Config.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2022 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 
20 namespace Auth
21 {
22 namespace Digest
23 {
24 class User;
25 }
26 }
27 
28 /* Generic */
29 typedef struct _digest_nonce_data digest_nonce_data;
30 typedef struct _digest_nonce_h digest_nonce_h;
31 
32 /* data to be encoded into the nonce's hex representation */
33 struct _digest_nonce_data {
34  time_t creationtime;
35  uint32_t randomdata;
36 };
37 
38 /* the nonce structure we'll pass around */
39 
40 struct _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 
56 void authDigestNonceUnlink(digest_nonce_h * nonce);
57 int authDigestNonceIsValid(digest_nonce_h * nonce, char nc[9]);
58 int authDigestNonceIsStale(digest_nonce_h * nonce);
59 const char *authenticateDigestNonceNonceHex(const digest_nonce_h * nonce);
60 int authDigestNonceLastRequest(digest_nonce_h * nonce);
62 void authDigestNoncePurge(digest_nonce_h * nonce);
63 void authDigestUserLinkNonce(Auth::Digest::User * user, digest_nonce_h * nonce);
64 digest_nonce_h *authenticateDigestNonceNew(void);
65 
66 namespace Auth
67 {
68 namespace Digest
69 {
70 
72 class Config : public Auth::SchemeConfig
73 {
74 public:
75  Config();
76  virtual bool active() const;
77  virtual bool configured() const;
78  virtual Auth::UserRequest::Pointer decode(char const *proxy_auth, const HttpRequest *request, const char *requestRealm);
79  virtual void done();
80  virtual void rotateHelpers();
81  virtual bool dump(StoreEntry *, const char *, Auth::SchemeConfig *) const;
82  virtual void fixHeader(Auth::UserRequest::Pointer, HttpReply *, Http::HdrType, HttpRequest *);
83  virtual void init(Auth::SchemeConfig *);
84  virtual void parse(Auth::SchemeConfig *, int, char *);
85  virtual void registerWithCacheManager(void);
86  virtual const char * type() const;
87 
88 public:
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 
HTTP Authentication.
Definition: Config.h:19
int authDigestNonceIsValid(digest_nonce_h *nonce, char nc[9])
Definition: Config.cc:327
int type
Definition: errorpage.cc:152
static struct node * parse(FILE *fp)
Definition: parse.c:965
int authDigestNonceIsStale(digest_nonce_h *nonce)
Definition: Config.cc:365
void authDigestUserLinkNonce(Auth::Digest::User *user, digest_nonce_h *nonce)
Definition: Config.cc:653
Definition: helper.h:64
digest_nonce_h * authenticateDigestNonceNew(void)
Definition: Config.cc:120
void authDigestNoncePurge(digest_nonce_h *nonce)
Definition: Config.cc:428
int authDigestNonceLastRequest(digest_nonce_h *nonce)
Definition: Config.cc:408
helper * digestauthenticators
Definition: Config.cc:49
void authDigestNonceUnlink(digest_nonce_h *nonce)
Definition: Config.cc:281
void authenticateDigestNonceShutdown(void)
Definition: Config.cc:216
const char * authenticateDigestNonceNonceHex(const digest_nonce_h *nonce)
Definition: Config.cc:298
struct _request * request(char *urlin)
Definition: tcp-banger2.c:291
class SquidConfig Config
Definition: SquidConfig.cc:12

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors