ML-DSA Composite Signature Support#1109
Conversation
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
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.
9753775 to
b1fec5b
Compare
b1fec5b to
5af710c
Compare
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
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.
5af710c to
1050ef1
Compare
1050ef1 to
a1fddf0
Compare
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
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.
a1fddf0 to
2137136
Compare
2137136 to
145e2cf
Compare
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
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.
145e2cf to
7228798
Compare
7228798 to
47dd078
Compare
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
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.
| #ifndef WOLFSSH_NO_MLDSA | ||
| else if (p->useMlDsaComposite) { | ||
| CompositeParams params; | ||
| if (WS_GetCompositeParams(p->pubKeyId, ¶ms) == WS_SUCCESS) { |
There was a problem hiding this comment.
🔵 [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.
| || sigKeyBlock_ptr->pubKeyFmtId == ID_MLDSA44_ED25519 | ||
| || sigKeyBlock_ptr->pubKeyFmtId == ID_MLDSA65_ED25519 | ||
| || sigKeyBlock_ptr->pubKeyFmtId == ID_MLDSA87_ED448) { | ||
| CompositeParams params; |
There was a problem hiding this comment.
🔵 [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.
Introduced support for ML-DSA composite signatures for hybrid post-quantum authentication.
Added all sig types as auth options into the test echoservers, new CI tests, and interop tested mldsa44-ed25519 wtih openssh-portable.