From af715722e5ea4802eaa5e93f1f44abc0958bf5be Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Tue, 22 Nov 2016 09:18:04 -0500 Subject: Add macro signalling support for online revocation checks. --- src/lib/x509/x509path.cpp | 4 ++-- src/lib/x509/x509path.h | 6 +++++- 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 #include -#if defined(BOTAN_TARGET_OS_HAS_THREADS) && defined(BOTAN_HAS_HTTP_UTIL) +#if defined(BOTAN_HAS_ONLINE_REVOCATION_CHECKS) #include #include #endif @@ -239,7 +239,7 @@ PKIX::check_crl(const std::vector>& 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> PKIX::check_ocsp_online(const std::vector>& 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 #include +#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>& const std::vector& 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> BOTAN_DLL check_ocsp_online(const std::vector>& 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 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; } -- cgit v1.2.3