Make the change to strong keys in the string to key(s) functions experimental in...
[oweals/openssl.git] / crypto / ec / ectest.c
index c1f0b44c9bd1948b1c78b47d19bff9563e8057f4..243cd83fb54aa7d0cb5ebc06b0a8a74dd7e080ed 100644 (file)
@@ -156,7 +156,12 @@ int main(int argc, char *argv[])
        if (!((getenv("OPENSSL_DEBUG_MEMORY") != NULL) && (0 == strcmp(getenv("OPENSSL_DEBUG_MEMORY"), "off"))))
                {
                CRYPTO_malloc_debug_init();
-               CRYPTO_dbg_set_options(V_CRYPTO_MDEBUG_ALL);
+               CRYPTO_set_mem_debug_options(V_CRYPTO_MDEBUG_ALL);
+               }
+       else
+               {
+               /* OPENSSL_DEBUG_MEMORY=off */
+               CRYPTO_set_mem_debug_functions(0, 0, 0, 0, 0);
                }
        CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
        ERR_load_crypto_strings();
@@ -564,10 +569,10 @@ int main(int argc, char *argv[])
                fflush(stdout);
 
                if (!BN_pseudo_rand(y, BN_num_bits(y), 0, 0)) ABORT;
-               if (!BN_copy(z, y)) ABORT;
+               if (!BN_add(z, z, y)) ABORT;
                z->neg = 1;
                scalars[0] = y;
-               scalars[1] = z; /* z = -y */
+               scalars[1] = z; /* z = -(order + y) */
 
                if (!EC_POINTs_mul(group, P, NULL, 2, points, scalars, ctx)) ABORT;
                if (!EC_POINT_is_at_infinity(group, P)) ABORT;
@@ -619,6 +624,7 @@ int main(int argc, char *argv[])
        if (P_521) EC_GROUP_free(P_521);
 
        ENGINE_cleanup();
+       CRYPTO_cleanup_all_ex_data();
        ERR_free_strings();
        ERR_remove_state(0);
        CRYPTO_mem_leaks_fp(stderr);