From 12abb5191d255afec7c47e3087718501e69086b5 Mon Sep 17 00:00:00 2001 From: Hayden Roche Date: Fri, 15 Jan 2021 12:21:12 -0600 Subject: [PATCH] Allow wolfSSL_RSA_public_decrypt on Windows. --- src/ssl.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ssl.c b/src/ssl.c index e2576a553..1ad05bddd 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -29067,6 +29067,9 @@ int wolfSSL_BIO_vprintf(WOLFSSL_BIO* bio, const char* format, va_list args) break; case WOLFSSL_BIO_MEMORY: + /* In Visual Studio versions prior to Visual Studio 2013, the va_* symbols + aren't defined. If using Visual Studio 2013 or later, define + HAVE_VA_COPY. */ #if defined(OPENSSL_EXTRA) && (!defined(_WIN32) || defined(HAVE_VA_COPY)) case WOLFSSL_BIO_SSL: { @@ -48611,9 +48614,8 @@ int wolfSSL_RSA_private_decrypt(int len, const unsigned char* fr, return ret; } -#if !defined(_WIN32) && !defined(HAVE_SELFTEST) && \ - (!defined(HAVE_FIPS) || \ - (defined(HAVE_FIPS_VERSION) && HAVE_FIPS_VERSION > 2)) +#if !defined(HAVE_SELFTEST) && (!defined(HAVE_FIPS) || \ + (defined(HAVE_FIPS_VERSION) && HAVE_FIPS_VERSION > 2)) int wolfSSL_RSA_public_decrypt(int flen, const unsigned char* from, unsigned char* to, WOLFSSL_RSA* rsa, int padding) { @@ -48665,7 +48667,7 @@ int wolfSSL_RSA_public_decrypt(int flen, const unsigned char* from, } return tlen; } -#endif /* !defined(_WIN32) && !defined(HAVE_FIPS) && !defined(HAVE_SELFTEST) */ +#endif /* !defined(HAVE_FIPS) && !defined(HAVE_SELFTEST) */ /* RSA private encrypt calls wc_RsaSSL_Sign. Similar function set up as RSA * public decrypt.