Skip to content

Commit a6dab68

Browse files
Emma Stenslandclaude
andcommitted
Guard composite ML-DSA keyId check with WOLFSSH_NO_MLDSA
wolfSSH_ProcessBuffer() referenced the composite key IDs (ID_MLDSA44_ES256 etc.) unconditionally when rejecting non-composite OpenSSH-format private keys, but those IDs are only declared inside #ifndef WOLFSSH_NO_MLDSA in wolfssh/internal.h. Any build linked against a wolfSSL without HAVE_DILITHIUM (ie without --enable-mldsa) fails to compile as a result -- this was the cause of every CI job failing on this branch, not just the ML-DSA-specific ones. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent a73c160 commit a6dab68

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/internal.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3257,10 +3257,13 @@ int wolfSSH_ProcessBuffer(WOLFSSH_CTX* ctx,
32573257
* openssh-key-v1 envelope later (SendKexGetSigningKey()); every
32583258
* other key type expects raw DER, so reject them here instead of
32593259
* silently storing an envelope that will fail every handshake. */
3260-
if (format == WOLFSSH_FORMAT_OPENSSH &&
3261-
keyId != ID_MLDSA44_ES256 && keyId != ID_MLDSA65_ES256 &&
3260+
if (format == WOLFSSH_FORMAT_OPENSSH
3261+
#ifndef WOLFSSH_NO_MLDSA
3262+
&& keyId != ID_MLDSA44_ES256 && keyId != ID_MLDSA65_ES256 &&
32623263
keyId != ID_MLDSA87_ES384 && keyId != ID_MLDSA44_ED25519 &&
3263-
keyId != ID_MLDSA65_ED25519 && keyId != ID_MLDSA87_ED448) {
3264+
keyId != ID_MLDSA65_ED25519 && keyId != ID_MLDSA87_ED448
3265+
#endif
3266+
) {
32643267
WS_FORCEZERO(der, derSz);
32653268
WFREE(der, heap, dynamicType);
32663269
return WS_UNIMPLEMENTED_E;

0 commit comments

Comments
 (0)