4 * Copyright 2003-2004 Oliver Feiler <kiza@kcore.de>
8 * This is the sample implementation from RFC 2617.
9 * The code has been modified to work with Colin Plumb's
10 * MD5 implementation rather than using RSA's.
14 typedef char HASH[HASHLEN];
16 typedef char HASHHEX[HASHHEXLEN+1];
25 /* calculate H(A1) as per HTTP Digest spec */
28 IN char * pszUserName,
30 IN char * pszPassword,
33 OUT HASHHEX SessionKey
36 /* calculate request-digest/response-digest as per HTTP Digest spec */
37 void DigestCalcResponse(
38 IN HASHHEX HA1, /* H(A1) */
39 IN char * pszNonce, /* nonce from server */
40 IN char * pszNonceCount, /* 8 hex digits */
41 IN char * pszCNonce, /* client nonce */
42 IN char * pszQop, /* qop-value: "", "auth", "auth-int" */
43 IN char * pszMethod, /* method from the request */
44 IN char * pszDigestUri, /* requested URL */
45 IN HASHHEX HEntity, /* H(entity body) if qop="auth-int" */
46 OUT HASHHEX Response /* request-digest or response-digest */