diff options
-rw-r--r-- | src/lib/x509/x509path.cpp | 4 | ||||
-rw-r--r-- | src/lib/x509/x509path.h | 6 | ||||
-rw-r--r-- | src/tests/test_ocsp.cpp | 4 |
3 files changed, 11 insertions, 3 deletions
diff --git a/src/lib/x509/x509path.cpp b/src/lib/x509/x509path.cpp index c57985766..2544d6176 100644 --- a/src/lib/x509/x509path.cpp +++ b/src/lib/x509/x509path.cpp @@ -15,7 +15,7 @@ #include <vector> #include <set> -#if defined(BOTAN_TARGET_OS_HAS_THREADS) && defined(BOTAN_HAS_HTTP_UTIL) +#if defined(BOTAN_HAS_ONLINE_REVOCATION_CHECKS) #include <future> #include <botan/http_util.h> #endif @@ -239,7 +239,7 @@ PKIX::check_crl(const std::vector<std::shared_ptr<const X509_Certificate>>& cert return PKIX::check_crl(cert_path, crls, ref_time); } -#if defined(BOTAN_TARGET_OS_HAS_THREADS) && defined(BOTAN_HAS_HTTP_UTIL) +#if defined(BOTAN_HAS_ONLINE_REVOCATION_CHECKS) std::vector<std::set<Certificate_Status_Code>> PKIX::check_ocsp_online(const std::vector<std::shared_ptr<const X509_Certificate>>& cert_path, diff --git a/src/lib/x509/x509path.h b/src/lib/x509/x509path.h index 414a877da..6b544dba3 100644 --- a/src/lib/x509/x509path.h +++ b/src/lib/x509/x509path.h @@ -16,6 +16,10 @@ #include <set> #include <chrono> +#if defined(BOTAN_TARGET_OS_HAS_THREADS) && defined(BOTAN_HAS_HTTP_UTIL) + #define BOTAN_HAS_ONLINE_REVOCATION_CHECKS +#endif + namespace Botan { /** @@ -212,7 +216,7 @@ BOTAN_DLL check_crl(const std::vector<std::shared_ptr<const X509_Certificate>>& const std::vector<Certificate_Store*>& certstores, std::chrono::system_clock::time_point ref_time); -#if defined(BOTAN_TARGET_OS_HAS_THREADS) && defined(BOTAN_HAS_HTTP_UTIL) +#if defined(BOTAN_HAS_ONLINE_REVOCATION_CHECKS) std::vector<std::set<Certificate_Status_Code>> BOTAN_DLL check_ocsp_online(const std::vector<std::shared_ptr<const X509_Certificate>>& cert_path, diff --git a/src/tests/test_ocsp.cpp b/src/tests/test_ocsp.cpp index da52191df..41faa5edf 100644 --- a/src/tests/test_ocsp.cpp +++ b/src/tests/test_ocsp.cpp @@ -143,6 +143,7 @@ class OCSP_Tests : public Test return result; } +#if defined(BOTAN_HAS_ONLINE_REVOCATION_CHECKS) Test::Result test_online_request() { Test::Result result("OCSP online check"); @@ -177,6 +178,7 @@ class OCSP_Tests : public Test return result; } +#endif public: std::vector<Test::Result> run() override @@ -187,8 +189,10 @@ class OCSP_Tests : public Test results.push_back(test_response_parsing()); results.push_back(test_response_verification()); +#if defined(BOTAN_HAS_ONLINE_REVOCATION_CHECKS) if(Test::run_online_tests()) results.push_back(test_online_request()); +#endif return results; } |