]>
Commit | Line | Data |
---|---|---|
652789d8 | 1 | /* |
f70aedc4 | 2 | * Copyright (C) 1996-2021 The Squid Software Foundation and contributors |
652789d8 CT |
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 | /* DEBUG: section 28 Access Control */ | |
10 | ||
11 | #include "squid.h" | |
652789d8 | 12 | #include "acl/ConnectionsEncrypted.h" |
ff89bfa0 | 13 | #include "acl/FilledChecklist.h" |
652789d8 | 14 | #include "Debug.h" |
652789d8 | 15 | #include "HttpReply.h" |
ff89bfa0 | 16 | #include "HttpRequest.h" |
652789d8 CT |
17 | #include "SquidConfig.h" |
18 | ||
19 | ACL * | |
20 | Acl::ConnectionsEncrypted::clone() const | |
21 | { | |
22 | return new Acl::ConnectionsEncrypted(*this); | |
23 | } | |
24 | ||
25 | Acl::ConnectionsEncrypted::ConnectionsEncrypted (char const *theClass) : class_ (theClass) | |
26 | {} | |
27 | ||
28 | Acl::ConnectionsEncrypted::ConnectionsEncrypted (Acl::ConnectionsEncrypted const & old) :class_ (old.class_) | |
29 | {} | |
30 | ||
31 | Acl::ConnectionsEncrypted::~ConnectionsEncrypted() | |
32 | {} | |
33 | ||
34 | char const * | |
35 | Acl::ConnectionsEncrypted::typeString() const | |
36 | { | |
37 | return class_; | |
38 | } | |
39 | ||
40 | bool | |
41 | Acl::ConnectionsEncrypted::empty () const | |
42 | { | |
43 | return false; | |
44 | } | |
45 | ||
46 | void | |
47 | Acl::ConnectionsEncrypted::parse() | |
48 | { | |
49 | if (ConfigParser::strtokFile()) { | |
a85f0df5 | 50 | debugs(89, DBG_CRITICAL, "WARNING: connections_encrypted does not accept any value."); |
652789d8 CT |
51 | } |
52 | } | |
53 | ||
54 | int | |
55 | Acl::ConnectionsEncrypted::match(ACLChecklist *checklist) | |
56 | { | |
57 | if (!checklist->hasRequest()) { | |
58 | debugs(28, DBG_IMPORTANT, "WARNING: " << name << " ACL is used in " << | |
59 | "context without an HTTP request. Assuming mismatch."); | |
60 | return 0; | |
61 | } | |
62 | ||
63 | ACLFilledChecklist *filled = Filled((ACLChecklist*)checklist); | |
ff89bfa0 | 64 | |
652789d8 | 65 | const bool safeRequest = |
63df1d28 | 66 | !(filled->request->sources & Http::Message::srcUnsafe); |
652789d8 | 67 | const bool safeReply = !filled->reply || |
63df1d28 | 68 | !(filled->reply->sources & Http::Message::srcUnsafe); |
652789d8 CT |
69 | |
70 | return (safeRequest && safeReply) ? 1 : 0; | |
71 | } | |
72 | ||
73 | SBufList | |
74 | Acl::ConnectionsEncrypted::dump() const | |
75 | { | |
76 | return SBufList(); | |
77 | } | |
78 |