Skip to content

Argon2 via OpenSSL >= 3.2 - #9602

Open
ThomasWaldmann wants to merge 4 commits into
borgbackup:masterfrom
ThomasWaldmann:argon2-via-openssl32
Open

Argon2 via OpenSSL >= 3.2#9602
ThomasWaldmann wants to merge 4 commits into
borgbackup:masterfrom
ThomasWaldmann:argon2-via-openssl32

Conversation

@ThomasWaldmann

Copy link
Copy Markdown
Member

No description provided.

@codecov

codecov Bot commented May 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.04%. Comparing base (def9383) to head (3bb1eb3).
⚠️ Report is 5 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9602      +/-   ##
==========================================
- Coverage   87.05%   87.04%   -0.01%     
==========================================
  Files         101      101              
  Lines       17848    17851       +3     
  Branches     2705     2709       +4     
==========================================
+ Hits        15538    15539       +1     
+ Misses       1609     1608       -1     
- Partials      701      704       +3     

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

@ThomasWaldmann
ThomasWaldmann force-pushed the argon2-via-openssl32 branch 2 times, most recently from 745ffbd to b06e98b Compare May 11, 2026 20:55
@ThomasWaldmann
ThomasWaldmann marked this pull request as draft May 11, 2026 20:55
@ThomasWaldmann

ThomasWaldmann commented May 11, 2026

Copy link
Copy Markdown
Member Author

@ThomasWaldmann
ThomasWaldmann force-pushed the argon2-via-openssl32 branch 9 times, most recently from 18e786b to 252cf06 Compare May 11, 2026 23:35
@ThomasWaldmann
ThomasWaldmann force-pushed the argon2-via-openssl32 branch 4 times, most recently from 8232e39 to d70e1a5 Compare June 11, 2026 08:39
@ThomasWaldmann
ThomasWaldmann force-pushed the argon2-via-openssl32 branch 5 times, most recently from f7e6aae to 7f16bc3 Compare June 15, 2026 13:05
@ThomasWaldmann
ThomasWaldmann force-pushed the argon2-via-openssl32 branch from 7f16bc3 to 21b6a76 Compare July 2, 2026 07:54
@ThomasWaldmann ThomasWaldmann modified the milestones: 2.0.0b22, 2.0.0b23 Jul 2, 2026
@ThomasWaldmann
ThomasWaldmann force-pushed the argon2-via-openssl32 branch from 21b6a76 to 0069733 Compare July 6, 2026 18:11
@ThomasWaldmann ThomasWaldmann modified the milestones: 2.0.0b23, 2.0.0b24 Aug 1, 2026
ThomasWaldmann and others added 3 commits August 16, 2026 14:35
- src/borg/crypto/low_level.pyx: implement `argon2_hash` using OpenSSL's
  `EVP_KDF` API for ARGON2 (requires OpenSSL >= 3.2.0).
- src/borg/crypto/key.py: switch to the native `argon2_hash` implementation,
  removing `argon2-cffi` dependency.
- setup.py: require OpenSSL >= 3.2.0 for the crypto extension to ensure
  ARGON2 KDF support is available.
- pyproject.toml: drop `argon2-cffi` dependency.
- docs: update installation requirements and security documentation to
  reflect the transition to OpenSSL for Argon2.
The inverted canary added in borgbackup#10097 watched for actions/setup-python
gaining Python 3.12 support on the ubuntu-26.04 image. It went red on
2026-08-15 and 2026-08-16: the "Try to set up Python 3.12" step now
succeeds, which was the whole point of the probe. Its job is done, so
remove it.

Older Pythons are therefore no longer categorically unavailable on
ubuntu-26.04, so the matrix can gain multi-version coverage there once
we move to those runners.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Borg on Linux now needs OpenSSL >= 3.2 for argon2, and ubuntu-24.04 ships
OpenSSL 3.0.x, so the crypto extension no longer builds there. Move all
Ubuntu-based jobs to ubuntu-26.04 (and ubuntu-24.04-arm to
ubuntu-26.04-arm): ci.yml, canary.yml, bigendian.yml, codeql-analysis.yml,
black.yaml, backport.yml and release.yml. The jobs that never build borg
move along with them, so we do not end up with a confusing mix of runners.

Ubuntu 26.04 ships glibc 2.43, so rename the built binaries from glibc239
to glibc243, in the native_tests matrix and in the EXPECTED_ASSETS list of
the release workflow, which has to stay in sync with it.

The Python versions stay as they are: actions/python-versions publishes
3.10 through 3.15 builds for the ubuntu-26.04 image, so setup-python can
still provide the whole 3.11 .. 3.15-dev range we test. (When the image was
new it only worked with its default 3.14, which is what the canary removed
in the previous commit was watching for.)

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ThomasWaldmann
ThomasWaldmann marked this pull request as ready for review August 16, 2026 13:18
@ThomasWaldmann

Copy link
Copy Markdown
Member Author

Note: Delay merge after 2.0.0b23 release (give beta testers a bit more time in case they still run ubuntu 24.04 or some other dist with too old openssl).

OpenSSL's Argon2 only uses threads if OSSL_set_max_threads() enabled the
thread pool and a "threads" parameter > 1 is given - previously we always
passed threads=1, so the 4 lanes of our default parallelism=4 were computed
sequentially (argon2-cffi used real threads for the lanes, so unlocking got
slower with the switch to OpenSSL).

The thread count only affects speed, never the derived key (only the lanes
parameter does), so this is fully compatible with existing keys.

Apple M-series (OpenSSL 3.6.3), borg defaults (t=3, m=64 MiB, p=4):
threads=1: 83 ms, threads=4: 29 ms (2.8x faster).
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.

1 participant