musl: re-enable des crypto support, fixes pppd MPPE issues

Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 47078
This commit is contained in:
Felix Fietkau 2015-10-01 19:50:06 +00:00
parent 57a70e8a64
commit 7ac91a91b3

View File

@ -1,24 +1,18 @@
--- a/src/crypt/crypt_r.c --- a/src/crypt/crypt_r.c
+++ b/src/crypt/crypt_r.c +++ b/src/crypt/crypt_r.c
@@ -16,17 +16,7 @@ char *__crypt_r(const char *key, const c @@ -19,12 +19,6 @@ char *__crypt_r(const char *key, const c
* use the structure to store any internal state, and treats if (salt[0] == '$' && salt[1] && salt[2]) {
* it purely as a char buffer for storing the result. */ if (salt[1] == '1' && salt[2] == '$')
char *output = (char *)data; return __crypt_md5(key, salt, output);
- if (salt[0] == '$' && salt[1] && salt[2]) {
- if (salt[1] == '1' && salt[2] == '$')
- return __crypt_md5(key, salt, output);
- if (salt[1] == '2' && salt[3] == '$') - if (salt[1] == '2' && salt[3] == '$')
- return __crypt_blowfish(key, salt, output); - return __crypt_blowfish(key, salt, output);
- if (salt[1] == '5' && salt[2] == '$') - if (salt[1] == '5' && salt[2] == '$')
- return __crypt_sha256(key, salt, output); - return __crypt_sha256(key, salt, output);
- if (salt[1] == '6' && salt[2] == '$') - if (salt[1] == '6' && salt[2] == '$')
- return __crypt_sha512(key, salt, output); - return __crypt_sha512(key, salt, output);
- } }
- return __crypt_des(key, salt, output); return __crypt_des(key, salt, output);
+ return __crypt_md5(key, salt, output);
} }
weak_alias(__crypt_r, crypt_r);
--- a/src/crypt/crypt_sha512.c --- a/src/crypt/crypt_sha512.c
+++ b/src/crypt/crypt_sha512.c +++ b/src/crypt/crypt_sha512.c
@@ -12,6 +12,7 @@ @@ -12,6 +12,7 @@
@ -49,50 +43,6 @@
return "*"; return "*";
} }
+#endif +#endif
--- a/src/crypt/crypt_des.c
+++ b/src/crypt/crypt_des.c
@@ -56,6 +56,7 @@
#include <stdint.h>
#include <string.h>
+#if 0
struct expanded_key {
uint32_t l[16], r[16];
};
@@ -1016,3 +1017,4 @@ char *__crypt_des(const char *key, const
return (setting[0]=='*') ? "x" : "*";
}
+#endif
--- a/src/crypt/encrypt.c
+++ b/src/crypt/encrypt.c
@@ -16,6 +16,7 @@ static struct expanded_key __encrypt_key
void setkey(const char *key)
{
+#if 0
unsigned char bkey[8];
int i, j;
@@ -26,10 +27,12 @@ void setkey(const char *key)
}
__des_setkey(bkey, &__encrypt_key);
+#endif
}
void encrypt(char *block, int edflag)
{
+#if 0
struct expanded_key decrypt_key, *key;
uint32_t b[2];
int i, j;
@@ -57,4 +60,5 @@ void encrypt(char *block, int edflag)
for (i = 0; i < 2; i++)
for (j = 31; j >= 0; j--)
*p++ = b[i]>>j & 1;
+#endif
}
--- a/src/crypt/crypt_sha256.c --- a/src/crypt/crypt_sha256.c
+++ b/src/crypt/crypt_sha256.c +++ b/src/crypt/crypt_sha256.c
@@ -13,6 +13,7 @@ @@ -13,6 +13,7 @@