From 373258a0c280dfb3401ca8e4a6444d3b655274ec Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Wed, 15 Aug 2018 09:50:50 -0600 Subject: [PATCH] account for NO_RSA and SP math when printing max RSA key size --- examples/client/client.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/examples/client/client.c b/examples/client/client.c index 9188f09ab..be6367d84 100644 --- a/examples/client/client.c +++ b/examples/client/client.c @@ -722,8 +722,18 @@ static void Usage(void) " NOTE: All files relative to wolfSSL home dir\n"); /* print out so that scripts can know what the max supported key size is */ - printf("Max key size in bits for build is set at : "); -#ifdef USE_FAST_MATH + printf("Max RSA key size in bits for build is set at : "); +#ifdef NO_RSA + printf("RSA not supported\n"); +#elif defined(WOLFSSL_SP_MATH) /* case of SP math only */ + #ifndef WOLFSSL_SP_NO_3072 + printf("3072\n"); + #elif !defined(WOLFSSL_SP_NO_2048) + printf("2048\n"); + #else + printf("0\n"); + #endif +#elif defined(USE_FAST_MATH) printf("%d\n", FP_MAX_BITS/2); #else /* normal math has unlimited max size */