This commits changes to various parts of libcrypto required by the recent
[openssl.git] / crypto / dsa / dsatest.c
index 5f24b59554636045f536d1d3ab96b467e6065bc2..12da64f9f49fb495ddbe3ff6f5bde38683f489bc 100644 (file)
@@ -65,6 +65,7 @@
 #include <openssl/rand.h>
 #include <openssl/bio.h>
 #include <openssl/err.h>
+#include <openssl/engine.h>
 #ifdef OPENSSL_SYS_WINDOWS
 #include "../bio/bss_file.c"
 #endif
@@ -136,9 +137,6 @@ int main(int argc, char **argv)
        unsigned char sig[256];
        unsigned int siglen;
 
-       ERR_load_crypto_strings();
-       RAND_seed(rnd_seed, sizeof rnd_seed);
-
        if (bio_err == NULL)
                bio_err=BIO_new_fp(stderr,BIO_NOCLOSE);
 
@@ -146,6 +144,9 @@ int main(int argc, char **argv)
        CRYPTO_dbg_set_options(V_CRYPTO_MDEBUG_ALL);
        CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
 
+       ERR_load_crypto_strings();
+       RAND_seed(rnd_seed, sizeof rnd_seed);
+
        BIO_printf(bio_err,"test generation of DSA parameters\n");
 
        dsa=DSA_generate_parameters(512,seed,20,&counter,&h,dsa_cb,bio_err);
@@ -204,6 +205,7 @@ end:
        if (dsa != NULL) DSA_free(dsa);
        CRYPTO_cleanup_all_ex_data();
        ERR_remove_state(0);
+       ERR_free_strings();
        CRYPTO_mem_leaks(bio_err);
        if (bio_err != NULL)
                {