aboutsummaryrefslogtreecommitdiffstats
path: root/src/pkcs8.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2006-07-01 21:09:54 +0000
committerlloyd <[email protected]>2006-07-01 21:09:54 +0000
commit6d3a4de1efcb6b04a1ab87037d487f979d7ca445 (patch)
tree02342b193a3808d2010b441480f65aa45a23dc92 /src/pkcs8.cpp
parent3d1d14cf405111e30643cf4c7674d441cc07a2e0 (diff)
Access the global configuration through an object reference instead
of stand-alone functions. Store the configuration in a distinct object, rather than just a map inside the library state.
Diffstat (limited to 'src/pkcs8.cpp')
-rw-r--r--src/pkcs8.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/pkcs8.cpp b/src/pkcs8.cpp
index 32408eb43..8be9c3353 100644
--- a/src/pkcs8.cpp
+++ b/src/pkcs8.cpp
@@ -82,12 +82,14 @@ SecureVector<byte> PKCS8_decode(DataSource& source, const User_Interface& ui,
if(!is_encrypted)
key = key_data;
- const u32bit max_tries = Config::get_u32bit("base/pkcs8_tries");
+ const u32bit MAX_TRIES =
+ global_config().option_as_u32bit("base/pkcs8_tries");
+
u32bit tries = 0;
while(true)
{
try {
- if(max_tries && tries >= max_tries)
+ if(MAX_TRIES && tries >= MAX_TRIES)
break;
if(is_encrypted)
@@ -167,7 +169,7 @@ void encrypt_key(const PKCS8_PrivateKey& key, Pipe& pipe,
const std::string& pass, const std::string& pbe_algo,
X509_Encoding encoding)
{
- const std::string DEFAULT_PBE = Config::get_string("base/default_pbe");
+ const std::string DEFAULT_PBE = global_config().option("base/default_pbe");
Pipe raw_key;
raw_key.start_msg();