]> git.ipfire.org Git - thirdparty/squid.git/blame - src/acl/ConnectionsEncrypted.cc
Source Format Enforcement (#963)
[thirdparty/squid.git] / src / acl / ConnectionsEncrypted.cc
CommitLineData
652789d8 1/*
bf95c10a 2 * Copyright (C) 1996-2022 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
652789d8
CT
19Acl::ConnectionsEncrypted::ConnectionsEncrypted (char const *theClass) : class_ (theClass)
20{}
21
652789d8
CT
22Acl::ConnectionsEncrypted::~ConnectionsEncrypted()
23{}
24
25char const *
26Acl::ConnectionsEncrypted::typeString() const
27{
28 return class_;
29}
30
31bool
32Acl::ConnectionsEncrypted::empty () const
33{
34 return false;
35}
36
37void
38Acl::ConnectionsEncrypted::parse()
39{
40 if (ConfigParser::strtokFile()) {
a85f0df5 41 debugs(89, DBG_CRITICAL, "WARNING: connections_encrypted does not accept any value.");
652789d8
CT
42 }
43}
44
45int
46Acl::ConnectionsEncrypted::match(ACLChecklist *checklist)
47{
48 if (!checklist->hasRequest()) {
49 debugs(28, DBG_IMPORTANT, "WARNING: " << name << " ACL is used in " <<
50 "context without an HTTP request. Assuming mismatch.");
51 return 0;
52 }
53
54 ACLFilledChecklist *filled = Filled((ACLChecklist*)checklist);
ff89bfa0 55
652789d8 56 const bool safeRequest =
63df1d28 57 !(filled->request->sources & Http::Message::srcUnsafe);
652789d8 58 const bool safeReply = !filled->reply ||
63df1d28 59 !(filled->reply->sources & Http::Message::srcUnsafe);
652789d8
CT
60
61 return (safeRequest && safeReply) ? 1 : 0;
62}
63
64SBufList
65Acl::ConnectionsEncrypted::dump() const
66{
67 return SBufList();
68}
69