[uClibc]multiple MD5* symbols patch

Geoffrey Espin espin at idiom.com
Tue Feb 26 01:29:24 UTC 2002


The pppd package has its own MD5{Init,Final,...} functions
which conflict with uClibc's libcrypt.  This patch weakens
the duplicated symbols.

Geoff
-- 
Geoffrey Espin
espin at idiom.com
--

diff -b -Naur uClibc.orig/libcrypt/md5.c uClibc/libcrypt/md5.c
--- uClibc.orig/libcrypt/md5.c	Wed Dec 19 07:53:00 2001
+++ uClibc/libcrypt/md5.c	Mon Feb 25 17:05:43 2002
@@ -186,7 +186,7 @@
 
 /* MD5 initialization. Begins an MD5 operation, writing a new context. */
 
-void MD5Init (MD5_CTX *context)
+void __libcrypt_MD5Init (MD5_CTX *context)
 {
 	context->count[0] = context->count[1] = 0;
 
@@ -196,6 +196,7 @@
 	context->state[2] = 0x98badcfe;
 	context->state[3] = 0x10325476;
 }
+weak_alias (__libcrypt_MD5Init,MD5Init);
 
 /* 
  * MD5 block update operation. Continues an MD5 message-digest
@@ -203,7 +204,7 @@
  * context.
  */
 
-void MD5Update ( MD5_CTX *context, const unsigned char *input, unsigned int inputLen)
+void __libcrypt_MD5Update ( MD5_CTX *context, const unsigned char *input, unsigned int inputLen)
 {
 	unsigned int i, index, partLen;
 
@@ -236,12 +237,13 @@
 	memcpy ((void *)&context->buffer[index], (const void *)&input[i],
 	    inputLen-i);
 }
+weak_alias (__libcrypt_MD5Update,MD5Update);
 
 /*
  * MD5 padding. Adds padding followed by original length.
  */
 
-void MD5Pad ( MD5_CTX *context)
+void __libcrypt_MD5Pad ( MD5_CTX *context)
 {
 	unsigned char bits[8];
 	unsigned int index, padLen;
@@ -261,13 +263,14 @@
 	/* Append length (before padding) */
 	MD5Update (context, bits, 8);
 }
+weak_alias (__libcrypt_MD5Pad,MD5Pad);
 
 /*
  * MD5 finalization. Ends an MD5 message-digest operation, writing the
  * the message digest and zeroizing the context.
  */
 
-void MD5Final ( unsigned char digest[16], MD5_CTX *context)
+void __libcrypt_MD5Final ( unsigned char digest[16], MD5_CTX *context)
 {
 	/* Do padding. */
 	MD5Pad (context);
@@ -278,6 +281,7 @@
 	/* Zeroize sensitive information. */
 	memset ((void *)context, 0, sizeof (*context));
 }
+weak_alias (__libcrypt_MD5Final,MD5Final);
 
 /* MD5 basic transformation. Transforms state based on block. */
 



More information about the uClibc mailing list