aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
authorlloyd <[email protected]>2014-02-08 16:01:49 +0000
committerlloyd <[email protected]>2014-02-08 16:01:49 +0000
commit93c361028df3e33b9f6195f7d4b9ffcf47a7fa2c (patch)
tree3fdc838b34dc937ef280899f89aa10a47e005f30 /src/tests
parent7def8d303e3cf0f1a27ee8ebcb8ae5137261a361 (diff)
Fix minimized builds. Patch by Markus Wanner sent to botan-devel
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/nist_x509.cpp3
-rw-r--r--src/tests/test_ecdsa.cpp6
-rw-r--r--src/tests/unit_ecdh.cpp9
-rw-r--r--src/tests/unit_ecdsa.cpp13
-rw-r--r--src/tests/unit_x509.cpp2
5 files changed, 32 insertions, 1 deletions
diff --git a/src/tests/nist_x509.cpp b/src/tests/nist_x509.cpp
index f385ddddb..d6446639a 100644
--- a/src/tests/nist_x509.cpp
+++ b/src/tests/nist_x509.cpp
@@ -13,6 +13,7 @@ extensions which are not supported.
#include "tests.h"
+#if defined(BOTAN_HAS_X509_CERTIFICATES)
#include <botan/x509path.h>
#include <botan/init.h>
@@ -300,3 +301,5 @@ void populate_expected_results()
//expected_results[75] = ;
//expected_results[76] = ;
}
+
+#endif
diff --git a/src/tests/test_ecdsa.cpp b/src/tests/test_ecdsa.cpp
index 32747c7b0..5741580a4 100644
--- a/src/tests/test_ecdsa.cpp
+++ b/src/tests/test_ecdsa.cpp
@@ -1,6 +1,7 @@
#include "tests.h"
#include "test_pubkey.h"
+#if defined(BOTAN_HAS_ECDSA)
#include <botan/auto_rng.h>
#include <botan/pubkey.h>
#include <botan/ecdsa.h>
@@ -50,3 +51,8 @@ size_t test_ecdsa()
return fails;
}
+#else
+
+size_t test_ecdsa() { return 0; }
+
+#endif
diff --git a/src/tests/unit_ecdh.cpp b/src/tests/unit_ecdh.cpp
index 2c6857d3b..81e2e8fab 100644
--- a/src/tests/unit_ecdh.cpp
+++ b/src/tests/unit_ecdh.cpp
@@ -9,13 +9,16 @@
#include "tests.h"
+#if defined(BOTAN_HAS_ECDH)
#include <iostream>
#include <fstream>
#include <botan/auto_rng.h>
#include <botan/pubkey.h>
#include <botan/ecdh.h>
+#if defined(BOTAN_HAS_X509_CERTIFICATES)
#include <botan/x509self.h>
+#endif
#include <botan/der_enc.h>
using namespace Botan;
@@ -130,3 +133,9 @@ size_t test_ecdh_unit()
return fails;
}
+
+#else
+
+size_t test_ecdh_unit() { return 0; }
+
+#endif
diff --git a/src/tests/unit_ecdsa.cpp b/src/tests/unit_ecdsa.cpp
index 2953073d2..7a2e844e4 100644
--- a/src/tests/unit_ecdsa.cpp
+++ b/src/tests/unit_ecdsa.cpp
@@ -8,12 +8,15 @@
#include "tests.h"
+#if defined(BOTAN_HAS_ECDSA)
#include <botan/hex.h>
#include <botan/auto_rng.h>
#include <botan/pubkey.h>
#include <botan/ecdsa.h>
#include <botan/rsa.h>
+#if defined(BOTAN_HAS_X509_CERTIFICATES)
#include <botan/x509cert.h>
+#endif
#include <botan/oids.h>
#include <iostream>
@@ -94,6 +97,7 @@ size_t test_hash_larger_than_n(RandomNumberGenerator& rng)
return fails;
}
+#if defined(BOTAN_HAS_X509_CERTIFICATES)
size_t test_decode_ecdsa_X509()
{
X509_Certificate cert(ECC_TEST_DATA_DIR "/CSCA.CSCA.csca-germany.1.crt");
@@ -135,6 +139,7 @@ size_t test_decode_ver_link_SHA1()
CHECK_MESSAGE(ver_ec, "could not positively verify correct SHA1 link x509-ecdsa certificate");
return fails;
}
+#endif
size_t test_sign_then_ver(RandomNumberGenerator& rng)
{
@@ -471,9 +476,11 @@ size_t test_ecdsa_unit()
AutoSeeded_RNG rng;
fails += test_hash_larger_than_n(rng);
+#if defined(BOTAN_HAS_X509_CERTIFICATES)
fails += test_decode_ecdsa_X509();
fails += test_decode_ver_link_SHA256();
fails += test_decode_ver_link_SHA1();
+#endif
fails += test_sign_then_ver(rng);
fails += test_ec_sign(rng);
fails += test_create_pkcs8(rng);
@@ -486,3 +493,9 @@ size_t test_ecdsa_unit()
return fails;
}
+
+#else
+
+size_t test_ecdsa_unit() { return 0; }
+
+#endif
diff --git a/src/tests/unit_x509.cpp b/src/tests/unit_x509.cpp
index cd0beec5b..a6d6f98de 100644
--- a/src/tests/unit_x509.cpp
+++ b/src/tests/unit_x509.cpp
@@ -249,7 +249,7 @@ size_t test_x509()
#else
-size_t test_x590() { return 0; }
+size_t test_x509() { return 0; }
#endif