X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fbn%2Fexptest.c;h=3e86f2ea0e0b3897a24e437b38a73824e1993110;hp=d64905df1b59c70f92463d987b0d3117b212a9f2;hb=eb1f1b0a341cbe2c75d8f24b2dc62f4cad05dcec;hpb=798757762a2b1a952147b602fd37fd6fe317e26f diff --git a/crypto/bn/exptest.c b/crypto/bn/exptest.c index d64905df1b..3e86f2ea0e 100644 --- a/crypto/bn/exptest.c +++ b/crypto/bn/exptest.c @@ -69,6 +69,8 @@ #define NUM_BITS (BN_BITS*2) +static const char rnd_seed[] = "string to make the random number generator think it has entropy"; + int main(int argc, char *argv[]) { BN_CTX *ctx; @@ -77,6 +79,10 @@ int main(int argc, char *argv[]) unsigned char c; BIGNUM *r_mont,*r_recp,*r_simple,*a,*b,*m; + RAND_seed(rnd_seed, sizeof rnd_seed); /* or BN_rand may fail, and we don't + * even check its return value + * (which we should) */ + ERR_load_BN_strings(); ctx=BN_CTX_new(); @@ -167,6 +173,7 @@ int main(int argc, char *argv[]) BN_free(b); BN_free(m); BN_CTX_free(ctx); + ERR_remove_state(0); CRYPTO_mem_leaks(out); BIO_free(out); printf(" done\n");