diff --git a/lib/des/test_crypto.in b/lib/des/test_crypto.in index f897589c9..b2a6c5014 100644 --- a/lib/des/test_crypto.in +++ b/lib/des/test_crypto.in @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2006 Kungliga Tekniska Högskolan +# Copyright (c) 2006 - 2007 Kungliga Tekniska Högskolan # (Royal Institute of Technology, Stockholm, Sweden). # All rights reserved. # @@ -38,6 +38,7 @@ srcdir="@srcdir@" rsa="${TESTS_ENVIRONMENT} ./test_rsa" engine="${TESTS_ENVIRONMENT} ./test_engine_dso" +rand="${TESTS_ENVIRONMENT} ./test_rand" ${rsa} --key=${srcdir}/rsakey.der || \ { echo "rsa test failed" ; exit 1; } @@ -45,4 +46,24 @@ ${rsa} --key=${srcdir}/rsakey.der || \ ${engine} --rsa=${srcdir}/rsakey.der || \ { echo "engine test failed" ; exit 1; } + +for a in unix fortuna egd ;do + ${rand} --method=${a} crypto-test 2>error + res=$? + if test "X$res" != X0 ; then + grep "random not ready yet" error || exit 1 + echo "random metod $a out for lunch" + continue + fi + ${rand} --method=${a} crypto-test2 2>error + res=$? + if test "X$res" != X0 ; then + grep "random not ready yet" error || exit 1 + echo "random metod $a out for dinner" + continue + fi + cmp crypto-test crypto-test2 && { echo "rand output same!" ; exit 1; } +done + + exit 0