aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstate/libstate.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2009-10-13 16:01:57 +0000
committerlloyd <[email protected]>2009-10-13 16:01:57 +0000
commit9268a0455a07d31a66364aa5b7594bd75250b466 (patch)
tree63b683ca95448ce083981d002d870a569c2c98a1 /src/libstate/libstate.cpp
parent3bc2bb0461b1b40466821daf0061eab769621eab (diff)
parent5318b944acc2a5fa6d445784c710f37c793ff90b (diff)
propagate from branch 'net.randombit.botan.1_8' (head c5ae189464f6ef16e3ce73ea7c563412460d76a3)
to branch 'net.randombit.botan' (head e2b95b6ad31c7539cf9ac0ebddb1d80bf63b5b21)
Diffstat (limited to 'src/libstate/libstate.cpp')
-rw-r--r--src/libstate/libstate.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libstate/libstate.cpp b/src/libstate/libstate.cpp
index 3275c6493..ca454458b 100644
--- a/src/libstate/libstate.cpp
+++ b/src/libstate/libstate.cpp
@@ -7,6 +7,7 @@
#include <botan/libstate.h>
#include <botan/init.h>
+#include <botan/selftest.h>
#include <botan/engine.h>
#include <botan/stl_util.h>
#include <botan/mutex.h>
@@ -212,7 +213,7 @@ std::string Library_State::deref_alias(const std::string& key) const
/*
* Set/Add an option
*/
-void Library_State::set_option(const std::string key,
+void Library_State::set_option(const std::string& key,
const std::string& value)
{
set("conf", key, value);
@@ -302,6 +303,9 @@ void Library_State::initialize(bool thread_safe)
engines.push_back(new Default_Engine);
m_algorithm_factory = new Algorithm_Factory(engines, *mutex_factory);
+
+ if(!passes_self_tests(algorithm_factory()))
+ throw Self_Test_Failure("Startup self tests failed");
}
/*