]> WPIA git - cassiopeia.git/blobdiff - src/crypto/sslUtil.h
fix: use correct prepared statement for writing logs
[cassiopeia.git] / src / crypto / sslUtil.h
index 079989939a5e3829dabb6e90ffbf6b993bc58815..f0eaaf6e6e3d0ccf7584bf227a391b2f75f06b28 100644 (file)
@@ -2,9 +2,11 @@
 
 #include <memory>
 #include <string>
+#include <string.h>
 #include <vector>
 #include <cinttypes>
 #include <ctime>
+#include <unordered_set>
 
 #include <openssl/ssl.h>
 
@@ -33,16 +35,18 @@ struct Profile {
 
     std::vector<std::shared_ptr<CAConfig>> ca;
     std::time_t maxValidity;
+    std::unordered_set<std::string> include;
     std::shared_ptr<CAConfig> getCA() {
         std::shared_ptr<CAConfig> 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;
                 }
             }
         }