diff options
author | Jack Lloyd <[email protected]> | 2018-02-02 11:39:24 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-02-02 11:39:24 -0500 |
commit | da288ccb4bb1bb6a95fdbf59bc0f31266a1e2bef (patch) | |
tree | 92799971e7aeb8836ae6b57f5c4ad18d1bdbf247 /src/lib | |
parent | deeca72a3e5f875c87601e0da673288a798c55d5 (diff) | |
parent | e9b1771b72a6b405e270dd21751b30e5e9b495f4 (diff) |
Merge GH #1436 In Certificate_Store load multiple certs from file
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/x509/certstor.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
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 <botan/certstor.h> #include <botan/internal/filesystem.h> #include <botan/hash.h> +#include <botan/data_src.h> 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<X509_Certificate>(cert_file)); + { + DataSource_Stream src(cert_file, true); + while(!src.end_of_data()) + { + try + { + m_certs.push_back(std::make_shared<X509_Certificate>(src)); + } + catch(std::exception&) + { + // stop searching for other certificate at first exception + break; + } + } } catch(std::exception&) { |