]> git.ipfire.org Git - thirdparty/squid.git/blob - src/acl/CertificateData.h
Merge from trunk rev.13584
[thirdparty/squid.git] / src / acl / CertificateData.h
1 /*
2 * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
3 *
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.
7 */
8
9 #ifndef SQUID_ACLCERTIFICATEDATA_H
10 #define SQUID_ACLCERTIFICATEDATA_H
11
12 #include "acl/Acl.h"
13 #include "acl/Data.h"
14 #include "acl/StringData.h"
15 #include "splay.h"
16 #include "ssl/support.h"
17 #include <string>
18 #include <list>
19
20 /// \ingroup ACLAPI
21 class ACLCertificateData : public ACLData<X509 *>
22 {
23
24 public:
25 MEMPROXY_CLASS(ACLCertificateData);
26
27 ACLCertificateData(Ssl::GETX509ATTRIBUTE *, const char *attributes, bool optionalAttr = false);
28 ACLCertificateData(ACLCertificateData const &);
29 ACLCertificateData &operator= (ACLCertificateData const &);
30 virtual ~ACLCertificateData();
31 bool match(X509 *);
32 virtual SBufList dump() const;
33 void parse();
34 bool empty() const;
35 virtual ACLData<X509 *> *clone() const;
36
37 /// A '|'-delimited list of valid ACL attributes.
38 /// A "*" item means that any attribute is acceptable.
39 /// Assumed to be a const-string and is never duped/freed.
40 /// Nil unless ACL form is: acl Name type attribute value1 ...
41 const char *validAttributesStr;
42 /// Parsed list of valid attribute names
43 std::list<std::string> validAttributes;
44 /// True if the attribute is optional (-xxx options)
45 bool attributeIsOptional;
46 char *attribute;
47 ACLStringData values;
48
49 private:
50 /// The callback used to retrieve the data from X509 cert
51 Ssl::GETX509ATTRIBUTE *sslAttributeCall;
52 };
53
54 MEMPROXY_CLASS_INLINE(ACLCertificateData);
55
56 #endif /* SQUID_ACLCERTIFICATEDATA_H */