Skip to content

Commit

Permalink
chore: Add explicit error message strings to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lubux committed Nov 11, 2024
1 parent e0431bc commit c6358f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions openpgp/read_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ func TestSymmetricAeadEaxOpenPGPJsMessage(t *testing.T) {
func TestCorruptedMessageInvalidSigHeader(t *testing.T) {
// Decrypt message with corrupted MDC and invalid one-pass-signature header
// Expect parsing errors over unverified decrypted data to be opaque
var expectedErr string = errors.DecryptWithSessionKeyError(errors.GenericParsingErrorMessage).Error()
var expectedErr string = "openpgp: decryption with session key failed: parsing error"
passphrase := []byte("password")
file, err := os.Open("test_data/sym-corrupted-message-invalid-sig-header.asc")
if err != nil {
Expand Down Expand Up @@ -829,7 +829,7 @@ func TestCorruptedMessageInvalidSigHeader(t *testing.T) {
func TestCorruptedMessageWrongLength(t *testing.T) {
// Decrypt message with wrong length in Literal packet header (length too long)
// Expect parsing errors over unverified decrypted data to be opaque
var expectedErr string = errors.DecryptWithSessionKeyError(errors.GenericParsingErrorMessage).Error()
var expectedErr string = "openpgp: decryption with session key failed: parsing error"
passphrase := []byte("password")
promptFunc := func(keys []Key, symmetric bool) ([]byte, error) {
return passphrase, nil
Expand Down
4 changes: 2 additions & 2 deletions openpgp/v2/read_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ func TestSymmetricAeadEaxOpenPGPJsMessage(t *testing.T) {
func TestCorruptedMessageInvalidSigHeader(t *testing.T) {
// Decrypt message with corrupted MDC and invalid one-pass-signature header
// Expect parsing errors over unverified decrypted data to be opaque
var expectedErr string = errors.DecryptWithSessionKeyError(errors.GenericParsingErrorMessage).Error()
var expectedErr string = "openpgp: decryption with session key failed: parsing error"
passphrase := []byte("password")
file, err := os.Open("../test_data/sym-corrupted-message-invalid-sig-header.asc")
if err != nil {
Expand Down Expand Up @@ -861,7 +861,7 @@ func TestCorruptedMessageInvalidSigHeader(t *testing.T) {
func TestCorruptedMessageWrongLength(t *testing.T) {
// Decrypt message with wrong length in Literal packet header (length too long)
// Expect parsing errors over unverified decrypted data to be opaque
var expectedErr string = errors.DecryptWithSessionKeyError(errors.GenericParsingErrorMessage).Error()
var expectedErr string = "openpgp: decryption with session key failed: parsing error"
passphrase := []byte("password")
promptFunc := func(keys []Key, symmetric bool) ([]byte, error) {
return passphrase, nil
Expand Down

0 comments on commit c6358f1

Please sign in to comment.