From 8ba88feb44a972e14499741bfade75d117552736 Mon Sep 17 00:00:00 2001 From: Mathieu Souchaud Date: Thu, 1 Feb 2018 09:16:04 +0000 Subject: Load every certificates of files found. --- src/lib/x509/certstor.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/lib') diff --git a/src/lib/x509/certstor.cpp b/src/lib/x509/certstor.cpp index 23e8185c4..904e322b1 100644 --- a/src/lib/x509/certstor.cpp +++ b/src/lib/x509/certstor.cpp @@ -9,6 +9,7 @@ #include #include #include +#include namespace Botan { @@ -184,8 +185,20 @@ Certificate_Store_In_Memory::Certificate_Store_In_Memory(const std::string& dir) for(auto&& cert_file : maybe_certs) { try - { - m_certs.push_back(std::make_shared(cert_file)); + { + DataSource_Stream src(cert_file, true); + while(!src.end_of_data()) + { + try + { + m_certs.push_back(std::make_shared(src)); + } + catch(std::exception&) + { + // stop searching for other certificate at first exception + break; + } + } } catch(std::exception&) { -- cgit v1.2.3