From 6b1b6ece00e27e3c04906787626307812af3364d Mon Sep 17 00:00:00 2001 From: Brett Nicholas <7547222+bigbrett@users.noreply.github.com> Date: Tue, 12 Nov 2024 16:06:07 -0700 Subject: [PATCH] guard use of dilithium_key->params on WC implementation --- wolfcrypt/src/dilithium.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/wolfcrypt/src/dilithium.c b/wolfcrypt/src/dilithium.c index 44f9e7972a..c74ca493ad 100644 --- a/wolfcrypt/src/dilithium.c +++ b/wolfcrypt/src/dilithium.c @@ -9614,9 +9614,9 @@ int wc_Dilithium_PrivateKeyDecode(const byte* input, word32* inOutIdx, } /* If expected security level not set in key, detect it from DER */ - if (key->level == 0 || key->params == NULL -#ifdef WOLFSSL_DILITHIUM_FIPS204_DRAFT - || key->params->level == 0) + if (key->level == 0 +#ifdef WOLFSSL_WC_DILITHIUM + || key->params == NULL #endif ) { int level; @@ -9885,9 +9885,9 @@ int wc_Dilithium_PublicKeyDecode(const byte* input, word32* inOutIdx, #if !defined(WOLFSSL_DILITHIUM_NO_ASN1) /* If expected security level not set in key, detect it from DER */ - if (key->level == 0 || key->params == NULL -#ifdef WOLFSSL_DILITHIUM_FIPS204_DRAFT - || key->params->level == 0) + if (key->level == 0 +#ifdef WOLFSSL_WC_DILITHIUM + || key->params == NULL #endif ) { int level;