Skip to content

cryptsetup: fix Argon2 with OpenWrt's OpenSSL, update to 2.8.8 - #30499

Merged
dangowrt merged 2 commits into
openwrt:masterfrom
dangowrt:cryptsetup-openssl-no-argon2
Sep 11, 2026
Merged

cryptsetup: fix Argon2 with OpenWrt's OpenSSL, update to 2.8.8#30499
dangowrt merged 2 commits into
openwrt:masterfrom
dangowrt:cryptsetup-openssl-no-argon2

Conversation

@dangowrt

Copy link
Copy Markdown
Member

📦 Package Details

Maintainer: @dangowrt
(You can find this by checking the history of the package Makefile.)

Description:

Since fbac2e7 cryptsetup is built with the OpenSSL crypto backend. OpenWrt's libopenssl is configured with no-blake2, which OpenSSL's Configure cascades into no-argon2 because Argon2 is implemented on top of BLAKE2b, so the shipped library has no Argon2 KDF at all (openssl list -disabled shows ARGON2). cryptsetup's configure script detects OpenSSL Argon2 solely through the OSSL_KDF_PARAM_ARGON2_VERSION macro in core_names.h, which every OpenSSL 3.2+ build installs regardless of that option, so it drops its bundled Argon2 implementation. At runtime EVP_KDF_fetch("argon2id") fails and every LUKS2 keyslot using Argon2 (the default) fails immediately with Keyslot open failed; cryptsetup benchmark reports argon2id N/A.

The first commit adds a patch that makes the configure check (and its meson equivalent) also honour OPENSSL_NO_ARGON2, so the bundled Argon2 implementation is used again with OpenWrt's OpenSSL. The patch is written to be submitted upstream; the detection is unchanged in cryptsetup 2.8.8 and in the upstream main branch.

The second commit updates cryptsetup to 2.8.8, a stable bug-fix release (TOCTOU in header restore, BITLK metadata hardening, a 32-bit integer overflow in the anti-forensic size calculation, a memory corruption in reencrypt init, keyed discards for integritysetup). Release notes: https://gitlab.com/cryptsetup/cryptsetup/-/blob/v2.8.8/docs/v2.8.8-ReleaseNotes


🧪 Run Testing Details

  • OpenWrt Version: SNAPSHOT r36162-ac2ed40b48
  • OpenWrt Target/Subtarget: mediatek/mt7623
  • OpenWrt Device: Bananapi BPI-R2

Built with the matching mt7623 SDK. The fixed package was installed on the device and opened an existing LUKS2 argon2id volume on /dev/md/pfusch:0 that failed to open with the unpatched 2.8.7-r1 package; cryptsetup --debug benchmark --pbkdf argon2id now reports the [cryptsetup libargon2] backend and a working argon2id benchmark instead of N/A. The 2.8.8 build was additionally exercised under qemu-arm user emulation: argon2id and PBKDF2 benchmarks, luksFormat --type luks2 --pbkdf argon2id on a file image and open --test-passphrase of that image.


✅ Formalities

  • I have reviewed the CONTRIBUTING.md file for detailed contributing guidelines.

If your PR contains a patch:

  • It can be applied using git am
  • It has been refreshed to avoid offsets, fuzzes, etc., using
    make package/<your-package>/refresh V=s
  • It is structured in a way that it is potentially upstreamable
    (e.g., subject line, commit description, etc.)
    We must try to upstream patches to reduce maintenance burden.

OpenWrt builds OpenSSL with no-blake2, which OpenSSL's Configure turns
into no-argon2 because Argon2 is built on BLAKE2b. The cryptsetup
configure script only looks for the OSSL_KDF_PARAM_ARGON2_VERSION macro,
which such a build still installs, so it drops the bundled Argon2 and
EVP_KDF_fetch() fails at runtime. Every LUKS2 keyslot using Argon2 then
fails instantly with "Keyslot open failed", and cryptsetup benchmark
reports argon2id as N/A. Add a patch that also checks OPENSSL_NO_ARGON2
so the bundled implementation is used again.

Fixes: fbac2e7 ("cryptsetup: update to 2.8.7")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Stable bug-fix release. It avoids a TOCTOU issue in LUKS header restore
by opening the header file only once, hardens BITLK metadata validation
against crafted images, fixes an integer overflow in the anti-forensic
data size calculation on 32-bit systems and a memory corruption in
reencrypt init with more than 16 active LUKS2 keyslots or tokens, and
adds keyed discards to integritysetup (--allow-discards-keyed, Linux
7.3 or later).

Link: https://gitlab.com/cryptsetup/cryptsetup/-/blob/v2.8.8/docs/v2.8.8-ReleaseNotes
Signed-off-by: Daniel Golle <daniel@makrotopia.org>

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 2 new commits.


Generated by Claude Code

Argon2 fails to open. Check OPENSSL_NO_ARGON2 as well and fall back to
the internal Argon2 implementation.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: no upstream reference in the patch, although the PR body says it is meant for upstream. Please add the cryptsetup MR link (or an Upstream-Status: line saying submission is pending) above the sign-off.


Generated by Claude Code

@dangowrt
dangowrt merged commit bd5899b into openwrt:master Sep 11, 2026
11 of 14 checks passed
@dangowrt
dangowrt deleted the cryptsetup-openssl-no-argon2 branch September 11, 2026 00:46
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.

3 participants