fix sse-kms context unmarshal failure (#13206)

json.Unmarshal expects a pointer receiver, otherwise
kms.Context unmarshal fails with lack of pointer receiver,
this becomes complicated due to type aliasing over
map[string]string - fix it properly.
This commit is contained in:
Harshavardhana 2021-09-14 12:52:46 -07:00 committed by GitHub
parent bf5bfe589f
commit 67596ef0cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -210,8 +210,8 @@ func (ssekms) ParseMetadata(metadata map[string]string) (keyID string, kmsKey []
return keyID, kmsKey, sealedKey, ctx, Errorf("The internal KMS context is not base64-encoded")
}
var json = jsoniter.ConfigCompatibleWithStandardLibrary
if err = json.Unmarshal(b, ctx); err != nil {
return keyID, kmsKey, sealedKey, ctx, Errorf("The internal sealed KMS context is invalid")
if err = json.Unmarshal(b, &ctx); err != nil {
return keyID, kmsKey, sealedKey, ctx, Errorf("The internal sealed KMS context is invalid %w", err)
}
}