mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 11:08:10 +00:00
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:
@@ -720,7 +720,7 @@ func (a *access) Decrypt(ctx context.Context, ciphertext *MultiWrapValue, option
|
|||||||
for _, sealWrapper := range wrappersByPriority {
|
for _, sealWrapper := range wrappersByPriority {
|
||||||
keyId, err := sealWrapper.Wrapper.KeyId(ctx)
|
keyId, err := sealWrapper.Wrapper.KeyId(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
reportResult(sealWrapper.Name, nil, false, err)
|
go reportResult(sealWrapper.Name, nil, false, err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if keyId == k {
|
if keyId == k {
|
||||||
@@ -765,6 +765,7 @@ GATHER_RESULTS:
|
|||||||
break GATHER_RESULTS
|
break GATHER_RESULTS
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
close(resultCh)
|
||||||
|
|
||||||
// No wrapper was able to decrypt the value, return an error
|
// No wrapper was able to decrypt the value, return an error
|
||||||
if len(errs) > 0 {
|
if len(errs) > 0 {
|
||||||
|
|||||||
Reference in New Issue
Block a user