Config.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2023 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 __AUTH_DIGEST_H__
10#define __AUTH_DIGEST_H__
11
12#if HAVE_AUTH_MODULE_DIGEST
13
14#include "auth/Gadgets.h"
15#include "auth/SchemeConfig.h"
16#include "auth/UserRequest.h"
17#include "helper/forward.h"
18#include "rfc2617.h"
19
20namespace Auth
21{
22namespace Digest
23{
24class User;
25}
26}
27
28/* Generic */
29typedef struct _digest_nonce_data digest_nonce_data;
30typedef struct _digest_nonce_h digest_nonce_h;
31
32/* data to be encoded into the nonce's hex representation */
33struct _digest_nonce_data {
34 time_t creationtime;
35 uint32_t randomdata;
36};
37
38/* the nonce structure we'll pass around */
39
40struct _digest_nonce_h : public hash_link {
41 digest_nonce_data noncedata;
42 /* number of uses we've seen of this nonce */
43 unsigned long nc;
44 /* reference count */
45 uint64_t references;
46 /* the auth_user this nonce has been tied to */
47 Auth::Digest::User *user;
48 /* has this nonce been invalidated ? */
49
50 struct {
51 bool valid;
52 bool incache;
53 } flags;
54};
55
56void authDigestNonceUnlink(digest_nonce_h * nonce);
57int authDigestNonceIsValid(digest_nonce_h * nonce, char nc[9]);
58int authDigestNonceIsStale(digest_nonce_h * nonce);
59const char *authenticateDigestNonceNonceHex(const digest_nonce_h * nonce);
60int authDigestNonceLastRequest(digest_nonce_h * nonce);
62void authDigestNoncePurge(digest_nonce_h * nonce);
63void authDigestUserLinkNonce(Auth::Digest::User * user, digest_nonce_h * nonce);
64digest_nonce_h *authenticateDigestNonceNew(void);
65
66namespace Auth
67{
68namespace Digest
69{
70
72class Config : public Auth::SchemeConfig
73{
74public:
75 Config();
76 bool active() const override;
77 bool configured() const override;
78 Auth::UserRequest::Pointer decode(char const *proxy_auth, const HttpRequest *request, const char *requestRealm) override;
79 void done() override;
80 void rotateHelpers() override;
81 bool dump(StoreEntry *, const char *, Auth::SchemeConfig *) const override;
82 void fixHeader(Auth::UserRequest::Pointer, HttpReply *, Http::HdrType, HttpRequest *) override;
83 void init(Auth::SchemeConfig *) override;
84 void parse(Auth::SchemeConfig *, int, char *) override;
85 void registerWithCacheManager(void) override;
86 const char * type() const override;
87
88public:
89 time_t nonceGCInterval;
90 time_t noncemaxduration;
91 unsigned int noncemaxuses;
92 int NonceStrictness;
93 int CheckNonceCount;
94 int PostWorkaround;
95};
96
97} // namespace Digest
98} // namespace Auth
99
100/* strings */
101#define QOP_AUTH "auth"
102
104
105#endif /* HAVE_AUTH_MODULE_DIGEST */
106#endif
107
class SquidConfig Config
Definition: SquidConfig.cc:12
Helper::ClientPointer digestauthenticators
Definition: Config.cc:49
void authDigestUserLinkNonce(Auth::Digest::User *user, digest_nonce_h *nonce)
Definition: Config.cc:650
void authDigestNonceUnlink(digest_nonce_h *nonce)
Definition: Config.cc:279
int authDigestNonceIsStale(digest_nonce_h *nonce)
Definition: Config.cc:363
int authDigestNonceIsValid(digest_nonce_h *nonce, char nc[9])
Definition: Config.cc:325
void authenticateDigestNonceShutdown(void)
Definition: Config.cc:214
const char * authenticateDigestNonceNonceHex(const digest_nonce_h *nonce)
Definition: Config.cc:296
int authDigestNonceLastRequest(digest_nonce_h *nonce)
Definition: Config.cc:406
void authDigestNoncePurge(digest_nonce_h *nonce)
Definition: Config.cc:426
digest_nonce_h * authenticateDigestNonceNew(void)
Definition: Config.cc:120
HTTP Authentication.
Definition: Config.h:19
static struct node * parse(FILE *fp)
Definition: parse.c:965

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors