Add a BN_mod_word test()
[openssl.git] / test / srptest.c
index 60cdbc31fd5221af0d87ae76b4b8a996ae9faacf..8d0aaa3bcd05f21c0834c5ad2a4a63d53e57f12a 100644 (file)
@@ -1,3 +1,12 @@
+/*
+ * Copyright 2011-2016 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the OpenSSL license (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
 #include <openssl/opensslconf.h>
 #ifdef OPENSSL_NO_SRP
 
@@ -126,11 +135,9 @@ int main(int argc, char **argv)
     BIO *bio_err;
     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();
 
     /* "Negative" test, expect a mismatch */
     if (run_srp("alice", "password1", "password2") == 0) {
@@ -144,10 +151,10 @@ int main(int argc, char **argv)
         return 1;
     }
 
-    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
     BIO_free(bio_err);
 
     return 0;