Skip to content

crypto/mldsa: respect OpenSSL external-mu capabilities - #2662

Merged
George Adams (gdams) merged 2 commits into
microsoft/mainfrom
dev/gdams/mldsa-mu-main
Oct 28, 2026
Merged

George Adams (gdams) merged 2 commits into
microsoft/mainfrom
dev/gdams/mldsa-mu-main

Conversation

@gdams

@gdams George Adams (gdams) commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Native validation stack

Bottom layer of stack #2664, landing on microsoft/main: this ML-DSA fix → Azure Linux 4 matrix #2651. The top layer runs CI with this fix included. Auto-merge is disabled; use the native stack merge flow.

Summary

Fix Azure Linux 4’s crypto/mldsa.TestExternalMu failures without disabling ML-DSA or skipping standard-library tests.

Uses merged microsoft/go-crypto-openssl#108, pinned to main merge commit c9be04267896c74dd64bc75eb25869fdc037f96d (v0.5.1-0.20261028130524-c9be04267896).

  • Ask the OpenSSL provider whether the key’s specific ML-DSA parameter set supports external-mu signing/verification.
  • Use the existing cached Go-key fallback when that capability is unavailable. Azure Linux 4’s SymCrypt provider supports ordinary ML-DSA but rejects external-mu.
  • Preserve ordinary native ML-DSA and existing Windows/Darwin behavior; update matching platform/stub signatures.
  • Regenerate vendor patch 0001 and its index. No Go submodule pointer change or test skips.

Unblocks the Azure Linux 4 matrix PR #2651. Go 1.27 counterpart: #2663; Go 1.26 has no ML-DSA package/integration and needs no backport.

Validation

  • Ran go generate in cryptobackend and removed stale checksums. Full go test ./... and go mod tidy -diff now pass, including the previously failing TestXCryptoDependencyIsSynced.

  • Built the patched main toolchain and tested the actual published Azure Linux 4 ARM64 image with its SymCrypt/OpenSSL 3.5.4 provider.

  • TestExternalMu passes for ML-DSA-44/65/87 with cgo enabled and disabled.

  • Complete crypto/mldsa tests and go/build.TestDependencies pass.

  • External-mu tests also pass with the CI FIPS environment (OPENSSL_FORCE_FIPS_MODE=1) in both cgo modes and with systemcrypto disabled as a control.

  • Complete ML-DSA tests pass on macOS/arm64 as well.

  • Backend shim tests/vet and pipeline-generation reproducibility pass.

  • Source changes were squashed into the vendor commit and regenerated via git go-patch extract; patch extraction succeeds.

Copilot AI balanced review requested due to automatic review settings October 28, 2026 13:03
@gdams
George Adams (gdams) requested a review from a team as a code owner October 28, 2026 13:03
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

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.

🔵 Needs a closer look

Obsolete OpenSSL checksums remain in go.sum, causing go mod tidy -diff to report removals and TestXCryptoDependencyIsSynced to fail.

No open issues 🎉

What changed in this PR

Updates Microsoft Go’s ML-DSA backend to respect OpenSSL provider capabilities, allowing Azure Linux 4 external-mu operations to use the cached Go fallback without disabling ordinary native ML-DSA.

Changes:

  • Checks external-mu support for the key’s specific ML-DSA parameter set.
  • Updates platform and stub signatures while preserving Windows and Darwin behavior.
  • Upgrades the OpenSSL dependency and regenerates the vendor patch and index.

Patches are happy!

File Description
patches/​index.json Refreshes vendor patch hashes and line mappings.
patches/​0001-Vendor-external-dependencies.patch Vendors the capability probe and updated backend integration.
cryptobackend/​mldsa/​nobackend.go Updates the unsupported-backend stub signature.
cryptobackend/​mldsa/​mldsa_windows.go Accepts parameters while retaining native external-mu support.
cryptobackend/​mldsa/​mldsa_openssl.go Delegates capability checks to OpenSSL.
cryptobackend/​mldsa/​mldsa_msgostd.go Gates native signing using the key’s parameters.
cryptobackend/​mldsa/​mldsa_darwin.go Updates the signature while retaining Go fallback behavior.
cryptobackend/​go.sum Adds checksums for the upgraded OpenSSL dependency.
cryptobackend/​go.mod Pins the OpenSSL revision containing the capability probe.

Review effort: Balanced

@gdams
George Adams (gdams) enabled stacked auto-merge October 28, 2026 13:20
George Adams (gdams) and others added 2 commits October 28, 2026 16:05
Use the provider-aware per-parameter external-mu probe from go-crypto-openssl to select native signing or the existing cached Go fallback. Preserve ordinary native ML-DSA and existing Windows/Darwin support. Pin the backend fix and regenerate its vendor patch and index.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Pin the merged c9be04267896 commit instead of the PR branch commit. Run go generate in cryptobackend to remove stale checksums and fix TestXCryptoDependencyIsSynced, then regenerate the vendor patch and index.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@gdams
George Adams (gdams) merged commit f9c2b3e into microsoft/main Oct 28, 2026
67 checks passed
@gdams
George Adams (gdams) deleted the dev/gdams/mldsa-mu-main branch October 28, 2026 18:44
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