Fix two potential channel hangs in access.tryDecrypt (#24418)

* Fix two potential channel hangs in access.tryDecrypt

* could also live here
This commit is contained in:
Scott Miller
2023-12-07 12:17:24 -06:00
committed by GitHub
parent 889cca71fa
commit a2c263bf12

View File

@@ -720,7 +720,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 {
@@ -765,6 +765,7 @@ GATHER_RESULTS:
break GATHER_RESULTS
}
}
close(resultCh)
// No wrapper was able to decrypt the value, return an error
if len(errs) > 0 {