Browse code

core: fix another bunch of 'no real prototype' warnings, add doxygen docs

* fix another bunch of gcc 4.5 'no real prototype' warnings by making the MD5
functions typesafe (removing this PROTO_LIST stuff)
* refactoring of function definitions to use a proper style, like everybody else
* remove not needed defines for datatypes, delete the then empty header completely
* remove the unneeded include of md5global.h from a few modules
* fix callers of MD5 utility functions which already use a proper type
* adapt format of RSA copyright notices to the common style as well
* add doxygen documentations to all functions and defines
* similar changes have been done in kamailio, but have been not ported to this
repository yet

Henning Westerholt authored on 29/06/2011 20:12:28
Showing 11 changed files
... ...
@@ -117,7 +117,7 @@ void compute_md5(char *dst, char *src, int src_len)
117 117
 	unsigned char digest[16];
118 118
 	MD5Init (&context);
119 119
   	MD5Update (&context, src, src_len);
120
-	MD5Final (digest, &context);
120
+	U_MD5Final (digest, &context);
121 121
 	string2hex(digest, 16, dst);
122 122
 }
123 123
 
... ...
@@ -30,7 +30,6 @@
30 30
 
31 31
 
32 32
 #include <string.h>
33
-#include "md5global.h"
34 33
 #include "md5.h"
35 34
 
36 35
 
... ...
@@ -57,11 +56,9 @@
57 57
 #define S44 21
58 58
 /*@} */
59 59
 
60
-static void MD5Transform PROTO_LIST ((UINT4 [4], unsigned char [64]));
61
-static void Encode PROTO_LIST
62
-  ((unsigned char *, UINT4 *, unsigned int));
63
-static void Decode PROTO_LIST
64
-  ((UINT4 *, unsigned char *, unsigned int));
60
+static void MD5Transform(unsigned int [4], unsigned char [64]);
61
+static void Encode(unsigned char *, unsigned int *, unsigned int);
62
+static void Decode(unsigned int *, unsigned char *, unsigned int);
65 63
 
66 64
 static unsigned char PADDING[64] = {
67 65
   0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
... ...
@@ -93,22 +90,22 @@ static unsigned char PADDING[64] = {
93 93
 
94 94
 /*@{ */
95 95
 #define FF(a, b, c, d, x, s, ac) { \
96
- (a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); \
96
+ (a) += F ((b), (c), (d)) + (x) + (unsigned int)(ac); \
97 97
  (a) = ROTATE_LEFT ((a), (s)); \
98 98
  (a) += (b); \
99 99
   }
100 100
 #define GG(a, b, c, d, x, s, ac) { \
101
- (a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); \
101
+ (a) += G ((b), (c), (d)) + (x) + (unsigned int)(ac); \
102 102
  (a) = ROTATE_LEFT ((a), (s)); \
103 103
  (a) += (b); \
104 104
   }
105 105
 #define HH(a, b, c, d, x, s, ac) { \
106
- (a) += H ((b), (c), (d)) + (x) + (UINT4)(ac); \
106
+ (a) += H ((b), (c), (d)) + (x) + (unsigned int)(ac); \
107 107
  (a) = ROTATE_LEFT ((a), (s)); \
108 108
  (a) += (b); \
109 109
   }
110 110
 #define II(a, b, c, d, x, s, ac) { \
111
- (a) += I ((b), (c), (d)) + (x) + (UINT4)(ac); \
111
+ (a) += I ((b), (c), (d)) + (x) + (unsigned int)(ac); \
112 112
  (a) = ROTATE_LEFT ((a), (s)); \
113 113
  (a) += (b); \
114 114
   }
... ...
@@ -120,8 +117,7 @@ static unsigned char PADDING[64] = {
120 120
  * MD5 context initialization. Begins an MD5 operation, writing a new context.
121 121
  * \param context initialized context
122 122
  */
123
-void MD5Init (context)
124
-MD5_CTX *context;
123
+void MD5Init (MD5_CTX *context)
125 124
 {
126 125
   context->count[0] = context->count[1] = 0;
127 126
   /* Load magic initialization constants.
... ...
@@ -142,10 +138,7 @@ MD5_CTX *context;
142 142
  * \param input input block
143 143
  * \param inputLen length of input block
144 144
  */
145
-void MD5Update (context, input, inputLen)
146
-MD5_CTX *context;
147
-unsigned char *input;
148
-unsigned int inputLen;
145
+void U_MD5Update (MD5_CTX *context, unsigned char *input, unsigned int inputLen)
149 146
 {
150 147
   unsigned int i, index, partLen;
151 148
 
... ...
@@ -153,11 +146,11 @@ unsigned int inputLen;
153 153
   index = (unsigned int)((context->count[0] >> 3) & 0x3F);
154 154
 
155 155
   /* Update number of bits */
156
-  if ((context->count[0] += ((UINT4)inputLen << 3))
156
+  if ((context->count[0] += ((unsigned int)inputLen << 3))
157 157
 
158
-   < ((UINT4)inputLen << 3))
158
+   < ((unsigned int)inputLen << 3))
159 159
  context->count[1]++;
160
-  context->count[1] += ((UINT4)inputLen >> 29);
160
+  context->count[1] += ((unsigned int)inputLen >> 29);
161 161
 
162 162
   partLen = 64 - index;
163 163
 
... ...
@@ -165,7 +158,7 @@ unsigned int inputLen;
165 165
 */
166 166
   if (inputLen >= partLen) {
167 167
  memcpy
168
-   ((POINTER)&context->buffer[index], (POINTER)input, partLen);
168
+   ((unsigned char *)&context->buffer[index], (unsigned char *)input, partLen);
169 169
  MD5Transform (context->state, context->buffer);
170 170
 
171 171
  for (i = partLen; i + 63 < inputLen; i += 64)
... ...
@@ -178,7 +171,7 @@ unsigned int inputLen;
178 178
 
179 179
   /* Buffer remaining input */
180 180
   memcpy
181
- ((POINTER)&context->buffer[index], (POINTER)&input[i],
181
+ ((unsigned char *)&context->buffer[index], (unsigned char *)&input[i],
182 182
   inputLen-i);
183 183
 }
184 184
 
... ...
@@ -190,9 +183,7 @@ unsigned int inputLen;
190 190
  * \param digest message digest
191 191
  * \param context context
192 192
  */
193
-void MD5Final (digest, context)
194
-unsigned char digest[16];
195
-MD5_CTX *context;
193
+void U_MD5Final (unsigned char digest[16], MD5_CTX *context)
196 194
 {
197 195
   unsigned char bits[8];
198 196
   unsigned int index, padLen;
... ...
@@ -204,17 +195,17 @@ MD5_CTX *context;
204 204
 */
205 205
   index = (unsigned int)((context->count[0] >> 3) & 0x3f);
206 206
   padLen = (index < 56) ? (56 - index) : (120 - index);
207
-  MD5Update (context, PADDING, padLen);
207
+  U_MD5Update (context, PADDING, padLen);
208 208
 
209 209
   /* Append length (before padding) */
210
-  MD5Update (context, bits, 8);
210
+  U_MD5Update (context, bits, 8);
211 211
 
212 212
   /* Store state in digest */
213 213
   Encode (digest, context->state, 16);
214 214
 
215 215
   /* Zeroize sensitive information.
216 216
 */
217
-  memset ((POINTER)context, 0, sizeof (*context));
217
+  memset ((unsigned char *)context, 0, sizeof (*context));
218 218
 }
219 219
 
220 220
 /**
... ...
@@ -224,11 +215,9 @@ MD5_CTX *context;
224 224
  * \param state transformed state
225 225
  * \param block block input for transformation
226 226
  */
227
-static void MD5Transform (state, block)
228
-UINT4 state[4];
229
-unsigned char block[64];
227
+static void MD5Transform (unsigned int state[4], unsigned char block[64])
230 228
 {
231
-  UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16];
229
+  unsigned int a = state[0], b = state[1], c = state[2], d = state[3], x[16];
232 230
 
233 231
   Decode (x, block, 64);
234 232
 
... ...
@@ -311,50 +300,44 @@ unsigned char block[64];
311 311
 
312 312
   /* Zeroize sensitive information.
313 313
 */
314
-  memset ((POINTER)x, 0, sizeof (x));
314
+  memset ((unsigned char *)x, 0, sizeof (x));
315 315
 }
316 316
 
317 317
 /**
318
- * \brief Encodes input (UINT4) into output (unsigned char)
318
+ * \brief Encodes input (unsigned int) into output (unsigned char)
319 319
  * 
320
- * Encodes input (UINT4) into output (unsigned char). Assumes len is
320
+ * Encodes input (unsigned int) into output (unsigned char). Assumes len is
321 321
  * a multiple of 4.
322 322
  * \param output output character
323 323
  * \param input integer input
324 324
  * \param len length of output
325 325
  */
326
-static void Encode (output, input, len)
327
-unsigned char *output;
328
-UINT4 *input;
329
-unsigned int len;
326
+static void Encode (unsigned char *output, unsigned int *input, unsigned int len)
330 327
 {
331 328
   unsigned int i, j;
332 329
 
333 330
   for (i = 0, j = 0; j < len; i++, j += 4) {
334
- output[j] = (unsigned char)(input[i] & 0xff);
335
- output[j+1] = (unsigned char)((input[i] >> 8) & 0xff);
336
- output[j+2] = (unsigned char)((input[i] >> 16) & 0xff);
337
- output[j+3] = (unsigned char)((input[i] >> 24) & 0xff);
331
+    output[j] = (unsigned char)(input[i] & 0xff);
332
+    output[j+1] = (unsigned char)((input[i] >> 8) & 0xff);
333
+    output[j+2] = (unsigned char)((input[i] >> 16) & 0xff);
334
+    output[j+3] = (unsigned char)((input[i] >> 24) & 0xff);
338 335
   }
339 336
 }
340 337
 
341 338
 /**
342
- * \brief Decodes input (unsigned char) into output (UINT4)
339
+ * \brief Decodes input (unsigned char) into output (unsigned int)
343 340
  * 
344
- * Decodes input (unsigned char) into output (UINT4). Assumes len is
341
+ * Decodes input (unsigned char) into output (unsigned int). Assumes len is
345 342
  * a multiple of 4.
346 343
  * \param output output integer
347 344
  * \param input input character
348 345
  * \param len length of input
349 346
  */
350
-static void Decode (output, input, len)
351
-UINT4 *output;
352
-unsigned char *input;
353
-unsigned int len;
347
+static void Decode (unsigned int *output, unsigned char *input, unsigned int len)
354 348
 {
355 349
   unsigned int i, j;
356 350
 
357 351
   for (i = 0, j = 0; j < len; i++, j += 4)
358
- output[i] = ((UINT4)input[j]) | (((UINT4)input[j+1]) << 8) |
359
-   (((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24);
352
+    output[i] = ((unsigned int)input[j]) | (((unsigned int)input[j+1]) << 8) |
353
+      (((unsigned int)input[j+2]) << 16) | (((unsigned int)input[j+3]) << 24);
360 354
 }
... ...
@@ -31,14 +31,12 @@
31 31
 #ifndef MD5_H
32 32
 #define MD5_H
33 33
 
34
-#include "md5global.h"
35
-
36 34
 /**
37 35
  * \brief MD5 context
38 36
  */
39 37
 typedef struct {
40
-  UINT4 state[4];                                   /* state (ABCD) */
41
-  UINT4 count[2];        /* number of bits, modulo 2^64 (lsb first) */
38
+  unsigned int state[4];                                   /* state (ABCD) */
39
+  unsigned int count[2];        /* number of bits, modulo 2^64 (lsb first) */
42 40
   unsigned char buffer[64];                         /* input buffer */
43 41
 } MD5_CTX;
44 42
 
... ...
@@ -48,7 +46,7 @@ typedef struct {
48 48
  * MD5 context initialization. Begins an MD5 operation, writing a new context.
49 49
  * \param context initialized context
50 50
  */
51
-void MD5Init PROTO_LIST ((MD5_CTX *));
51
+void MD5Init (MD5_CTX *context);
52 52
 
53 53
 /**
54 54
  * \brief MD5 block update operation
... ...
@@ -60,8 +58,7 @@ void MD5Init PROTO_LIST ((MD5_CTX *));
60 60
  * \param input input block
61 61
  * \param inputLen length of input block
62 62
  */
63
-void MD5Update PROTO_LIST
64
-  ((MD5_CTX *, unsigned char *, unsigned int));
63
+void U_MD5Update (MD5_CTX *context, unsigned char *input, unsigned int inputLen);
65 64
 
66 65
   /**
67 66
  * \brief MD5 finalization
... ...
@@ -71,6 +68,35 @@ void MD5Update PROTO_LIST
71 71
  * \param digest message digest
72 72
  * \param context context
73 73
  */
74
-void MD5Final PROTO_LIST ((unsigned char [16], MD5_CTX *));
74
+void U_MD5Final (unsigned char digest[16], MD5_CTX *context);
75
+
76
+/*!
77
+ * \brief Small wrapper around MD5Update
78
+ *
79
+ * Small wrapper around MD5Update, because everybody uses this on 'str' types
80
+ * \param context MD5 context
81
+ * \param input input block
82
+ * \param inputLen length of input block
83
+ * \note please not use this in new code
84
+ * \todo review and fix all wrong usage
85
+ */
86
+static inline void MD5Update (MD5_CTX *context, char *input, unsigned int inputLen)
87
+{
88
+	return U_MD5Update(context, (unsigned char *)input, inputLen);
89
+}
90
+
91
+/*!
92
+ * \brief Small wrapper around MD5Final
93
+ *
94
+ * Small wrapper around MD5Final, because everybody uses this on 'str' types
95
+ * \param digest message digest
96
+ * \param context MD5 context
97
+ * \note please not use this in new code
98
+ * \todo review and fix all wrong usage
99
+ */
100
+static inline void MD5Final (char digest[16], MD5_CTX *context)
101
+{
102
+	U_MD5Final((unsigned char *)digest, context);
103
+}
75 104
 
76 105
 #endif /* MD5_H */
77 106
deleted file mode 100644
... ...
@@ -1,38 +0,0 @@
1
-/* GLOBAL.H - RSAREF types and constants
2
- *
3
- */
4
-
5
-
6
-/* PROTOTYPES should be set to one if and only if the compiler supports
7
-  function argument prototyping.
8
-The following makes PROTOTYPES default to 0 if it has not already
9
-  been defined with C compiler flags.
10
- */
11
-#ifndef MD5GLOBAL_H
12
-#define MD5GLOBAL_H
13
-
14
-
15
-#ifndef PROTOTYPES
16
-#define PROTOTYPES 0
17
-#endif
18
-
19
-/* POINTER defines a generic pointer type */
20
-typedef unsigned char *POINTER;
21
-
22
-/* UINT2 defines a two byte word */
23
-typedef unsigned short int UINT2;
24
-
25
-/* UINT4 defines a four byte word */
26
-typedef unsigned int UINT4;
27
-
28
-/* PROTO_LIST is defined depending on how PROTOTYPES is defined above.
29
-If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it
30
-  returns an empty list.
31
- */
32
-#if PROTOTYPES
33
-#define PROTO_LIST(list) list
34
-#else
35
-#define PROTO_LIST(list) ()
36
-#endif
37
-
38
-#endif /* MD5GLOBAL_H */
... ...
@@ -1,94 +1,67 @@
1
-/* MDDRIVER.C - test driver for MD2, MD4 and MD5
2
- *
3
- */
4
-
5
-
6
-
7
-/* Copyright (C) 1990-2, RSA Data Security, Inc. Created 1990. All
8
-rights reserved.
9
-
10
-RSA Data Security, Inc. makes no representations concerning either
11
-the merchantability of this software or the suitability of this
12
-software for any particular purpose. It is provided "as is"
13
-without express or implied warranty of any kind.
14
-
15
-These notices must be retained in any copies of any part of this
16
-documentation and/or software.
17
- */
18
-
19 1
 /*
20
-
21
-jku: added support to deal with vectors
22
-
23
-*/
2
+ * Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
3
+ * rights reserved.
4
+ * 
5
+ * License to copy and use this software is granted provided that it
6
+ * is identified as the "RSA Data Security, Inc. MD5 Message-Digest
7
+ * Algorithm" in all material mentioning or referencing this software
8
+ * or this function.
9
+ * 
10
+ * License is also granted to make and use derivative works provided
11
+ * that such works are identified as "derived from the RSA Data
12
+ * Security, Inc. MD5 Message-Digest Algorithm" in all material
13
+ * mentioning or referencing the derived work.
14
+ * 
15
+ * RSA Data Security, Inc. makes no representations concerning either
16
+ * the merchantability of this software or the suitability of this
17
+ * software for any particular purpose. It is provided "as is"
18
+ * without express or implied warranty of any kind.
19
+ * 
20
+ * These notices must be retained in any copies of any part of this
21
+ * documentation and/or software.
22
+ */
24 23
 
25 24
 /*!
26 25
  * \file
27
- * \brief SIP-router core :: 
26
+ * \brief SIP-router core :: md5 hash support
28 27
  * \ingroup core
29 28
  * Module: \ref core
30 29
  */
31 30
 
32
-#define MD 5
33
-
34 31
 #include <stdio.h>
35 32
 #include <time.h>
36 33
 #include <string.h>
37
-#include "md5global.h"
38 34
 #include "md5.h"
39 35
 #include "md5utils.h"
40 36
 #include "dprint.h"
41 37
 #include "ut.h"
42 38
 
43 39
 
44
-/*static void MDString PROTO_LIST ((char *));*/
45
-
46
-#define MD_CTX MD5_CTX
47
-#define MDInit MD5Init
48
-#define MDUpdate MD5Update
49
-#define MDFinal MD5Final
50
-
51
-
52
-/* Digests a string array and store the result in dst; assumes
53
-  32 bytes in dst
54
- */
40
+/*!
41
+  * \brief Calculate a MD5 digests over a string array
42
+  * 
43
+  * Calculate a MD5 digests over a string array and stores the result in the
44
+  * destination char array. This function assumes 32 bytes in the destination
45
+  * buffer.
46
+  * \param dst destination
47
+  * \param src string input array
48
+  * \param size elements in the input array
49
+  */
55 50
 void MD5StringArray (char *dst, str src[], int size)
56 51
 {
57
-	MD_CTX context;
52
+	MD5_CTX context;
58 53
 	unsigned char digest[16];
59 54
  	int i;
60 55
 	int len;
61 56
 	char *s;
62 57
 
63
-/*
64
-#	ifdef EXTRA_DEBUG
65
-	int j;
66
-	int sum;
67
-#endif
68
-*/
69
-
70
-	MDInit (&context);
58
+	MD5Init (&context);
71 59
 	for (i=0; i<size; i++) {
72 60
 		trim_len( len, s, src[i] );
73
-/*
74
-#		ifdef EXTRA_DEBUG
75
-		fprintf(stderr, "EXTRA_DEBUG: %d. (%d) {", i+1, len);
76
-		sum=0;
77
-		for (j=0; j<len; j++) {
78
-			fprintf( stderr, "%c ", *(s+j));
79
-			sum+=*(s+j);
80
-		}
81
-		for (j=0; j<len; j++) {
82
-			fprintf( stderr, "%d ", *(s+j));
83
-			sum+=*(s+j);
84
-		}
85
-		fprintf(stderr, " [%d]\n", sum );	
86
-#		endif
87
-*/
88 61
 		if (len > 0)
89
-  			MDUpdate (&context, s, len);
62
+  			MD5Update (&context, s, len);
90 63
   }
91
-  MDFinal (digest, &context);
64
+  U_MD5Final (digest, &context);
92 65
 
93 66
   string2hex(digest, 16, dst );
94 67
   DBG("DEBUG: MD5 calculated: %.*s\n", MD5_LEN, dst );
... ...
@@ -1,7 +1,4 @@
1 1
 /* 
2
- * $Id$
3
- *
4
- *
5 2
  * Copyright (C) 2001-2003 FhG Fokus
6 3
  *
7 4
  * This file is part of ser, a free SIP server.
... ...
@@ -26,6 +23,12 @@
26 26
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
27 27
  */
28 28
 
29
+/*!
30
+ * \file
31
+ * \brief SIP-router core :: md5 hash support
32
+ * \ingroup core
33
+ * Module: \ref core
34
+ */
29 35
 
30 36
 #ifndef _MD5UTILS_H
31 37
 #define _MD5UTILS_H
... ...
@@ -34,6 +37,16 @@
34 34
 
35 35
 #define MD5_LEN	32
36 36
 
37
+/*!
38
+  * \brief Calculate a MD5 digests over a string array
39
+  * 
40
+  * Calculate a MD5 digests over a string array and stores the result in the
41
+  * destination char array. This function assumes 32 bytes in the destination
42
+  * buffer.
43
+  * \param dst destination
44
+  * \param src string input array
45
+  * \param size elements in the input array
46
+  */
37 47
 void MD5StringArray (char *dst, str src[], int size);
38 48
 
39 49
 #endif /* _MD5UTILS_H */
... ...
@@ -44,7 +44,6 @@
44 44
 #include <sys/types.h>
45 45
 #include <netinet/in.h>
46 46
 #include "../../compiler_opt.h"
47
-#include "../../md5global.h"
48 47
 #include "../../md5.h"
49 48
 #include "../../dprint.h"
50 49
 #include "../../ut.h"
... ...
@@ -118,15 +117,15 @@ inline static int calc_bin_nonce_md5(union bin_nonce* b_nonce, int cfg,
118 118
 
119 119
 	MD5Init(&ctx);
120 120
 	
121
-	MD5Update(&ctx, &b_nonce->raw[0], 4 + 4);
121
+	U_MD5Update(&ctx, &b_nonce->raw[0], 4 + 4);
122 122
 	if (cfg && msg){
123 123
 		/* auth extra checks => 2 md5s */
124 124
 		len = 4 + 4 + 16 + 16;
125 125
 #if defined USE_NC  || defined USE_OT_NONCE
126 126
 		if (b_nonce->n.nid_pf & (NF_VALID_NC_ID | NF_VALID_OT_ID)){
127 127
 			/* if extra auth checks enabled, nid & pf are after the 2nd md5 */
128
-			MD5Update(&ctx, (unsigned char*)&b_nonce->n.nid_i, 
129
-							nonce_nid_extra_size);
128
+			U_MD5Update(&ctx, (unsigned char*)&b_nonce->n.nid_i,
129
+                                                        nonce_nid_extra_size);
130 130
 			len+=nonce_nid_extra_size;
131 131
 		}
132 132
 #endif /* USE_NC || USE_OT_NONCE */
... ...
@@ -148,7 +147,7 @@ inline static int calc_bin_nonce_md5(union bin_nonce* b_nonce, int cfg,
148 148
 					  get_from(msg)->tag_value.len);
149 149
 		}
150 150
 		if (cfg & AUTH_CHECK_SRC_IP) {
151
-			MD5Update(&ctx, msg->rcv.src_ip.u.addr, msg->rcv.src_ip.len);
151
+			U_MD5Update(&ctx, msg->rcv.src_ip.u.addr, msg->rcv.src_ip.len);
152 152
 		}
153 153
 		MD5Update(&ctx, secret2->s, secret2->len);
154 154
 		MD5Final(&b_nonce->n.md5_2[0], &ctx);
... ...
@@ -159,7 +158,7 @@ inline static int calc_bin_nonce_md5(union bin_nonce* b_nonce, int cfg,
159 159
 		if (b_nonce->n_small.nid_pf & (NF_VALID_NC_ID | NF_VALID_OT_ID)){
160 160
 			/* if extra auth checks are not enabled, nid & pf are after the
161 161
 			 *  1st md5 */
162
-			MD5Update(&ctx, (unsigned char*)&b_nonce->n_small.nid_i,
162
+			U_MD5Update(&ctx, (unsigned char*)&b_nonce->n_small.nid_i,
163 163
 							nonce_nid_extra_size);
164 164
 			len+=nonce_nid_extra_size;
165 165
 		}
... ...
@@ -33,7 +33,6 @@
33 33
 #include <string.h>
34 34
 
35 35
 #include "rfc2617.h"
36
-#include "../../md5global.h"
37 36
 #include "../../md5.h"
38 37
 #include "../../dprint.h"
39 38
 
... ...
@@ -54,7 +54,7 @@ void th_shuffle(char *in, int size)
54 54
 	MD5Init(&ctx);
55 55
 	MD5Update(&ctx, _th_key.s, _th_key.len);
56 56
 	MD5Update(&ctx, _th_key.s, _th_key.len);
57
-	MD5Final(md5, &ctx);
57
+	U_MD5Final(md5, &ctx);
58 58
 
59 59
 	md5i = (unsigned int*)md5;
60 60
 
... ...
@@ -525,11 +525,11 @@ static int MD5File(char *dest, const char *file_name)
525 525
 			fclose(input);
526 526
 			return -1;
527 527
 		}
528
-		MD5Update(&context, buffer, counter);
528
+		U_MD5Update(&context, buffer, counter);
529 529
 		size -= counter;
530 530
 	}
531 531
 	fclose(input);
532
-	MD5Final(hash, &context);
532
+	U_MD5Final(hash, &context);
533 533
 
534 534
 	string2hex(hash, 16, dest);
535 535
 	LM_DBG("MD5 calculated: %.*s for file %s\n", MD5_LEN, dest, file_name);
... ...
@@ -30,7 +30,6 @@
30 30
  */
31 31
 
32 32
 
33
-#include "../../md5global.h"
34 33
 #include "../../md5.h"
35 34
 
36 35
 #include "auth_alg.h"