From 22e1781d5910453fc7b0b5d058b987a9b566fefe Mon Sep 17 00:00:00 2001 From: hc-github-team-secure-vault-core <82990506+hc-github-team-secure-vault-core@users.noreply.github.com> Date: Thu, 7 Dec 2023 13:36:26 -0500 Subject: [PATCH] backport of commit a2c263bf12657cea45485b50eec3094591733806 (#24422) Co-authored-by: Scott Miller --- vault/seal/seal.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vault/seal/seal.go b/vault/seal/seal.go index 49bad9c7d0fd..0673b988d228 100644 --- a/vault/seal/seal.go +++ b/vault/seal/seal.go @@ -712,7 +712,7 @@ func (a *access) Decrypt(ctx context.Context, ciphertext *MultiWrapValue, option for _, sealWrapper := range wrappersByPriority { keyId, err := sealWrapper.Wrapper.KeyId(ctx) if err != nil { - reportResult(sealWrapper.Name, nil, false, err) + go reportResult(sealWrapper.Name, nil, false, err) continue } if keyId == k { @@ -757,6 +757,7 @@ GATHER_RESULTS: break GATHER_RESULTS } } + close(resultCh) // No wrapper was able to decrypt the value, return an error if len(errs) > 0 {