]> git.ipfire.org Git - thirdparty/squid.git/blob - include/md5.h
SSL->HTTP gatewaying support by Benno Rice
[thirdparty/squid.git] / include / md5.h
1 /*
2 * $Id: md5.h,v 1.9 2001/04/14 00:03:20 hno Exp $
3 */
4
5 #ifndef MD5_H
6 #define MD5_H
7
8 #if USE_OPENSSL
9
10 #if HAVE_OPENSSL_MD5_H
11 #include <openssl/md5.h>
12 #else
13 #error Cannot find OpenSSL headers
14 #endif
15
16 /* Hack to adopt Squid to the OpenSSL syntax */
17 #define MD5_DIGEST_CHARS MD5_DIGEST_LENGTH
18
19 #define MD5Init MD5_Init
20 #define MD5Update MD5_Update
21 #define MD5Final MD5_Final
22
23 #else /* USE_OPENSSL */
24
25 /* MD5.H - header file for MD5C.C
26 */
27
28 /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
29 * rights reserved.
30 *
31 * License to copy and use this software is granted provided that it
32 * is identified as the "RSA Data Security, Inc. MD5 Message-Digest
33 * Algorithm" in all material mentioning or referencing this software
34 * or this function.
35 *
36 * License is also granted to make and use derivative works provided
37 * that such works are identified as "derived from the RSA Data
38 * Security, Inc. MD5 Message-Digest Algorithm" in all material
39 * mentioning or referencing the derived work.
40 *
41 * RSA Data Security, Inc. makes no representations concerning either
42 * the merchantability of this software or the suitability of this
43 * software for any particular purpose. It is provided "as is"
44 * without express or implied warranty of any kind.
45 *
46 * These notices must be retained in any copies of any part of this
47 * documentation and/or software.
48 */
49
50 #include "squid_types.h"
51
52 /* MD5 context. */
53 typedef struct {
54 u_int32_t state[4]; /* state (ABCD) */
55 u_int32_t count[2]; /* number of bits, modulo 2^64 (lsb first) */
56 unsigned char buffer[64]; /* input buffer */
57 } MD5_CTX;
58
59 void MD5Init(MD5_CTX *);
60 void MD5Update(MD5_CTX *, const unsigned char *, unsigned int);
61 void MD5Final(unsigned char[16], MD5_CTX *);
62
63 #define MD5_DIGEST_CHARS 16
64
65 #endif /* USE_OPENSSL */
66 #endif /* MD5_H */