diff --git a/lib/hcrypto/test_crypto.in b/lib/hcrypto/test_crypto.in index 64ecd077d..65daa642a 100644 --- a/lib/hcrypto/test_crypto.in +++ b/lib/hcrypto/test_crypto.in @@ -60,6 +60,8 @@ for a in unix fortuna egd w32crypto ;do ${rand} --method=${a} --file=crypto-test 2>error res=$? if test "X$res" != X0 ; then + grep "unknown method" error && \ + { echo "random $a is not available" ; continue; } grep "random not ready yet" error || \ { echo "random $a ready failing" ; cat error; exit 1; } echo "random method $a out for lunch" @@ -101,6 +103,8 @@ if [ -e /dev/random -o -e /dev/urandom -o -e /dev/srandom -o -e /dev/arandom ] ; ${rand} --method=unix --file=unix 2>error res=$? if test "X$res" != X0 ; then + grep "unknown method" error && \ + { echo "random unix is not available"; exit 0; } grep "random not ready yet" error || \ { echo "random unix ready failing" ; cat error; exit 1; } echo "random method unix out for lunch" diff --git a/lib/hcrypto/test_rand.c b/lib/hcrypto/test_rand.c index dc98218d9..272d39d99 100644 --- a/lib/hcrypto/test_rand.c +++ b/lib/hcrypto/test_rand.c @@ -132,7 +132,7 @@ main(int argc, char **argv) RAND_set_rand_method(RAND_w32crypto_method()); #endif else - errx(0, "unknown method %s", rand_method); + errx(1, "unknown method %s", rand_method); } if (RAND_file_name(path, sizeof(path)) == NULL)