Skip to content

Commit

Permalink
Return a UserError is aead.Open() fails and assume by that stage ther…
Browse files Browse the repository at this point in the history
…e is a problem with the user input for said decryption
  • Loading branch information
crozzy committed Nov 16, 2021
1 parent 043172b commit 660c9e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sdk/helper/keysutil/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 660c9e3

Please sign in to comment.