diff options
author | lloyd <[email protected]> | 2007-10-15 13:48:20 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2007-10-15 13:48:20 +0000 |
commit | 24519471c61aa88c38c29475901e56616b34fe44 (patch) | |
tree | 71c95bec42cdbd7a8502d0b214e2eb4a0df317f1 /src | |
parent | 83784f32b65b822636355eafa0ba744456cdc753 (diff) |
Move the self tests from LibraryInitializer::initialize to
Library_State::initialize: now the LibraryInitializer is just a simple
wrapper to create/destroy the state with no other operations.
Diffstat (limited to 'src')
-rw-r--r-- | src/init_def.cpp | 7 | ||||
-rw-r--r-- | src/libstate.cpp | 7 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/init_def.cpp b/src/init_def.cpp index abfbe646e..f77b65453 100644 --- a/src/init_def.cpp +++ b/src/init_def.cpp @@ -6,7 +6,6 @@ #include <botan/init.h> #include <botan/libstate.h> #include <botan/modules.h> -#include <botan/fips140.h> namespace Botan { @@ -21,12 +20,6 @@ void LibraryInitializer::initialize(const InitializerOptions& args, set_global_state(new Library_State); global_state().initialize(args, modules); - - if(args.fips_mode() || args.self_test()) - { - if(!FIPS140::passes_self_tests()) - throw Self_Test_Failure("FIPS-140 startup tests"); - } } catch(...) { diff --git a/src/libstate.cpp b/src/libstate.cpp index 04a5760cb..9dda38b1f 100644 --- a/src/libstate.cpp +++ b/src/libstate.cpp @@ -13,6 +13,7 @@ #include <botan/timers.h> #include <botan/charset.h> #include <botan/x931_rng.h> +#include <botan/fips140.h> #include <algorithm> namespace Botan { @@ -378,6 +379,12 @@ void Library_State::initialize(const InitializerOptions& args, if(!rng_is_seeded()) throw PRNG_Unseeded("Unable to collect sufficient entropy"); } + + if(args.fips_mode() || args.self_test()) + { + if(!FIPS140::passes_self_tests()) + throw Self_Test_Failure("FIPS-140 startup tests"); + } } /************************************************* |