aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/bn/bntest.c
diff options
context:
space:
mode:
authorBodo Möller <bodo@openssl.org>2000-01-14 17:55:37 +0000
committerBodo Möller <bodo@openssl.org>2000-01-14 17:55:37 +0000
commit0c50e02b30de26a9a5027a1065db7e07fd91469a (patch)
treeb8db8b6be9a99887365ad7dda250b9c7640c1042 /crypto/bn/bntest.c
parenta8eeb155b5323809113e57e62de887b31f9fba7b (diff)
downloadopenssl-0c50e02b30de26a9a5027a1065db7e07fd91469a.tar.gz
- 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/bntest.c')
-rw-r--r--crypto/bn/bntest.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/crypto/bn/bntest.c b/crypto/bn/bntest.c
index 652f6794f0..012d387bf5 100644
--- a/crypto/bn/bntest.c
+++ b/crypto/bn/bntest.c
@@ -98,6 +98,8 @@ static int results=0;
static unsigned char lst1[]="\xC6\x4F\x43\x04\x2A\xEA\xCA\x6E\x58\x36\x80\x5B\xE8\xC9"
"\x9B\x04\x5D\x48\x36\xC2\xFD\x16\xC9\x64\xF0";
+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;
@@ -106,6 +108,10 @@ int main(int argc, char *argv[])
results = 0;
+ RAND_seed(rnd_seed, sizeof rnd_seed); /* or BN_rand may fail, and we don't
+ * even check its return value
+ * (which we should) */
+
argc--;
argv++;
while (argc >= 1)