Revert "Revert "and added files""
[bcm963xx.git] / userapps / opensource / siproxd / src / digcalc.h
1
2 /* TAKEN from rcf2617.txt */
3
4 /* $Id: digcalc.h,v 1.2 2004/04/11 10:40:00 hb9xar Exp $ */
5
6 #ifndef _DIGCALC_H_
7 #define _DIGCALC_H_
8
9 #define HASHLEN 16
10 typedef char HASH[HASHLEN];
11 #define HASHHEXLEN 32
12 typedef char HASHHEX[HASHHEXLEN+1];
13 #define IN
14 #define OUT
15
16 /* calculate H(A1) as per HTTP Digest spec */
17 void DigestCalcHA1(
18     IN char * pszAlg,
19     IN char * pszUserName,
20     IN char * pszRealm,
21     IN char * pszPassword,
22     IN char * pszNonce,
23     IN char * pszCNonce,
24     OUT HASHHEX SessionKey
25     );
26
27 /* calculate request-digest/response-digest as per HTTP Digest spec */
28 void DigestCalcResponse(
29     IN HASHHEX HA1,           /* H(A1) */
30     IN char * pszNonce,       /* nonce from server */
31     IN char * pszNonceCount,  /* 8 hex digits */
32     IN char * pszCNonce,      /* client nonce */
33     IN char * pszQop,         /* qop-value: "", "auth", "auth-int" */
34     IN char * pszMethod,      /* method from the request */
35     IN char * pszDigestUri,   /* requested URL */
36     IN HASHHEX HEntity,       /* H(entity body) if qop="auth-int" */
37     OUT HASHHEX Response      /* request-digest or response-digest */
38     );
39
40
41
42 #endif