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:
Joseph Crosland 2021-11-17 08:40:43 -08:00 committed by GitHub
parent a01e1a4101
commit dd11865597
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -1697,7 +1697,7 @@ func (p *Policy) SymmetricDecryptRaw(encKey, ciphertext []byte, opts SymmetricOp
// Verify and Decrypt
plain, err := aead.Open(nil, nonce, trueCT, opts.AdditionalData)
if err != nil {
return nil, err
return nil, errutil.UserError{Err: err.Error()}
}
return plain, nil
}