From e6b587772f9963809eb03b42e95a861204b875ea Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Thu, 26 Nov 2020 01:20:29 -0600 Subject: [PATCH] fix pointer type clash in wolfSSL_BN_mod_word(); restore accidentally removed WOLFSSL_KEY_GEN gate in dsa_test(). --- src/ssl.c | 4 +++- wolfcrypt/test/test.c | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ssl.c b/src/ssl.c index 224c409ec..7c22b4f85 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -47059,10 +47059,12 @@ unsigned long wolfSSL_BN_mod_word(const WOLFSSL_BIGNUM *bn, } if (w <= MP_MASK) { - if (mp_mod_d((mp_int*)bn->internal, (WOLFSSL_BN_ULONG)w, &ret) != MP_OKAY) { + WOLFSSL_BN_ULONG bn_ret; + if (mp_mod_d((mp_int*)bn->internal, (WOLFSSL_BN_ULONG)w, &bn_ret) != MP_OKAY) { WOLFSSL_MSG("mp_add_d error"); return (unsigned long)WOLFSSL_FATAL_ERROR; } + ret = (unsigned long)bn_ret; } else { int mp_ret; mp_int w_mp, r_mp; diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index bf063076f..a3bb97712 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -15635,9 +15635,11 @@ static int dsa_test(void) #else byte tmp[1024]; DsaKey key[1]; +#ifdef WOLFSSL_KEY_GEN DsaKey derIn[1]; DsaKey genKey[1]; #endif +#endif #ifdef USE_CERT_BUFFERS_1024 XMEMCPY(tmp, dsa_key_der_1024, sizeof_dsa_key_der_1024);