Bug#916163: ppp FTBFS with glibc 2.28

2019-03-15 Thread Chris Boot
On 09/03/2019 14:55, Chris Lamb wrote:
> I've uploaded ppp 2.4.7-2+4.1 to DELAYED/5:
>   
>   ppp (2.4.7-2+4.1) unstable; urgency=medium
>   
> * Non-maintainer upload.
> * Apply upstream patch from
>   
> 
>   to fix FTBFS with glibc 2.28. (Closes: #916163)

Hi Chris,

Thanks for making this upload on my behalf, I really appreciate you
fitting this in around your busy DPL and Reproducible Builds work.

Cheers,
Chris

-- 
Chris Boot
bo...@debian.org



Bug#916163: ppp FTBFS with glibc 2.28

2019-03-09 Thread Chris Lamb
tags 916163 + pending patch
thanks

I've uploaded ppp 2.4.7-2+4.1 to DELAYED/5:
  
  ppp (2.4.7-2+4.1) unstable; urgency=medium
  
* Non-maintainer upload.
* Apply upstream patch from
  

  to fix FTBFS with glibc 2.28. (Closes: #916163)

The full debdiff is attached.


Regards,

-- 
  ,''`.
 : :'  : Chris Lamb
 `. `'`  la...@debian.org / chris-lamb.co.uk
   `-
diffstat for ppp-2.4.7 ppp-2.4.7

 changelog|9 +++
 patches/glibc-2.28.patch |  107 +++
 patches/series   |3 +
 3 files changed, 119 insertions(+)

diff -Nru ppp-2.4.7/debian/changelog ppp-2.4.7/debian/changelog
--- ppp-2.4.7/debian/changelog  2018-11-04 12:56:54.0 +
+++ ppp-2.4.7/debian/changelog  2019-03-09 14:48:25.0 +
@@ -1,3 +1,12 @@
+ppp (2.4.7-2+4.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Apply upstream patch from
+

+to fix FTBFS with glibc 2.28. (Closes: #916163)
+
+ -- Chris Lamb   Sat, 09 Mar 2019 14:48:25 +
+
 ppp (2.4.7-2+4) unstable; urgency=medium
 
   * Update EAP-TLS patch to version 1.102. (Closes: #912822)
diff -Nru ppp-2.4.7/debian/patches/glibc-2.28.patch 
ppp-2.4.7/debian/patches/glibc-2.28.patch
--- ppp-2.4.7/debian/patches/glibc-2.28.patch   1970-01-01 01:00:00.0 
+0100
+++ ppp-2.4.7/debian/patches/glibc-2.28.patch   2019-03-09 14:48:25.0 
+
@@ -0,0 +1,107 @@
+From 3c7b86229f7bd2600d74db14b1fe5b3896be3875 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= 
+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
+
+[https://github.com/paulusmack/ppp/commit/3c7b86229f7bd2600d74db14b1fe5b3896be3875]
+
+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.
+
+[pau...@ozlabs.org - wrote the commit description, fixed comment in
+ Makefile.linux.]
+
+Signed-off-by: Jaroslav Å karvada 
+Signed-off-by: Paul Mackerras 
+---
+ pppd/Makefile.linux |  7 ---
+ pppd/pppcrypt.c | 18 +-
+ 2 files changed, 13 insertions(+), 12 deletions(-)
+--- ppp-2.4.7.orig/pppd/Makefile.linux
 ppp-2.4.7/pppd/Makefile.linux
+@@ -35,10 +35,10 @@ endif
+ COPTS = -O2 -pipe -Wall -g
+ LIBS = -lcrypto
+ 
+-# 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
+@@ -142,7 +142,8 @@ endif
+ 
+ ifdef NEEDDES
+ ifndef USE_CRYPT
+-LIBS += -ldes $(LIBS)
++CFLAGS   += -I/usr/include/openssl
++LIBS += -lcrypto
+ else
+ CFLAGS   += -DUSE_CRYPT=1
+ endif
+--- ppp-2.4.7.orig/pppd/pppcrypt.c
 ppp-2.4.7/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(_key, key_schedule);
++  DES_set_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,
++  _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,
++  _schedule, 0);
+   return (1);
+ }
+ 
diff -Nru 

Bug#916163: ppp FTBFS with glibc 2.28

2019-02-10 Thread Peter Pentchev
On Wed, Jan 09, 2019 at 06:45:43PM +, Luca Boccassi wrote:
> Control: tags -1 patch
> 
> On Mon, 10 Dec 2018 21:16:50 +0200 Adrian Bunk  wrote:
[snip]
> > make[3]: *** [Makefile:227: pppd] Error 1
> 
> Dear Maintainer,
> 
> This was fixed upstream in Github:
> 
> https://github.com/paulusmack/ppp/commit/3c7b86229f7bd2600d74db14b1fe5b3896be3875
> 
> A backport (with a minor refresh for fuzz) is inlined below.

Hi,

I submitted a merge request with this patch to the Salsa ppp
packaging repository:

  https://salsa.debian.org/debian/ppp/merge_requests/1

I also submitted another merge request to import the ppp-2.4.7 upstream
tarball's data into the pristine-tar branch:

  https://salsa.debian.org/debian/ppp/merge_requests/2

Thanks to everyone for taking care of ppp in Debian!

G'luck,
Peter

-- 
Peter Pentchev  roam@{ringlet.net,debian.org,FreeBSD.org} p...@storpool.com
PGP key:http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint 2EE7 A7A5 17FC 124C F115  C354 651E EFB0 2527 DF13


signature.asc
Description: PGP signature


Bug#916163: ppp FTBFS with glibc 2.28

2019-01-09 Thread Luca Boccassi
Control: tags -1 patch

On Mon, 10 Dec 2018 21:16:50 +0200 Adrian Bunk  wrote:
> Source: ppp
> Version: 2.4.7-2+4
> Severity: serious
> Tags: ftbfs
> 
> https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/pp
p.html
> 
> ...
> pppcrypt.c: In function 'DesSetkey':
> pppcrypt.c:122:2: warning: implicit declaration of function 'setkey';
did you mean 'DesSetkey'? [-Wimplicit-function-declaration]
>   setkey((const char *)crypt_key);
>   ^~
>   DesSetkey
> pppcrypt.c: In function 'DesEncrypt':
> pppcrypt.c:137:2: warning: implicit declaration of function
'encrypt'; did you mean 'crypt'? [-Wimplicit-function-declaration]
>   encrypt((char *)des_input, 0);
>   ^~~
> ...
> cc -Wl,-z,relro -Wl,-z,now -Wl,-E -o pppd main.o magic.o fsm.o lcp.o
ipcp.o upap.o chap-new.o ccp.o ecp.o auth.o options.o demand.o utils.o
sys-linux.o ipxcp.o tty.o eap.o chap-md5.o session.o chap_ms.o eap-
tls.o pppcrypt.o multilink.o tdb.o spinlock.o ipv6cp.o eui64.o cbcp.o
-lcrypto -lssl -lcrypt -lutil -lpam -ldl -ldl -lpcap \
>   -Wl,-soname,pppd.so.2.4.7
> /usr/bin/ld: pppcrypt.o: in function `DesSetkey':
> ./pppd/pppcrypt.c:122: undefined reference to `setkey'
> /usr/bin/ld: pppcrypt.o: in function `DesEncrypt':
> ./pppd/pppcrypt.c:137: undefined reference to `encrypt'
> /usr/bin/ld: pppcrypt.o: in function `DesDecrypt':
> ./pppd/pppcrypt.c:153: undefined reference to `encrypt'
> collect2: error: ld returned 1 exit status
> make[3]: *** [Makefile:227: pppd] Error 1

Dear Maintainer,

This was fixed upstream in Github:

https://github.com/paulusmack/ppp/commit/3c7b86229f7bd2600d74db14b1fe5b3896be3875

A backport (with a minor refresh for fuzz) is inlined below.

-- 
Kind regards,
Luca Boccassi

Author: jskar...@redhat.com
Description: Use openssl for the DES instead of the libcrypt / glibc
 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.
 
 [pau...@ozlabs.org - wrote the commit description, fixed comment in
  Makefile.linux.]
Origin: https://github.com/paulusmack/ppp/pull/96
Applied-Upstream: 
https://github.com/paulusmack/ppp/commit/3c7b86229f7bd2600d74db14b1fe5b3896be3875
--- a/pppd/Makefile.linux
+++ b/pppd/Makefile.linux
@@ -35,10 +35,10 @@ endif
 COPTS = -O2 -pipe -Wall -g
 LIBS = -lcrypto
 
-# 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
@@ -142,7 +142,8 @@ endif
 
 ifdef NEEDDES
 ifndef USE_CRYPT
-LIBS += -ldes $(LIBS)
+CFLAGS   += -I/usr/include/openssl
+LIBS += -lcrypto
 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_schedulekey_schedule;
+static DES_key_schedulekey_schedule;
 
 bool
 DesSetkey(key)
 u_char *key;
 {
-   des_cblock des_key;
+   DES_cblock des_key;
MakeKey(key, des_key);
-   des_set_key(_key, key_schedule);
+   DES_set_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,
+   _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,
+   _schedule, 0);
return (1);
 }
 

signature.asc
Description: This is a digitally signed message part


Bug#916163: ppp FTBFS with glibc 2.28

2018-12-10 Thread Adrian Bunk
Source: ppp
Version: 2.4.7-2+4
Severity: serious
Tags: ftbfs

https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/ppp.html

...
pppcrypt.c: In function 'DesSetkey':
pppcrypt.c:122:2: warning: implicit declaration of function 'setkey'; did you 
mean 'DesSetkey'? [-Wimplicit-function-declaration]
  setkey((const char *)crypt_key);
  ^~
  DesSetkey
pppcrypt.c: In function 'DesEncrypt':
pppcrypt.c:137:2: warning: implicit declaration of function 'encrypt'; did you 
mean 'crypt'? [-Wimplicit-function-declaration]
  encrypt((char *)des_input, 0);
  ^~~
...
cc -Wl,-z,relro -Wl,-z,now -Wl,-E -o pppd main.o magic.o fsm.o lcp.o ipcp.o 
upap.o chap-new.o ccp.o ecp.o auth.o options.o demand.o utils.o sys-linux.o 
ipxcp.o tty.o eap.o chap-md5.o session.o chap_ms.o eap-tls.o pppcrypt.o 
multilink.o tdb.o spinlock.o ipv6cp.o eui64.o cbcp.o -lcrypto -lssl -lcrypt 
-lutil -lpam -ldl -ldl -lpcap \
-Wl,-soname,pppd.so.2.4.7
/usr/bin/ld: pppcrypt.o: in function `DesSetkey':
./pppd/pppcrypt.c:122: undefined reference to `setkey'
/usr/bin/ld: pppcrypt.o: in function `DesEncrypt':
./pppd/pppcrypt.c:137: undefined reference to `encrypt'
/usr/bin/ld: pppcrypt.o: in function `DesDecrypt':
./pppd/pppcrypt.c:153: undefined reference to `encrypt'
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:227: pppd] Error 1