1
0
forked from ports/opt

ppp: fix build with glibc 2.28

This commit is contained in:
Juergen Daubert 2019-01-17 15:40:46 +01:00
parent f7e10a2f82
commit 1194e43f48
3 changed files with 119 additions and 4 deletions

View File

@ -1,7 +1,8 @@
untrusted comment: verify with /etc/ports/opt.pub
RWSE3ohX2g5d/UWPd7+qJm2MhCxaTEfuWI2fe/AFK300F9bFZuFAS3ryP349D9JWKoimFb2Nj66Xc1AxVH31flwXI5+xdVIyuQg=
SHA256 (Pkgfile) = 9298b7ce9eabc3c4d521a4e4b209b13c64d13c1bfe28b804da6dae7a698d9648
RWSE3ohX2g5d/f0BrfBwKDsmR+a85aneu6Tzm2erbvx7CMwQp0Urn/62qB5d3fUkhKmpWEWCmCgulfBdG2HBcNE2KAwTiCcGiAQ=
SHA256 (Pkgfile) = 4852b75f9a22f332d4239fd6a121dc229bfe3998b6e8fb957c96afa730dec7eb
SHA256 (.footprint) = 02ba8f49c773c5bb70a42ff518804a8343a501ca650fa08a9465a736cece84f2
SHA256 (ppp-2.4.7.tar.gz) = 02e0a3dd3e4799e33103f70ec7df75348c8540966ee7c948e4ed8a42bbccfb30
SHA256 (ppp-nofilter.patch) = ac6100526d256e341183aa6470515f85cfb6195277b801339c4f7930942132fa
SHA256 (0029-pppoe-include-netinet-in.h-before-linux-in.h.patch) = 7239409d9e28d2874da41db189e6c45a0c8f3894879783966ddcea0b5462779a
SHA256 (glibc-2.28.patch) = 3f199d83d2632274dbbe7345e5369891469f64642f28e4afb471747a88888b62

View File

@ -5,10 +5,11 @@
name=ppp
version=2.4.7
release=3
release=4
source=(https://ppp.samba.org/ftp/ppp/$name-$version.tar.gz \
$name-nofilter.patch \
0029-pppoe-include-netinet-in.h-before-linux-in.h.patch)
0029-pppoe-include-netinet-in.h-before-linux-in.h.patch \
glibc-2.28.patch)
build () {
cd $name-$version
@ -18,6 +19,9 @@ build () {
# http://pkgs.fedoraproject.org/cgit/rpms/ppp.git/tree/
patch -p1 -i $SRC/0029-pppoe-include-netinet-in.h-before-linux-in.h.patch
# from https://dev.gentoo.org/~polynomial-c/ppp-2.4.7-patches-7.tar.xz
patch -p1 -i $SRC/glibc-2.28.patch
./configure --prefix=/usr --sysconfdir=/etc
make
make -j1 INSTROOT=$PKG install install-etcppp

110
ppp/glibc-2.28.patch Normal file
View File

@ -0,0 +1,110 @@
From 3c7b86229f7bd2600d74db14b1fe5b3896be3875 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= <jskarvad@redhat.com>
Date: Fri, 6 Apr 2018 14:27:18 +0200
Subject: [PATCH] pppd: Use openssl for the DES instead of the libcrypt / glibc
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
It seems the latest glibc (in Fedora glibc-2.27.9000-12.fc29) dropped
libcrypt. The libxcrypt standalone package can be used instead, but
it dropped the old setkey/encrypt API which ppp uses for DES. There
is support for using openssl in pppcrypt.c, but it contains typos
preventing it from compiling and seems to be written for an ancient
openssl version.
This updates the code to use current openssl.
[paulus@ozlabs.org - wrote the commit description, fixed comment in
Makefile.linux.]
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
---
pppd/Makefile.linux | 7 ++++---
pppd/pppcrypt.c | 18 +++++++++---------
2 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/pppd/Makefile.linux b/pppd/Makefile.linux
index 36d2b036..8d5ce99d 100644
--- a/pppd/Makefile.linux
+++ b/pppd/Makefile.linux
@@ -35,10 +35,10 @@ endif
COPTS = -O2 -pipe -Wall -g
LIBS =
-# Uncomment the next 2 lines to include support for Microsoft's
+# Uncomment the next line 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
@@ -137,7 +137,8 @@ endif
ifdef NEEDDES
ifndef USE_CRYPT
-LIBS += -ldes $(LIBS)
+CFLAGS += -I/usr/include/openssl
+LIBS += -lcrypto
else
CFLAGS += -DUSE_CRYPT=1
endif
diff --git a/pppd/pppcrypt.c b/pppd/pppcrypt.c
index 8b85b132..6b35375e 100644
--- a/pppd/pppcrypt.c
+++ b/pppd/pppcrypt.c
@@ -64,7 +64,7 @@ u_char *des_key; /* OUT 64 bit DES key with parity bits added */
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, key, cipher)
+DesEncrypt(clear, 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);
}