From ad71f44f3cf962bddace1c7b12452cdddf82c8cf Mon Sep 17 00:00:00 2001 From: Takashi Kojo Date: Sat, 5 May 2018 17:41:40 +0900 Subject: [PATCH] suppress i2d_RSAPublicKey with HAVE_FAST_RSA --- src/ssl.c | 3 ++- tests/api.c | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ssl.c b/src/ssl.c index e33612814..bb4d5bd56 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -27496,6 +27496,7 @@ WOLFSSL_RSA *wolfSSL_d2i_RSAPublicKey(WOLFSSL_RSA **r, const unsigned char **pp, return rsa; } +#if !defined(HAVE_FAST_RSA) int wolfSSL_i2d_RSAPublicKey(WOLFSSL_RSA *rsa, const unsigned char **pp) { byte *der; @@ -27525,12 +27526,12 @@ int wolfSSL_i2d_RSAPublicKey(WOLFSSL_RSA *rsa, const unsigned char **pp) return ret; } - /* return WOLFSSL_SUCCESS if success, WOLFSSL_FATAL_ERROR if error */ int wolfSSL_RSA_LoadDer(WOLFSSL_RSA* rsa, const unsigned char* derBuf, int derSz) { return wolfSSL_RSA_LoadDer_ex(rsa, derBuf, derSz, WOLFSSL_RSA_LOAD_PRIVATE); } +#endif /* #if !defined(HAVE_FAST_RSA) */ int wolfSSL_RSA_LoadDer_ex(WOLFSSL_RSA* rsa, const unsigned char* derBuf, int derSz, int opt) diff --git a/tests/api.c b/tests/api.c index b2db365dc..c5b0614a9 100644 --- a/tests/api.c +++ b/tests/api.c @@ -9852,9 +9852,10 @@ static int test_wc_RsaKeyToDer (void) * Testing wc_RsaKeyToPublicDer() */ static int test_wc_RsaKeyToPublicDer (void) -{ +{ int ret = 0; -#if !defined(NO_RSA) && defined(WOLFSSL_KEY_GEN) +#if (!defined(NO_RSA) || !defined(HAVE_FAST_RSA) || defined(WOLFSSL_KEY_GEN)) && \ + (defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)) RsaKey key; WC_RNG rng; byte* der;