source: squid-ssl/trunk/fuentes/src/auth/digest/Config.h @ 5495

Last change on this file since 5495 was 5495, checked in by Juanma, 2 years ago

Initial release

File size: 2.8 KB
Line 
1/*
2 * Copyright (C) 1996-2015 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#include "auth/Config.h"
13#include "auth/Gadgets.h"
14#include "auth/UserRequest.h"
15#include "helper/forward.h"
16#include "rfc2617.h"
17
18namespace Auth
19{
20namespace Digest
21{
22class User;
23}
24}
25
26/* Generic */
27typedef struct _digest_nonce_data digest_nonce_data;
28typedef struct _digest_nonce_h digest_nonce_h;
29
30/* data to be encoded into the nonce's b64 representation */
31struct _digest_nonce_data {
32    time_t creationtime;
33    /* in memory address of the nonce struct (similar purpose to an ETag) */
34    digest_nonce_h *self;
35    long 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    short 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 *authenticateDigestNonceNonceb64(const digest_nonce_h * nonce);
60int authDigestNonceLastRequest(digest_nonce_h * nonce);
61void authenticateDigestNonceShutdown(void);
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
71/** Digest Authentication configuration data */
72class Config : public Auth::Config
73{
74public:
75    Config();
76    virtual bool active() const;
77    virtual bool configured() const;
78    virtual Auth::UserRequest::Pointer decode(char const *proxy_auth, const char *requestRealm);
79    virtual void done();
80    virtual void rotateHelpers();
81    virtual bool dump(StoreEntry *, const char *, Auth::Config *) const;
82    virtual void fixHeader(Auth::UserRequest::Pointer, HttpReply *, http_hdr_type, HttpRequest *);
83    virtual void init(Auth::Config *);
84    virtual void parse(Auth::Config *, int, char *);
85    virtual void registerWithCacheManager(void);
86    virtual const char * type() const;
87
88public:
89    time_t nonceGCInterval;
90    time_t noncemaxduration;
91    unsigned int noncemaxuses;
92    int NonceStrictness;
93    int CheckNonceCount;
94    int PostWorkaround;
95    int utf8;
96};
97
98} // namespace Digest
99} // namespace Auth
100
101/* strings */
102#define QOP_AUTH "auth"
103
104extern helper *digestauthenticators;
105
106#endif
107
Note: See TracBrowser for help on using the repository browser.