Skip to content

Commit

Permalink
Add test for the issue #2245: Botan 3.5 compatibility on aead decrypt…
Browse files Browse the repository at this point in the history
…ion.
  • Loading branch information
ni4 committed Jun 12, 2024
1 parent d5fe67f commit 886b24c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/tests/cli_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -4654,6 +4654,22 @@ def test_encryption_no_wrap(self):
self.assertEqual(file_text(dec), file_text(src))
clear_workfiles()

def test_aead_eax_botan35_decryption(self):
# Artifact which was obtained from tests used EAX + Twofish
if not RNP_AEAD_EAX or not RNP_TWOFISH:
self.skipTest('AEAD-EAX is not supported')
# See issue #2245 for the details
[dec] = reg_workfiles('cleartext', '.txt')
EAXSRC = data_path('test_messages/cleartext.rnp-aead-eax')
# Decrypt and verify AEAD-EAX encrypted message by RNP
ret, _, _ = run_proc(RNP, ['--keyfile', data_path('test_messages/seckey-aead-eax.gpg'), '--password', 'encsign1pass', '-d', EAXSRC, '--output', dec])
self.assertEqual(ret, 0)
remove_files(dec)
# Decrypt it using the password
ret, _, _ = run_proc(RNP, ['--keyfile', data_path('test_messages/pubkey-aead-eax.gpg'), '--password', 'password1', '-d', EAXSRC, '--output', dec])
self.assertEqual(ret, 0)
clear_workfiles()

class Compression(unittest.TestCase):
@classmethod
def setUpClass(cls):
Expand Down
Binary file not shown.
Binary file added src/tests/data/test_messages/pubkey-aead-eax.gpg
Binary file not shown.
Binary file added src/tests/data/test_messages/seckey-aead-eax.gpg
Binary file not shown.

0 comments on commit 886b24c

Please sign in to comment.