Skip to content

legacy: move legacy AES-CTR key classes into borg.legacy.crypto, refs #9556#9600

Merged
ThomasWaldmann merged 2 commits into
borgbackup:masterfrom
mr-raj12:legacy-crypto-key-phase2
May 11, 2026
Merged

legacy: move legacy AES-CTR key classes into borg.legacy.crypto, refs #9556#9600
ThomasWaldmann merged 2 commits into
borgbackup:masterfrom
mr-raj12:legacy-crypto-key-phase2

Conversation

@mr-raj12
Copy link
Copy Markdown
Contributor

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

Description

Moves the four Borg 1.x AES-CTR key classes into borg.legacy.crypto, refs #9556.

  • KeyfileKey, RepoKey, Blake2KeyfileKey, Blake2RepoKeylegacy/crypto/key.py
  • LEGACY_KEY_TYPES moved with them
  • borg.crypto.key re-exports all four classes and LEGACY_KEY_TYPES for backwards compatibility
  • Shared base classes (FlexiKey, AESKeyBase, ID_HMAC_SHA_256, ID_BLAKE2b_256) remain in borg.crypto.key and are imported by the legacy module (no duplication)

No logic changes. The legacy import in borg.crypto.key is placed after FlexiKey is fully defined so the partial module already has all needed names during the circular load.

Refs #9556

Checklist

  • PR is against master
  • New code has tests
  • Tests pass
  • Commit message references related issue

@mr-raj12 mr-raj12 force-pushed the legacy-crypto-key-phase2 branch from 33e620b to 0cf9322 Compare May 11, 2026 12:43
@codecov
Copy link
Copy Markdown

codecov Bot commented May 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.34%. Comparing base (62d8762) to head (0cf9322).
⚠️ Report is 1 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #9600   +/-   ##
=======================================
  Coverage   83.34%   83.34%           
=======================================
  Files          88       89    +1     
  Lines       15541    15546    +5     
  Branches     2342     2342           
=======================================
+ Hits        12952    12957    +5     
  Misses       1835     1835           
  Partials      754      754           

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

@ThomasWaldmann ThomasWaldmann merged commit ca3e88f into borgbackup:master May 11, 2026
20 checks passed
@ThomasWaldmann
Copy link
Copy Markdown
Member

LGTM! This was about the repository data encryption.

There is also some other legacy crypto stuff in low_level.pyx, but separating that would be a bit more effort as it affects also the build process, so guess we can keep that as is for now.

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