Skip to content

testsuite: add argon2 wrong-passphrase test for decrypt_key_file, refs #9686#9691

Merged
ThomasWaldmann merged 1 commit into
borgbackup:masterfrom
mr-raj12:testsuite-argon2-wrong-passphrase
May 31, 2026
Merged

testsuite: add argon2 wrong-passphrase test for decrypt_key_file, refs #9686#9691
ThomasWaldmann merged 1 commit into
borgbackup:masterfrom
mr-raj12:testsuite-argon2-wrong-passphrase

Conversation

@mr-raj12

@mr-raj12 mr-raj12 commented May 31, 2026

Copy link
Copy Markdown
Contributor

Description

One test for decrypt_key_file_argon2, refs #9686.

Follow-up to #9686, which added wrong-passphrase coverage for the PBKDF2 path. decrypt_key_file calls decrypt_key_file_argon2 when the stored algorithm is argon2 chacha20-poly1305. Wrong passphrase, different derived key, Poly1305 auth fails, None back. Same contract as PBKDF2.

Added to src/borg/testsuite/crypto/key_test.py:

  • wrong passphrase returns None: Argon2 derives a different key, Poly1305 check fails, None returned (not raised)

BORG_TESTONLY_WEAKEN_KDF is set globally in conftest.py, so Argon2 runs with minimal parameters.

No production code changes.

Refs #9686

Checklist

  • PR is against master (or maintenance branch if only applicable there)
  • New code has tests (this PR is the test)
  • Tests pass (run tox or the relevant test subset)
  • Commit messages are clean and reference related issues

@codecov

codecov Bot commented May 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.95%. Comparing base (7815e02) to head (a6124fc).
⚠️ Report is 6 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #9691   +/-   ##
=======================================
  Coverage   83.95%   83.95%           
=======================================
  Files          93       93           
  Lines       15586    15586           
  Branches     2335     2335           
=======================================
+ Hits        13085    13086    +1     
+ Misses       1776     1775    -1     
  Partials      725      725           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ThomasWaldmann
ThomasWaldmann merged commit a0448ab into borgbackup:master May 31, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants