~ubuntu-branches/debian/lenny/fpc/lenny

« back to all changes in this revision

Viewing changes to fpcsrc/packages/base/httpd/httpd-2.2/aprutil/apr_md5.inc

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-05-17 17:12:11 UTC
  • mfrom: (3.1.9 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080517171211-9qi33xhd9evfa0kg
Tags: 2.2.0-dfsg1-9
[ Torsten Werner ]
* Add Mazen Neifer to Uploaders field.

[ Mazen Neifer ]
* Moved FPC sources into a version dependent directory from /usr/share/fpcsrc
  to /usr/share/fpcsrc/${FPCVERSION}. This allow installing more than on FPC
  release.
* Fixed far call issue in compiler preventing building huge binearies.
  (closes: #477743)
* Updated building dependencies, recomennded and suggested packages.
* Moved fppkg to fp-utils as it is just a helper tool and is not required by
  compiler.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
{
 
2
 * This is work is derived from material Copyright RSA Data Security, Inc.
 
3
 *
 
4
 * The RSA copyright statement and Licence for that original material is
 
5
 * included below. This is followed by the Apache copyright statement and
 
6
 * licence for the modifications made to that material.
 
7
 }
 
8
 
 
9
{ Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
 
10
   rights reserved.
 
11
 
 
12
   License to copy and use this software is granted provided that it
 
13
   is identified as the "RSA Data Security, Inc. MD5 Message-Digest
 
14
   Algorithm" in all material mentioning or referencing this software
 
15
   or this function.
 
16
 
 
17
   License is also granted to make and use derivative works provided
 
18
   that such works are identified as "derived from the RSA Data
 
19
   Security, Inc. MD5 Message-Digest Algorithm" in all material
 
20
   mentioning or referencing the derived work.
 
21
 
 
22
   RSA Data Security, Inc. makes no representations concerning either
 
23
   the merchantability of this software or the suitability of this
 
24
   software for any particular purpose. It is provided "as is"
 
25
   without express or implied warranty of any kind.
 
26
 
 
27
   These notices must be retained in any copies of any part of this
 
28
   documentation and/or software.
 
29
 }
 
30
 
 
31
{ Copyright 2000-2005 The Apache Software Foundation or its licensors, as
 
32
 * applicable.
 
33
 *
 
34
 * Licensed under the Apache License, Version 2.0 (the "License");
 
35
 * you may not use this file except in compliance with the License.
 
36
 * You may obtain a copy of the License at
 
37
 *
 
38
 *     http://www.apache.org/licenses/LICENSE-2.0
 
39
 *
 
40
 * Unless required by applicable law or agreed to in writing, software
 
41
 * distributed under the License is distributed on an "AS IS" BASIS,
 
42
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
43
 * See the License for the specific language governing permissions and
 
44
 * limitations under the License.
 
45
 }
 
46
 
 
47
{#include "apu.h"}
 
48
{$include apr_xlate.inc}
 
49
 
 
50
{
 
51
 * @file apr_md5.h
 
52
 * @brief APR MD5 Routines
 
53
 }
 
54
 
 
55
{
 
56
 * @defgroup APR_MD5 MD5 Routines
 
57
 * @ingroup APR
 
58
 }
 
59
 
 
60
const
 
61
{ The MD5 digest size }
 
62
  APR_MD5_DIGESTSIZE = 16;
 
63
 
 
64
{ @see apr_md5_ctx_t }
 
65
type
 
66
  TDigestArray = array [0..APR_MD5_DIGESTSIZE] of Char;
 
67
 
 
68
  Papr_md5_ctx_t = ^apr_md5_ctx_t;
 
69
 
 
70
{ MD5 context. }
 
71
  apr_md5_ctx_t = record
 
72
    { state (ABCD) }
 
73
    state: array [1..4] of apr_uint32_t;
 
74
    { number of bits, modulo 2^64 (lsb first) }
 
75
    count: array [1..2] of apr_uint32_t;
 
76
    { input buffer }
 
77
    buffer: array [1..64] of Char;
 
78
    { translation handle
 
79
     *  ignored if xlate is unsupported
 
80
     }
 
81
    xlate: Papr_xlate_t;
 
82
  end;
 
83
 
 
84
{
 
85
 * MD5 Initialize.  Begins an MD5 operation, writing a new context.
 
86
 * @param context The MD5 context to initialize.
 
87
 }
 
88
function apr_md5_init(context: Papr_md5_ctx_t): apr_status_t;
 
89
 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
 
90
 external LibAPRUtil name LibNamePrefix + 'apr_md5_init' + LibSuff4;
 
91
 
 
92
{
 
93
 * MD5 translation setup.  Provides the APR translation handle to be used 
 
94
 * for translating the content before calculating the digest.
 
95
 * @param context The MD5 content to set the translation for.
 
96
 * @param xlate The translation handle to use for this MD5 context 
 
97
 }
 
98
function apr_md5_set_xlate(context: Papr_md5_ctx_t;
 
99
 xlate: Papr_xlate_t): apr_status_t;
 
100
 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
 
101
 external LibAPRUtil name LibNamePrefix + 'apr_md5_set_xlate' + LibSuff8;
 
102
 
 
103
{
 
104
 * MD5 block update operation.  Continue an MD5 message-digest operation, 
 
105
 * processing another message block, and updating the context.
 
106
 * @param context The MD5 content to update.
 
107
 * @param input next message block to update
 
108
 * @param inputLen The length of the next message block
 
109
 }
 
110
function apr_md5_update(context: Papr_md5_ctx_t;
 
111
 input: Pointer; inputLen: apr_size_t): apr_status_t;
 
112
 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
 
113
 external LibAPRUtil name LibNamePrefix + 'apr_md5_update' + LibSuff12;
 
114
 
 
115
{
 
116
 * MD5 finalization.  Ends an MD5 message-digest operation, writing the 
 
117
 * message digest and zeroing the context
 
118
 * @param digest The final MD5 digest
 
119
 * @param context The MD5 content we are finalizing.
 
120
 }
 
121
function apr_md5_final(digest: TDigestArray;
 
122
 context: Papr_md5_ctx_t): apr_status_t;
 
123
 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
 
124
 external LibAPRUtil name LibNamePrefix + 'apr_md5_final' + LibSuff8;
 
125
 
 
126
{
 
127
 * MD5 in one step
 
128
 * @param digest The final MD5 digest
 
129
 * @param input The message block to use
 
130
 * @param inputLen The length of the message block
 
131
 }
 
132
function apr_md5(digest: TDigestArray;
 
133
 input: Pointer; inputLen: apr_size_t): apr_status_t;
 
134
 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
 
135
 external LibAPRUtil name LibNamePrefix + 'apr_md5' + LibSuff12;
 
136
 
 
137
{
 
138
 * Encode a password using an MD5 algorithm
 
139
 * @param password The password to encode
 
140
 * @param salt The salt to use for the encoding
 
141
 * @param result The string to store the encoded password in
 
142
 * @param nbytes The length of the string
 
143
 }
 
144
function apr_md5_encode(const password, salt: PChar;
 
145
 result: PChar; nbytes: apr_size_t): apr_status_t;
 
146
 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
 
147
 external LibAPRUtil name LibNamePrefix + 'apr_md5_encode' + LibSuff16;
 
148
 
 
149
{
 
150
 * Validate hashes created by APR-supported algorithms: md5 and sha1.
 
151
 * hashes created by crypt are supported only on platforms that provide
 
152
 * crypt(3), so don't rely on that function unless you know that your
 
153
 * application will be run only on platforms that support it.  On platforms
 
154
 * that don't support crypt(3), this falls back to a clear text string
 
155
 * comparison.
 
156
 * @param passwd The password to validate
 
157
 * @param hash The password to validate against
 
158
 }
 
159
function apr_password_validate(const passwd, hash: PChar): apr_status_t;
 
160
 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
 
161
 external LibAPRUtil name LibNamePrefix + 'apr_password_validate' + LibSuff8;
 
162