ppp-2.4.7-DES-openssl.patch 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. Used openssl for the DES instead of the libcrypt / glibc
  2. Upstream-Status: Pending
  3. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  4. Index: ppp-2.4.7/pppd/Makefile.linux
  5. ===================================================================
  6. --- ppp-2.4.7.orig/pppd/Makefile.linux
  7. +++ ppp-2.4.7/pppd/Makefile.linux
  8. @@ -38,7 +38,7 @@ LIBS =
  9. # Uncomment the next 2 lines to include support for Microsoft's
  10. # MS-CHAP authentication protocol. Also, edit plugins/radius/Makefile.linux.
  11. CHAPMS=y
  12. -USE_CRYPT=y
  13. +#USE_CRYPT=y
  14. # Don't use MSLANMAN unless you really know what you're doing.
  15. #MSLANMAN=y
  16. # Uncomment the next line to include support for MPPE. CHAPMS (above) must
  17. @@ -132,7 +132,7 @@ endif
  18. ifdef NEEDDES
  19. ifndef USE_CRYPT
  20. -LIBS += -ldes $(LIBS)
  21. +LIBS += -lcrypto
  22. else
  23. CFLAGS += -DUSE_CRYPT=1
  24. endif
  25. Index: ppp-2.4.7/pppd/pppcrypt.c
  26. ===================================================================
  27. --- ppp-2.4.7.orig/pppd/pppcrypt.c
  28. +++ ppp-2.4.7/pppd/pppcrypt.c
  29. @@ -64,7 +64,7 @@ u_char *des_key; /* OUT 64 bit DES key w
  30. des_key[7] = Get7Bits(key, 49);
  31. #ifndef USE_CRYPT
  32. - des_set_odd_parity((des_cblock *)des_key);
  33. + DES_set_odd_parity((DES_cblock *)des_key);
  34. #endif
  35. }
  36. @@ -158,25 +158,25 @@ u_char *clear; /* OUT 8 octets */
  37. }
  38. #else /* USE_CRYPT */
  39. -static des_key_schedule key_schedule;
  40. +static DES_key_schedule key_schedule;
  41. bool
  42. DesSetkey(key)
  43. u_char *key;
  44. {
  45. - des_cblock des_key;
  46. + DES_cblock des_key;
  47. MakeKey(key, des_key);
  48. - des_set_key(&des_key, key_schedule);
  49. + DES_set_key(&des_key, &key_schedule);
  50. return (1);
  51. }
  52. bool
  53. -DesEncrypt(clear, key, cipher)
  54. +DesEncrypt(clear, cipher)
  55. u_char *clear; /* IN 8 octets */
  56. u_char *cipher; /* OUT 8 octets */
  57. {
  58. - des_ecb_encrypt((des_cblock *)clear, (des_cblock *)cipher,
  59. - key_schedule, 1);
  60. + DES_ecb_encrypt((DES_cblock *)clear, (DES_cblock *)cipher,
  61. + &key_schedule, 1);
  62. return (1);
  63. }
  64. @@ -185,8 +185,8 @@ DesDecrypt(cipher, clear)
  65. u_char *cipher; /* IN 8 octets */
  66. u_char *clear; /* OUT 8 octets */
  67. {
  68. - des_ecb_encrypt((des_cblock *)cipher, (des_cblock *)clear,
  69. - key_schedule, 0);
  70. + DES_ecb_encrypt((DES_cblock *)cipher, (DES_cblock *)clear,
  71. + &key_schedule, 0);
  72. return (1);
  73. }