Skip to content

Commit

Permalink
Return a UserError if aead.Open() fails to align with documentation (#…
Browse files Browse the repository at this point in the history
…10914)

Return a UserError is aead.Open() fails and assume by that stage there is a problem with the user input for said decryption
  • Loading branch information
crozzy authored Nov 17, 2021
1 parent b6dae64 commit 580b8bc
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 580b8bc

Please sign in to comment.