600-Revert-pppd-Use-openssl-for-the-DES-instead-of-the-l.patch 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. From 831dca008699d485f2c8e91749657ef2d0b06166 Mon Sep 17 00:00:00 2001
  2. From: Martin Schiller <ms@dev.tdt.de>
  3. Date: Thu, 6 Dec 2018 08:43:17 +0100
  4. Subject: [PATCH] Revert "pppd: Use openssl for the DES instead of the libcrypt
  5. / glibc"
  6. For musl and glibc2.27 we can keep linking to crypt; however if we
  7. switch to glibc 2.28 we will have to link to one of the SSL libraries.
  8. This reverts commit 3c7b86229f7bd2600d74db14b1fe5b3896be3875.
  9. ---
  10. pppd/Makefile.linux | 7 +++----
  11. pppd/pppcrypt.c | 18 +++++++++---------
  12. 2 files changed, 12 insertions(+), 13 deletions(-)
  13. --- a/pppd/Makefile.linux
  14. +++ b/pppd/Makefile.linux
  15. @@ -35,10 +35,10 @@ endif
  16. COPTS = -O2 -pipe -Wall -g
  17. LIBS =
  18. -# Uncomment the next line to include support for Microsoft's
  19. +# Uncomment the next 2 lines to include support for Microsoft's
  20. # MS-CHAP authentication protocol. Also, edit plugins/radius/Makefile.linux.
  21. CHAPMS=y
  22. -#USE_CRYPT=y
  23. +USE_CRYPT=y
  24. # Don't use MSLANMAN unless you really know what you're doing.
  25. #MSLANMAN=y
  26. # Uncomment the next line to include support for MPPE. CHAPMS (above) must
  27. @@ -140,8 +140,7 @@ endif
  28. ifdef NEEDDES
  29. ifndef USE_CRYPT
  30. -CFLAGS += -I/usr/include/openssl
  31. -LIBS += -lcrypto
  32. +LIBS += -ldes $(LIBS)
  33. else
  34. CFLAGS += -DUSE_CRYPT=1
  35. endif
  36. --- a/pppd/pppcrypt.c
  37. +++ b/pppd/pppcrypt.c
  38. @@ -64,7 +64,7 @@ u_char *des_key; /* OUT 64 bit DES key w
  39. des_key[7] = Get7Bits(key, 49);
  40. #ifndef USE_CRYPT
  41. - DES_set_odd_parity((DES_cblock *)des_key);
  42. + des_set_odd_parity((des_cblock *)des_key);
  43. #endif
  44. }
  45. @@ -158,25 +158,25 @@ u_char *clear; /* OUT 8 octets */
  46. }
  47. #else /* USE_CRYPT */
  48. -static DES_key_schedule key_schedule;
  49. +static des_key_schedule key_schedule;
  50. bool
  51. DesSetkey(key)
  52. u_char *key;
  53. {
  54. - DES_cblock des_key;
  55. + des_cblock des_key;
  56. MakeKey(key, des_key);
  57. - DES_set_key(&des_key, &key_schedule);
  58. + des_set_key(&des_key, key_schedule);
  59. return (1);
  60. }
  61. bool
  62. -DesEncrypt(clear, cipher)
  63. +DesEncrypt(clear, key, cipher)
  64. u_char *clear; /* IN 8 octets */
  65. u_char *cipher; /* OUT 8 octets */
  66. {
  67. - DES_ecb_encrypt((DES_cblock *)clear, (DES_cblock *)cipher,
  68. - &key_schedule, 1);
  69. + des_ecb_encrypt((des_cblock *)clear, (des_cblock *)cipher,
  70. + key_schedule, 1);
  71. return (1);
  72. }
  73. @@ -185,8 +185,8 @@ DesDecrypt(cipher, clear)
  74. u_char *cipher; /* IN 8 octets */
  75. u_char *clear; /* OUT 8 octets */
  76. {
  77. - DES_ecb_encrypt((DES_cblock *)cipher, (DES_cblock *)clear,
  78. - &key_schedule, 0);
  79. + des_ecb_encrypt((des_cblock *)cipher, (des_cblock *)clear,
  80. + key_schedule, 0);
  81. return (1);
  82. }