diff options
author | Bodo Möller <bodo@openssl.org> | 2000-01-14 17:55:37 +0000 |
---|---|---|
committer | Bodo Möller <bodo@openssl.org> | 2000-01-14 17:55:37 +0000 |
commit | 0c50e02b30de26a9a5027a1065db7e07fd91469a (patch) | |
tree | b8db8b6be9a99887365ad7dda250b9c7640c1042 /crypto/bn/exptest.c | |
parent | a8eeb155b5323809113e57e62de887b31f9fba7b (diff) |
- Pseudo-seed the PRNG in programs used for "make test"
because otherwise BN_rand will fail unless DEVRANDOM works,
which causes the programs to dump core because they
don't check the return value of BN_rand (and if they
did, we still couldn't test anything).
- add comment to some files that appear not to be used at all.
Diffstat (limited to 'crypto/bn/exptest.c')
-rw-r--r-- | crypto/bn/exptest.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/crypto/bn/exptest.c b/crypto/bn/exptest.c index d64905df1b..b6c7b18a3a 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(); |