diff options
Diffstat (limited to 'checks/x509.cpp')
-rw-r--r-- | checks/x509.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/checks/x509.cpp b/checks/x509.cpp index 459f3b62f..6a61ad361 100644 --- a/checks/x509.cpp +++ b/checks/x509.cpp @@ -69,11 +69,13 @@ u32bit check_against_copy(const Private_Key& orig) void do_x509_tests() { + RandomNumberGenerator& rng = global_state().prng_reference(); + std::cout << "Testing X.509 CA/CRL/cert/cert request: " << std::flush; /* Create the CA's key and self-signed cert */ std::cout << '.' << std::flush; - RSA_PrivateKey ca_key(1024, global_state().prng_reference()); + RSA_PrivateKey ca_key(1024, rng); std::cout << '.' << std::flush; X509_Certificate ca_cert = X509::create_self_signed_cert(ca_opts(), ca_key); @@ -81,15 +83,14 @@ void do_x509_tests() /* Create user #1's key and cert request */ std::cout << '.' << std::flush; - DSA_PrivateKey user1_key(DL_Group("dsa/jce/1024"), - global_state().prng_reference()); + DSA_PrivateKey user1_key(DL_Group("dsa/jce/1024"), rng); std::cout << '.' << std::flush; PKCS10_Request user1_req = X509::create_cert_req(req_opts1(), user1_key); /* Create user #2's key and cert request */ std::cout << '.' << std::flush; - RSA_PrivateKey user2_key(1024, global_state().prng_reference()); + RSA_PrivateKey user2_key(1024, rng); std::cout << '.' << std::flush; PKCS10_Request user2_req = X509::create_cert_req(req_opts2(), user2_key); @@ -101,11 +102,11 @@ void do_x509_tests() /* Sign the requests to create the certs */ std::cout << '.' << std::flush; X509_Certificate user1_cert = - ca.sign_request(user1_req, X509_Time("2008-01-01"), - X509_Time("2100-01-01")); + ca.sign_request(user1_req, rng, + X509_Time("2008-01-01"), X509_Time("2100-01-01")); std::cout << '.' << std::flush; - X509_Certificate user2_cert = ca.sign_request(user2_req, + X509_Certificate user2_cert = ca.sign_request(user2_req, rng, X509_Time("2008-01-01"), X509_Time("2100-01-01")); std::cout << '.' << std::flush; |