aboutsummaryrefslogtreecommitdiffstats
path: root/checks
diff options
context:
space:
mode:
Diffstat (limited to 'checks')
-rw-r--r--checks/pk.cpp8
-rw-r--r--checks/pk_bench.cpp4
-rw-r--r--checks/x509.cpp6
3 files changed, 12 insertions, 6 deletions
diff --git a/checks/pk.cpp b/checks/pk.cpp
index 12b675430..8498c8291 100644
--- a/checks/pk.cpp
+++ b/checks/pk.cpp
@@ -151,7 +151,9 @@ u32bit validate_rsa_enc_pkcs8(const std::string& algo,
DataSource_Memory keysource(reinterpret_cast<const byte*>(str[0].c_str()),
str[0].length());
- Private_Key* privkey = PKCS8::load_key(keysource, pass);
+ Private_Key* privkey = PKCS8::load_key(keysource,
+ global_state().prng_reference(),
+ pass);
RSA_PrivateKey* rsapriv = dynamic_cast<RSA_PrivateKey*>(privkey);
if(!rsapriv)
@@ -346,7 +348,9 @@ u32bit validate_dsa_sig(const std::string& algo,
DataSource_Memory keysource(reinterpret_cast<const byte*>(str[0].c_str()),
str[0].length());
- Private_Key* privkey = PKCS8::load_key(keysource, pass);
+ Private_Key* privkey = PKCS8::load_key(keysource,
+ global_state().prng_reference(),
+ pass);
DSA_PrivateKey* dsapriv = dynamic_cast<DSA_PrivateKey*>(privkey);
if(!dsapriv)
diff --git a/checks/pk_bench.cpp b/checks/pk_bench.cpp
index f3f873467..d00130ebd 100644
--- a/checks/pk_bench.cpp
+++ b/checks/pk_bench.cpp
@@ -65,7 +65,7 @@ void bench_pk(const std::string& algo, bool html, double seconds)
const std::string file = "checks/keys/rsa" + len_str + ".pem";
std::auto_ptr<RSA_PrivateKey> key(
- dynamic_cast<RSA_PrivateKey*>(PKCS8::load_key(file))
+ dynamic_cast<RSA_PrivateKey*>(PKCS8::load_key(file, global_state().prng_reference()))
);
if(key.get() == 0)
@@ -165,7 +165,7 @@ void bench_pk(const std::string& algo, bool html, double seconds)
const std::string file = "checks/keys/rw" + len_str + ".pem";
RW_PrivateKey* key =
- dynamic_cast<RW_PrivateKey*>(PKCS8::load_key(file));
+ dynamic_cast<RW_PrivateKey*>(PKCS8::load_key(file, global_state().prng_reference()));
bench_ver(get_pk_signer(*key, "EMSA2(SHA-1)"),
get_pk_verifier(*key, "EMSA2(SHA-1)"),
diff --git a/checks/x509.cpp b/checks/x509.cpp
index 40966bf01..d1aebe059 100644
--- a/checks/x509.cpp
+++ b/checks/x509.cpp
@@ -47,12 +47,14 @@ u64bit key_id(const Public_Key* key)
u32bit check_against_copy(const Private_Key& orig)
{
- Private_Key* copy_priv = PKCS8::copy_key(orig);
+ Private_Key* copy_priv = PKCS8::copy_key(orig, global_state().prng_reference());
Public_Key* copy_pub = X509::copy_key(orig);
const std::string passphrase= "I need work! -Mr. T"; // Me too...
DataSource_Memory enc_source(PKCS8::PEM_encode(orig, passphrase));
- Private_Key* copy_priv_enc = PKCS8::load_key(enc_source, passphrase);
+ Private_Key* copy_priv_enc = PKCS8::load_key(enc_source,
+ global_state().prng_reference(),
+ passphrase);
u64bit orig_id = key_id(&orig);
u64bit pub_id = key_id(copy_pub);