Skip to content

ML-DSA Composite Signature Support#1109

Open
stenslae wants to merge 2 commits into
wolfSSL:masterfrom
stenslae:ml-dsa-hybrid-support-rebased
Open

ML-DSA Composite Signature Support#1109
stenslae wants to merge 2 commits into
wolfSSL:masterfrom
stenslae:ml-dsa-hybrid-support-rebased

Conversation

@stenslae

@stenslae stenslae commented Jul 16, 2026

Copy link
Copy Markdown
Member

Introduced support for ML-DSA composite signatures for hybrid post-quantum authentication.

  • Added ML-DSA44-Ed25519 as per draft-miller-sshm-mldsa44-ed25519-composite-sigs
  • Added ML-DSA44-ECDSA-P256, ML-DSA65-ECDSA-P384, ML-DSA65-ECDSA-P256, ML-DSA87-ED448, ML-DSA87-ECDSA-P384 as per draft-sun-ssh-composite-sigs-02

Added all sig types as auth options into the test echoservers, new CI tests, and interop tested mldsa44-ed25519 wtih openssh-portable.

@stenslae stenslae self-assigned this Jul 16, 2026

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fenrir Automated Review — PR #1109

Scan targets checked: wolfssh-bugs, wolfssh-src

Findings: 2
2 finding(s) posted as inline comments (see file-level comments below)

This review was generated automatically by Fenrir. Findings are non-blocking.

Comment thread src/internal.c
Comment thread examples/echoserver/echoserver.c
Comment thread src/internal.c
Comment thread examples/echoserver/echoserver.c
@stenslae
stenslae force-pushed the ml-dsa-hybrid-support-rebased branch 2 times, most recently from 9753775 to b1fec5b Compare July 20, 2026 16:46
@stenslae
stenslae force-pushed the ml-dsa-hybrid-support-rebased branch from b1fec5b to 5af710c Compare July 20, 2026 16:50
@stenslae
stenslae marked this pull request as ready for review July 20, 2026 16:53

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fenrir Automated Review — PR #1109

Scan targets checked: wolfssh-bugs, wolfssh-src

Findings: 2
2 finding(s) posted as inline comments (see file-level comments below)

This review was generated automatically by Fenrir. Findings are non-blocking.

Comment thread examples/echoserver/echoserver.c
Comment thread examples/echoserver/echoserver.c
Comment thread examples/echoserver/echoserver.c
Comment thread examples/echoserver/echoserver.c
@stenslae
stenslae force-pushed the ml-dsa-hybrid-support-rebased branch from 5af710c to 1050ef1 Compare July 20, 2026 20:45
@stenslae
stenslae force-pushed the ml-dsa-hybrid-support-rebased branch from 1050ef1 to a1fddf0 Compare July 20, 2026 21:52
@stenslae
stenslae requested review from wolfSSL-Fenrir-bot and removed request for wolfSSL-Fenrir-bot July 20, 2026 22:29

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fenrir Automated Review — PR #1109

Scan targets checked: wolfssh-bugs, wolfssh-src

Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)

This review was generated automatically by Fenrir. Findings are non-blocking.

Comment thread wolfssh/internal.h Outdated
Comment thread wolfssh/internal.h Outdated
@stenslae
stenslae force-pushed the ml-dsa-hybrid-support-rebased branch from a1fddf0 to 2137136 Compare July 21, 2026 17:51
@stenslae
stenslae force-pushed the ml-dsa-hybrid-support-rebased branch from 2137136 to 145e2cf Compare July 21, 2026 18:15

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fenrir Automated Review — PR #1109

Scan targets checked: wolfssh-bugs, wolfssh-src

Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)

This review was generated automatically by Fenrir. Findings are non-blocking.

Comment thread src/internal.c Outdated
@stenslae
stenslae force-pushed the ml-dsa-hybrid-support-rebased branch from 145e2cf to 7228798 Compare July 21, 2026 18:23
Comment thread src/internal.c Outdated
@stenslae
stenslae force-pushed the ml-dsa-hybrid-support-rebased branch from 7228798 to 47dd078 Compare July 21, 2026 18:24

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fenrir Automated Review — PR #1109

Scan targets checked: wolfssh-bugs, wolfssh-src

Findings: 2
2 finding(s) posted as inline comments (see file-level comments below)

This review was generated automatically by Fenrir. Findings are non-blocking.

Comment thread src/internal.c
#ifndef WOLFSSH_NO_MLDSA
else if (p->useMlDsaComposite) {
CompositeParams params;
if (WS_GetCompositeParams(p->pubKeyId, &params) == WS_SUCCESS) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 [Low] Composite key leaked in FreePubKey and SendKexDhReply cleanup when WS_GetCompositeParams fails · Resource leaks on error paths

Both wc_MlDsaKey_Free and ops->free are gated on WS_GetCompositeParams succeeding; if it fails, neither key is released. The same pattern appears in SendKexDhReply's cleanup block at line 15221. wolfSSH_KEY_clean (line 1698) unconditionally calls wc_MlDsaKey_Free first — both cleanup paths should mirror that.

Fix: Call wc_MlDsaKey_Free unconditionally before the WS_GetCompositeParams call; keep only ops->free conditional on params lookup, matching the pattern in wolfSSH_KEY_clean.

Comment thread src/internal.c
|| sigKeyBlock_ptr->pubKeyFmtId == ID_MLDSA44_ED25519
|| sigKeyBlock_ptr->pubKeyFmtId == ID_MLDSA65_ED25519
|| sigKeyBlock_ptr->pubKeyFmtId == ID_MLDSA87_ED448) {
CompositeParams params;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 [Low] Composite key components leak in SendKexDhReply cleanup block when WS_GetCompositeParams fails · Resource leaks — Memory, file descriptors, or crypto state…

The SendKexDhReply composite-key cleanup (lines 15220–15228) guards both wc_MlDsaKey_Free and ops->free with WS_GetCompositeParams(...) == WS_SUCCESS, so a params-lookup failure leaks the fully initialized key pair. Same root cause as FreePubKey.

Fix: Call wc_MlDsaKey_Free unconditionally before the WS_GetCompositeParams guard, then free the trad key only if params lookup succeeds.

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.

2 participants