From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: development@lists.ipfire.org Subject: Re: [PATCH] ppp: Update to 2.4.8 Date: Tue, 18 Feb 2020 10:21:58 +0000 Message-ID: <3687BB51-EF2B-4962-813A-E0E0FE218055@ipfire.org> In-Reply-To: <20200218101813.3159-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4563788429949240758==" List-Id: --===============4563788429949240758== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Reviewed-by: Michael Tremer > On 18 Feb 2020, at 10:18, Stefan Schantl wrot= e: >=20 > Signed-off-by: Stefan Schantl > --- > config/rootfiles/common/ppp | 24 ++-- > lfs/ppp | 7 +- > src/patches/ppp-2.4.7-openssl.patch | 110 ------------------ > .../0013-everywhere-O_CLOEXEC-harder.patch | 11 +- > 4 files changed, 21 insertions(+), 131 deletions(-) > delete mode 100644 src/patches/ppp-2.4.7-openssl.patch >=20 > diff --git a/config/rootfiles/common/ppp b/config/rootfiles/common/ppp > index 46c2f83b3..f1f4f88f2 100644 > --- a/config/rootfiles/common/ppp > +++ b/config/rootfiles/common/ppp > @@ -33,18 +33,18 @@ etc/ppp/standardloginscript > #usr/include/pppd/tdb.h > #usr/include/pppd/upap.h > usr/lib/pppd > -usr/lib/pppd/2.4.7 > -#usr/lib/pppd/2.4.7/minconn.so > -#usr/lib/pppd/2.4.7/openl2tp.so > -#usr/lib/pppd/2.4.7/passprompt.so > -#usr/lib/pppd/2.4.7/passwordfd.so > -#usr/lib/pppd/2.4.7/pppoatm.so > -#usr/lib/pppd/2.4.7/pppol2tp.so > -#usr/lib/pppd/2.4.7/radattr.so > -#usr/lib/pppd/2.4.7/radius.so > -#usr/lib/pppd/2.4.7/radrealms.so > -#usr/lib/pppd/2.4.7/rp-pppoe.so > -#usr/lib/pppd/2.4.7/winbind.so > +usr/lib/pppd/2.4.8 > +#usr/lib/pppd/2.4.8/minconn.so > +#usr/lib/pppd/2.4.8/openl2tp.so > +#usr/lib/pppd/2.4.8/passprompt.so > +#usr/lib/pppd/2.4.8/passwordfd.so > +#usr/lib/pppd/2.4.8/pppoatm.so > +#usr/lib/pppd/2.4.8/pppol2tp.so > +#usr/lib/pppd/2.4.8/radattr.so > +#usr/lib/pppd/2.4.8/radius.so > +#usr/lib/pppd/2.4.8/radrealms.so > +#usr/lib/pppd/2.4.8/rp-pppoe.so > +#usr/lib/pppd/2.4.8/winbind.so > usr/sbin/chat > usr/sbin/pppd > usr/sbin/pppdump > diff --git a/lfs/ppp b/lfs/ppp > index f02864cc0..607765bd0 100644 > --- a/lfs/ppp > +++ b/lfs/ppp > @@ -24,12 +24,12 @@ >=20 > include Config >=20 > -VER =3D 2.4.7 > +VER =3D 2.4.8 >=20 > THISAPP =3D ppp-$(VER) > DL_FILE =3D $(THISAPP).tar.gz > DL_FROM =3D $(URL_IPFIRE) > -DIR_APP =3D $(DIR_SRC)/$(THISAPP) > +DIR_APP =3D $(DIR_SRC)/ppp-$(THISAPP) > TARGET =3D $(DIR_INFO)/$(THISAPP) >=20 > CFLAGS +=3D -fno-strict-aliasing > @@ -42,7 +42,7 @@ objects =3D $(DL_FILE) >=20 > $(DL_FILE) =3D $(DL_FROM)/$(DL_FILE) >=20 > -$(DL_FILE)_MD5 =3D 78818f40e6d33a1d1de68a1551f6595a > +$(DL_FILE)_MD5 =3D fa325e90e43975a1bd7e1012c8676123 >=20 > install : $(TARGET) >=20 > @@ -79,7 +79,6 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) > cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/ppp/0014-everywhere-= use-SOCK_CLOEXEC-when-creating-socket.patch > cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/ppp/ppp-2.4.6-increa= se-max-padi-attempts.patch > cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/ppp/ppp-2.4.7-header= s_4.9.patch > - cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/ppp-2.4.7-openssl.p= atch > cd $(DIR_APP) && sed -i -e "s+/etc/ppp/connect-errors+/var/log/connect-err= ors+" pppd/pathnames.h > cd $(DIR_APP) && ./configure --prefix=3D/usr --disable-nls > cd $(DIR_APP) && make $(MAKETUNING) CC=3D"gcc" RPM_OPT_FLAGS=3D"$(CFLAGS)" > diff --git a/src/patches/ppp-2.4.7-openssl.patch b/src/patches/ppp-2.4.7-op= enssl.patch > deleted file mode 100644 > index cbb5857a7..000000000 > --- a/src/patches/ppp-2.4.7-openssl.patch > +++ /dev/null > @@ -1,110 +0,0 @@ > -From 3c7b86229f7bd2600d74db14b1fe5b3896be3875 Mon Sep 17 00:00:00 2001 > -From: =3D?UTF-8?q?Jaroslav=3D20=3DC5=3DA0karvada?=3D > -Date: Fri, 6 Apr 2018 14:27:18 +0200 > -Subject: [PATCH] pppd: Use openssl for the DES instead of the libcrypt / g= libc > -MIME-Version: 1.0 > -Content-Type: text/plain; charset=3DUTF-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(a)ozlabs.org - wrote the commit description, fixed comment in > - Makefile.linux.] > - > -Signed-off-by: Jaroslav =C5=A0karvada > -Signed-off-by: Paul Mackerras > ---- > - 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 =3D -O2 -pipe -Wall -g > - LIBS =3D > -=20 > --# 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.li= nux. > - CHAPMS=3Dy > --USE_CRYPT=3Dy > -+#USE_CRYPT=3Dy > - # Don't use MSLANMAN unless you really know what you're doing. > - #MSLANMAN=3Dy > - # Uncomment the next line to include support for MPPE. CHAPMS (above) mu= st > -@@ -137,7 +137,8 @@ endif > -=20 > - ifdef NEEDDES > - ifndef USE_CRYPT > --LIBS +=3D -ldes $(LIBS) > -+CFLAGS +=3D -I/usr/include/openssl > -+LIBS +=3D -lcrypto > - else > - CFLAGS +=3D -DUSE_CRYPT=3D1 > - 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] =3D Get7Bits(key, 49); > -=20 > - #ifndef USE_CRYPT > -- des_set_odd_parity((des_cblock *)des_key); > -+ DES_set_odd_parity((DES_cblock *)des_key); > - #endif > - } > -=20 > -@@ -158,25 +158,25 @@ u_char *clear; /* OUT 8 octets */ > - } > -=20 > - #else /* USE_CRYPT */ > --static des_key_schedule key_schedule; > -+static DES_key_schedule key_schedule; > -=20 > - 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); > - } > -=20 > - 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); > - } > -=20 > -@@ -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); > - } > -=20 > diff --git a/src/patches/ppp/0013-everywhere-O_CLOEXEC-harder.patch b/src/p= atches/ppp/0013-everywhere-O_CLOEXEC-harder.patch > index e3608a0d6..2513021b2 100644 > --- a/src/patches/ppp/0013-everywhere-O_CLOEXEC-harder.patch > +++ b/src/patches/ppp/0013-everywhere-O_CLOEXEC-harder.patch > @@ -140,16 +140,17 @@ index 8a12fa0..00a2cf5 100644 > if (mfd >=3D 0) { > int ptn; > if (ioctl(mfd, TIOCGPTN, &ptn) >=3D 0) { > -@@ -2581,7 +2581,7 @@ get_pty(master_fdp, slave_fdp, slave_name, uid) > +@@ -2851,7 +2851,8 @@ > if (ioctl(mfd, TIOCSPTLCK, &ptn) < 0) > warn("Couldn't unlock pty slave %s: %m", pty_name); > #endif > - if ((sfd =3D open(pty_name, O_RDWR | O_NOCTTY)) < 0) > -+ if ((sfd =3D open(pty_name, O_RDWR | O_NOCTTY | O_CLOEXEC)) < 0) > ++ > ++ if ((sfd =3D open(pty_name, O_RDWR | O_NOCTTY | O_CLOEXEC)) <= 0) > + { > warn("Couldn't open pty slave %s: %m", pty_name); > - } > - } > -@@ -2592,10 +2592,10 @@ get_pty(master_fdp, slave_fdp, slave_name, uid) > + close(mfd); > +@@ -2865,10 +2866,10 @@ > for (i =3D 0; i < 64; ++i) { > slprintf(pty_name, sizeof(pty_name), "/dev/pty%c%x", > 'p' + i / 16, i % 16); > --=20 > 2.25.0 >=20 --===============4563788429949240758==--