Annotation of parser3/src/lib/md5/pa_md5.h, revision 1.7
1.1 paf 1: /** @file
2: Parser: copied from apache 1.3.20 sources.
3: Replaced ap_ to pa_ prefixes. linked into all targets but Apache-module target,
4: where linked targets/apache/pa_md5c.c stub instead.
5:
1.5 paf 6: Copyright (c) 2001, 2003 ArtLebedev Group (http://www.artlebedev.com)
1.1 paf 7: */
8:
9: /*
10: * This is work is derived from material Copyright RSA Data Security, Inc.
11: *
12: * The RSA copyright statement and Licence for that original material is
13: * included below. This is followed by the Apache copyright statement and
14: * licence for the modifications made to that material.
15: */
16:
17: /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
18: rights reserved.
19:
20: License to copy and use this software is granted provided that it
21: is identified as the "RSA Data Security, Inc. MD5 Message-Digest
22: Algorithm" in all material mentioning or referencing this software
23: or this function.
24:
25: License is also granted to make and use derivative works provided
26: that such works are identified as "derived from the RSA Data
27: Security, Inc. MD5 Message-Digest Algorithm" in all material
28: mentioning or referencing the derived work.
29:
30: RSA Data Security, Inc. makes no representations concerning either
31: the merchantability of this software or the suitability of this
32: software for any particular purpose. It is provided "as is"
33: without express or implied warranty of any kind.
34:
35: These notices must be retained in any copies of any part of this
36: documentation and/or software.
37: */
38:
39: /* ====================================================================
40: * Copyright (c) 1996-1999 The Apache Group. All rights reserved.
41: *
42: * Redistribution and use in source and binary forms, with or without
43: * modification, are permitted provided that the following conditions
44: * are met:
45: *
46: * 1. Redistributions of source code must retain the above copyright
47: * notice, this list of conditions and the following disclaimer.
48: *
49: * 2. Redistributions in binary form must reproduce the above copyright
50: * notice, this list of conditions and the following disclaimer in
51: * the documentation and/or other materials provided with the
52: * distribution.
53: *
54: * 3. All advertising materials mentioning features or use of this
55: * software must display the following acknowledgment:
56: * "This product includes software developed by the Apache Group
57: * for use in the Apache HTTP server project (http://www.apache.org/)."
58: *
59: * 4. The names "Apache Server" and "Apache Group" must not be used to
60: * endorse or promote products derived from this software without
61: * prior written permission. For written permission, please contact
62: * apache@apache.org.
63: *
64: * 5. Products derived from this software may not be called "Apache"
65: * nor may "Apache" appear in their names without prior written
66: * permission of the Apache Group.
67: *
68: * 6. Redistributions of any form whatsoever must retain the following
69: * acknowledgment:
70: * "This product includes software developed by the Apache Group
71: * for use in the Apache HTTP server project (http://www.apache.org/)."
72: *
73: * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
74: * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
75: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
76: * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE GROUP OR
77: * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
78: * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
79: * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
80: * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
81: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
82: * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
83: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
84: * OF THE POSSIBILITY OF SUCH DAMAGE.
85: * ====================================================================
86: *
87: * This software consists of voluntary contributions made by many
88: * individuals on behalf of the Apache Group and was originally based
89: * on public domain software written at the National Center for
90: * Supercomputing Applications, University of Illinois, Urbana-Champaign.
91: * For more information on the Apache Group and the Apache HTTP server
92: * project, please see <http://www.apache.org/>.
93: *
94: */
95:
1.2 paf 96: #ifndef PA_MD5_H
97: #define PA_MD5_H
1.3 paf 98:
1.7 ! paf 99: static const char* IDENT_MD5_H="$Date: 2003/04/14 14:59:29 $";
1.1 paf 100:
101: #define PA_API_EXPORT(rtype) rtype
102:
103: #ifdef __cplusplus
104: extern "C" {
105: #endif
106:
1.2 paf 107: #ifndef APACHE_MD5_H
108:
1.1 paf 109: /* MD5.H - header file for MD5C.C */
110:
111: #define MD5_DIGESTSIZE 16
112:
113: /* UINT4 defines a four byte word */
114: typedef unsigned int UINT4;
115:
1.2 paf 116: #endif
117:
1.1 paf 118: /* MD5 context. */
119: typedef struct {
120: UINT4 state[4]; /* state (ABCD) */
121: UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */
122: unsigned char buffer[64]; /* input buffer */
123: } PA_MD5_CTX;
124:
125: /*
126: * Define the Magic String prefix that identifies a password as being
127: * hashed using our algorithm.
128: */
129: #define PA_MD5PW_ID "$apr1$"
130: #define PA_MD5PW_IDLEN 6
131:
1.7 ! paf 132: PA_API_EXPORT(void) PA_MD5Init(PA_MD5_CTX *context);
! 133: PA_API_EXPORT(void) PA_MD5Update(PA_MD5_CTX *context, const unsigned char *input,
1.1 paf 134: unsigned int inputLen);
1.7 ! paf 135: PA_API_EXPORT(void) PA_MD5Final(unsigned char digest[MD5_DIGESTSIZE],
1.1 paf 136: PA_MD5_CTX *context);
1.7 ! paf 137: PA_API_EXPORT(void) PA_MD5Encode(const unsigned char *password,
1.6 paf 138: const unsigned char *salt, int mix_in_magic_string,
1.7 ! paf 139: char *result_base64, size_t result_base64_size);
! 140: PA_API_EXPORT(void) PA_to64(char *s, unsigned long v, int n);
1.1 paf 141:
142: #ifdef __cplusplus
143: }
144: #endif
145:
1.2 paf 146: #endif /* !PA_MD5_H */
E-mail: