aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/x509/certstor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/x509/certstor.cpp')
-rw-r--r--src/lib/x509/certstor.cpp17
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&)
{