Return a UserError if aead.Open() fails to align with documentation (#10914)
Return a UserError is aead.Open() fails and assume by that stage there is a problem with the user input for said decryption
This commit is contained in:
parent
a01e1a4101
commit
dd11865597
|
@ -1697,7 +1697,7 @@ func (p *Policy) SymmetricDecryptRaw(encKey, ciphertext []byte, opts SymmetricOp
|
||||||
// Verify and Decrypt
|
// Verify and Decrypt
|
||||||
plain, err := aead.Open(nil, nonce, trueCT, opts.AdditionalData)
|
plain, err := aead.Open(nil, nonce, trueCT, opts.AdditionalData)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, errutil.UserError{Err: err.Error()}
|
||||||
}
|
}
|
||||||
return plain, nil
|
return plain, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue