Test for random device.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21044 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -117,6 +117,7 @@ static int help_flag;
|
|||||||
static char *id_flag;
|
static char *id_flag;
|
||||||
static char *rsa_flag;
|
static char *rsa_flag;
|
||||||
static int dh_flag = 1;
|
static int dh_flag = 1;
|
||||||
|
static int test_random_flag;
|
||||||
|
|
||||||
static struct getargs args[] = {
|
static struct getargs args[] = {
|
||||||
{ "id", 0, arg_string, &id_flag,
|
{ "id", 0, arg_string, &id_flag,
|
||||||
@@ -125,6 +126,8 @@ static struct getargs args[] = {
|
|||||||
"tests RSA modes", "private-rsa-der-file" },
|
"tests RSA modes", "private-rsa-der-file" },
|
||||||
{ "dh", 0, arg_negative_flag, &dh_flag,
|
{ "dh", 0, arg_negative_flag, &dh_flag,
|
||||||
"test dh", NULL },
|
"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,
|
{ "version", 0, arg_flag, &version_flag,
|
||||||
"print version", NULL },
|
"print version", NULL },
|
||||||
{ "help", 0, arg_flag, &help_flag,
|
{ "help", 0, arg_flag, &help_flag,
|
||||||
@@ -191,6 +194,8 @@ main(int argc, char **argv)
|
|||||||
|
|
||||||
if (RAND_status() != 1)
|
if (RAND_status() != 1)
|
||||||
errx(77, "no functional random device, can't execute tests");
|
errx(77, "no functional random device, can't execute tests");
|
||||||
|
if (test_random_flag)
|
||||||
|
exit(0);
|
||||||
|
|
||||||
if (rsa_flag && have_rsa) {
|
if (rsa_flag && have_rsa) {
|
||||||
unsigned char buf[1024 * 4];
|
unsigned char buf[1024 * 4];
|
||||||
|
Reference in New Issue
Block a user