1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
|
--- ./src/pdes.c.orig 2000-05-21 14:07:05.000000000 -0500
+++ ./src/pdes.c 2018-05-07 17:03:36.483003872 -0500
@@ -46,7 +46,7 @@
-static des_key_schedule sched;
+static DES_key_schedule sched;
@@ -55,7 +55,7 @@
{
char keybuf[1024+1];
int fd, res;
- des_cblock key_bin;
+ DES_cblock key_bin;
if (keyfile == NULL)
@@ -100,8 +100,8 @@
}
keybuf[sizeof(keybuf)-1] = '\0';
- des_string_to_key(keybuf, &key_bin);
- des_set_key(&key_bin, sched);
+ DES_string_to_key(keybuf, &key_bin);
+ DES_set_key(&key_bin, &sched);
return 0;
}
@@ -136,20 +136,20 @@
for (i = 1; i < 6; i++)
r.longs[0] ^= r.longs[i];
- des_ecb_encrypt((des_cblock *)&(r.longs[0]), (des_cblock *)&(r.longs[0]),
- sched, DES_ENCRYPT);
+ DES_ecb_encrypt((DES_cblock *)&(r.longs[0]), (DES_cblock *)&(r.longs[0]),
+ &sched, DES_ENCRYPT);
r.longs[2] ^= r.longs[0];
r.longs[3] ^= r.longs[1];
- des_ecb_encrypt((des_cblock *)&(r.longs[2]), (des_cblock *)&(r.longs[2]),
- sched, DES_ENCRYPT);
+ DES_ecb_encrypt((DES_cblock *)&(r.longs[2]), (DES_cblock *)&(r.longs[0]),
+ &sched, DES_ENCRYPT);
r.longs[4] ^= r.longs[2];
r.longs[5] ^= r.longs[3];
- des_ecb_encrypt((des_cblock *)&(r.longs[4]), (des_cblock *)&(r.longs[4]),
- sched, DES_ENCRYPT);
+ DES_ecb_encrypt((DES_cblock *)&(r.longs[4]), (DES_cblock *)&(r.longs[0]),
+ &sched, DES_ENCRYPT);
for (i = 0, j = 0; i < 24; i+=3, j+=4)
{
--- ./src/idecrypt.c.orig 2001-04-23 15:40:15.000000000 -0500
+++ ./src/idecrypt.c 2018-05-07 17:04:20.897003874 -0500
@@ -100,8 +100,8 @@
char buf1[32], buf2[32];
struct sockaddr_gen ip_local, ip_remote;
int keyfile_fd;
- des_cblock key_bin;
- des_key_schedule sched;
+ DES_cblock key_bin;
+ DES_key_schedule sched;
static char readable[256];
@@ -118,9 +118,8 @@
while (read(keyfile_fd, keybuf, sizeof(keybuf)-1) == sizeof(keybuf)-1)
{
keybuf[sizeof(keybuf)-1] = '\0';
- des_string_to_key(keybuf, &key_bin);
- des_set_key(&key_bin, sched);
-
+ DES_string_to_key(keybuf, &key_bin);
+ DES_set_key(&key_bin, &sched);
for (i = 0, j = 0; i < 24; i += 3, j += 4)
{
@@ -129,21 +128,21 @@
r.chars[i+2] = (to_bin[packet[j+2]] << 6) + (to_bin[packet[j+3]]);
}
- des_ecb_encrypt((des_cblock *)&(r.longs[4]),
- (des_cblock *)&(r.longs[4]),
- sched, DES_DECRYPT);
+ DES_ecb_encrypt((DES_cblock *)&(r.longs[i+2]),
+ (DES_cblock *)&(r.longs[i+2]),
+ &sched, DES_DECRYPT);
r.longs[4] ^= r.longs[2];
r.longs[5] ^= r.longs[3];
- des_ecb_encrypt((des_cblock *)&(r.longs[2]),
- (des_cblock *)&(r.longs[2]),
- sched, DES_DECRYPT);
+ DES_ecb_encrypt((DES_cblock *)&(r.longs[0]),
+ (DES_cblock *)&(r.longs[0]),
+ &sched, DES_DECRYPT);
r.longs[2] ^= r.longs[0];
r.longs[3] ^= r.longs[1];
- des_ecb_encrypt((des_cblock *)&(r.longs[0]),
- (des_cblock *)&(r.longs[0]),
- sched, DES_DECRYPT);
+ DES_ecb_encrypt((DES_cblock *)&(r.longs[0]),
+ (DES_cblock *)&(r.longs[0]),
+ &sched, DES_DECRYPT);
for (i = 1; i < 6; i++)
{
|