From b947f69f60caec34df0049efca6d18652c02ed0c Mon Sep 17 00:00:00 2001 From: David Garske Date: Mon, 1 Jun 2020 10:49:08 -0700 Subject: [PATCH] Fix to correct SP 4096-bit enable. Correct nonexistent `WOLFSSL_SP_NO_4096`, which should be `WOLFSSL_SP_4096`. --- wolfcrypt/src/dh.c | 2 +- wolfcrypt/src/sp_int.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/wolfcrypt/src/dh.c b/wolfcrypt/src/dh.c index 6c53be8f3..78decc3f8 100644 --- a/wolfcrypt/src/dh.c +++ b/wolfcrypt/src/dh.c @@ -1485,7 +1485,7 @@ int wc_DhCheckPubKey_ex(DhKey* key, const byte* pub, word32 pubSz, } else #endif -#ifdef WOLFSSL_SP_NO_4096 +#ifdef WOLFSSL_SP_4096 if (mp_count_bits(&key->p) == 4096) { ret = sp_ModExp_4096(y, q, p, y); if (ret != 0) diff --git a/wolfcrypt/src/sp_int.c b/wolfcrypt/src/sp_int.c index e53bc93fc..4ec6e2339 100644 --- a/wolfcrypt/src/sp_int.c +++ b/wolfcrypt/src/sp_int.c @@ -43,7 +43,6 @@ * WOLFSSL_SP_NO_MALLOC: Always use stack, no heap XMALLOC/XFREE allowed * WOLFSSL_SP_NO_2048: Disable RSA/DH 2048-bit support * WOLFSSL_SP_NO_3072: Disable RSA/DH 3072-bit support - * WOLFSSL_SP_NO_4096: Disable RSA/DH 4096-bit support * WOLFSSL_SP_4096: Enable RSA/RH 4096-bit support * WOLFSSL_SP_384 Enable ECC 384-bit SECP384R1 support * WOLFSSL_SP_NO_256 Disable ECC 256-bit SECP256R1 support @@ -1659,7 +1658,7 @@ int sp_exptmod(sp_int* b, sp_int* e, sp_int* m, sp_int* r) } else #endif -#ifdef WOLFSSL_SP_NO_4096 +#ifdef WOLFSSL_SP_4096 if ((mBits == 4096) && sp_isodd(m) && (bBits <= 4096) && (eBits <= 4096)) { err = sp_ModExp_4096(b, e, m, r);