Skip to content

Commit bb226ea

Browse files
committed
Fix for the comments
1 parent 513a106 commit bb226ea

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

tests/api/test_mldsa.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17176,11 +17176,12 @@ int test_mldsa_x509_pubkey_sigtype(void)
1717617176
!defined(NO_CERTS) && !defined(NO_FILESYSTEM)
1717717177
static const struct {
1717817178
const char* pem_path;
17179-
word32 expected_sig_oid; /* CTC_ML_DSA_LEVEL* */
17179+
int expected_sig_oid; /* CTC_ML_DSA_LEVEL* (stored as int,
17180+
* same bit pattern as word32 return) */
1718017181
} cases[] = {
17181-
{ "./certs/mldsa/mldsa44-cert.pem", CTC_ML_DSA_LEVEL2 },
17182-
{ "./certs/mldsa/mldsa65-cert.pem", CTC_ML_DSA_LEVEL3 },
17183-
{ "./certs/mldsa/mldsa87-cert.pem", CTC_ML_DSA_LEVEL5 },
17182+
{ "./certs/mldsa/mldsa44-cert.pem", (int)CTC_ML_DSA_LEVEL2 },
17183+
{ "./certs/mldsa/mldsa65-cert.pem", (int)CTC_ML_DSA_LEVEL3 },
17184+
{ "./certs/mldsa/mldsa87-cert.pem", (int)CTC_ML_DSA_LEVEL5 },
1718417185
};
1718517186
int i;
1718617187
int n = (int)(sizeof(cases) / sizeof(cases[0]));
@@ -17199,7 +17200,7 @@ int test_mldsa_x509_pubkey_sigtype(void)
1719917200

1720017201
/* wolfSSL_X509_get_signature_type() must return the ML-DSA OID sum */
1720117202
sig_oid = wolfSSL_X509_get_signature_type(x509);
17202-
ExpectIntEQ((word32)sig_oid, cases[i].expected_sig_oid);
17203+
ExpectIntEQ(sig_oid, cases[i].expected_sig_oid);
1720317204

1720417205
/* wolfSSL_X509_get_pubkey() must succeed */
1720517206
ExpectNotNull(pkey = wolfSSL_X509_get_pubkey(x509));

wolfcrypt/src/evp_pk.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ static int d2iTryAltDhKey(WOLFSSL_EVP_PKEY** out, const unsigned char* mem,
398398
/* Create DH key object from data. */
399399
dhObj = wolfSSL_DH_new();
400400
if (dhObj == NULL) {
401-
return WOLFSSL_FATAL_ERROR;
401+
return 0;
402402
}
403403

404404
key = (DhKey*)dhObj->internal;

0 commit comments

Comments
 (0)