aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
authorlloyd <[email protected]>2014-01-10 23:07:16 +0000
committerlloyd <[email protected]>2014-01-10 23:07:16 +0000
commitad6555f522ae16f6284e8dafa02f630b88bcf289 (patch)
treebd63c51dbeab75eb0f90c72589bc922141237056 /src/tests
parent6894dca64c04936d07048c0e8cbf7e25858548c3 (diff)
Split up docs into the reference manual, the website, and everything else.
Add `website` target to makefile. Some progress towards fixing minimized builds. TLS now hard requires ECDSA and GCM since otherwise a minimized build has only insecure options. Remove boost_thread dependency in command line tool
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/test_aead.cpp (renamed from src/tests/kat_aead.cpp)0
-rw-r--r--src/tests/test_bigint.cpp (renamed from src/tests/kat_bigint.cpp)0
-rw-r--r--src/tests/test_block.cpp (renamed from src/tests/kat_block.cpp)0
-rw-r--r--src/tests/test_cryptobox.cpp (renamed from src/tests/kat_cryptobox.cpp)0
-rw-r--r--src/tests/test_cvc.cpp (renamed from src/tests/kat_cvc.cpp)0
-rw-r--r--src/tests/test_dh.cpp (renamed from src/tests/kat_dh.cpp)0
-rw-r--r--src/tests/test_dlies.cpp (renamed from src/tests/kat_dlies.cpp)0
-rw-r--r--src/tests/test_dsa.cpp (renamed from src/tests/kat_dsa.cpp)0
-rw-r--r--src/tests/test_ecdsa.cpp (renamed from src/tests/kat_ecdsa.cpp)0
-rw-r--r--src/tests/test_elg.cpp (renamed from src/tests/kat_elg.cpp)11
-rw-r--r--src/tests/test_gost_3410.cpp (renamed from src/tests/kat_gost.cpp)0
-rw-r--r--src/tests/test_hash.cpp (renamed from src/tests/kat_hash.cpp)0
-rw-r--r--src/tests/test_hkdf.cpp (renamed from src/tests/kat_hkdf.cpp)8
-rw-r--r--src/tests/test_kdf.cpp (renamed from src/tests/kat_kdf.cpp)0
-rw-r--r--src/tests/test_keywrap.cpp (renamed from src/tests/kat_keywrap.cpp)0
-rw-r--r--src/tests/test_mac.cpp (renamed from src/tests/kat_mac.cpp)0
-rw-r--r--src/tests/test_modes.cpp (renamed from src/tests/kat_modes.cpp)0
-rw-r--r--src/tests/test_nr.cpp (renamed from src/tests/kat_nr.cpp)12
-rw-r--r--src/tests/test_ocb.cpp (renamed from src/tests/kat_ocb.cpp)12
-rw-r--r--src/tests/test_passhash.cpp (renamed from src/tests/kat_passhash.cpp)0
-rw-r--r--src/tests/test_pbkdf.cpp (renamed from src/tests/kat_pbkdf.cpp)0
-rw-r--r--src/tests/test_pubkey.cpp (renamed from src/tests/pubkey.cpp)0
-rw-r--r--src/tests/test_rng.cpp (renamed from src/tests/kat_rng.cpp)0
-rw-r--r--src/tests/test_rsa.cpp (renamed from src/tests/kat_rsa.cpp)0
-rw-r--r--src/tests/test_rw.cpp (renamed from src/tests/kat_rw.cpp)0
-rw-r--r--src/tests/test_stream.cpp (renamed from src/tests/kat_stream.cpp)0
-rw-r--r--src/tests/test_transform.cpp (renamed from src/tests/kat_transform.cpp)1
-rw-r--r--src/tests/test_tss.cpp (renamed from src/tests/kat_tss.cpp)12
28 files changed, 48 insertions, 8 deletions
diff --git a/src/tests/kat_aead.cpp b/src/tests/test_aead.cpp
index 8b46e9177..8b46e9177 100644
--- a/src/tests/kat_aead.cpp
+++ b/src/tests/test_aead.cpp
diff --git a/src/tests/kat_bigint.cpp b/src/tests/test_bigint.cpp
index b71e0af2d..b71e0af2d 100644
--- a/src/tests/kat_bigint.cpp
+++ b/src/tests/test_bigint.cpp
diff --git a/src/tests/kat_block.cpp b/src/tests/test_block.cpp
index 2ef5f8979..2ef5f8979 100644
--- a/src/tests/kat_block.cpp
+++ b/src/tests/test_block.cpp
diff --git a/src/tests/kat_cryptobox.cpp b/src/tests/test_cryptobox.cpp
index 9a53da74c..9a53da74c 100644
--- a/src/tests/kat_cryptobox.cpp
+++ b/src/tests/test_cryptobox.cpp
diff --git a/src/tests/kat_cvc.cpp b/src/tests/test_cvc.cpp
index 9519f0926..9519f0926 100644
--- a/src/tests/kat_cvc.cpp
+++ b/src/tests/test_cvc.cpp
diff --git a/src/tests/kat_dh.cpp b/src/tests/test_dh.cpp
index 890bae632..890bae632 100644
--- a/src/tests/kat_dh.cpp
+++ b/src/tests/test_dh.cpp
diff --git a/src/tests/kat_dlies.cpp b/src/tests/test_dlies.cpp
index 05fdb863f..05fdb863f 100644
--- a/src/tests/kat_dlies.cpp
+++ b/src/tests/test_dlies.cpp
diff --git a/src/tests/kat_dsa.cpp b/src/tests/test_dsa.cpp
index 19c557823..19c557823 100644
--- a/src/tests/kat_dsa.cpp
+++ b/src/tests/test_dsa.cpp
diff --git a/src/tests/kat_ecdsa.cpp b/src/tests/test_ecdsa.cpp
index 32747c7b0..32747c7b0 100644
--- a/src/tests/kat_ecdsa.cpp
+++ b/src/tests/test_ecdsa.cpp
diff --git a/src/tests/kat_elg.cpp b/src/tests/test_elg.cpp
index d94d2813e..332e5ae0e 100644
--- a/src/tests/kat_elg.cpp
+++ b/src/tests/test_elg.cpp
@@ -3,11 +3,15 @@
#include <botan/auto_rng.h>
#include <botan/pubkey.h>
-#include <botan/elgamal.h>
+#include <botan/dl_group.h>
#include <botan/hex.h>
#include <iostream>
#include <fstream>
+#if defined(BOTAN_HAS_ELGAMAL)
+ #include <botan/elgamal.h>
+#endif
+
using namespace Botan;
namespace {
@@ -27,6 +31,7 @@ size_t elgamal_kat(const std::string& p,
const BigInt x_bn = BigInt(x);
DL_Group group(p_bn, g_bn);
+#if defined(BOTAN_HAS_ELGAMAL)
ElGamal_PrivateKey privkey(rng, group, x_bn);
ElGamal_PublicKey pubkey = privkey;
@@ -38,6 +43,9 @@ size_t elgamal_kat(const std::string& p,
PK_Decryptor_EME dec(privkey, padding);
return validate_encryption(enc, dec, "ElGamal/" + padding, msg, nonce, ciphertext);
+#else
+ return 1;
+#endif
}
}
@@ -57,4 +65,3 @@ size_t test_elgamal()
return fails;
}
-
diff --git a/src/tests/kat_gost.cpp b/src/tests/test_gost_3410.cpp
index 4cd43a027..4cd43a027 100644
--- a/src/tests/kat_gost.cpp
+++ b/src/tests/test_gost_3410.cpp
diff --git a/src/tests/kat_hash.cpp b/src/tests/test_hash.cpp
index eaa3ff3b5..eaa3ff3b5 100644
--- a/src/tests/kat_hash.cpp
+++ b/src/tests/test_hash.cpp
diff --git a/src/tests/kat_hkdf.cpp b/src/tests/test_hkdf.cpp
index 25ad4567f..842123968 100644
--- a/src/tests/kat_hkdf.cpp
+++ b/src/tests/test_hkdf.cpp
@@ -1,7 +1,9 @@
#include "tests.h"
#include <botan/libstate.h>
-#include <botan/hkdf.h>
+#if defined(BOTAN_HAS_HKDF)
+ #include <botan/hkdf.h>
+#endif
#include <botan/hex.h>
#include <iostream>
#include <fstream>
@@ -25,6 +27,7 @@ secure_vector<byte> hkdf(const std::string& hkdf_algo,
if(!mac_proto)
throw std::invalid_argument("Bad HKDF hash '" + algo + "'");
+#if defined(BOTAN_HAS_HKDF)
HKDF hkdf(mac_proto->clone(), mac_proto->clone());
hkdf.start_extract(&salt[0], salt.size());
@@ -34,6 +37,9 @@ secure_vector<byte> hkdf(const std::string& hkdf_algo,
secure_vector<byte> key(L);
hkdf.expand(&key[0], key.size(), &info[0], info.size());
return key;
+#else
+ return "";
+#endif
}
size_t hkdf_test(const std::string& algo,
diff --git a/src/tests/kat_kdf.cpp b/src/tests/test_kdf.cpp
index 0fc627673..0fc627673 100644
--- a/src/tests/kat_kdf.cpp
+++ b/src/tests/test_kdf.cpp
diff --git a/src/tests/kat_keywrap.cpp b/src/tests/test_keywrap.cpp
index a7dcbfe75..a7dcbfe75 100644
--- a/src/tests/kat_keywrap.cpp
+++ b/src/tests/test_keywrap.cpp
diff --git a/src/tests/kat_mac.cpp b/src/tests/test_mac.cpp
index 2b07497aa..2b07497aa 100644
--- a/src/tests/kat_mac.cpp
+++ b/src/tests/test_mac.cpp
diff --git a/src/tests/kat_modes.cpp b/src/tests/test_modes.cpp
index 1c3dad934..1c3dad934 100644
--- a/src/tests/kat_modes.cpp
+++ b/src/tests/test_modes.cpp
diff --git a/src/tests/kat_nr.cpp b/src/tests/test_nr.cpp
index 7946ed324..982e38bc2 100644
--- a/src/tests/kat_nr.cpp
+++ b/src/tests/test_nr.cpp
@@ -3,7 +3,12 @@
#include <botan/auto_rng.h>
#include <botan/pubkey.h>
-#include <botan/nr.h>
+#include <botan/dl_group.h>
+
+#if defined(BOTAN_HAS_NYBERG_RUEPPEL)
+ #include <botan/nr.h>
+#endif
+
#include <botan/hex.h>
#include <iostream>
#include <fstream>
@@ -26,6 +31,8 @@ size_t nr_sig_kat(const std::string& p,
BigInt p_bn(p), q_bn(q), g_bn(g), x_bn(x);
DL_Group group(p_bn, q_bn, g_bn);
+
+#if defined(BOTAN_HAS_NYBERG_RUEPPEL)
NR_PrivateKey privkey(rng, group, x_bn);
NR_PublicKey pubkey = privkey;
@@ -36,6 +43,9 @@ size_t nr_sig_kat(const std::string& p,
PK_Signer sign(privkey, padding);
return validate_signature(verify, sign, "nr/" + hash, msg, rng, nonce, signature);
+#else
+ return 1;
+#endif
}
}
diff --git a/src/tests/kat_ocb.cpp b/src/tests/test_ocb.cpp
index b2bd296e0..b76e26189 100644
--- a/src/tests/kat_ocb.cpp
+++ b/src/tests/test_ocb.cpp
@@ -1,12 +1,12 @@
#include "tests.h"
+#include <iostream>
+#if defined(BOTAN_HAS_OCB)
#include <botan/ocb.h>
#include <botan/hex.h>
#include <botan/sha2_32.h>
#include <botan/aes.h>
-#include <iostream>
-//#include <botan/selftest.h>
using namespace Botan;
@@ -139,4 +139,12 @@ size_t test_ocb()
return fails;
}
+#else
+
+size_t test_ocb()
+ {
+ std::cout << "OCB disabled in build\n";
+ return 0;
+ }
+#endif
diff --git a/src/tests/kat_passhash.cpp b/src/tests/test_passhash.cpp
index 6f66743c5..6f66743c5 100644
--- a/src/tests/kat_passhash.cpp
+++ b/src/tests/test_passhash.cpp
diff --git a/src/tests/kat_pbkdf.cpp b/src/tests/test_pbkdf.cpp
index 5d97bf0e9..5d97bf0e9 100644
--- a/src/tests/kat_pbkdf.cpp
+++ b/src/tests/test_pbkdf.cpp
diff --git a/src/tests/pubkey.cpp b/src/tests/test_pubkey.cpp
index 85e2924be..85e2924be 100644
--- a/src/tests/pubkey.cpp
+++ b/src/tests/test_pubkey.cpp
diff --git a/src/tests/kat_rng.cpp b/src/tests/test_rng.cpp
index 88e21f62c..88e21f62c 100644
--- a/src/tests/kat_rng.cpp
+++ b/src/tests/test_rng.cpp
diff --git a/src/tests/kat_rsa.cpp b/src/tests/test_rsa.cpp
index 28320ddb0..28320ddb0 100644
--- a/src/tests/kat_rsa.cpp
+++ b/src/tests/test_rsa.cpp
diff --git a/src/tests/kat_rw.cpp b/src/tests/test_rw.cpp
index 4d3bc2d5b..4d3bc2d5b 100644
--- a/src/tests/kat_rw.cpp
+++ b/src/tests/test_rw.cpp
diff --git a/src/tests/kat_stream.cpp b/src/tests/test_stream.cpp
index 707f5d62d..707f5d62d 100644
--- a/src/tests/kat_stream.cpp
+++ b/src/tests/test_stream.cpp
diff --git a/src/tests/kat_transform.cpp b/src/tests/test_transform.cpp
index e53b5b800..5d3c4dc3f 100644
--- a/src/tests/kat_transform.cpp
+++ b/src/tests/test_transform.cpp
@@ -2,7 +2,6 @@
#include <botan/botan.h>
#include <botan/transform.h>
-#include <botan/threefish.h>
#include <botan/benchmark.h>
#include <botan/hex.h>
#include <iostream>
diff --git a/src/tests/kat_tss.cpp b/src/tests/test_tss.cpp
index f9caddb6f..38d9dfbfa 100644
--- a/src/tests/kat_tss.cpp
+++ b/src/tests/test_tss.cpp
@@ -7,10 +7,13 @@
#include "tests.h"
#include <botan/auto_rng.h>
#include <botan/hex.h>
-#include <botan/tss.h>
#include <iostream>
#include <stdio.h>
+#if defined(BOTAN_HAS_THRESHOLD_SECRET_SHARING)
+
+#include <botan/tss.h>
+
namespace {
void print(const Botan::secure_vector<Botan::byte>& r)
@@ -59,3 +62,10 @@ size_t test_tss()
return fails;
}
+#else
+size_t test_tss()
+ {
+ std::cout << "Skipping TSS tests\n";
+ return 1;
+ }
+#endif