aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/cert
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/cert')
-rw-r--r--src/lib/cert/x509/certstor.cpp25
-rw-r--r--src/lib/cert/x509/info.txt4
2 files changed, 7 insertions, 22 deletions
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 <botan/certstor.h>
-
-#if defined(BOTAN_HAS_BOOST_FILESYSTEM)
-#include <boost/filesystem.hpp>
-#endif
+#include <botan/fs.h>
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<std::string> 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
</requires>
-
-<libs>
-all -> boost_filesystem
-</libs>