about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog24
-rw-r--r--Makeconfig4
-rw-r--r--crypt/Makefile33
-rw-r--r--crypt/Versions (renamed from md5-crypt/Versions)0
-rw-r--r--crypt/crypt-entry.c (renamed from crypt/sysdeps/unix/crypt-entry.c)0
-rw-r--r--crypt/crypt-private.h (renamed from crypt/sysdeps/unix/crypt-private.h)0
-rw-r--r--crypt/crypt.c (renamed from crypt/sysdeps/unix/crypt.c)0
-rw-r--r--crypt/crypt.h (renamed from crypt/sysdeps/unix/crypt.h)0
-rw-r--r--crypt/crypt_util.c (renamed from crypt/sysdeps/unix/crypt_util.c)5
-rw-r--r--crypt/md5-crypt.c (renamed from md5-crypt/md5-crypt.c)0
-rw-r--r--crypt/md5.c (renamed from md5-crypt/md5.c)0
-rw-r--r--crypt/md5.h (renamed from md5-crypt/md5.h)0
-rw-r--r--crypt/md5c-test.c (renamed from md5-crypt/md5c-test.c)0
-rw-r--r--crypt/md5test.c (renamed from md5-crypt/md5test.c)0
-rw-r--r--crypt/sysdeps/mach/hurd/Implies2
-rw-r--r--crypt/sysdeps/unix/Makefile4
-rw-r--r--crypt/sysdeps/unix/patchlevel.h25
-rw-r--r--crypt/ufc-crypt.h (renamed from crypt/sysdeps/unix/ufc-crypt.h)0
-rw-r--r--md5-crypt/Makefile83
-rw-r--r--md5-crypt/onlymd5-entry.c1
-rw-r--r--sunrpc/des_impl.c (renamed from crypt/sysdeps/unix/des_impl.c)0
-rw-r--r--sysdeps/generic/crypt-entry.c72
-rw-r--r--sysdeps/generic/crypt.h59
-rw-r--r--sysdeps/generic/des_impl.c30
24 files changed, 51 insertions, 291 deletions
diff --git a/ChangeLog b/ChangeLog
index 7cbabb0c1c..a0d47fb720 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,27 @@
+2000-03-03  Geoff Keating  <geoffk@cygnus.com>
+
+	* Makeconfig (rpath-dirs): Add crypt.
+	(all-subdirs): Remove md5crypt.
+	* crypt/sysdeps/unix/crypt.c: Move to crypt/.
+	* crypt/sysdeps/unix/crypt-entry.c: Move to crypt/.
+	* sysdeps/generic/crypt-entry.c: Delete.
+	* crypt/sysdeps/unix/crypt.h: Move to crypt/.
+	* sysdeps/generic/crypt.h: Delete.
+	* crypt/sysdeps/unix/crypt-private.h: Move to crypt/.
+	* crypt/sysdeps/unix/crypt_util.c: Move to crypt/.
+	* crypt/sysdeps/unix/des_impl.c: Move to sunrpc/.
+	* sysdeps/generic/des_impl.c: Delete.
+	* crypt/sysdeps/unix/ufc-crypt.h: Move to crypt/.
+	* crypt/sysdeps: Delete.
+	* crypt/crypt_util.c: Don't use `patchlevel.h'.
+	* md5-crypt/Versions: Move to crypt/.
+	* md5-crypt/md5-crypt.c: Move to crypt/.
+	* md5-crypt/md5.c: Move to crypt/.
+	* md5-crypt/md5c-test.c: Move to crypt/.
+	* md5-crypt/md5test.c: Move to crypt/.
+	* md5-crypt: Delete.
+	* crypt/Makefile: Adjust for new structure.
+
 2000-03-03  Paul Eggert  <eggert@twinsun.com>
 
 	* posix/regex.c (MB_LEN_MAX): Include <limits.h> to define;
diff --git a/Makeconfig b/Makeconfig
index 285b747014..6d87892d74 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -414,7 +414,7 @@ link-libc = -Wl,-rpath-link=$(rpath-link) \
 	    $(common-objpfx)libc.so$(libc.so-version) \
 	    $(common-objpfx)$(patsubst %,$(libtype.oS),c) $(gnulib)
 # This is how to find at build-time things that will be installed there.
-rpath-dirs = math elf dlfcn nss nis rt resolv
+rpath-dirs = math elf dlfcn nss nis rt resolv crypt
 rpath-link = \
 $(common-objdir):$(subst $(empty) ,:,$(patsubst ../$(subdir),.,$(rpath-dirs:%=$(common-objpfx)%)))
 elfobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)elf)
@@ -781,7 +781,7 @@ endif
 all-subdirs = csu assert ctype locale intl catgets math setjmp signal	    \
 	      stdlib stdio-common $(stdio) malloc string wcsmbs time dirent \
 	      grp pwd posix io termios resource misc socket sysvipc gmon    \
-	      gnulib iconv iconvdata wctype manual shadow md5-crypt po argp \
+	      gnulib iconv iconvdata wctype manual shadow po argp	    \
 	      crypt $(add-ons) nss localedata timezone rt debug		    \
 	      $(sysdep-subdirs) $(dlfcn) $(binfmt-subdir)
 all-subdirs := $(filter-out $(sysdep-inhibit-subdirs),$(all-subdirs))
diff --git a/crypt/Makefile b/crypt/Makefile
index 1be33be001..a9ce7da41e 100644
--- a/crypt/Makefile
+++ b/crypt/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1996 Free Software Foundation, Inc.
+# Copyright (C) 1996, 2000 Free Software Foundation, Inc.
 # This file is part of the GNU C Library.
 
 # The GNU C Library is free software; you can redistribute it and/or
@@ -17,20 +17,35 @@
 # Boston, MA 02111-1307, USA.
 
 #
-#	Sub-makefile for DES crypt portion of the library.
+#	Sub-makefile for crypt() portion of the library.
 #
 subdir	:= crypt
 
-tests = cert
+headers := crypt.h
+
+distribute := md5.h
+
+extra-libs := libcrypt
+extra-libs-others := $(extra-libs)
+
+libcrypt-routines := crypt-entry md5-crypt md5 crypt crypt_util
+
+tests = cert md5test md5c-test
 
 include ../Makeconfig
 
-rpath-dirs += md5-crypt
+ifeq ($(crypt-in-libc),yes)
+routines += $(libcrypt-routines)
+endif
+
+$(objpfx)md5test: $(objpfx)md5.o
 
 include ../Rules
 
-ifeq ($(build-shared),yes)
-$(objpfx)cert: $(common-objpfx)md5-crypt/libcrypt.so$(libcrypt.so-version)
-else
-$(objpfx)cert: $(common-objpfx)md5-crypt/libcrypt.a
-endif
+LDLIBS-cert = crypt/libcrypt
+LDLIBS-md5c-test = crypt/libcrypt
+
+# Depend on libc.so so a DT_NEEDED is generated in the shared objects.
+# This ensures they will load libc.so for needed symbols if loaded by
+# a statically-linked program that hasn't already loaded it.
+$(objpfx)libcrypt.so: $(common-objpfx)libc.so
diff --git a/md5-crypt/Versions b/crypt/Versions
index 389e7d544a..389e7d544a 100644
--- a/md5-crypt/Versions
+++ b/crypt/Versions
diff --git a/crypt/sysdeps/unix/crypt-entry.c b/crypt/crypt-entry.c
index 9d99c53a2b..9d99c53a2b 100644
--- a/crypt/sysdeps/unix/crypt-entry.c
+++ b/crypt/crypt-entry.c
diff --git a/crypt/sysdeps/unix/crypt-private.h b/crypt/crypt-private.h
index 130cccd373..130cccd373 100644
--- a/crypt/sysdeps/unix/crypt-private.h
+++ b/crypt/crypt-private.h
diff --git a/crypt/sysdeps/unix/crypt.c b/crypt/crypt.c
index 8e2a576a70..8e2a576a70 100644
--- a/crypt/sysdeps/unix/crypt.c
+++ b/crypt/crypt.c
diff --git a/crypt/sysdeps/unix/crypt.h b/crypt/crypt.h
index 7018cb16ce..7018cb16ce 100644
--- a/crypt/sysdeps/unix/crypt.h
+++ b/crypt/crypt.h
diff --git a/crypt/sysdeps/unix/crypt_util.c b/crypt/crypt_util.c
index 671571c51d..1eb2d4cc63 100644
--- a/crypt/sysdeps/unix/crypt_util.c
+++ b/crypt/crypt_util.c
@@ -1,7 +1,7 @@
 /*
  * UFC-crypt: ultra fast crypt(3) implementation
  *
- * Copyright (C) 1991, 92, 93, 96, 97, 98 Free Software Foundation, Inc.
+ * Copyright (C) 1991, 92, 93, 96, 97, 98, 2000 Free Software Foundation, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -34,7 +34,6 @@
 #endif
 
 #ifndef DOS
-#include "patchlevel.h"
 #include "ufc-crypt.h"
 #else
 /*
@@ -61,8 +60,6 @@ STATIC void shuffle_sb (long64 *k, ufc_long saltbits);
 #endif
 
 
-static const char patchlevel_str[] = PATCHLEVEL;
-
 /*
  * Permutation done once on the 56 bit
  *  key derived from the original 8 byte ASCII key.
diff --git a/md5-crypt/md5-crypt.c b/crypt/md5-crypt.c
index 126103503c..126103503c 100644
--- a/md5-crypt/md5-crypt.c
+++ b/crypt/md5-crypt.c
diff --git a/md5-crypt/md5.c b/crypt/md5.c
index 478429f8e6..478429f8e6 100644
--- a/md5-crypt/md5.c
+++ b/crypt/md5.c
diff --git a/md5-crypt/md5.h b/crypt/md5.h
index fbc2bdbf93..fbc2bdbf93 100644
--- a/md5-crypt/md5.h
+++ b/crypt/md5.h
diff --git a/md5-crypt/md5c-test.c b/crypt/md5c-test.c
index f56d0eb4ab..f56d0eb4ab 100644
--- a/md5-crypt/md5c-test.c
+++ b/crypt/md5c-test.c
diff --git a/md5-crypt/md5test.c b/crypt/md5test.c
index cfd9605099..cfd9605099 100644
--- a/md5-crypt/md5test.c
+++ b/crypt/md5test.c
diff --git a/crypt/sysdeps/mach/hurd/Implies b/crypt/sysdeps/mach/hurd/Implies
deleted file mode 100644
index 03a772586f..0000000000
--- a/crypt/sysdeps/mach/hurd/Implies
+++ /dev/null
@@ -1,2 +0,0 @@
-# The Hurd uses Unix like DES crypto function.
-unix
diff --git a/crypt/sysdeps/unix/Makefile b/crypt/sysdeps/unix/Makefile
deleted file mode 100644
index 65810482d0..0000000000
--- a/crypt/sysdeps/unix/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-ifeq ($(subdir),md5-crypt)
-libcrypt-routines += crypt crypt_util
-dont_distribute += crypt.c crypt_util.c
-endif
diff --git a/crypt/sysdeps/unix/patchlevel.h b/crypt/sysdeps/unix/patchlevel.h
deleted file mode 100644
index 450c091f60..0000000000
--- a/crypt/sysdeps/unix/patchlevel.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * UFC-crypt: ultra fast crypt(3) implementation
- *
- * Copyright (C) 1991, 1992, 1993, 1996 Free Software Foundation, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library 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.
- *
- * @(#)patchlevel.h	1.13 9/10/96
- *
- */
-
-#define PATCHLEVEL "UFC-crypt, patchlevel 1e, @(#)patchlevel.h	1.13 9/10/96"
diff --git a/crypt/sysdeps/unix/ufc-crypt.h b/crypt/ufc-crypt.h
index 879211afec..879211afec 100644
--- a/crypt/sysdeps/unix/ufc-crypt.h
+++ b/crypt/ufc-crypt.h
diff --git a/md5-crypt/Makefile b/md5-crypt/Makefile
deleted file mode 100644
index 40186eceef..0000000000
--- a/md5-crypt/Makefile
+++ /dev/null
@@ -1,83 +0,0 @@
-# Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
-# This file is part of the GNU C Library.
-
-# The GNU C Library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Library General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-
-# The GNU C 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
-# Library General Public License for more details.
-
-# You should have received a copy of the GNU Library General Public
-# License along with the GNU C 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.
-
-#
-#	Sub-makefile for MD5 crypt portion of the library.
-#
-subdir	:= md5-crypt
-
-headers := crypt.h
-
-distribute := md5.h
-
-tests	:= md5test md5c-test
-
-extra-libs := libcrypt
-extra-libs-others := $(extra-libs)
-
-md5-routines := crypt-entry md5-crypt md5
-libcrypt-routines := $(md5-routines)
-
-onlymd5-routines := onlymd5-entry md5-crypt md5
-distribute += onlymd5-entry.c
-extra-objs = $(patsubst %,onlymd5-entry%,$(object-suffixes))
-
-include ../Makeconfig
-
-rpath-dirs += md5-crypt
-
-ifeq ($(crypt-in-libc),yes)
-routines += $(libcrypt-routines)
-endif
-
-$(objpfx)md5test: $(objpfx)md5.o
-
-include ../Rules
-
-ifeq ($(build-shared),yes)
-libdepend = $(common-objpfx)md5-crypt/libcrypt.so$(libcrypt.so-version)
-else
-libdepend = $(common-objpfx)md5-crypt/libcrypt.a
-endif
-
-$(objpfx)md5test $(objpfx)md5c-test: $(libdepend)
-
-.PHONY: libmd5crypt
-libmd5crypt: $(foreach o,$(object-suffixes), \
-		    $(addprefix $(objpfx),$(patsubst %,$(libtype$o),md5crypt)))
-ifeq ($(build-shared),yes)
-libmd5crypt: $(objpfx)libmd5crypt.so
-# Use the same soname as the real libcrypt, so that it can be used as a
-# drop in replacement.
-LDFLAGS-md5crypt.so = -Wl,-soname=lib$(libprefix)crypt.so$(libcrypt.so-version)
-# We also use the same version script.
-libmd5crypt-map := $(common-objpfx)libcrypt.map
-endif
-
-define o-iterator-doit
-$(objpfx)$(patsubst %,$(libtype$o),md5crypt): \
-  $(onlymd5-routines:%=$(objpfx)%$o); $$(build-extra-lib)
-endef
-object-suffixes-left = $(object-suffixes)
-include $(patsubst %,$(..)o-iterator.mk,$(object-suffixes))
-
-# Depend on libc.so so a DT_NEEDED is generated in the shared objects.
-# This ensures they will load libc.so for needed symbols if loaded by
-# a statically-linked program that hasn't already loaded it.
-$(objpfx)libcrypt.so: $(common-objpfx)libc.so
-$(objpfx)libmd5crypt.so: $(common-objpfx)libc.so
diff --git a/md5-crypt/onlymd5-entry.c b/md5-crypt/onlymd5-entry.c
deleted file mode 100644
index d03fae9bd1..0000000000
--- a/md5-crypt/onlymd5-entry.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/generic/crypt-entry.c>
diff --git a/crypt/sysdeps/unix/des_impl.c b/sunrpc/des_impl.c
index f4fee720a1..f4fee720a1 100644
--- a/crypt/sysdeps/unix/des_impl.c
+++ b/sunrpc/des_impl.c
diff --git a/sysdeps/generic/crypt-entry.c b/sysdeps/generic/crypt-entry.c
deleted file mode 100644
index 8248ed9ba3..0000000000
--- a/sysdeps/generic/crypt-entry.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Wrapper around MD5 sum replacement for crypt function.
-   Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
-
-   The GNU C 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
-   Library General Public License for more details.
-
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C 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.  */
-
-#include <crypt.h>
-#include <errno.h>
-#include <string.h>
-
-
-/* Define our magic string to mark salt for MD5 encryption
-   replacement.  This is meant to be the same as for other MD5 based
-   encryption implementations.  */
-static const char md5_salt_prefix[] = "$1$";
-
-
-/* Prototypes for the MD5 encryption replacement functions.  */
-extern char *__md5_crypt_r (const char *key, const char *salt, char *buffer,
-			    int buflen);
-extern char *__md5_crypt (const char *key, const char *salt);
-
-extern char *__crypt_r (const char *key, const char *salt,
-			struct crypt_data *__restrict data);
-
-/* We recognize an intended call of the MD5 crypt replacement function
-   by the first 3 characters of the salt string.  If they match the
-   MD5 magic string we want MD5 encryption replacement.  */
-char *
-__crypt_r (key, salt, data)
-     const char *key;
-     const char *salt;
-     struct crypt_data *__restrict data;
-{
-  if (strncmp (md5_salt_prefix, salt, sizeof (md5_salt_prefix) - 1) == 0)
-    return __md5_crypt_r (key, salt, (char *) data,
-			  sizeof (struct crypt_data));
-
-  /* We don't have DES encryption.  */
-  __set_errno (EOPNOTSUPP);
-  return NULL;
-}
-weak_alias (__crypt_r, crypt_r)
-
-
-/* The same here, only we call the non-reentrant version.  */
-char *
-crypt (key, salt)
-     const char *key;
-     const char *salt;
-{
-  if (strncmp (md5_salt_prefix, salt, sizeof (md5_salt_prefix) - 1) == 0)
-    return __md5_crypt (key, salt);
-
-  /* We don't have DES encryption.  */
-  __set_errno (EOPNOTSUPP);
-  return NULL;
-}
diff --git a/sysdeps/generic/crypt.h b/sysdeps/generic/crypt.h
deleted file mode 100644
index 0713e950ba..0000000000
--- a/sysdeps/generic/crypt.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * UFC-crypt: ultra fast crypt(3) implementation
- *
- * Copyright (C) 1991, 92, 93, 96, 97, 98 Free Software Foundation, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with the GNU C 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.
- *
- * @(#)crypt.h	1.3 16 Sep 1996
- *
- */
-
-#ifndef _CRYPT_H
-
-#define _CRYPT_H	1
-#include <features.h>
-
-__BEGIN_DECLS
-
-/* Encrypt at most 8 characters from KEY using salt to perturb DES.  */
-extern char *crypt __P ((__const char *__key, __const char *__salt));
-
-
-#ifdef __USE_GNU
-/* Reentrant versions of the functions above.  The additional argument
-   points to a structure where the results are placed in.  */
-struct crypt_data
-  {
-    char keysched[16 * 8];
-    char sb0[32768];
-    char sb1[32768];
-    char sb2[32768];
-    char sb3[32768];
-    /* end-of-alignment-critical-data */
-    char crypt_3_buf[14];
-    char current_salt[2];
-    long int current_saltbits;
-    int direction, initialized;
-  };
-
-extern char *crypt_r __P ((__const char *__key, __const char *__salt,
-			   struct crypt_data *__restrict __data));
-#endif
-
-__END_DECLS
-
-#endif	/* crypt.h */
diff --git a/sysdeps/generic/des_impl.c b/sysdeps/generic/des_impl.c
deleted file mode 100644
index f801a841fc..0000000000
--- a/sysdeps/generic/des_impl.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Copyright (C) 1997 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
-
-   The GNU C 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
-   Library General Public License for more details.
-
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C 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.  */
-
-/* We must not distribute the DES implementation as part of the glibc.
-   So we have to provide a dummy version here.  */
-#include <des.h>
-
-int
-_des_crypt (char *buf, unsigned len, struct desparams *desp)
-{
-  return 0;
-}
-
-stub_warning (_des_crypt)
-#include <stub-tag.h>