]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/acl/ServerCertificate.cc
SourceFormat Enforcement
[thirdparty/squid.git] / src / acl / ServerCertificate.cc
index 5f814a364eef8060e83e3df44c284d29942f8f0e..4c3a1a720c784a464342dcdc7b2bc5330cd708d0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
+ * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
  *
  * Squid software is distributed under GPLv2+ license and includes
  * contributions from numerous individuals and organizations.
 #include "acl/ServerCertificate.h"
 #include "client_side.h"
 #include "fde.h"
+#include "http/Stream.h"
 #include "ssl/ServerBump.h"
 
 int
 ACLServerCertificateStrategy::match(ACLData<MatchType> * &data, ACLFilledChecklist *checklist, ACLFlags &)
 {
-    X509 *cert = NULL;
-    if (checklist->serverCert.get())
-        cert = checklist->serverCert.get();
+    Security::CertPointer cert;
+    if (checklist->serverCert)
+        cert = checklist->serverCert;
     else if (checklist->conn() != NULL && checklist->conn()->serverBump())
-        cert = checklist->conn()->serverBump()->serverCert.get();
+        cert = checklist->conn()->serverBump()->serverCert;
 
     if (!cert)
         return 0;
 
-    return data->match(cert);
+    return data->match(cert.get());
 }
 
 ACLServerCertificateStrategy *
@@ -41,3 +42,4 @@ ACLServerCertificateStrategy::Instance()
 ACLServerCertificateStrategy ACLServerCertificateStrategy::Instance_;
 
 #endif /* USE_OPENSSL */
+