aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-09-28 22:56:05 +0000
committerlloyd <[email protected]>2008-09-28 22:56:05 +0000
commit499ec262fc895d68b7c98e534e99d908b63577b3 (patch)
treea08a6aa4967d90c4ce85f0849c378bba805bc07e /src
parent443ed32a366bbc01cc09b352020f01e08d580565 (diff)
Move startup selftest into module
Diffstat (limited to 'src')
-rw-r--r--src/libstate.cpp7
-rw-r--r--src/selftest/selftest.cpp (renamed from src/selftest.cpp)0
-rw-r--r--src/selftest/selftest.h20
3 files changed, 26 insertions, 1 deletions
diff --git a/src/libstate.cpp b/src/libstate.cpp
index 9fb2b186a..141e0d1ec 100644
--- a/src/libstate.cpp
+++ b/src/libstate.cpp
@@ -9,10 +9,13 @@
#include <botan/stl_util.h>
#include <botan/mutex.h>
#include <botan/charset.h>
-#include <botan/selftest.h>
#include <botan/lookup.h>
#include <algorithm>
+#if defined(BOTAN_HAS_SELFTEST)
+ #include <botan/selftest.h>
+#endif
+
namespace Botan {
/*************************************************
@@ -248,11 +251,13 @@ void Library_State::initialize(const InitializerOptions& args,
for(u32bit j = 0; j != mod_engines.size(); ++j)
engines.push_back(mod_engines[j]);
+#if defined(BOTAN_HAS_SELFTEST)
if(args.fips_mode() || args.self_test())
{
if(!passes_self_tests())
throw Self_Test_Failure("Initialization self-tests");
}
+#endif
}
/*************************************************
diff --git a/src/selftest.cpp b/src/selftest/selftest.cpp
index ca7000db8..ca7000db8 100644
--- a/src/selftest.cpp
+++ b/src/selftest/selftest.cpp
diff --git a/src/selftest/selftest.h b/src/selftest/selftest.h
new file mode 100644
index 000000000..ff011a32c
--- /dev/null
+++ b/src/selftest/selftest.h
@@ -0,0 +1,20 @@
+/*************************************************
+* Startup Self Test Header File *
+* (C) 1999-2007 Jack Lloyd *
+*************************************************/
+
+#ifndef BOTAN_SELF_TEST_H__
+#define BOTAN_SELF_TEST_H__
+
+#include <botan/base.h>
+
+namespace Botan {
+
+/*************************************************
+* Self Tests *
+*************************************************/
+BOTAN_DLL bool passes_self_tests();
+
+}
+
+#endif