From 740ec80819f7554eaaee7013cff042d2b3ed7114 Mon Sep 17 00:00:00 2001 From: Allan Roger Reid Date: Tue, 16 Apr 2024 17:34:45 -0700 Subject: [PATCH] At server init, use the correct context when creating the KMS Master Key (#19526) --- cmd/common-main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/common-main.go b/cmd/common-main.go index 3adc2fc68..440928f42 100644 --- a/cmd/common-main.go +++ b/cmd/common-main.go @@ -967,7 +967,7 @@ func handleKMSConfig() { // We don't treat a policy error as failure condition since MinIO may not have the permission // to create keys - just to generate/decrypt data encryption keys. if _, err = KMS.GenerateKey(GlobalContext, env.Get(kms.EnvKESKeyName, ""), kms.Context{}); err != nil && errors.Is(err, kes.ErrKeyNotFound) { - if err = KMS.CreateKey(context.Background(), env.Get(kms.EnvKESKeyName, "")); err != nil && !errors.Is(err, kes.ErrKeyExists) && !errors.Is(err, kes.ErrNotAllowed) { + if err = KMS.CreateKey(GlobalContext, env.Get(kms.EnvKESKeyName, "")); err != nil && !errors.Is(err, kes.ErrKeyExists) && !errors.Is(err, kes.ErrNotAllowed) { logger.Fatal(err, "Unable to initialize a connection to KES as specified by the shell environment") } }