Skip to content

Replace MbedTLS with the SHA stdlib for HMAC signing - #35

Draft
krynju wants to merge 1 commit into
masterfrom
drop-mbedtls
Draft

krynju wants to merge 1 commit into
masterfrom
drop-mbedtls

Conversation

@krynju

@krynju krynju commented Sep 17, 2026

Copy link
Copy Markdown
Member

What

MbedTLS was used in exactly two places, both computing HMAC-SHA256 over a request string with the base64-decoded account key:

  • src/rest_api_protocol.jl: SharedKey Authorization header signing
  • src/StorageServices/sas.jl: SAS token signature

Both digest(MD_SHA256, data, key) calls are replaced with hmac_sha256(key, data) from the SHA stdlib (note the argument order swap). using MbedTLS in REST and StorageServices becomes using SHA: hmac_sha256. Project.toml swaps the MbedTLS dep for SHA. Patch version bump 0.5.0 → 0.5.1.

Why

An upcoming AWS.jl release drops GitHub.jl, which is the last package pulling MbedTLS into JuliaHub manifests transitively when running on HTTP.jl 2.x. After that, every remaining MbedTLS in our trees comes from a direct dependency like this one. This is part of a sweep to remove those, see JuliaComputing/JuliaHubData.jl#90 for the first one.

Testing

Checked locally that MbedTLS.digest(MD_SHA256, data, key) and SHA.hmac_sha256(key, data) return identical bytes for a random key and multi-line string. Changed files parse. Full test suite not run locally; CI will tell.

🤖 Generated with Claude Code

The only MbedTLS use was `digest(MD_SHA256, data, key)`, i.e. HMAC-SHA256,
in the SharedKey request signer and the SAS token generator. The SHA
stdlib's `hmac_sha256(key, data)` produces identical bytes, so MbedTLS is
dropped in favour of it. This removes MbedTLS from downstream manifests
once AWS.jl stops pulling it in transitively.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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