build checks on mp_read_radix

This commit is contained in:
Jacob Barthelmeh
2023-03-07 13:55:10 -07:00
parent 9bc3b867e0
commit eb0bf7cd03
3 changed files with 15 additions and 2 deletions

View File

@ -575,6 +575,18 @@ char* wolfSSL_BN_bn2hex(const WOLFSSL_BIGNUM *bn)
*/
static int wolfssl_bn_radix2bn(WOLFSSL_BIGNUM** bn, const char* str, int radix)
{
#if defined(USE_FAST_MATH) && (!defined(OPENSSL_EXTRA) && defined(NO_DSA) && \
!defined(HAVE_ECC))
/* in this build case mp_read_radix is not available */
WOLFSSL_ENTER("wolfSSL_BN_bn2dec");
WOLFSSL_MSG("BN mp_read_radix not available");
(void)bn;
(void)str;
(void)radix;
return 0;
#else
int ret = 1;
WOLFSSL_BIGNUM* a = NULL;
@ -608,6 +620,7 @@ static int wolfssl_bn_radix2bn(WOLFSSL_BIGNUM** bn, const char* str, int radix)
*bn = NULL;
}
return ret;
#endif
}
/* Decode hex string into a big number.

View File

@ -5510,7 +5510,7 @@ static wcchar fp_s_rmap = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz+/";
#endif
#if !defined(NO_DSA) || defined(HAVE_ECC)
#if defined(OPENSSL_EXTRA) || !defined(NO_DSA) || defined(HAVE_ECC)
#if DIGIT_BIT == 64 || DIGIT_BIT == 32
static int fp_read_radix_16(fp_int *a, const char *str)
{

View File

@ -812,7 +812,7 @@ MP_API int mp_radix_size (mp_int * a, int radix, int *size);
#define mp_dump(desc, a, verbose)
#endif
#if !defined(NO_DSA) || defined(HAVE_ECC)
#if defined(OPENSSL_EXTRA) || !defined(NO_DSA) || defined(HAVE_ECC)
MP_API int mp_read_radix(mp_int* a, const char* str, int radix);
#endif