From 05a0a1dba7994fdef90dfd8a92c2dc888fa0ce9a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Felix=20D=C3=B6rre?= Date: Fri, 26 May 2017 11:33:30 +0000 Subject: [PATCH] add: handle the 'noOCSP' feature in the include section Change-Id: I4b1b92796f7c021c847ba45f67291bc1d5b78860 --- src/config.cpp | 14 ++++++++++++++ src/crypto/X509.cpp | 2 +- src/crypto/sslUtil.h | 2 ++ test/genTestData.sh | 1 + 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/config.cpp b/src/config.cpp index ccd2f24..8b17596 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -92,6 +92,20 @@ int parseProfiles() { prof.id = std::stoi( id ); prof.eku = map->at( "eku" ); prof.ku = map->at( "ku" ); + { + std::string include = map->at( "include" ); + size_t pos = 0; + size_t end = 0; + std::unordered_set include_set; + + while( ( end = include.find( ",", pos ) ) != std::string::npos ) { + include_set.emplace( include.substr( pos, end - pos ) ); + pos = end + 1; + } + + include_set.emplace( include.substr( pos ) ); + prof.include = include_set; + } prof.maxValidity = std::stoi( map->at( "days" ) ) * /* DAYS */24 * 60 * 60; diff --git a/src/crypto/X509.cpp b/src/crypto/X509.cpp index 9c2ed9a..3d0efbc 100644 --- a/src/crypto/X509.cpp +++ b/src/crypto/X509.cpp @@ -185,7 +185,7 @@ void X509Cert::setExtensions( std::shared_ptr caCert, std::vector #include #include +#include #include @@ -34,6 +35,7 @@ struct Profile { std::vector> ca; std::time_t maxValidity; + std::unordered_set include; std::shared_ptr getCA() { std::shared_ptr min = nullptr; diff --git a/test/genTestData.sh b/test/genTestData.sh index 9b175f9..0de15bd 100755 --- a/test/genTestData.sh +++ b/test/genTestData.sh @@ -26,6 +26,7 @@ ca=unassured eku= ku= days=10 +include= EOF mkdir -p ca/unassured_2015_2 -- 2.39.2