change add_all_* to be evp table init and fix valgrind report

pull/2520/head
Jacob Barthelmeh 2019-10-20 01:13:43 -06:00
parent 0eefa80d74
commit ea45da5fa8
4 changed files with 15 additions and 5 deletions

View File

@ -6323,6 +6323,7 @@ int ProcessFile(WOLFSSL_CTX* ctx, const char* fname, int format, int type,
WOLFSSL_MSG("Failed to detect certificate type");
if (dynamic)
XFREE(myBuffer, heapHint, DYNAMIC_TYPE_FILE);
XFCLOSE(file);
return WOLFSSL_BAD_CERTTYPE;
}
}
@ -16892,7 +16893,8 @@ int wolfSSL_EVP_MD_type(const WOLFSSL_EVP_MD *md)
{
WOLFSSL_ENTER("wolfSSL_ERR_clear_error");
#if defined(DEBUG_WOLFSSL) || defined(WOLFSSL_NGINX)
#if defined(DEBUG_WOLFSSL) || defined(WOLFSSL_NGINX) || \
defined(OPENSSL_EXTRA) || defined(DEBUG_WOLFSSL_VERBOSE)
wc_ClearErrorNodes();
#endif
}

View File

@ -19107,6 +19107,7 @@ static void test_wolfSSL_private_keys(void)
SSL_free(ssl);
SSL_CTX_free(ctx);
#endif /* end of Ed25519 private key match tests */
EVP_cleanup();
/* test existence of no-op macros in wolfssl/openssl/ssl.h */
CONF_modules_free();
@ -28165,8 +28166,6 @@ static int test_various_pathlen_chains(void)
WOLFSSL_CERT_MANAGER* cm;
/* Test chain G (large chain with varying pathLens) */
wolfSSL_Init();
if ((cm = wolfSSL_CertManagerNew()) == NULL) {
printf("cert manager new failed\n");
return -1;
@ -28648,6 +28647,7 @@ void ApiTest(void)
AssertIntEQ(test_wc_DsaExportKeyRaw(), 0);
AssertIntEQ(test_wc_SignatureGetSize_ecc(), 0);
AssertIntEQ(test_wc_SignatureGetSize_rsa(), 0);
wolfCrypt_Cleanup();
#ifdef OPENSSL_EXTRA
/*wolfSSL_EVP_get_cipherbynid test*/
@ -28736,6 +28736,10 @@ void ApiTest(void)
* a need to implement a new test case
*/
test_stubs_are_stubs();
#if defined(HAVE_ECC) && defined(FP_ECC) && defined(HAVE_THREAD_LS) \
&& (defined(NO_MAIN_DRIVER) || defined(HAVE_STACK_SIZE))
wc_ecc_fp_free(); /* free per thread cache */
#endif
wolfSSL_Cleanup();
printf(" End API Tests\n");

View File

@ -998,6 +998,10 @@ exit:
wolfSSL_CTX_free(cipherSuiteCtx);
wolfSSL_Cleanup();
#if defined(HAVE_ECC) && defined(FP_ECC) && defined(HAVE_THREAD_LS) \
&& (defined(NO_MAIN_DRIVER) || defined(HAVE_STACK_SIZE))
wc_ecc_fp_free(); /* free per thread cache */
#endif
#ifdef WOLFSSL_ASYNC_CRYPT
wolfAsync_DevClose(&devId);
#endif

View File

@ -682,8 +682,8 @@ typedef WOLFSSL_EVP_CIPHER_CTX EVP_CIPHER_CTX;
#define EVP_cleanup wolfSSL_EVP_cleanup
#define EVP_read_pw_string wolfSSL_EVP_read_pw_string
#define OpenSSL_add_all_digests() wolfCrypt_Init()
#define OpenSSL_add_all_ciphers() wolfCrypt_Init()
#define OpenSSL_add_all_digests() wolfSSL_EVP_init()
#define OpenSSL_add_all_ciphers() wolfSSL_EVP_init()
#define OpenSSL_add_all_algorithms wolfSSL_add_all_algorithms
#define OpenSSL_add_all_algorithms_noconf wolfSSL_OpenSSL_add_all_algorithms_noconf
#define wolfSSL_OPENSSL_add_all_algorithms_noconf wolfSSL_OpenSSL_add_all_algorithms_noconf