mirror of
https://github.com/minio/minio.git
synced 2025-11-07 21:02:58 -05:00
do not crash when KMS is not enabled (#14634)
KMS when not enabled might crash when listing an object that previously had SSE-S3 enabled, fail appropriately in such situations.
This commit is contained in:
@@ -96,6 +96,10 @@ func (ssekms) IsEncrypted(metadata map[string]string) bool {
|
||||
// from the metadata using KMS and returns the decrypted object
|
||||
// key.
|
||||
func (s3 ssekms) UnsealObjectKey(KMS kms.KMS, metadata map[string]string, bucket, object string) (key ObjectKey, err error) {
|
||||
if KMS == nil {
|
||||
return key, Errorf("KMS not configured")
|
||||
}
|
||||
|
||||
keyID, kmsKey, sealedKey, ctx, err := s3.ParseMetadata(metadata)
|
||||
if err != nil {
|
||||
return key, err
|
||||
|
||||
Reference in New Issue
Block a user