diff --git a/NOTICE b/NOTICE index 996eff7..17b34db 100644 --- a/NOTICE +++ b/NOTICE @@ -1,8 +1,7 @@ This product includes software developed at MinIO, Inc. (https://min.io/). -The Boundary MinIO Plugin contains unmodified -subcomponents of the Minio madmin-go library v1.7.5 +The Boundary MinIO Plugin contains subcomponents of the Minio madmin-go library v1.7.5 (https://github.com/minio/madmin-go/tree/v1.7.5), licensed under the Apache License 2.0. diff --git a/madmin/encrypt.go b/madmin/encrypt.go index 139c739..a974f4f 100644 --- a/madmin/encrypt.go +++ b/madmin/encrypt.go @@ -80,7 +80,8 @@ func EncryptData(password string, data []byte) ([]byte, error) { nonce := sioutil.MustRandom(stream.NonceSize()) // ciphertext = salt || AEAD ID | nonce | encrypted data - cLen := int64(len(salt)+1+len(nonce)+len(data)) + stream.Overhead(int64(len(data))) + // cLen calculation: Modified by Hashicorp in 2026 to make arithmetic operations overflow-safe by casting to int64 before addition + cLen := int64(len(salt)) + 1 + int64(len(nonce)) + int64(len(data)) + stream.Overhead(int64(len(data))) ciphertext := bytes.NewBuffer(make([]byte, 0, cLen)) // pre-alloc correct length // Prefix the ciphertext with salt, AEAD ID and nonce