2 * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
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.
11 * Internal declarations for the digest auth module
14 #ifndef __AUTH_DIGEST_H__
15 #define __AUTH_DIGEST_H__
17 #include "auth/Config.h"
18 #include "auth/Gadgets.h"
19 #include "auth/UserRequest.h"
32 typedef struct _digest_nonce_data digest_nonce_data
;
33 typedef struct _digest_nonce_h digest_nonce_h
;
35 /* data to be encoded into the nonce's b64 representation */
36 struct _digest_nonce_data
{
38 /* in memory address of the nonce struct (similar purpose to an ETag) */
43 /* the nonce structure we'll pass around */
45 struct _digest_nonce_h
: public hash_link
{
46 digest_nonce_data noncedata
;
47 /* number of uses we've seen of this nonce */
51 /* the auth_user this nonce has been tied to */
52 Auth::Digest::User
*user
;
53 /* has this nonce been invalidated ? */
61 void authDigestNonceUnlink(digest_nonce_h
* nonce
);
62 int authDigestNonceIsValid(digest_nonce_h
* nonce
, char nc
[9]);
63 int authDigestNonceIsStale(digest_nonce_h
* nonce
);
64 const char *authenticateDigestNonceNonceb64(const digest_nonce_h
* nonce
);
65 int authDigestNonceLastRequest(digest_nonce_h
* nonce
);
66 void authenticateDigestNonceShutdown(void);
67 void authDigestNoncePurge(digest_nonce_h
* nonce
);
68 void authDigestUserLinkNonce(Auth::Digest::User
* user
, digest_nonce_h
* nonce
);
69 digest_nonce_h
*authenticateDigestNonceNew(void);
76 /** Digest Authentication configuration data */
77 class Config
: public Auth::Config
81 virtual bool active() const;
82 virtual bool configured() const;
83 virtual Auth::UserRequest::Pointer
decode(char const *proxy_auth
, const char *requestRealm
);
85 virtual void rotateHelpers();
86 virtual bool dump(StoreEntry
*, const char *, Auth::Config
*) const;
87 virtual void fixHeader(Auth::UserRequest::Pointer
, HttpReply
*, http_hdr_type
, HttpRequest
*);
88 virtual void init(Auth::Config
*);
89 virtual void parse(Auth::Config
*, int, char *);
90 virtual void registerWithCacheManager(void);
91 virtual const char * type() const;
94 time_t nonceGCInterval
;
95 time_t noncemaxduration
;
96 unsigned int noncemaxuses
;
103 } // namespace Digest
107 #define QOP_AUTH "auth"
109 extern helper
*digestauthenticators
;