mirror of
https://github.com/minio/minio.git
synced 2025-11-07 04:42:56 -05:00
support autogenerated credentials for KMS_SECRET_KEY properly (#21223)
we had a chicken and egg problem with this feature even when used with kes the credentials generation would not work in correct sequence causing setup/deployment disruptions. This PR streamlines all of this properly to ensure that this functionality works as advertised.
This commit is contained in:
@@ -211,8 +211,11 @@ func (s secretKey) Decrypt(_ context.Context, req *DecryptRequest) ([]byte, erro
|
||||
return plaintext, nil
|
||||
}
|
||||
|
||||
func (secretKey) MAC(context.Context, *MACRequest) ([]byte, error) {
|
||||
return nil, ErrNotSupported
|
||||
// MAC generate hmac for the request
|
||||
func (s secretKey) MAC(_ context.Context, req *MACRequest) ([]byte, error) {
|
||||
mac := hmac.New(sha256.New, s.key)
|
||||
mac.Write(req.Message)
|
||||
return mac.Sum(make([]byte, 0, mac.Size())), nil
|
||||
}
|
||||
|
||||
// parseCiphertext parses and converts a ciphertext into
|
||||
|
||||
Reference in New Issue
Block a user