diff options
Diffstat (limited to 'src/lib/libcrypto/bn/exptest.c')
-rw-r--r-- | src/lib/libcrypto/bn/exptest.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/lib/libcrypto/bn/exptest.c b/src/lib/libcrypto/bn/exptest.c index 9e4ae91d20..3e86f2ea0e 100644 --- a/src/lib/libcrypto/bn/exptest.c +++ b/src/lib/libcrypto/bn/exptest.c | |||
@@ -69,6 +69,8 @@ | |||
69 | 69 | ||
70 | #define NUM_BITS (BN_BITS*2) | 70 | #define NUM_BITS (BN_BITS*2) |
71 | 71 | ||
72 | static const char rnd_seed[] = "string to make the random number generator think it has entropy"; | ||
73 | |||
72 | int main(int argc, char *argv[]) | 74 | int main(int argc, char *argv[]) |
73 | { | 75 | { |
74 | BN_CTX *ctx; | 76 | BN_CTX *ctx; |
@@ -77,6 +79,10 @@ int main(int argc, char *argv[]) | |||
77 | unsigned char c; | 79 | unsigned char c; |
78 | BIGNUM *r_mont,*r_recp,*r_simple,*a,*b,*m; | 80 | BIGNUM *r_mont,*r_recp,*r_simple,*a,*b,*m; |
79 | 81 | ||
82 | RAND_seed(rnd_seed, sizeof rnd_seed); /* or BN_rand may fail, and we don't | ||
83 | * even check its return value | ||
84 | * (which we should) */ | ||
85 | |||
80 | ERR_load_BN_strings(); | 86 | ERR_load_BN_strings(); |
81 | 87 | ||
82 | ctx=BN_CTX_new(); | 88 | ctx=BN_CTX_new(); |
@@ -160,7 +166,16 @@ int main(int argc, char *argv[]) | |||
160 | exit(1); | 166 | exit(1); |
161 | } | 167 | } |
162 | } | 168 | } |
169 | BN_free(r_mont); | ||
170 | BN_free(r_recp); | ||
171 | BN_free(r_simple); | ||
172 | BN_free(a); | ||
173 | BN_free(b); | ||
174 | BN_free(m); | ||
175 | BN_CTX_free(ctx); | ||
176 | ERR_remove_state(0); | ||
163 | CRYPTO_mem_leaks(out); | 177 | CRYPTO_mem_leaks(out); |
178 | BIO_free(out); | ||
164 | printf(" done\n"); | 179 | printf(" done\n"); |
165 | exit(0); | 180 | exit(0); |
166 | err: | 181 | err: |