From 86809cca74be095fe6d9f4f52699836103e3dd6a Mon Sep 17 00:00:00 2001 From: kaleb-himes Date: Thu, 8 Jun 2017 20:14:15 -0600 Subject: [PATCH] Fix compile time warning with openssl extra and cryptonly --- wolfcrypt/src/wc_port.c | 3 ++- wolfcrypt/test/test.c | 13 ++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/wolfcrypt/src/wc_port.c b/wolfcrypt/src/wc_port.c index 5478b9692..2104ace74 100755 --- a/wolfcrypt/src/wc_port.c +++ b/wolfcrypt/src/wc_port.c @@ -131,7 +131,8 @@ int wolfCrypt_Init(void) WOLFSSL_MSG("Using ARM hardware acceleration"); #endif - #if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER) + #if !defined(WOLFCRYPT_ONLY) && \ + ( defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER) ) wolfSSL_EVP_init(); #endif diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index 4bf48891b..9bc637df4 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -128,7 +128,9 @@ #endif #ifdef OPENSSL_EXTRA + #ifndef WOLFCRYPT_ONLY #include + #endif #include #include #include @@ -249,7 +251,9 @@ int random_test(void); #endif /* WC_NO_RNG */ int pwdbased_test(void); int ripemd_test(void); -int openssl_test(void); /* test mini api */ +#if defined(OPENSSL_EXTRA) && !defined(WOLFCRYPT_ONLY) + int openssl_test(void); /* test mini api */ +#endif int pbkdf1_test(void); int pkcs12_test(void); int pbkdf2_test(void); @@ -751,7 +755,7 @@ int wolfcrypt_test(void* args) printf( "PWDBASED test passed!\n"); #endif -#ifdef OPENSSL_EXTRA +#if defined(OPENSSL_EXTRA) && !defined(WOLFCRYPT_ONLY) if ( (ret = openssl_test()) != 0) return err_sys("OPENSSL test failed!\n", ret); else @@ -8430,7 +8434,7 @@ int srp_test(void) #endif /* WOLFCRYPT_HAVE_SRP */ -#ifdef OPENSSL_EXTRA +#if defined(OPENSSL_EXTRA) && !defined(WOLFCRYPT_ONLY) int openssl_test(void) { @@ -9121,12 +9125,11 @@ int openssl_test(void) } #endif /* ifndef NO_AES */ - return 0; } -#endif /* OPENSSL_EXTRA */ +#endif /* OPENSSL_EXTRA && !WOLFCRYPT_ONLY */ #ifndef NO_PWDBASED