~ubuntu-branches/ubuntu/oneiric/libapache-mod-jk/oneiric

« back to all changes in this revision

Viewing changes to jk/native/common/jk_md5.h

  • Committer: Bazaar Package Importer
  • Author(s): Steve Kowalik
  • Date: 2006-08-05 16:30:53 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060805163053-myf66gm6j1a21ps6
Tags: 1:1.2.18-1ubuntu1
Merge from Debian unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 *  Copyright 1999-2004 The Apache Software Foundation
3
 
 *
4
 
 *  Licensed under the Apache License, Version 2.0 (the "License");
5
 
 *  you may not use this file except in compliance with the License.
6
 
 *  You may obtain a copy of the License at
7
 
 *
8
 
 *      http://www.apache.org/licenses/LICENSE-2.0
9
 
 *
10
 
 *  Unless required by applicable law or agreed to in writing, software
11
 
 *  distributed under the License is distributed on an "AS IS" BASIS,
12
 
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 
 *  See the License for the specific language governing permissions and
14
 
 *  limitations under the License.
15
 
 */
16
 
 
17
 
/*
18
 
 * This is work is derived from material Copyright RSA Data Security, Inc.
19
 
 *
20
 
 * The RSA copyright statement and Licence for that original material is
21
 
 * included below. This is followed by the Apache copyright statement and
22
 
 * licence for the modifications made to that material.
23
 
 */
24
 
 
25
 
/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
26
 
   rights reserved.
27
 
 
28
 
   License to copy and use this software is granted provided that it
29
 
   is identified as the "RSA Data Security, Inc. MD5 Message-Digest
30
 
   Algorithm" in all material mentioning or referencing this software
31
 
   or this function.
32
 
 
33
 
   License is also granted to make and use derivative works provided
34
 
   that such works are identified as "derived from the RSA Data
35
 
   Security, Inc. MD5 Message-Digest Algorithm" in all material
36
 
   mentioning or referencing the derived work.
37
 
 
38
 
   RSA Data Security, Inc. makes no representations concerning either
39
 
   the merchantability of this software or the suitability of this
40
 
   software for any particular purpose. It is provided "as is"
41
 
   without express or implied warranty of any kind.
42
 
 
43
 
   These notices must be retained in any copies of any part of this
44
 
   documentation and/or software.
45
 
*/
46
 
 
47
 
#ifndef JK_APACHE_MD5_H
48
 
#define JK_APACHE_MD5_H
49
 
 
50
 
#ifdef __cplusplus
51
 
extern "C"
52
 
{
53
 
#endif
54
 
 
55
 
/* MD5.H - header file for MD5.C */
56
 
 
57
 
#define JK_MD5_DIGESTSIZE 16
58
 
 
59
 
/* JK_UINT4 defines a four byte word */
60
 
#if defined (WIN32)
61
 
    typedef DWORD JK_UINT4;
62
 
#elif defined(NETWARE) && !defined(__NOVELL_LIBC__)
63
 
    typedef unsigned int JK_UINT4;
64
 
#elif defined(HAVE_UINT32_T)
65
 
    typedef uint32_t JK_UINT4;
66
 
#elif defined(HAVE_U_INT32_T)
67
 
    typedef u_int32_t JK_UINT4;
68
 
#else
69
 
    typedef unsigned long JK_UINT4; /* ansi HAVE_LONG */
70
 
#endif
71
 
 
72
 
/* MD5 context. */
73
 
typedef struct
74
 
{
75
 
    JK_UINT4 state[4];      /* state (ABCD) */
76
 
    JK_UINT4 count[2];      /* number of bits, modulo 2^64 (lsb first) */
77
 
    unsigned char buffer[64];       /* input buffer */
78
 
} JK_MD5_CTX;
79
 
 
80
 
/*
81
 
 * Define the Magic String prefix that identifies a password as being
82
 
 * hashed using our algorithm.
83
 
 */
84
 
#define JK_MD5PW_ID "$apr1$"
85
 
#define JK_MD5PW_IDLEN 6
86
 
 
87
 
char *JK_METHOD jk_hextocstr(unsigned char *org, char *dst, int n);
88
 
char *JK_METHOD jk_md5(const unsigned char *org,
89
 
                       const unsigned char *org2, char *dst);
90
 
 
91
 
 
92
 
#ifdef __cplusplus
93
 
}
94
 
#endif
95
 
 
96
 
#endif                          /* !JK_APACHE_MD5_H */