The des_xcbc_encrypt apparently always fails.
[openssl.git] / crypto / dsa / dsatest.c
index 70aa8ca28defa046a4104a678244ffa64149a114..220f71c26004865b492bb32136226d7e989e58c2 100644 (file)
@@ -120,6 +120,8 @@ static unsigned char out_g[]={
 
 static const unsigned char str1[]="12345678901234567890";
 
+static const char rnd_seed[] = "string to make the random number generator think it has entropy";
+
 static BIO *bio_err=NULL;
 
 int main(int argc, char **argv)
@@ -131,10 +133,12 @@ int main(int argc, char **argv)
        unsigned char sig[256];
        unsigned int siglen;
 
+       RAND_seed(rnd_seed, sizeof rnd_seed);
+
        if (bio_err == NULL)
                bio_err=BIO_new_fp(stderr,BIO_NOCLOSE);
 
-       CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
+       CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
 
        BIO_printf(bio_err,"test generation of DSA parameters\n");
        BIO_printf(bio_err,"expect '.*' followed by 5 lines of '.'s and '+'s\n");
@@ -194,7 +198,11 @@ end:
                ERR_print_errors(bio_err);
        if (dsa != NULL) DSA_free(dsa);
        CRYPTO_mem_leaks(bio_err);
-       if (bio_err != NULL) BIO_free(bio_err);
+       if (bio_err != NULL)
+               {
+               BIO_free(bio_err);
+               bio_err = NULL;
+               }
        exit(!ret);
        return(0);
        }