]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/acl/Certificate.cc
2 * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
9 /* DEBUG: section 28 Access Control */
13 /* MS Visual Studio Projects are monolithic, so we need the following
14 * #if to exclude the SSL code from compile process when not needed.
18 #include "acl/Certificate.h"
19 #include "acl/CertificateData.h"
20 #include "acl/Checklist.h"
21 #include "client_side.h"
24 #include "http/Stream.h"
25 #include "HttpRequest.h"
28 ACLCertificateStrategy::match (ACLData
<MatchType
> * &data
, ACLFilledChecklist
*checklist
, ACLFlags
&)
30 const int fd
= checklist
->fd();
31 const bool goodDescriptor
= 0 <= fd
&& fd
<= Biggest_FD
;
32 auto ssl
= goodDescriptor
? fd_table
[fd
].ssl
.get() : nullptr;
33 X509
*cert
= SSL_get_peer_certificate(ssl
);
34 const bool res
= data
->match (cert
);
39 ACLCertificateStrategy
*
40 ACLCertificateStrategy::Instance()
45 ACLCertificateStrategy
ACLCertificateStrategy::Instance_
;
47 #endif /* USE_OPENSSL */