Update from stable branch.
[oweals/openssl.git] / crypto / dh / dhtest.c
index 492fbeefa2a7a320ca7228813e7516dbb891f579..882f5c310a79b0931b0239fa8589bf033aaadd60 100644 (file)
@@ -145,6 +145,10 @@ int main(int argc, char *argv[])
        b->g=BN_dup(a->g);
        if ((b->p == NULL) || (b->g == NULL)) goto err;
 
+       /* Set a to run with normal modexp and b to use constant time */
+       a->flags &= ~DH_FLAG_NO_EXP_CONSTTIME;
+       b->flags |= DH_FLAG_NO_EXP_CONSTTIME;
+
        if (!DH_generate_key(a)) goto err;
        BIO_puts(out,"pri 1=");
        BN_print(out,a->priv_key);
@@ -197,9 +201,9 @@ err:
        if(b != NULL) DH_free(b);
        if(a != NULL) DH_free(a);
        BIO_free(out);
-       CRYPTO_cleanup_all_ex_data();
-       ERR_remove_state(0);
-       CRYPTO_mem_leaks_fp(stderr);
+#ifdef OPENSSL_SYS_NETWARE
+    if (ret) printf("ERROR: %d\n", ret);
+#endif
        EXIT(ret);
        return(ret);
        }