diff options
author | lloyd <[email protected]> | 2009-10-07 15:53:21 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2009-10-07 15:53:21 +0000 |
commit | 14781861531974130e48c996f2ac18e037c9bff6 (patch) | |
tree | 9aafcf1feb8fa7e362599e3b5a94bfe0d63014fb /src/libstate/libstate.cpp | |
parent | 56ebd3dfdab9e0f6b84773f7447ea0a0c52236e5 (diff) |
Run self tests at startup
Diffstat (limited to 'src/libstate/libstate.cpp')
-rw-r--r-- | src/libstate/libstate.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libstate/libstate.cpp b/src/libstate/libstate.cpp index 20e736868..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> @@ -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"); } /* |