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