Skip to content

Fix CI for the replaced Alpine apk-tools and wolfSSL master PBKDF2 - #287

Merged
LinuxJedi merged 3 commits into
wolfSSL:masterfrom
Frauschi:ci-alpine-pbkdf2
Nov 6, 2026
Merged

LinuxJedi merged 3 commits into
wolfSSL:masterfrom
Frauschi:ci-alpine-pbkdf2

Conversation

@Frauschi

@Frauschi Frauschi commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

CI fails on every PR in two places: the Alpine jobs can no longer download their pinned apk-tools, and the no_hmac build no longer compiles against wolfSSL master.

Changes

  • Alpine: read the current apk-tools-static version from the v3.22 APKINDEX on dl-cdn, since Alpine keeps only the newest package and the pinned 2.14.12-r0 now returns 404.
  • Verify that package against Alpine's x86_64 signing key (committed under .github/keys) and its datahash before extracting apk.static.
  • Guard WP11_PBKDF2 with NO_HMAC like its only caller, as wolfSSL 9e972225e now declares wc_PBKDF2 only when HMAC is available.

Testing

  • Alpine Architecture Tests and the no_hmac unit-test job on this PR.

The Alpine jobs pinned apk-tools-static-2.14.12-r0 from the v3.22
repository on dl-cdn. Alpine keeps only the newest revision of a
package, so the URL started to return 404 once 2.14.13-r0 replaced it,
and every Alpine job failed at "Fetch static apk-tools".

Read the package's current version from the repository's APKINDEX and
fetch that, then hash the extracted apk.static for setup-alpine's
apk-tools-url. The binary is no longer checked against a hash kept in
the workflow; it is trusted over HTTPS from dl-cdn, the repository the
rest of the Alpine packages are installed from.
wolfSSL now declares wc_PBKDF2 only when HMAC is available (9e972225e,
"Guard PBKDF2 prototypes and PBES2 tests"). A --disable-hmac build
defines NO_HMAC and already leaves CKM_PKCS5_PBKD2 out, but
WP11_PBKDF2 still called wc_PBKDF2, so the build failed against
current wolfSSL master with an implicit declaration. Guard the wrapper
and its prototype the same way as its only caller.
@Frauschi Frauschi self-assigned this Nov 6, 2026
Copilot AI balanced review requested due to automatic review settings November 6, 2026 09:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Deriving the expected checksum from the downloaded binary without verifying the package signature removes independent integrity protection, allowing a compromised CDN to supply malicious code that executes on the runner.

1 open issue
What changed in this PR

This PR addresses two CI failures: Alpine’s removed apk-tools-static package and wolfSSL master’s restriction of PBKDF2 to builds with HMAC enabled.

Changes:

  • Resolve the available Alpine package version from APKINDEX and compute its binary checksum at runtime.
  • Guard the WP11_PBKDF2 declaration and implementation with NO_HMAC, matching its caller.
File Description
wolfpkcs11/​internal.h Excludes the PBKDF2 declaration when HMAC is disabled.
src/​internal.c Excludes the PBKDF2 implementation when HMAC is disabled.
.github/​workflows/​alpine-architecture-tests.yml Replaces the pinned package URL and digest with dynamic version lookup and hashing.

Review effort: Balanced

Looking the package up at run time left apk.static checked only against
a hash of itself, so a package from a compromised mirror would have run
on the runner. setup-alpine verifies every later package with the
Alpine keys it bundles, which left this binary as the one unverified
link.

Verify the package the way apk does: the control stream must carry an
RSA signature by alpine-devel@lists.alpinelinux.org-6165ee59, Alpine's
x86_64 signing key, and the data stream must match the control
stream's datahash. The key is committed under .github/keys and matches
the copies in Alpine's alpine-keys and in setup-alpine. If Alpine
rotates the key, this step fails with "missing .SIGN.RSA.<key>".
@Frauschi Frauschi assigned wolfSSL-Bot and unassigned Frauschi Nov 6, 2026
@Frauschi
Frauschi requested a review from LinuxJedi November 6, 2026 10:50
@LinuxJedi
LinuxJedi merged commit e7a6af7 into wolfSSL:master Nov 6, 2026
102 checks passed
@Frauschi
Frauschi deleted the ci-alpine-pbkdf2 branch November 6, 2026 11:07
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.

4 participants