From 5ef7108d620a00ce5b2f6997c8b6ffc0708467d6 Mon Sep 17 00:00:00 2001 From: lloyd Date: Sat, 21 Feb 2015 14:14:45 +0000 Subject: Hide all uses of boost filesystem in fs.cpp. Use readdir as an alternate implementation for Unix and add some feature checks so a boost-free build of the tests and command line are possible again. --- src/lib/cert/x509/certstor.cpp | 25 +++++++------------------ src/lib/cert/x509/info.txt | 4 ---- 2 files changed, 7 insertions(+), 22 deletions(-) (limited to 'src/lib/cert') diff --git a/src/lib/cert/x509/certstor.cpp b/src/lib/cert/x509/certstor.cpp index cbb0fd670..d7e6f0a65 100644 --- a/src/lib/cert/x509/certstor.cpp +++ b/src/lib/cert/x509/certstor.cpp @@ -6,10 +6,7 @@ */ #include - -#if defined(BOTAN_HAS_BOOST_FILESYSTEM) -#include -#endif +#include namespace Botan { @@ -116,25 +113,17 @@ Certificate_Store_In_Memory::Certificate_Store_In_Memory(const std::string& dir) if(dir == "") return; -#if defined(BOTAN_HAS_BOOST_FILESYSTEM) - boost::filesystem::recursive_directory_iterator i(dir); - boost::filesystem::recursive_directory_iterator end; - - while(i != end) + std::vector maybe_certs = list_all_readable_files_in_or_under(dir); + for(auto&& cert_file : maybe_certs) { - auto path = i->path(); - ++i; - try { - if(boost::filesystem::is_regular_file(path)) - m_certs.push_back(X509_Certificate(path.string())); + m_certs.push_back(X509_Certificate(cert_file)); + } + catch(std::exception&) + { } - catch(...) {} } -#else - throw std::runtime_error("Certificate_Store_In_Memory: FS access disabled"); -#endif } const X509_Certificate* diff --git a/src/lib/cert/x509/info.txt b/src/lib/cert/x509/info.txt index 39e51a625..19db981bc 100644 --- a/src/lib/cert/x509/info.txt +++ b/src/lib/cert/x509/info.txt @@ -6,7 +6,3 @@ asn1 datastor http_util - - -all -> boost_filesystem - -- cgit v1.2.3