X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=src%2Fcrypto%2FsslUtil.h;h=f0eaaf6e6e3d0ccf7584bf227a391b2f75f06b28;hb=HEAD;hp=569c20058eccd47dac2c2125e7e138bd6b774d96;hpb=3a45e813dfbb75ac7f9069b9799d2c5ac9e47140;p=cassiopeia.git diff --git a/src/crypto/sslUtil.h b/src/crypto/sslUtil.h index 569c200..f0eaaf6 100644 --- a/src/crypto/sslUtil.h +++ b/src/crypto/sslUtil.h @@ -6,6 +6,7 @@ #include #include #include +#include #include @@ -34,16 +35,18 @@ struct Profile { std::vector> ca; std::time_t maxValidity; + std::unordered_set include; std::shared_ptr getCA() { std::shared_ptr min = nullptr; + for( auto it = ca.rbegin(); it != ca.rend(); it++ ) { - if( X509_cmp_current_time( ( *it )->notBefore.get() ) < 0) { - if(min != nullptr){ - if(strcmp(min->name.c_str(), (*it)->name.c_str()) < 0){ + if( X509_cmp_current_time( ( *it )->notBefore.get() ) < 0 ) { + if( min != nullptr ) { + if( strcmp( min->name.c_str(), ( *it )->name.c_str() ) < 0 ) { min = *it; } - }else{ - min=*it; + } else { + min = *it; } } }