diff options
author | lloyd <[email protected]> | 2014-02-08 16:01:49 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2014-02-08 16:01:49 +0000 |
commit | 93c361028df3e33b9f6195f7d4b9ffcf47a7fa2c (patch) | |
tree | 3fdc838b34dc937ef280899f89aa10a47e005f30 | |
parent | 7def8d303e3cf0f1a27ee8ebcb8ae5137261a361 (diff) |
Fix minimized builds. Patch by Markus Wanner sent to botan-devel
-rw-r--r-- | doc/license.rst | 2 | ||||
-rw-r--r-- | doc/relnotes/1_11_8.rst | 3 | ||||
-rw-r--r-- | src/cmd/ca.cpp | 3 | ||||
-rw-r--r-- | src/cmd/cert_verify.cpp | 2 | ||||
-rw-r--r-- | src/cmd/main.cpp | 12 | ||||
-rw-r--r-- | src/cmd/ocsp.cpp | 2 | ||||
-rw-r--r-- | src/cmd/pkcs10.cpp | 2 | ||||
-rw-r--r-- | src/cmd/self_sig.cpp | 2 | ||||
-rw-r--r-- | src/cmd/tls_client.cpp | 4 | ||||
-rw-r--r-- | src/cmd/tls_server.cpp | 4 | ||||
-rw-r--r-- | src/cmd/tls_server_asio.cpp | 3 | ||||
-rw-r--r-- | src/cmd/x509print.cpp | 2 | ||||
-rw-r--r-- | src/tests/nist_x509.cpp | 3 | ||||
-rw-r--r-- | src/tests/test_ecdsa.cpp | 6 | ||||
-rw-r--r-- | src/tests/unit_ecdh.cpp | 9 | ||||
-rw-r--r-- | src/tests/unit_ecdsa.cpp | 13 | ||||
-rw-r--r-- | src/tests/unit_x509.cpp | 2 |
17 files changed, 67 insertions, 7 deletions
diff --git a/doc/license.rst b/doc/license.rst index e90337ff0..0084051c5 100644 --- a/doc/license.rst +++ b/doc/license.rst @@ -24,7 +24,7 @@ Botan (http://botan.randombit.net/) is distributed under these terms:: 2007 Patrick Sona 2010 Olivier de Gaalon 2012 Vojtech Kral - 2012 Markus Wanner + 2012-2014 Markus Wanner 2013 Joel Low All rights reserved. diff --git a/doc/relnotes/1_11_8.rst b/doc/relnotes/1_11_8.rst index a5bc38a05..9754e5f5e 100644 --- a/doc/relnotes/1_11_8.rst +++ b/doc/relnotes/1_11_8.rst @@ -4,6 +4,9 @@ Version 1.11.8, Not Yet Released * The `botan` command line application introduced in 1.11.7 is now installed along with the library. +* Fix compilation errors in the tests that occured with minimized + builds. Contributed by Markus Wanner. + * A bug in certificate path validation introduced in 1.11.6 which caused all CRL signature checks to fail has been corrected. diff --git a/src/cmd/ca.cpp b/src/cmd/ca.cpp index 17d930358..7dba4c7fe 100644 --- a/src/cmd/ca.cpp +++ b/src/cmd/ca.cpp @@ -1,5 +1,5 @@ - #include "apps.h" +#if defined(BOTAN_HAS_X509_CERTIFICATES) #include <botan/x509_ca.h> using namespace Botan; @@ -61,3 +61,4 @@ int ca_main(int argc, char* argv[]) } return 0; } +#endif diff --git a/src/cmd/cert_verify.cpp b/src/cmd/cert_verify.cpp index 154267fe1..daf7240f2 100644 --- a/src/cmd/cert_verify.cpp +++ b/src/cmd/cert_verify.cpp @@ -6,6 +6,7 @@ */ #include "apps.h" +#if defined(BOTAN_HAS_X509_CERTIFICATES) #include <botan/x509cert.h> #include <botan/x509path.h> #include <iostream> @@ -41,3 +42,4 @@ int cert_verify_main(int argc, char* argv[]) return 0; } +#endif diff --git a/src/cmd/main.cpp b/src/cmd/main.cpp index 5f6a0042f..6e4cb6702 100644 --- a/src/cmd/main.cpp +++ b/src/cmd/main.cpp @@ -37,7 +37,7 @@ int help(int , char* argv[]) return 1; } -int config_main(int argc, char* argv[]) +int config_main(int , char* argv[]) { return 1; } @@ -109,20 +109,24 @@ int main(int argc, char* argv[]) CALL_APP(base64); CALL_APP(bcrypt); CALL_APP(bzip); - CALL_APP(ca); CALL_APP(factor); CALL_APP(fpe); CALL_APP(hash); CALL_APP(keygen); CALL_APP(dsa_sign); CALL_APP(dsa_verify); - CALL_APP(pkcs10); CALL_APP(read_ssh); - CALL_APP(self_sig); +#if defined(BOTAN_HAS_TLS) CALL_APP(tls_client); CALL_APP(tls_server); CALL_APP(tls_server_asio); +#endif +#if defined(BOTAN_HAS_X509_CERTIFICATES) + CALL_APP(ca); + CALL_APP(pkcs10); + CALL_APP(self_sig); CALL_APP(x509); +#endif CALL_APP(speed); std::cout << "Unknown command " << cmd << "\n"; diff --git a/src/cmd/ocsp.cpp b/src/cmd/ocsp.cpp index 98324caff..a36dd73f6 100644 --- a/src/cmd/ocsp.cpp +++ b/src/cmd/ocsp.cpp @@ -1,4 +1,5 @@ #include "apps.h" +#if defined(BOTAN_HAS_X509_CERTIFICATES) #include <botan/x509cert.h> #include <botan/certstor.h> #include <botan/x509path.h> @@ -36,3 +37,4 @@ int ocsp_check_main(int argc, char* argv[]) return 1; } } +#endif diff --git a/src/cmd/pkcs10.cpp b/src/cmd/pkcs10.cpp index cb1d44436..2dad14575 100644 --- a/src/cmd/pkcs10.cpp +++ b/src/cmd/pkcs10.cpp @@ -1,4 +1,5 @@ #include "apps.h" +#if defined(BOTAN_HAS_X509_CERTIFICATES) #include <botan/x509self.h> #include <botan/rsa.h> #include <botan/dsa.h> @@ -46,3 +47,4 @@ int pkcs10_main(int argc, char* argv[]) } return 0; } +#endif diff --git a/src/cmd/self_sig.cpp b/src/cmd/self_sig.cpp index 7d05aed60..592a7f279 100644 --- a/src/cmd/self_sig.cpp +++ b/src/cmd/self_sig.cpp @@ -1,4 +1,5 @@ #include "apps.h" +#if defined(BOTAN_HAS_X509_CERTIFICATES) #include <botan/x509self.h> #include <botan/rsa.h> #include <botan/dsa.h> @@ -68,3 +69,4 @@ int self_sig_main(int argc, char* argv[]) return 0; } +#endif diff --git a/src/cmd/tls_client.cpp b/src/cmd/tls_client.cpp index 933d859eb..0c92d2cba 100644 --- a/src/cmd/tls_client.cpp +++ b/src/cmd/tls_client.cpp @@ -1,4 +1,6 @@ #include "apps.h" + +#if defined(BOTAN_HAS_TLS) #include <botan/tls_client.h> #include <botan/pkcs8.h> #include <botan/hex.h> @@ -261,3 +263,5 @@ int tls_client_main(int argc, char* argv[]) } return 0; } + +#endif diff --git a/src/cmd/tls_server.cpp b/src/cmd/tls_server.cpp index dac69e2c1..396497727 100644 --- a/src/cmd/tls_server.cpp +++ b/src/cmd/tls_server.cpp @@ -1,4 +1,6 @@ #include "apps.h" + +#if defined(BOTAN_HAS_TLS) #include <botan/tls_server.h> #include <botan/hex.h> @@ -260,3 +262,5 @@ int tls_server_main(int argc, char* argv[]) return 0; } + +#endif diff --git a/src/cmd/tls_server_asio.cpp b/src/cmd/tls_server_asio.cpp index f04e479ac..0e5af3dcc 100644 --- a/src/cmd/tls_server_asio.cpp +++ b/src/cmd/tls_server_asio.cpp @@ -1,4 +1,6 @@ #include "apps.h" + +#if defined(BOTAN_HAS_TLS) #include <iostream> #include <string> #include <vector> @@ -313,3 +315,4 @@ int tls_server_asio_main(int argc, char* argv[]) return 0; } +#endif diff --git a/src/cmd/x509print.cpp b/src/cmd/x509print.cpp index 935b50668..c2c63021c 100644 --- a/src/cmd/x509print.cpp +++ b/src/cmd/x509print.cpp @@ -1,4 +1,5 @@ #include "apps.h" +#if defined(BOTAN_HAS_X509_CERTIFICATES) #include <botan/x509cert.h> int x509_main(int argc, char* argv[]) @@ -15,3 +16,4 @@ int x509_main(int argc, char* argv[]) return 0; } +#endif 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 |