@@ -34962,7 +34962,7 @@ static int test_wc_dilithium_der(void)
3496234962 int pubDerLen;
3496334963 int privDerLen;
3496434964 int keyDerLen;
34965- word32 idx;
34965+ word32 idx = 0 ;
3496634966
3496734967#ifndef WOLFSSL_NO_ML_DSA_44
3496834968 pubLen = DILITHIUM_LEVEL2_PUB_KEY_SIZE;
@@ -34989,6 +34989,9 @@ static int test_wc_dilithium_der(void)
3498934989 if (key != NULL) {
3499034990 XMEMSET(key, 0, sizeof(*key));
3499134991 }
34992+ if (der != NULL) {
34993+ XMEMSET(der, 0, sizeof(*der));
34994+ }
3499234995 XMEMSET(&rng, 0, sizeof(WC_RNG));
3499334996 ExpectIntEQ(wc_InitRng(&rng), 0);
3499434997 ExpectIntEQ(wc_dilithium_init(key), 0);
@@ -35002,21 +35005,21 @@ static int test_wc_dilithium_der(void)
3500235005 /* When security level is not set, we attempt to parse it from DER. Since
3500335006 * the supplied DER is invalid, this should fail with ASN parsing error */
3500435007 idx = 0;
35005- ExpectIntEQ(wc_Dilithium_PublicKeyDecode(der, &idx, key, pubDerLen),
3500635008#ifdef WOLFSSL_DILITHIUM_FIPS204_DRAFT
35007- WC_NO_ERR_TRACE(BAD_FUNC_ARG)
35009+ ExpectIntEQ(wc_Dilithium_PublicKeyDecode(der, &idx, key, pubDerLen),
35010+ WC_NO_ERR_TRACE(BAD_FUNC_ARG));
3500835011#else
35009- WC_NO_ERR_TRACE(ASN_PARSE_E)
35012+ ExpectIntEQ(wc_Dilithium_PublicKeyDecode(der, &idx, key, pubDerLen),
35013+ WC_NO_ERR_TRACE(ASN_PARSE_E));
3501035014#endif
35011- );
3501235015 idx = 0;
35013- ExpectIntEQ(wc_Dilithium_PrivateKeyDecode(der, &idx, key, privDerLen),
3501435016#ifdef WOLFSSL_DILITHIUM_FIPS204_DRAFT
35015- WC_NO_ERR_TRACE(BAD_FUNC_ARG)
35017+ ExpectIntEQ(wc_Dilithium_PrivateKeyDecode(der, &idx, key, privDerLen),
35018+ WC_NO_ERR_TRACE(BAD_FUNC_ARG));
3501635019#else
35017- WC_NO_ERR_TRACE(ASN_PARSE_E)
35020+ ExpectIntEQ(wc_Dilithium_PrivateKeyDecode(der, &idx, key, privDerLen),
35021+ WC_NO_ERR_TRACE(ASN_PARSE_E));
3501835022#endif
35019- );
3502035023
3502135024#ifndef WOLFSSL_NO_ML_DSA_44
3502235025 ExpectIntEQ(wc_dilithium_set_level(key, WC_ML_DSA_44), 0);
0 commit comments