diff options
author | "Steven J. Hill" <sjhill@realitydiluted.com> | 2006-02-25 04:03:33 +0000 |
---|---|---|
committer | "Steven J. Hill" <sjhill@realitydiluted.com> | 2006-02-25 04:03:33 +0000 |
commit | cb6a88484ce0b5ffba2fe98a40e2d51f4af92eb8 (patch) | |
tree | 520f8e8d113184cfa7954ebd274564b8c255fa9a /libcrypt | |
parent | e4461be66e2655058aef358b00050bc70ac72861 (diff) | |
download | uClibc-alpine-cb6a88484ce0b5ffba2fe98a40e2d51f4af92eb8.tar.bz2 uClibc-alpine-cb6a88484ce0b5ffba2fe98a40e2d51f4af92eb8.tar.xz |
Merge from trunk. Going pretty good so far. Kind of. Okay, not really.
Diffstat (limited to 'libcrypt')
-rw-r--r-- | libcrypt/Makefile.in | 16 | ||||
-rw-r--r-- | libcrypt/crypt.c | 21 | ||||
-rw-r--r-- | libcrypt/des.c | 3 | ||||
-rw-r--r-- | libcrypt/md5.c | 21 |
4 files changed, 29 insertions, 32 deletions
diff --git a/libcrypt/Makefile.in b/libcrypt/Makefile.in index 7c8b4589f..0d84b6f10 100644 --- a/libcrypt/Makefile.in +++ b/libcrypt/Makefile.in @@ -1,7 +1,7 @@ # Makefile for uClibc # # Copyright (C) 2000 by Lineo, inc. -# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org> +# Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> # # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # @@ -27,24 +27,32 @@ libcrypt-a-y := $(libcrypt_OBJ) endif libcrypt-so-y := $(libcrypt_OBJ:.o=.os) -libcrypt-multi-y := $(libcrypt_SRC) - lib-a-y += $(top_builddir)lib/libcrypt.a lib-so-y += $(top_builddir)lib/libcrypt.so objclean-y += libcrypt_clean +ifeq ($(DOMULTI),n) ifeq ($(DOPIC),y) $(top_builddir)lib/libcrypt.so: $(top_builddir)lib/libcrypt.a $(libc) else $(top_builddir)lib/libcrypt.so: $(libcrypt_OUT)/libcrypt_so.a $(libc) endif $(call link.so,$(libcrypt_FULL_NAME),$(MAJOR_VERSION)) +else +$(top_builddir)lib/libcrypt.so: $(libcrypt_OUT)/libcrypt.oS | $(libc) + $(call linkm.so,$(libcrypt_FULL_NAME),$(MAJOR_VERSION)) +endif $(libcrypt_OUT)/libcrypt_so.a: $(libcrypt-so-y) $(Q)$(RM) $@ $(do_strip) $(do_ar) +$(libcrypt_OUT)/libcrypt.oS: $(libcrypt_SRC) + $(Q)$(RM) $@ + $(compile-m) + $(do_t_strip) + $(top_builddir)lib/libcrypt.a: $(libcrypt-a-y) $(Q)$(INSTALL) -d $(dir $@) $(Q)$(RM) $@ @@ -52,4 +60,4 @@ $(top_builddir)lib/libcrypt.a: $(libcrypt-a-y) $(do_ar) libcrypt_clean: - $(RM) $(libcrypt_OUT)/*.{o,os,a} + $(RM) $(libcrypt_OUT)/*.{o,os,oS,a} diff --git a/libcrypt/crypt.c b/libcrypt/crypt.c index a1bba6ebd..a64b4a556 100644 --- a/libcrypt/crypt.c +++ b/libcrypt/crypt.c @@ -3,24 +3,11 @@ * crypt() for uClibc * * Copyright (C) 2000 by Lineo, inc. and Erik Andersen - * Copyright (C) 2000,2001 by Erik Andersen <andersen@uclibc.org> - * Written by Erik Andersen <andersen@uclibc.org> + * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; see the file COPYING.LIB. If not, - * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. */ +/* Written by Erik Andersen <andersen@uclibc.org> */ #define __FORCE_GLIBC #include <crypt.h> @@ -29,7 +16,7 @@ extern char * __md5_crypt( const char *pw, const char *salt) attribute_hidden; extern char * __des_crypt( const char *pw, const char *salt) attribute_hidden; -extern char * crypt(const char *key, const char *salt) +char * crypt(const char *key, const char *salt) { /* First, check if we are supposed to be using the MD5 replacement * instead of DES... */ diff --git a/libcrypt/des.c b/libcrypt/des.c index 80e513183..3f6b382bb 100644 --- a/libcrypt/des.c +++ b/libcrypt/des.c @@ -638,7 +638,8 @@ encrypt(char *block, int flag) block[(i << 5) | j] = (io[i] & bits32[j]) ? 1 : 0; } -char attribute_hidden * +char *__des_crypt(const char *key, const char *setting) attribute_hidden; +char * __des_crypt(const char *key, const char *setting) { u_int32_t count, salt, l, r0, r1, keybuf[2]; diff --git a/libcrypt/md5.c b/libcrypt/md5.c index 7d852b7b2..989d4482c 100644 --- a/libcrypt/md5.c +++ b/libcrypt/md5.c @@ -195,10 +195,10 @@ static void __md5_Init (struct MD5Context *context) static void __md5_Update ( struct MD5Context *context, const unsigned char *input, unsigned int inputLen) { - unsigned int i, index, partLen; + unsigned int i, idx, partLen; /* Compute number of bytes mod 64 */ - index = (unsigned int)((context->count[0] >> 3) & 0x3F); + idx = (unsigned int)((context->count[0] >> 3) & 0x3F); /* Update number of bits */ if ((context->count[0] += ((u_int32_t)inputLen << 3)) @@ -206,24 +206,24 @@ static void __md5_Update ( struct MD5Context *context, const unsigned char *inpu context->count[1]++; context->count[1] += ((u_int32_t)inputLen >> 29); - partLen = 64 - index; + partLen = 64 - idx; /* Transform as many times as possible. */ if (inputLen >= partLen) { - memcpy((void *)&context->buffer[index], (const void *)input, + memcpy((void *)&context->buffer[idx], (const void *)input, partLen); __md5_Transform (context->state, context->buffer); for (i = partLen; i + 63 < inputLen; i += 64) __md5_Transform (context->state, &input[i]); - index = 0; + idx = 0; } else i = 0; /* Buffer remaining input */ - memcpy ((void *)&context->buffer[index], (const void *)&input[i], + memcpy ((void *)&context->buffer[idx], (const void *)&input[i], inputLen-i); } @@ -234,7 +234,7 @@ static void __md5_Update ( struct MD5Context *context, const unsigned char *inpu static void __md5_Pad ( struct MD5Context *context) { unsigned char bits[8]; - unsigned int index, padLen; + unsigned int idx, padLen; unsigned char PADDING[64]; memset(PADDING, 0, sizeof(PADDING)); @@ -244,8 +244,8 @@ static void __md5_Pad ( struct MD5Context *context) __md5_Encode (bits, context->count, 8); /* Pad out to 56 mod 64. */ - index = (unsigned int)((context->count[0] >> 3) & 0x3f); - padLen = (index < 56) ? (56 - index) : (120 - index); + idx = (unsigned int)((context->count[0] >> 3) & 0x3f); + padLen = (idx < 56) ? (56 - idx) : (120 - idx); __md5_Update (context, PADDING, padLen); /* Append length (before padding) */ @@ -531,7 +531,8 @@ static void __md5_to64( char *s, unsigned long v, int n) * Use MD5 for what it is best at... */ -extern char attribute_hidden * __md5_crypt( const char *pw, const char *salt) +char * __md5_crypt( const char *pw, const char *salt) attribute_hidden; +char * __md5_crypt( const char *pw, const char *salt) { /* Static stuff */ static const char *sp, *ep; |