mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-29 18:19:02 +00:00
983605e61f
78cd384 Update README and patchlevel.h for 2.4.8 release 5d03403 pppd: Avoid use of strnlen (and strlen) in vslprintf a1e950a pppd: Fix IPv6 default route code for Solaris ca5e61b plugins/rp-pppoe: Make tag parsing loop condition more accurate c10c3c7 pppd: Make sure word read from options file is null-terminated b311e98 pppd: Limit memory accessed by string formats with max length specified 3ea9de9 pppd: Eliminate some more compiler warnings 57edb1a pppd: Include time.h header before using time_t 09f695f pppd: Don't free static string 03104ba pppd.h: Add missing headers 388597e pppd: Add defaultroute6 and related options 66ce4ba pppd: Avoid declarations within statements in main.c 5637180 pppd: Fix `ifname` option in case of multilink (#105) d00f8a0 pppd: Fix variable reference syntax in Makefile.linux b6b4d28 pppd: Check tdb pointer before closing Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
95 lines
2.5 KiB
Diff
95 lines
2.5 KiB
Diff
From 831dca008699d485f2c8e91749657ef2d0b06166 Mon Sep 17 00:00:00 2001
|
|
From: Martin Schiller <ms@dev.tdt.de>
|
|
Date: Thu, 6 Dec 2018 08:43:17 +0100
|
|
Subject: [PATCH] Revert "pppd: Use openssl for the DES instead of the libcrypt
|
|
/ glibc"
|
|
|
|
For musl and glibc2.27 we can keep linking to crypt; however if we
|
|
switch to glibc 2.28 we will have to link to one of the SSL libraries.
|
|
|
|
This reverts commit 3c7b86229f7bd2600d74db14b1fe5b3896be3875.
|
|
---
|
|
pppd/Makefile.linux | 7 +++----
|
|
pppd/pppcrypt.c | 18 +++++++++---------
|
|
2 files changed, 12 insertions(+), 13 deletions(-)
|
|
|
|
--- a/pppd/Makefile.linux
|
|
+++ b/pppd/Makefile.linux
|
|
@@ -35,10 +35,10 @@ endif
|
|
COPTS = -O2 -pipe -Wall -g
|
|
LIBS =
|
|
|
|
-# Uncomment the next line to include support for Microsoft's
|
|
+# Uncomment the next 2 lines to include support for Microsoft's
|
|
# MS-CHAP authentication protocol. Also, edit plugins/radius/Makefile.linux.
|
|
CHAPMS=y
|
|
-#USE_CRYPT=y
|
|
+USE_CRYPT=y
|
|
# Don't use MSLANMAN unless you really know what you're doing.
|
|
#MSLANMAN=y
|
|
# Uncomment the next line to include support for MPPE. CHAPMS (above) must
|
|
@@ -140,8 +140,7 @@ endif
|
|
|
|
ifdef NEEDDES
|
|
ifndef USE_CRYPT
|
|
-CFLAGS += -I$(shell $(CC) --print-sysroot)/usr/include/openssl
|
|
-LIBS += -lcrypto
|
|
+LIBS += -ldes $(LIBS)
|
|
else
|
|
CFLAGS += -DUSE_CRYPT=1
|
|
endif
|
|
--- a/pppd/pppcrypt.c
|
|
+++ b/pppd/pppcrypt.c
|
|
@@ -64,7 +64,7 @@ u_char *des_key; /* OUT 64 bit DES key w
|
|
des_key[7] = Get7Bits(key, 49);
|
|
|
|
#ifndef USE_CRYPT
|
|
- DES_set_odd_parity((DES_cblock *)des_key);
|
|
+ des_set_odd_parity((des_cblock *)des_key);
|
|
#endif
|
|
}
|
|
|
|
@@ -158,25 +158,25 @@ u_char *clear; /* OUT 8 octets */
|
|
}
|
|
|
|
#else /* USE_CRYPT */
|
|
-static DES_key_schedule key_schedule;
|
|
+static des_key_schedule key_schedule;
|
|
|
|
bool
|
|
DesSetkey(key)
|
|
u_char *key;
|
|
{
|
|
- DES_cblock des_key;
|
|
+ des_cblock des_key;
|
|
MakeKey(key, des_key);
|
|
- DES_set_key(&des_key, &key_schedule);
|
|
+ des_set_key(&des_key, key_schedule);
|
|
return (1);
|
|
}
|
|
|
|
bool
|
|
-DesEncrypt(clear, cipher)
|
|
+DesEncrypt(clear, key, cipher)
|
|
u_char *clear; /* IN 8 octets */
|
|
u_char *cipher; /* OUT 8 octets */
|
|
{
|
|
- DES_ecb_encrypt((DES_cblock *)clear, (DES_cblock *)cipher,
|
|
- &key_schedule, 1);
|
|
+ des_ecb_encrypt((des_cblock *)clear, (des_cblock *)cipher,
|
|
+ key_schedule, 1);
|
|
return (1);
|
|
}
|
|
|
|
@@ -185,8 +185,8 @@ DesDecrypt(cipher, clear)
|
|
u_char *cipher; /* IN 8 octets */
|
|
u_char *clear; /* OUT 8 octets */
|
|
{
|
|
- DES_ecb_encrypt((DES_cblock *)cipher, (DES_cblock *)clear,
|
|
- &key_schedule, 0);
|
|
+ des_ecb_encrypt((des_cblock *)cipher, (des_cblock *)clear,
|
|
+ key_schedule, 0);
|
|
return (1);
|
|
}
|
|
|