aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorlloyd <[email protected]>2006-07-01 23:17:47 +0000
committerlloyd <[email protected]>2006-07-01 23:17:47 +0000
commit984d1c480e724ffba5a5aa1f09980016bb9b03ca (patch)
tree4a71e6678ec7e235e9f1118204d07c48b32c0977 /src
parent6cf2f6d9554f724d0e8afc0020424950b8452d98 (diff)
Fix config handling (stupid mismatch was causing the getter for the
config options to always fail). Move the default config stuff from libstate to the config object.
Diffstat (limited to 'src')
-rw-r--r--src/config.cpp2
-rw-r--r--src/init_def.cpp6
-rw-r--r--src/policy.cpp11
3 files changed, 8 insertions, 11 deletions
diff --git a/src/config.cpp b/src/config.cpp
index 819bc61f5..2e0a6609d 100644
--- a/src/config.cpp
+++ b/src/config.cpp
@@ -78,7 +78,7 @@ std::string Config::deref_alias(const std::string& key) const
*************************************************/
std::string Config::option(const std::string& key) const
{
- return get("option", key);
+ return get("conf", key);
}
/*************************************************
diff --git a/src/init_def.cpp b/src/init_def.cpp
index 26e759120..2edd43b97 100644
--- a/src/init_def.cpp
+++ b/src/init_def.cpp
@@ -50,13 +50,11 @@ void initialize(const std::string& arg_string)
}
set_global_state(new Library_State(mutex_factory));
- global_state().set_default_policy();
-
- global_state().load(modules);
-
+ global_state().config().load_defaults();
if(args.config_file() != "")
global_config().load_inifile(args.config_file());
+ global_state().load(modules);
global_state().set_transcoder(new Default_Charset_Transcoder);
global_state().set_prng(new ANSI_X931_RNG);
diff --git a/src/policy.cpp b/src/policy.cpp
index e4fa78edf..2a5329e89 100644
--- a/src/policy.cpp
+++ b/src/policy.cpp
@@ -3,7 +3,6 @@
* (C) 1999-2006 The Botan Project *
*************************************************/
-#include <botan/libstate.h>
#include <botan/config.h>
namespace Botan {
@@ -363,12 +362,12 @@ void set_default_dl_groups(Config& config)
/*************************************************
* Set the default policy *
*************************************************/
-void Library_State::set_default_policy()
+void Config::load_defaults()
{
- set_default_config(config());
- set_default_aliases(config());
- set_default_oids(config());
- set_default_dl_groups(config());
+ set_default_config(*this);
+ set_default_aliases(*this);
+ set_default_oids(*this);
+ set_default_dl_groups(*this);
}
}