hcrypto/test_rand.c: Add w32crypto method
authorAsanka Herath <asanka@secure-endpoints.com>
Fri, 18 Jun 2010 20:13:59 +0000 (16:13 -0400)
committerAsanka Herath <asanka@secure-endpoints.com>
Fri, 20 Aug 2010 17:09:44 +0000 (13:09 -0400)
Also make it non-fatal to request a method that is unsupported.  This
makes it possible to only test methods that we are compiling.

lib/hcrypto/test_rand.c

index aec538f4d8fe7b0dfdff8865c5786bdd7e8f56c0..dc98218d9ac6e4d486f0e903e82e5232554b13ee 100644 (file)
@@ -126,9 +126,13 @@ main(int argc, char **argv)
 #ifndef NO_RAND_EGD_METHOD
        else if (strcasecmp(rand_method, "egd") == 0)
            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
        else
-           errx(1, "unknown method %s", rand_method);
+           errx(0, "unknown method %s", rand_method);
     }
        
     if (RAND_file_name(path, sizeof(path)) == NULL)