RT4313: Fix build for !IMPLEMENTED code path in CRYPTO_secure_free()
[openssl.git] / test / jpaketest.c
index ef9e54bdb3c9e3d89e1ebd5bd509c2f8fa67f40d..2b61705bf8e727208708aedce6b40c703372d6d5 100644 (file)
@@ -112,15 +112,14 @@ int main(int argc, char **argv)
     BIGNUM *g = NULL;
     BIGNUM *q = NULL;
     BIGNUM *secret = BN_new();
+#ifndef OPENSSL_NO_CRYPTO_MDEBUG
     BIO *bio_err;
 
-    bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
+    bio_err = BIO_new_fp(stderr, BIO_NOCLOSE | BIO_FP_TEXT);
 
-    CRYPTO_malloc_debug_init();
-    CRYPTO_dbg_set_options(V_CRYPTO_MDEBUG_ALL);
+    CRYPTO_set_mem_debug(1);
     CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
-
-    ERR_load_crypto_strings();
+#endif
 
     /*-
     BN_hex2bn(&p, "fd7f53811d75122952df4a9c2eece4e7f611b7523cef4400c31e3f80b6512669455d402251fb593d8d58fabfc5f5ba30f6cb9b556cd7813b801d346ff26660b76b9950a5a49f9fe8047b1022c24fbba9d7feb7c61bf83b57e7c6a8a6150f04fb83f6d3c51ec3023554135a169132f675f3ae2b61d72aeff22203199dd14801c7");
@@ -174,10 +173,10 @@ int main(int argc, char **argv)
     BN_free(g);
     BN_free(p);
 
-    CRYPTO_cleanup_all_ex_data();
-    ERR_remove_thread_state(NULL);
-    ERR_free_strings();
-    CRYPTO_mem_leaks(bio_err);
+#ifndef OPENSSL_NO_CRYPTO_MDEBUG
+    if (CRYPTO_mem_leaks(bio_err) <= 0)
+        return 1;
+#endif
 
     return 0;
 }