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-ED25519, 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
Comment thread src/internal.c
Comment thread src/internal.c
Comment thread src/internal.c Outdated
Comment thread src/internal.c Outdated
Comment thread src/internal.c
Comment thread src/internal.c Outdated
Comment thread tests/unit.c
Comment thread src/internal.c Outdated
Comment thread tests/unit.c

@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 apps/wolfsshd/test/test_configuration.c
Comment thread src/internal.c
@stenslae
stenslae force-pushed the ml-dsa-hybrid-support-rebased branch from 2daad5d to 51225eb Compare August 6, 2026 20:11
Comment thread apps/wolfsshd/test/test_configuration.c
Comment thread src/internal.c
@stenslae
stenslae requested review from wolfSSL-Fenrir-bot and removed request for wolfSSL-Fenrir-bot August 6, 2026 20:12

@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: 3
3 finding(s) posted as inline comments (see file-level comments below)

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

Comment thread tests/unit.c
Comment thread apps/wolfsshd/test/test_configuration.c
Comment thread src/internal.c
@stenslae
stenslae force-pushed the ml-dsa-hybrid-support-rebased branch from 51225eb to ec83417 Compare August 6, 2026 22:26
Comment thread apps/wolfsshd/test/test_configuration.c
Comment thread tests/unit.c
Comment thread src/internal.c
@stenslae
stenslae force-pushed the ml-dsa-hybrid-support-rebased branch from ec83417 to c820ef1 Compare August 6, 2026 22:30

@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 src/keygen.c Outdated
Comment thread src/internal.c
Comment thread src/keygen.c Outdated
@stenslae
stenslae force-pushed the ml-dsa-hybrid-support-rebased branch from c820ef1 to 840e927 Compare August 7, 2026 21:55

@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: 4
4 finding(s) posted as inline comments (see file-level comments below)

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

static int test_CheckAuthKeysLineTypes(void)
{
static const char* types[] = {
"ssh-rsa",

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] New test hardcodes key-type names that NameIdMap omits in non-RSA/non-ECDSA builds · Logic errors

types[] lists ssh-rsa and the three ecdsa-sha2-nistp* names unguarded, but CheckAuthKeysLine() now sources valid types from wolfSSH_QueryKey()/NameIdMap, which omits them under WOLFSSH_NO_RSA / WOLFSSH_NO_ECDSA_SHA2_NISTP*. The test then returns WS_FATAL_ERROR on a correct build. ssh-ed25519 is guarded; these are not.

Fix: Wrap each entry in the same guard NameIdMap uses (WOLFSSH_NO_RSA, WOLFSSH_NO_ECDSA_SHA2_NISTP256/384/521, WOLFSSH_NO_SSH_RSA_SHA1 for x509v3-ssh-rsa).

return BuildAuthKeysLineType("ssh-rsa", key, keySz, lineOut, lineOutSz);
}

/* Confirms every key-type string in CheckAuthKeysLine's allowedTypes[] table

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚪ [Info] Test comment references allowedTypes[] table removed by this PR · Dead/unreachable code

The comment states the test confirms every string in CheckAuthKeysLine's allowedTypes[] table, but this PR deleted that table in favor of wolfSSH_QueryKey(). The stated invariant no longer exists, obscuring what the test actually asserts.

Fix: Reword the comment to describe the wolfSSH_QueryKey()/NameIdMap lookup the test now exercises.

static int test_CheckAuthKeysLineTypes(void)
{
static const char* types[] = {
"ssh-rsa",

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] test_CheckAuthKeysLineTypes asserts key types that the new registry-driven check gates out · Hardcoded paths, ports, or environment dependencies

CheckAuthKeysLine() now derives accepted types from NameIdMap via wolfSSH_QueryKey(), which gates ssh-rsa on WOLFSSH_NO_RSA, ecdsa-sha2-nistp* on the per-curve macros, and x509v3-ssh-rsa on WOLFSSH_NO_SSH_RSA_SHA1. The test lists those names unconditionally, so it fails on builds with RSA, SHA-1 RSA, or an ECC curve disabled.

Fix: Wrap the RSA, ECDSA-curve, and x509v3 entries in the same #ifndef WOLFSSH_NO_RSA / WOLFSSH_NO_ECDSA_SHA2_NISTP* / WOLFSSH_NO_SSH_RSA_SHA1 guards used by NameIdMap.

Comment thread apps/wolfsshd/auth.c
if (ret == WSSHD_AUTH_SUCCESS) {
for (i = 0; i < NUM_ALLOWED_TYPES; ++i) {
if (WSTRCMP(type, allowedTypes[i]) == 0) {
while ((algoName = wolfSSH_QueryKey(&queryIdx)) != NULL) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚪ [Info] authorized_keys type whitelist widened to every TYPE_KEY name, including certificate algorithms · Authentication bypass

Replacing the hand-maintained allowedTypes[] with wolfSSH_QueryKey() also admits x509v3-* and *-cert-v01@openssh.com names as authorized_keys/TrustedUserCAKeys line types. Impact is contained because the entry still has to byte-match the offered blob, and certificate auth is routed to the CA path before this scanner runs.

Related known finding #6814 (similar but distinct): Both affect public-key authorization through authorized_keys processing, but #6814 removes SearchForPubKey’s no-match rejection gate, whereas this changes CheckAuthKeysLine’s accepted algorithm-name whitelist. The root causes and faulting operations differ, and each requires a separate patch.

Fix: Filter the queried names to non-certificate key types so an authorized_keys line naming a certificate algorithm remains rejected outright.

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