summaryrefslogtreecommitdiff
path: root/libcrypt/crypt.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-08-07 15:11:51 +0000
committerEric Andersen <andersen@codepoet.org>2002-08-07 15:11:51 +0000
commitcf0a78c8823f6e06e8cf253f90472ed653e120df (patch)
tree12a08c5296fe3c8c566e9965d146109e5b9f966a /libcrypt/crypt.c
parentbd85a75e3cd2972e2c7c7b7dac878f451c8065a4 (diff)
Cleanup crypt and remove the crypt_r stuff, since SuSv3
(IEEE Std 1003.1-2001) states that crypt need not be reentrant. -Erik
Diffstat (limited to 'libcrypt/crypt.c')
-rw-r--r--libcrypt/crypt.c26
1 files changed, 5 insertions, 21 deletions
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 <crypt.h>
#include <unistd.h>
-/* 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);
}
+