From c6358f155891e94c0a22d27ed0482722b32753b9 Mon Sep 17 00:00:00 2001 From: Lukas Burkhalter Date: Mon, 11 Nov 2024 15:09:59 +0100 Subject: [PATCH] chore: Add explicit error message strings to tests --- openpgp/read_test.go | 4 ++-- openpgp/v2/read_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openpgp/read_test.go b/openpgp/read_test.go index e8867a3f..bf604004 100644 --- a/openpgp/read_test.go +++ b/openpgp/read_test.go @@ -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 { @@ -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 diff --git a/openpgp/v2/read_test.go b/openpgp/v2/read_test.go index 9c8b6cff..b5f31860 100644 --- a/openpgp/v2/read_test.go +++ b/openpgp/v2/read_test.go @@ -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 { @@ -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