X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=src%2Fconfig.cpp;h=a58cc82878acabf16190dcc212bb27e2a617b8f3;hb=25b4018f92fc3245ad91ff6c0d12fc5dacc3cadd;hp=a4d32848ecb7de4e3e4609adc5a83e997d927d47;hpb=6121035a7d8ea738bc89c2de8e6602fb1099b0e2;p=cassiopeia.git diff --git a/src/config.cpp b/src/config.cpp index a4d3284..a58cc82 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -53,8 +53,8 @@ std::shared_ptr> parseConf( std::st int parseProfiles() { CAs = std::unordered_map>(); - DIR* dp; - struct dirent* ep; + DIR *dp; + struct dirent *ep; dp = opendir( "profiles" ); if( dp == NULL ) { @@ -93,16 +93,20 @@ int parseProfiles() { prof.ku = map->at( "ku" ); prof.maxValidity = std::stoi( map->at( "days" ) ) * /* DAYS */24 * 60 * 60; - std::string cas = map->at( "ca" ); - DIR* dir; - struct dirent* ent; + DIR *dir; + struct dirent *ent; + + if( profileName == "0100-ocsp" ) { + //This profile does not have a specific CA. The concrete CA has to be set in each request. + } else if( ( dir = opendir( "ca" ) ) != NULL ) { + std::string cas = map->at( "ca" ); + std::string toFind = cas + "_"; - if( ( dir = opendir( "ca" ) ) != NULL ) { while( ( ent = readdir( dir ) ) != NULL ) { std::string caName = std::string( ent->d_name ); - if( caName.find( cas ) != 0 ) { + if( caName.find( toFind ) != 0 ) { continue; }