Fixup secmemtest for the change of CRYPTO_free() and friends
[openssl.git] / test / clienthellotest.c
index 289ca1e57275db171fa0453802f623f461be378c..877566131a7db936f7d3cba8ddcb8065c83fee5e 100644 (file)
@@ -55,6 +55,7 @@
 
 #include <string.h>
 
+#include <openssl/opensslconf.h>
 #include <openssl/bio.h>
 #include <openssl/crypto.h>
 #include <openssl/evp.h>
@@ -102,9 +103,6 @@ int main(int argc, char *argv[])
     int testresult = 0;
     int currtest = 0;
 
-    SSL_library_init();
-    SSL_load_error_strings();
-
     err = BIO_new_fp(stderr, BIO_NOCLOSE | BIO_FP_TEXT);
 
     CRYPTO_set_mem_debug(1);
@@ -117,7 +115,11 @@ int main(int argc, char *argv[])
     for (; currtest < TOTAL_NUM_TESTS; currtest++) {
         testresult = 0;
         if (currtest == TEST_SET_SESSION_TICK_DATA_TLS_1_2) {
+#ifndef OPENSSL_NO_TLS1_2
             ctx = SSL_CTX_new(TLSv1_2_method());
+#else
+            continue;
+#endif
         } else {
             ctx = SSL_CTX_new(TLS_method());
         }
@@ -207,12 +209,9 @@ int main(int argc, char *argv[])
         }
     }
 
-    ERR_free_strings();
-    ERR_remove_thread_state(NULL);
-    EVP_cleanup();
-    CRYPTO_cleanup_all_ex_data();
-#ifdef CRYPTO_MDEBUG
-    CRYPTO_mem_leaks(err);
+#ifndef OPENSSL_NO_CRYPTO_MDEBUG
+    if (CRYPTO_mem_leaks(err) <= 0)
+        testresult = 0;
 #endif
     BIO_free(err);