1 --- a/src/crypt/crypt_r.c
2 +++ b/src/crypt/crypt_r.c
3 @@ -16,17 +16,7 @@ char *__crypt_r(const char *key, const c
4 * use the structure to store any internal state, and treats
5 * it purely as a char buffer for storing the result. */
6 char *output = (char *)data;
7 - if (salt[0] == '$' && salt[1] && salt[2]) {
8 - if (salt[1] == '1' && salt[2] == '$')
9 - return __crypt_md5(key, salt, output);
10 - if (salt[1] == '2' && salt[3] == '$')
11 - return __crypt_blowfish(key, salt, output);
12 - if (salt[1] == '5' && salt[2] == '$')
13 - return __crypt_sha256(key, salt, output);
14 - if (salt[1] == '6' && salt[2] == '$')
15 - return __crypt_sha512(key, salt, output);
17 - return __crypt_des(key, salt, output);
18 + return __crypt_md5(key, salt, output);
21 weak_alias(__crypt_r, crypt_r);
22 --- a/src/crypt/crypt_sha512.c
23 +++ b/src/crypt/crypt_sha512.c
30 /* public domain sha512 implementation based on fips180-3 */
31 /* >=2^64 bits messages are not supported (about 2000 peta bytes) */
32 @@ -369,3 +370,4 @@ char *__crypt_sha512(const char *key, co
37 --- a/src/crypt/crypt_blowfish.c
38 +++ b/src/crypt/crypt_blowfish.c
44 typedef uint32_t BF_word;
45 typedef int32_t BF_word_signed;
47 @@ -796,3 +797,4 @@ char *__crypt_blowfish(const char *key,
52 --- a/src/crypt/crypt_des.c
53 +++ b/src/crypt/crypt_des.c
60 uint32_t l[16], r[16];
62 @@ -1016,3 +1017,4 @@ char *__crypt_des(const char *key, const
64 return (setting[0]=='*') ? "x" : "*";
67 --- a/src/crypt/encrypt.c
68 +++ b/src/crypt/encrypt.c
69 @@ -16,6 +16,7 @@ static struct expanded_key __encrypt_key
71 void setkey(const char *key)
74 unsigned char bkey[8];
77 @@ -26,10 +27,12 @@ void setkey(const char *key)
80 __des_setkey(bkey, &__encrypt_key);
84 void encrypt(char *block, int edflag)
87 struct expanded_key decrypt_key, *key;
90 @@ -57,4 +60,5 @@ void encrypt(char *block, int edflag)
91 for (i = 0; i < 2; i++)
92 for (j = 31; j >= 0; j--)
96 --- a/src/crypt/crypt_sha256.c
97 +++ b/src/crypt/crypt_sha256.c
103 /* public domain sha256 implementation based on fips180-3 */
106 @@ -320,3 +321,4 @@ char *__crypt_sha256(const char *key, co