From cf0a78c8823f6e06e8cf253f90472ed653e120df Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Wed, 7 Aug 2002 15:11:51 +0000 Subject: Cleanup crypt and remove the crypt_r stuff, since SuSv3 (IEEE Std 1003.1-2001) states that crypt need not be reentrant. -Erik --- libcrypt/crypt.c | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) (limited to 'libcrypt/crypt.c') diff --git a/libcrypt/crypt.c b/libcrypt/crypt.c index 027aa5a4d..57181dc61 100644 --- a/libcrypt/crypt.c +++ b/libcrypt/crypt.c @@ -25,32 +25,16 @@ #include #include -/* For use by the old, non-reentrant routines (crypt/encrypt/setkey) */ -static struct crypt_data __crypt_data; -extern char * __md5_crypt_r( const char *pw, const char *salt, struct crypt_data * data); -extern char * __des_crypt_r( const char *pw, const char *salt, struct crypt_data * data); +extern char * __md5_crypt( const char *pw, const char *salt); +extern char * __des_crypt( const char *pw, const char *salt); extern char * crypt(const char *key, const char *salt) -{ - return crypt_r (key, salt, &__crypt_data); -} - -extern void setkey(const char *key) -{ - setkey_r(key, &__crypt_data); -} - -extern void encrypt(char *block, int edflag) -{ - encrypt_r(block, edflag, &__crypt_data); -} - -extern char *crypt_r(const char *pw, const char *salt, struct crypt_data *data) { /* First, check if we are supposed to be using the MD5 replacement * instead of DES... */ if (salt[0]=='$' && salt[1]=='1' && salt[2]=='$') - return __md5_crypt_r(pw, salt, data); + return __md5_crypt(key, salt); else - return __des_crypt_r(pw, salt, data); + return __des_crypt(key, salt); } + -- cgit v1.2.3