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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
|
$NetBSD: patch-ad,v 1.3 2000/07/29 03:12:20 jlam Exp $
--- mike.c.orig Tue Jun 13 14:13:04 2000
+++ mike.c Fri Jul 28 22:57:32 2000
@@ -23,8 +23,10 @@
char deskey[9]; /* Destination DES key, if any */
char rtpdeskey[9]; /* Destination RTP DES key, if any */
char vatdeskey[9]; /* Destination VAT DES key, if any */
+#ifdef USE_IDEA
char ideakey[17]; /* Destination IDEA key, if any */
char pgpkey[17]; /* Destination PGP key, if any */
+#endif
char blowfish_spec; /* Nonzero if Blowfish key specified */
#ifdef CRYPTO
BF_KEY blowfishkey; /* Destination Blowfish key, if any */
@@ -84,8 +86,10 @@
static char curkey[9] = ""; /* Current DES key if curkey[0] != 0 */
static char currtpkey[9] = ""; /* Current RTP DES key if currtpkey[0] != 0 */
static char curvatkey[9] = ""; /* Current VAT DES key if currtpkey[0] != 0 */
+#ifdef USE_IDEA
static char curideakey[17] = ""; /* Current IDEA key if curideakey[0] != 0 */
static char curpgpkey[17] = ""; /* Current PGP key if curpgpkey[0] != 0 */
+#endif
static char curblowfish_spec = FALSE; /* Nonzero if Blowfish key specified */
#ifdef CRYPTO
static BF_KEY curblowfishkey; /* Blowfish key */
@@ -429,8 +433,10 @@
bcopy(curkey, d->deskey, 9);
bcopy(currtpkey, d->rtpdeskey, 9);
bcopy(curvatkey, d->vatdeskey, 9);
+#ifdef USE_IDEA
bcopy(curideakey, d->ideakey, 17);
bcopy(curpgpkey, d->pgpkey, 17);
+#endif
d->blowfish_spec = curblowfish_spec;
#ifdef CRYPTO
bcopy(&curblowfishkey, &(d->blowfishkey), sizeof(BF_KEY));
@@ -599,8 +605,12 @@
#endif
#ifdef CRYPTO
+#ifdef USE_IDEA
if (d->deskey[0] || d->ideakey[0] || d->blowfish_spec ||
d->pgpkey[0] || d->otp != NULL) {
+#else
+ if (d->deskey[0] || d->blowfish_spec || d->otp != NULL) {
+#endif
soundbuf ebuf;
int i;
LONG slen, plen = 0;
@@ -677,6 +687,7 @@
}
}
+#ifdef USE_IDEA
/* IDEA encryption. */
if (d->ideakey[0]) {
@@ -699,6 +710,7 @@
close_idea();
ebuf.compression |= fEncIDEA;
}
+#endif
/* Blowfish encryption. */
@@ -723,6 +735,7 @@
ebuf.compression |= fEncBF;
}
+#ifdef USE_IDEA
/* PGP encryption. */
if (d->pgpkey[0]) {
@@ -745,6 +758,7 @@
close_idea();
ebuf.compression |= fEncPGP;
}
+#endif
/* Key file encryption. */
@@ -1593,7 +1607,7 @@
MD5Init(&md5c);
MD5Update(&md5c, s, strlen(s));
MD5Final(md5key1, &md5c);
-#ifdef CRYPTO
+#if defined(CRYPTO) && defined(USE_IDEA)
init_idearand(md5key, md5key1, time(NULL));
#define nextrand idearand()
#else
@@ -1617,7 +1631,7 @@
key[j] = nextrand;
}
}
-#ifdef CRYPTO
+#if defined(CRYPTO) && defined(USE_IDEA)
close_idearand();
#endif
#undef nextrand
@@ -1657,7 +1671,9 @@
V fprintf(stderr, " -F ADPCM compression\n");
V fprintf(stderr, " -G Automatic gain control\n");
#ifdef CRYPTO
+#ifdef USE_IDEA
V fprintf(stderr, " -Ikey IDEA encrypt with key\n");
+#endif
V fprintf(stderr, " -Kkey DES encrypt with key\n");
#endif
V fprintf(stderr, " -L Remote loopback\n");
@@ -1684,7 +1700,7 @@
#ifdef AUDIO_DEVICE_FILE
V fprintf(stderr, " -Yindev[:ctldev] Override default audio device file name or specify open #fd\n");
#endif
-#ifdef CRYPTO
+#if defined(CRYPTO) && defined(USE_IDEA)
V fprintf(stderr, " -Z\"user..\" Send PGP session key for user(s)\n");
#endif
V fprintf(stderr, "\n");
@@ -1877,6 +1893,7 @@
break;
#ifdef CRYPTO
+#ifdef USE_IDEA
case 'I': /* -Ikey -- Set IDEA key */
if (strlen(op + 1) == 0) {
curideakey[0] = FALSE;
@@ -1894,6 +1911,7 @@
}
}
break;
+#endif
case 'K': /* -Kkey -- Set DES key */
desinit(1); /* Initialise the DES library */
@@ -2107,6 +2125,7 @@
#endif
#ifdef CRYPTO
+#ifdef USE_IDEA
case 'Z': /* -Z"user1 user2..." -- Send PGP
encrypted session key to
named users */
@@ -2196,6 +2215,7 @@
}
break;
#endif
+#endif
}
} else {
@@ -2207,10 +2227,15 @@
}
if (rtp || vat) {
-#ifdef CRYPTO
+#if defined(CRYPTO) && defined(USE_IDEA)
if (curideakey[0] || curpgpkey[0] ||
curblowfish_spec || curotp != NULL) {
fprintf(stderr, "Blowfish, IDEA, PGP, and Key File encryption cannot be used\n with -RTP or -VAT protocols.\n");
+ return 2;
+ }
+#else
+ if (curblowfish_spec || curotp != NULL) {
+ fprintf(stderr, "Blowfish and Key File encryption cannot be used\n with -RTP or -VAT protocols.\n");
return 2;
}
#endif
|