diff options
author | Jack Lloyd <[email protected]> | 2017-12-20 10:03:11 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-12-20 10:03:11 -0500 |
commit | 646ed79e273f8b51dd2071ac045522f3e0736a40 (patch) | |
tree | 2048ed214ce62826ab7f9b6372dfb00d394c3ed0 /src | |
parent | 3be143169362a3da6d997dcc0ca2cdd61dcbec93 (diff) |
Avoid test failures when PKCSv1.5 signatures are disabled in build
Diffstat (limited to 'src')
-rw-r--r-- | src/tests/test_name_constraint.cpp | 2 | ||||
-rw-r--r-- | src/tests/test_ocsp.cpp | 2 | ||||
-rw-r--r-- | src/tests/test_x509_path.cpp | 7 | ||||
-rw-r--r-- | src/tests/unit_x509.cpp | 16 |
4 files changed, 17 insertions, 10 deletions
diff --git a/src/tests/test_name_constraint.cpp b/src/tests/test_name_constraint.cpp index 93fb66a6b..3d01d84c7 100644 --- a/src/tests/test_name_constraint.cpp +++ b/src/tests/test_name_constraint.cpp @@ -17,7 +17,7 @@ namespace Botan_Tests { namespace { -#if defined(BOTAN_HAS_X509_CERTIFICATES) && defined(BOTAN_HAS_RSA) +#if defined(BOTAN_HAS_X509_CERTIFICATES) && defined(BOTAN_HAS_RSA) && defined(BOTAN_HAS_EMSA_PKCS1) class Name_Constraint_Tests final : public Test { diff --git a/src/tests/test_ocsp.cpp b/src/tests/test_ocsp.cpp index ef4c5634b..2839d9ef5 100644 --- a/src/tests/test_ocsp.cpp +++ b/src/tests/test_ocsp.cpp @@ -16,7 +16,7 @@ namespace Botan_Tests { -#if defined(BOTAN_HAS_OCSP) && defined(BOTAN_HAS_RSA) +#if defined(BOTAN_HAS_OCSP) && defined(BOTAN_HAS_RSA) && defined(BOTAN_HAS_EMSA_PKCS1) class OCSP_Tests final : public Test { diff --git a/src/tests/test_x509_path.cpp b/src/tests/test_x509_path.cpp index 49f937475..912610ab1 100644 --- a/src/tests/test_x509_path.cpp +++ b/src/tests/test_x509_path.cpp @@ -28,7 +28,7 @@ namespace Botan_Tests { namespace { -#if defined(BOTAN_HAS_X509_CERTIFICATES) && defined(BOTAN_HAS_RSA) && defined(BOTAN_TARGET_OS_HAS_FILESYSTEM) +#if defined(BOTAN_HAS_X509_CERTIFICATES) && defined(BOTAN_HAS_RSA) && defined(BOTAN_HAS_EMSA_PKCS1) && defined(BOTAN_TARGET_OS_HAS_FILESYSTEM) std::map<std::string, std::string> read_results(const std::string& results_file, const char delim = ':') { @@ -454,9 +454,6 @@ std::vector<Test::Result> PSS_Path_Validation_Tests::run() BOTAN_REGISTER_TEST("x509_path_rsa_pss", PSS_Path_Validation_Tests); -// The certificates in this test suite are signed using EMSA_PKCS1 -#ifdef BOTAN_HAS_EMSA_PKCS1 - class BSI_Path_Validation_Tests final : public Test { public: @@ -625,8 +622,6 @@ BOTAN_REGISTER_TEST("x509_path_bsi", BSI_Path_Validation_Tests); #endif -#endif - } } diff --git a/src/tests/unit_x509.cpp b/src/tests/unit_x509.cpp index 97411a6cb..a8849292a 100644 --- a/src/tests/unit_x509.cpp +++ b/src/tests/unit_x509.cpp @@ -374,6 +374,7 @@ Test::Result test_crl_dn_name() // See GH #1252 +#if defined(BOTAN_HAS_RSA) && defined(BOTAN_HAS_EMSA_PKCS1) const Botan::OID dc_oid("0.9.2342.19200300.100.1.25"); Botan::X509_Certificate cert(Test::data_file("x509/misc/opcuactt_ca.der")); @@ -388,6 +389,7 @@ Test::Result test_crl_dn_name() result.confirm("contains DC component", crl.issuer_dn().get_attributes().count(dc_oid) == 1); +#endif return result; } @@ -1231,8 +1233,13 @@ class X509_Cert_Unit_Tests final : public Test Test::Result self_issued_result("X509 Self Issued"); Test::Result extensions_result("X509 Extensions"); - for(const auto& algo : sig_algos) + for(const std::string& algo : sig_algos) { +#if !defined(BOTAN_HAS_EMSA_PKCS1) + if(algo == "RSA") + continue; +#endif + try { cert_result.merge(test_x509_cert(algo)); @@ -1280,10 +1287,15 @@ class X509_Cert_Unit_Tests final : public Test "DH", "ECDH", "RSA", "ElGamal", "GOST-34.10", "DSA", "ECDSA", "ECGDSA", "ECKCDSA" }; + Test::Result valid_constraints_result("X509 Valid Constraints"); - for(const auto& algo : pk_algos) + for(const std::string& algo : pk_algos) { +#if !defined(BOTAN_HAS_EMSA_PKCS1) + if(algo == "RSA") + continue; +#endif valid_constraints_result.merge(test_valid_constraints(algo)); } |