hcrypto/test_rand.c: Add w32crypto method

Also make it non-fatal to request a method that is unsupported.  This
makes it possible to only test methods that we are compiling.
This commit is contained in:
Asanka Herath
2010-06-18 16:13:59 -04:00
parent f807cb8152
commit 7af1f40258

View File

@@ -126,9 +126,13 @@ main(int argc, char **argv)
#ifndef NO_RAND_EGD_METHOD #ifndef NO_RAND_EGD_METHOD
else if (strcasecmp(rand_method, "egd") == 0) else if (strcasecmp(rand_method, "egd") == 0)
RAND_set_rand_method(RAND_egd_method()); RAND_set_rand_method(RAND_egd_method());
#endif
#ifdef WIN32
else if (strcasecmp(rand_method, "w32crypto") == 0)
RAND_set_rand_method(RAND_w32crypto_method());
#endif #endif
else else
errx(1, "unknown method %s", rand_method); errx(0, "unknown method %s", rand_method);
} }
if (RAND_file_name(path, sizeof(path)) == NULL) if (RAND_file_name(path, sizeof(path)) == NULL)