aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pubkey/pkcs8.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-11-02 15:05:46 -0400
committerJack Lloyd <[email protected]>2016-11-03 11:57:10 -0400
commit8d50c82b43b34b70d19b0faaeab6b37f2eae066c (patch)
tree9cb7478fb7c37c66e140bc09ca77bf0ede07cc76 /src/lib/pubkey/pkcs8.cpp
parentb1021ca76bb3c47b1b520421ccece38d772e5907 (diff)
Remove automatic self-testing of public and private keys
Rarely expected and often causes performance problems, especially for private keys. Instead applications should call check_key explicitly to validate keys when necessary. Note this removal doesn't apply to tests like ECDH on-the-curve tests, where a check on the public key is required for security of our own key. Updates most APIs to remove RNG calls, where they are no longer required. Exception is PKCS8 interface, pending further work there (see GH #685) it just ignores the RNG argument now.
Diffstat (limited to 'src/lib/pubkey/pkcs8.cpp')
-rw-r--r--src/lib/pubkey/pkcs8.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/pubkey/pkcs8.cpp b/src/lib/pubkey/pkcs8.cpp
index 26cafdc4f..f74eb4387 100644
--- a/src/lib/pubkey/pkcs8.cpp
+++ b/src/lib/pubkey/pkcs8.cpp
@@ -215,7 +215,7 @@ namespace {
* Extract a private key (encrypted/unencrypted) and return it
*/
Private_Key* load_key(DataSource& source,
- RandomNumberGenerator& rng,
+ RandomNumberGenerator& /*rng*/,
std::function<std::string ()> get_pass,
bool is_encrypted)
{
@@ -227,7 +227,7 @@ Private_Key* load_key(DataSource& source,
throw PKCS8_Exception("Unknown algorithm OID: " +
alg_id.oid.as_string());
- return load_private_key(alg_id, pkcs8_key, rng).release();
+ return load_private_key(alg_id, pkcs8_key).release();
}
}