X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=src%2Fcrypto%2FsslUtil.h;h=f0eaaf6e6e3d0ccf7584bf227a391b2f75f06b28;hb=HEAD;hp=079989939a5e3829dabb6e90ffbf6b993bc58815;hpb=160ba9d844500d1e553a0dab21a4a2a7fabc60d5;p=cassiopeia.git diff --git a/src/crypto/sslUtil.h b/src/crypto/sslUtil.h index 0799899..f0eaaf6 100644 --- a/src/crypto/sslUtil.h +++ b/src/crypto/sslUtil.h @@ -2,9 +2,11 @@ #include #include +#include #include #include #include +#include #include @@ -33,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; } } }