From 7ac91a91b39e776a2fc7ff9b8f1663445f2855f5 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 1 Oct 2015 19:50:06 +0000 Subject: [PATCH] musl: re-enable des crypto support, fixes pppd MPPE issues Signed-off-by: Felix Fietkau SVN-Revision: 47078 --- .../musl/patches/901-crypt_size_hack.patch | 62 ++----------------- 1 file changed, 6 insertions(+), 56 deletions(-) diff --git a/toolchain/musl/patches/901-crypt_size_hack.patch b/toolchain/musl/patches/901-crypt_size_hack.patch index 635437f819..8cd7b1989c 100644 --- a/toolchain/musl/patches/901-crypt_size_hack.patch +++ b/toolchain/musl/patches/901-crypt_size_hack.patch @@ -1,24 +1,18 @@ --- a/src/crypt/crypt_r.c +++ b/src/crypt/crypt_r.c -@@ -16,17 +16,7 @@ char *__crypt_r(const char *key, const c - * use the structure to store any internal state, and treats - * it purely as a char buffer for storing the result. */ - char *output = (char *)data; -- if (salt[0] == '$' && salt[1] && salt[2]) { -- if (salt[1] == '1' && salt[2] == '$') -- return __crypt_md5(key, salt, output); +@@ -19,12 +19,6 @@ char *__crypt_r(const char *key, const c + 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] == '$') - return __crypt_blowfish(key, salt, output); - if (salt[1] == '5' && salt[2] == '$') - return __crypt_sha256(key, salt, output); - if (salt[1] == '6' && salt[2] == '$') - return __crypt_sha512(key, salt, output); -- } -- return __crypt_des(key, salt, output); -+ return __crypt_md5(key, salt, output); + } + return __crypt_des(key, salt, output); } - - weak_alias(__crypt_r, crypt_r); --- a/src/crypt/crypt_sha512.c +++ b/src/crypt/crypt_sha512.c @@ -12,6 +12,7 @@ @@ -49,50 +43,6 @@ return "*"; } +#endif ---- a/src/crypt/crypt_des.c -+++ b/src/crypt/crypt_des.c -@@ -56,6 +56,7 @@ - #include - #include - -+#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 +++ b/src/crypt/crypt_sha256.c @@ -13,6 +13,7 @@ -- 2.25.1