1 //-------------------------------------------------------------------
2 // Copyright (C) The Internet Society (1999). All Rights Reserved.
4 // This document and translations of it may be copied and furnished to
5 // others, and derivative works that comment on or otherwise explain it
6 // or assist in its implementation may be prepared, copied, published
7 // and distributed, in whole or in part, without restriction of any
8 // kind, provided that the above copyright notice and this paragraph are
9 // included on all such copies and derivative works. However, this
10 // document itself may not be modified in any way, such as by removing
11 // the copyright notice or references to the Internet Society or other
12 // Internet organizations, except as needed for the purpose of
13 // developing Internet standards in which case the procedures for
14 // copyrights defined in the Internet Standards process must be
15 // followed, or as required to translate it into languages other than
18 // The limited permissions granted above are perpetual and will not be
19 // revoked by the Internet Society or its successors or assigns.
21 // This document and the information contained herein is provided on an
22 // "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
23 // TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
24 // BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
25 // HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
26 // MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
29 // Modifiyed by Intel Corporation, 2005
30 //-------------------------------------------------------------------------
33 typedef unsigned char HASH[HASHLEN];
35 typedef char HASHHEX[HASHHEXLEN+1];
37 /* calculate H(A1) as per HTTP Digest spec */
48 /* calculate request-digest/response-digest as per HTTP Digest spec */
49 void DigestCalcResponse(
50 HASHHEX HA1, /* H(A1) */
51 char * pszNonce, /* nonce from server */
52 char * pszNonceCount, /* 8 hex digits */
53 char * pszCNonce, /* client nonce */
54 char * pszQop, /* qop-value: "", "auth", "auth-int" */
55 char * pszMethod, /* method from the request */
56 char * pszDigestUri, /* requested URL */
57 HASHHEX HEntity, /* H(entity body) if qop="auth-int" */
58 HASHHEX Response /* request-digest or response-digest */