From 6f5e55c30a9bef841fc61cc1ee4ba2c5137cb112 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Sun, 10 Jun 2007 08:03:13 +0000 Subject: [PATCH] Test for random device. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21044 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/hcrypto/test_engine_dso.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/hcrypto/test_engine_dso.c b/lib/hcrypto/test_engine_dso.c index f2d8b346c..4081b8f65 100644 --- a/lib/hcrypto/test_engine_dso.c +++ b/lib/hcrypto/test_engine_dso.c @@ -117,6 +117,7 @@ static int help_flag; static char *id_flag; static char *rsa_flag; static int dh_flag = 1; +static int test_random_flag; static struct getargs args[] = { { "id", 0, arg_string, &id_flag, @@ -125,6 +126,8 @@ static struct getargs args[] = { "tests RSA modes", "private-rsa-der-file" }, { "dh", 0, arg_negative_flag, &dh_flag, "test dh", NULL }, + { "test-random", 0, arg_flag, &test_random_flag, + "test if there is a random device", NULL }, { "version", 0, arg_flag, &version_flag, "print version", NULL }, { "help", 0, arg_flag, &help_flag, @@ -191,6 +194,8 @@ main(int argc, char **argv) if (RAND_status() != 1) errx(77, "no functional random device, can't execute tests"); + if (test_random_flag) + exit(0); if (rsa_flag && have_rsa) { unsigned char buf[1024 * 4];