Openwrt/package/network/services/ppp/patches/600-Revert-pppd-Use-openssl-for-the-DES-instead-of-the-l.patch
Hauke Mehrtens 030bc39c35 ppp: Update to version 2.4.9
Upstream integrated multiple patches from Distributions and did other
changes:
* rp-pppoe.so was renamed to pppoe.so
* Converted to ANSI C

The following patches were applied upstream:
* 100-debian_ip-ip_option.patch
* 101-debian_close_dev_ppp.patch
* 103-debian_fix_link_pidfile.patch
* 106-debian_stripMSdomain.patch
* 107-debian_pppoatm_wildcard.patch
* 110-debian_defaultroute.patch
* 202-no_strip.patch

Compilation with musl libc was fixed upstream so
140-pppoe_compile_fix.patch is not needed any more

Parts of the 203-opt_flags.patch patch were applied in a different way
upstream.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2021-02-24 00:30:20 +01:00

90 lines
2.3 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
@@ -36,10 +36,10 @@ endif
LIBS = -lrt
-# 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
@@ -158,8 +158,7 @@ endif
ifdef NEEDDES
ifndef USE_CRYPT
-CFLAGS += -I$(shell $(CC) --print-sysroot)/usr/include/openssl
-NEEDCRYPTOLIB = y
+LIBS += -ldes $(LIBS)
else
CFLAGS += -DUSE_CRYPT=1
endif
--- a/pppd/pppcrypt.c
+++ b/pppd/pppcrypt.c
@@ -62,7 +62,7 @@ MakeKey(u_char *key, u_char *des_key)
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
}
@@ -147,30 +147,30 @@ DesDecrypt(u_char *cipher, u_char *clear
}
#else /* USE_CRYPT */
-static DES_key_schedule key_schedule;
+static des_key_schedule key_schedule;
bool
DesSetkey(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(u_char *clear, u_char *cipher)
{
- 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);
}
bool
DesDecrypt(u_char *cipher, u_char *clear)
{
- 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);
}