]>
Commit | Line | Data |
---|---|---|
2d70df72 | 1 | /* The source in this file is derived from the reference implementation |
2 | * in RFC 2617. | |
3 | * RFC 2617 is Copyright (C) The Internet Society (1999). All Rights Reserved. | |
4 | * | |
5 | * The following copyright and licence statement covers all changes made to the | |
6 | * reference implementation. | |
7 | * | |
c5dd4956 | 8 | * Key changes to the reference implementation were: |
2d70df72 | 9 | * alteration to a plain C layout. |
10 | * Create CvtBin function | |
11 | * Allow CalcHA1 to make use of precaculated username:password:realm hash's | |
12 | * to prevent squid knowing the users password (idea suggested in RFC 2617). | |
13 | */ | |
14 | ||
2d70df72 | 15 | /* |
2d70df72 | 16 | * DEBUG: |
17 | * AUTHOR: RFC 2617 & Robert Collins | |
18 | * | |
19 | * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ | |
20 | * ---------------------------------------------------------- | |
21 | * | |
22 | * Squid is the result of efforts by numerous individuals from the | |
23 | * Internet community. Development is led by Duane Wessels of the | |
24 | * National Laboratory for Applied Network Research and funded by the | |
25 | * National Science Foundation. Squid is Copyrighted (C) 1998 by | |
26 | * the Regents of the University of California. Please see the | |
27 | * COPYRIGHT file for full details. Squid incorporates software | |
28 | * developed and/or copyrighted by other sources. Please see the | |
29 | * CREDITS file for full details. | |
30 | * | |
31 | * This program is free software; you can redistribute it and/or modify | |
32 | * it under the terms of the GNU General Public License as published by | |
33 | * the Free Software Foundation; either version 2 of the License, or | |
34 | * (at your option) any later version. | |
35 | * | |
36 | * This program is distributed in the hope that it will be useful, | |
37 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
38 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
39 | * GNU General Public License for more details. | |
40 | * | |
41 | * You should have received a copy of the GNU General Public License | |
42 | * along with this program; if not, write to the Free Software | |
43 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. | |
44 | * | |
45 | */ | |
b5638623 | 46 | #ifndef SQUID_RFC2617_H |
47 | #define SQUID_RFC2617_H | |
2d70df72 | 48 | |
25f98340 AJ |
49 | #ifdef __cplusplus |
50 | extern "C" { | |
51 | #endif | |
52 | ||
2d70df72 | 53 | #define HASHLEN 16 |
8236d34f | 54 | typedef char HASH[HASHLEN]; |
2d70df72 | 55 | #define HASHHEXLEN 32 |
8236d34f | 56 | typedef char HASHHEX[HASHHEXLEN + 1]; |
2d70df72 | 57 | |
8236d34f A |
58 | /* calculate H(A1) as per HTTP Digest spec */ |
59 | extern void DigestCalcHA1( | |
60 | const char *pszAlg, | |
61 | const char *pszUserName, | |
62 | const char *pszRealm, | |
63 | const char *pszPassword, | |
64 | const char *pszNonce, | |
65 | const char *pszCNonce, | |
66 | HASH HA1, | |
67 | HASHHEX SessionKey | |
68 | ); | |
2d70df72 | 69 | |
8236d34f A |
70 | /* calculate request-digest/response-digest as per HTTP Digest spec */ |
71 | extern void DigestCalcResponse( | |
72 | const HASHHEX HA1, /* H(A1) */ | |
73 | const char *pszNonce, /* nonce from server */ | |
74 | const char *pszNonceCount, /* 8 hex digits */ | |
75 | const char *pszCNonce, /* client nonce */ | |
76 | const char *pszQop, /* qop-value: "", "auth", "auth-int" */ | |
77 | const char *pszMethod, /* method from the request */ | |
78 | const char *pszDigestUri, /* requested URL */ | |
79 | const HASHHEX HEntity, /* H(entity body) if qop="auth-int" */ | |
80 | HASHHEX Response /* request-digest or response-digest */ | |
81 | ); | |
2d70df72 | 82 | |
8236d34f | 83 | extern void CvtHex(const HASH Bin, HASHHEX Hex); |
2d70df72 | 84 | |
8236d34f | 85 | extern void CvtBin(const HASHHEX Hex, HASH Bin); |
2d70df72 | 86 | |
25f98340 AJ |
87 | #ifdef __cplusplus |
88 | } | |
89 | #endif | |
b5638623 | 90 | #endif /* SQUID_RFC2617_H */ |