diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/crypto/Makefile | 5 | ||||
-rw-r--r-- | src/lib/libcrypto/des/Makefile | 6 | ||||
-rw-r--r-- | src/lib/libcrypto/des/des.h | 10 | ||||
-rw-r--r-- | src/lib/libcrypto/des/des_old.c | 273 | ||||
-rw-r--r-- | src/lib/libcrypto/des/des_old.h | 444 | ||||
-rw-r--r-- | src/lib/libcrypto/des/des_old2.c | 82 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/des/Makefile | 6 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/des/des.h | 10 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/des/des_old.c | 273 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/des/des_old.h | 444 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/des/des_old2.c | 82 |
11 files changed, 8 insertions, 1627 deletions
diff --git a/src/lib/libcrypto/crypto/Makefile b/src/lib/libcrypto/crypto/Makefile index 8139cade49..97bb90b96d 100644 --- a/src/lib/libcrypto/crypto/Makefile +++ b/src/lib/libcrypto/crypto/Makefile | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: Makefile,v 1.11 2014/04/15 20:19:55 miod Exp $ | 1 | # $OpenBSD: Makefile,v 1.12 2014/04/15 20:49:00 tedu Exp $ |
2 | 2 | ||
3 | LIB= crypto | 3 | LIB= crypto |
4 | 4 | ||
@@ -111,7 +111,7 @@ SRCS+= cbc_cksm.c cbc_enc.c cfb64enc.c cfb_enc.c | |||
111 | SRCS+= ecb3_enc.c ecb_enc.c enc_read.c enc_writ.c | 111 | SRCS+= ecb3_enc.c ecb_enc.c enc_read.c enc_writ.c |
112 | SRCS+= fcrypt.c ofb64enc.c ofb_enc.c pcbc_enc.c | 112 | SRCS+= fcrypt.c ofb64enc.c ofb_enc.c pcbc_enc.c |
113 | SRCS+= qud_cksm.c rand_key.c rpc_enc.c set_key.c xcbc_enc.c | 113 | SRCS+= qud_cksm.c rand_key.c rpc_enc.c set_key.c xcbc_enc.c |
114 | SRCS+= str2key.c cfb64ede.c ofb64ede.c ede_cbcm_enc.c des_old.c des_old2.c | 114 | SRCS+= str2key.c cfb64ede.c ofb64ede.c ede_cbcm_enc.c |
115 | SRCS+= read2pwd.c | 115 | SRCS+= read2pwd.c |
116 | 116 | ||
117 | # dh/ | 117 | # dh/ |
@@ -365,7 +365,6 @@ HDRS=\ | |||
365 | crypto/conf/conf_api.h \ | 365 | crypto/conf/conf_api.h \ |
366 | crypto/crypto.h \ | 366 | crypto/crypto.h \ |
367 | crypto/des/des.h \ | 367 | crypto/des/des.h \ |
368 | crypto/des/des_old.h \ | ||
369 | crypto/dh/dh.h \ | 368 | crypto/dh/dh.h \ |
370 | crypto/dsa/dsa.h \ | 369 | crypto/dsa/dsa.h \ |
371 | crypto/dso/dso.h \ | 370 | crypto/dso/dso.h \ |
diff --git a/src/lib/libcrypto/des/Makefile b/src/lib/libcrypto/des/Makefile index 9f54c243b4..50366fb40e 100644 --- a/src/lib/libcrypto/des/Makefile +++ b/src/lib/libcrypto/des/Makefile | |||
@@ -28,7 +28,7 @@ LIBSRC= cbc_cksm.c cbc_enc.c cfb64enc.c cfb_enc.c \ | |||
28 | qud_cksm.c rand_key.c rpc_enc.c set_key.c \ | 28 | qud_cksm.c rand_key.c rpc_enc.c set_key.c \ |
29 | des_enc.c fcrypt_b.c \ | 29 | des_enc.c fcrypt_b.c \ |
30 | xcbc_enc.c \ | 30 | xcbc_enc.c \ |
31 | str2key.c cfb64ede.c ofb64ede.c ede_cbcm_enc.c des_old.c des_old2.c \ | 31 | str2key.c cfb64ede.c ofb64ede.c ede_cbcm_enc.c \ |
32 | read2pwd.c | 32 | read2pwd.c |
33 | 33 | ||
34 | LIBOBJ= set_key.o ecb_enc.o cbc_enc.o \ | 34 | LIBOBJ= set_key.o ecb_enc.o cbc_enc.o \ |
@@ -37,11 +37,11 @@ LIBOBJ= set_key.o ecb_enc.o cbc_enc.o \ | |||
37 | ofb_enc.o str2key.o pcbc_enc.o qud_cksm.o rand_key.o \ | 37 | ofb_enc.o str2key.o pcbc_enc.o qud_cksm.o rand_key.o \ |
38 | ${DES_ENC} \ | 38 | ${DES_ENC} \ |
39 | fcrypt.o xcbc_enc.o rpc_enc.o cbc_cksm.o \ | 39 | fcrypt.o xcbc_enc.o rpc_enc.o cbc_cksm.o \ |
40 | ede_cbcm_enc.o des_old.o des_old2.o read2pwd.o | 40 | ede_cbcm_enc.o read2pwd.o |
41 | 41 | ||
42 | SRC= $(LIBSRC) | 42 | SRC= $(LIBSRC) |
43 | 43 | ||
44 | EXHEADER= des.h des_old.h | 44 | EXHEADER= des.h |
45 | HEADER= des_locl.h rpc_des.h spr.h des_ver.h $(EXHEADER) | 45 | HEADER= des_locl.h rpc_des.h spr.h des_ver.h $(EXHEADER) |
46 | 46 | ||
47 | ALL= $(GENERAL) $(SRC) $(HEADER) | 47 | ALL= $(GENERAL) $(SRC) $(HEADER) |
diff --git a/src/lib/libcrypto/des/des.h b/src/lib/libcrypto/des/des.h index 92b6663599..c06b706e9c 100644 --- a/src/lib/libcrypto/des/des.h +++ b/src/lib/libcrypto/des/des.h | |||
@@ -91,16 +91,6 @@ typedef struct DES_ks | |||
91 | } ks[16]; | 91 | } ks[16]; |
92 | } DES_key_schedule; | 92 | } DES_key_schedule; |
93 | 93 | ||
94 | #ifndef OPENSSL_DISABLE_OLD_DES_SUPPORT | ||
95 | # ifndef OPENSSL_ENABLE_OLD_DES_SUPPORT | ||
96 | # define OPENSSL_ENABLE_OLD_DES_SUPPORT | ||
97 | # endif | ||
98 | #endif | ||
99 | |||
100 | #ifdef OPENSSL_ENABLE_OLD_DES_SUPPORT | ||
101 | # include <openssl/des_old.h> | ||
102 | #endif | ||
103 | |||
104 | #define DES_KEY_SZ (sizeof(DES_cblock)) | 94 | #define DES_KEY_SZ (sizeof(DES_cblock)) |
105 | #define DES_SCHEDULE_SZ (sizeof(DES_key_schedule)) | 95 | #define DES_SCHEDULE_SZ (sizeof(DES_key_schedule)) |
106 | 96 | ||
diff --git a/src/lib/libcrypto/des/des_old.c b/src/lib/libcrypto/des/des_old.c deleted file mode 100644 index 7c33ed7a93..0000000000 --- a/src/lib/libcrypto/des/des_old.c +++ /dev/null | |||
@@ -1,273 +0,0 @@ | |||
1 | /* crypto/des/des_old.c -*- mode:C; c-file-style: "eay" -*- */ | ||
2 | |||
3 | /* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING | ||
4 | * | ||
5 | * The function names in here are deprecated and are only present to | ||
6 | * provide an interface compatible with libdes. OpenSSL now provides | ||
7 | * functions where "des_" has been replaced with "DES_" in the names, | ||
8 | * to make it possible to make incompatible changes that are needed | ||
9 | * for C type security and other stuff. | ||
10 | * | ||
11 | * Please consider starting to use the DES_ functions rather than the | ||
12 | * des_ ones. The des_ functions will dissapear completely before | ||
13 | * OpenSSL 1.0! | ||
14 | * | ||
15 | * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING | ||
16 | */ | ||
17 | |||
18 | /* Written by Richard Levitte (richard@levitte.org) for the OpenSSL | ||
19 | * project 2001. | ||
20 | */ | ||
21 | /* ==================================================================== | ||
22 | * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. | ||
23 | * | ||
24 | * Redistribution and use in source and binary forms, with or without | ||
25 | * modification, are permitted provided that the following conditions | ||
26 | * are met: | ||
27 | * | ||
28 | * 1. Redistributions of source code must retain the above copyright | ||
29 | * notice, this list of conditions and the following disclaimer. | ||
30 | * | ||
31 | * 2. Redistributions in binary form must reproduce the above copyright | ||
32 | * notice, this list of conditions and the following disclaimer in | ||
33 | * the documentation and/or other materials provided with the | ||
34 | * distribution. | ||
35 | * | ||
36 | * 3. All advertising materials mentioning features or use of this | ||
37 | * software must display the following acknowledgment: | ||
38 | * "This product includes software developed by the OpenSSL Project | ||
39 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
40 | * | ||
41 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
42 | * endorse or promote products derived from this software without | ||
43 | * prior written permission. For written permission, please contact | ||
44 | * openssl-core@openssl.org. | ||
45 | * | ||
46 | * 5. Products derived from this software may not be called "OpenSSL" | ||
47 | * nor may "OpenSSL" appear in their names without prior written | ||
48 | * permission of the OpenSSL Project. | ||
49 | * | ||
50 | * 6. Redistributions of any form whatsoever must retain the following | ||
51 | * acknowledgment: | ||
52 | * "This product includes software developed by the OpenSSL Project | ||
53 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
54 | * | ||
55 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
56 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
57 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
58 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
59 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
60 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
61 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
62 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
63 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
64 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
65 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
66 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
67 | * ==================================================================== | ||
68 | * | ||
69 | * This product includes cryptographic software written by Eric Young | ||
70 | * (eay@cryptsoft.com). This product includes software written by Tim | ||
71 | * Hudson (tjh@cryptsoft.com). | ||
72 | * | ||
73 | */ | ||
74 | |||
75 | #define OPENSSL_DES_LIBDES_COMPATIBILITY | ||
76 | #include <openssl/des.h> | ||
77 | #include <openssl/rand.h> | ||
78 | |||
79 | const char *_ossl_old_des_options(void) | ||
80 | { | ||
81 | return DES_options(); | ||
82 | } | ||
83 | void _ossl_old_des_ecb3_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output, | ||
84 | des_key_schedule ks1,des_key_schedule ks2, | ||
85 | des_key_schedule ks3, int enc) | ||
86 | { | ||
87 | DES_ecb3_encrypt((const_DES_cblock *)input, output, | ||
88 | (DES_key_schedule *)ks1, (DES_key_schedule *)ks2, | ||
89 | (DES_key_schedule *)ks3, enc); | ||
90 | } | ||
91 | DES_LONG _ossl_old_des_cbc_cksum(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output, | ||
92 | long length,des_key_schedule schedule,_ossl_old_des_cblock *ivec) | ||
93 | { | ||
94 | return DES_cbc_cksum((unsigned char *)input, output, length, | ||
95 | (DES_key_schedule *)schedule, ivec); | ||
96 | } | ||
97 | void _ossl_old_des_cbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length, | ||
98 | des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc) | ||
99 | { | ||
100 | DES_cbc_encrypt((unsigned char *)input, (unsigned char *)output, | ||
101 | length, (DES_key_schedule *)schedule, ivec, enc); | ||
102 | } | ||
103 | void _ossl_old_des_ncbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length, | ||
104 | des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc) | ||
105 | { | ||
106 | DES_ncbc_encrypt((unsigned char *)input, (unsigned char *)output, | ||
107 | length, (DES_key_schedule *)schedule, ivec, enc); | ||
108 | } | ||
109 | void _ossl_old_des_xcbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length, | ||
110 | des_key_schedule schedule,_ossl_old_des_cblock *ivec, | ||
111 | _ossl_old_des_cblock *inw,_ossl_old_des_cblock *outw,int enc) | ||
112 | { | ||
113 | DES_xcbc_encrypt((unsigned char *)input, (unsigned char *)output, | ||
114 | length, (DES_key_schedule *)schedule, ivec, inw, outw, enc); | ||
115 | } | ||
116 | void _ossl_old_des_cfb_encrypt(unsigned char *in,unsigned char *out,int numbits, | ||
117 | long length,des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc) | ||
118 | { | ||
119 | DES_cfb_encrypt(in, out, numbits, length, | ||
120 | (DES_key_schedule *)schedule, ivec, enc); | ||
121 | } | ||
122 | void _ossl_old_des_ecb_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output, | ||
123 | des_key_schedule ks,int enc) | ||
124 | { | ||
125 | DES_ecb_encrypt(input, output, (DES_key_schedule *)ks, enc); | ||
126 | } | ||
127 | void _ossl_old_des_encrypt(DES_LONG *data,des_key_schedule ks, int enc) | ||
128 | { | ||
129 | DES_encrypt1(data, (DES_key_schedule *)ks, enc); | ||
130 | } | ||
131 | void _ossl_old_des_encrypt2(DES_LONG *data,des_key_schedule ks, int enc) | ||
132 | { | ||
133 | DES_encrypt2(data, (DES_key_schedule *)ks, enc); | ||
134 | } | ||
135 | void _ossl_old_des_encrypt3(DES_LONG *data, des_key_schedule ks1, | ||
136 | des_key_schedule ks2, des_key_schedule ks3) | ||
137 | { | ||
138 | DES_encrypt3(data, (DES_key_schedule *)ks1, (DES_key_schedule *)ks2, | ||
139 | (DES_key_schedule *)ks3); | ||
140 | } | ||
141 | void _ossl_old_des_decrypt3(DES_LONG *data, des_key_schedule ks1, | ||
142 | des_key_schedule ks2, des_key_schedule ks3) | ||
143 | { | ||
144 | DES_decrypt3(data, (DES_key_schedule *)ks1, (DES_key_schedule *)ks2, | ||
145 | (DES_key_schedule *)ks3); | ||
146 | } | ||
147 | void _ossl_old_des_ede3_cbc_encrypt(_ossl_old_des_cblock *input, _ossl_old_des_cblock *output, | ||
148 | long length, des_key_schedule ks1, des_key_schedule ks2, | ||
149 | des_key_schedule ks3, _ossl_old_des_cblock *ivec, int enc) | ||
150 | { | ||
151 | DES_ede3_cbc_encrypt((unsigned char *)input, (unsigned char *)output, | ||
152 | length, (DES_key_schedule *)ks1, (DES_key_schedule *)ks2, | ||
153 | (DES_key_schedule *)ks3, ivec, enc); | ||
154 | } | ||
155 | void _ossl_old_des_ede3_cfb64_encrypt(unsigned char *in, unsigned char *out, | ||
156 | long length, des_key_schedule ks1, des_key_schedule ks2, | ||
157 | des_key_schedule ks3, _ossl_old_des_cblock *ivec, int *num, int enc) | ||
158 | { | ||
159 | DES_ede3_cfb64_encrypt(in, out, length, | ||
160 | (DES_key_schedule *)ks1, (DES_key_schedule *)ks2, | ||
161 | (DES_key_schedule *)ks3, ivec, num, enc); | ||
162 | } | ||
163 | void _ossl_old_des_ede3_ofb64_encrypt(unsigned char *in, unsigned char *out, | ||
164 | long length, des_key_schedule ks1, des_key_schedule ks2, | ||
165 | des_key_schedule ks3, _ossl_old_des_cblock *ivec, int *num) | ||
166 | { | ||
167 | DES_ede3_ofb64_encrypt(in, out, length, | ||
168 | (DES_key_schedule *)ks1, (DES_key_schedule *)ks2, | ||
169 | (DES_key_schedule *)ks3, ivec, num); | ||
170 | } | ||
171 | |||
172 | #if 0 /* broken code, preserved just in case anyone specifically looks for this */ | ||
173 | void _ossl_old_des_xwhite_in2out(_ossl_old_des_cblock (*des_key), _ossl_old_des_cblock (*in_white), | ||
174 | _ossl_old_des_cblock (*out_white)) | ||
175 | { | ||
176 | DES_xwhite_in2out(des_key, in_white, out_white); | ||
177 | } | ||
178 | #endif | ||
179 | |||
180 | int _ossl_old_des_enc_read(int fd,char *buf,int len,des_key_schedule sched, | ||
181 | _ossl_old_des_cblock *iv) | ||
182 | { | ||
183 | return DES_enc_read(fd, buf, len, (DES_key_schedule *)sched, iv); | ||
184 | } | ||
185 | int _ossl_old_des_enc_write(int fd,char *buf,int len,des_key_schedule sched, | ||
186 | _ossl_old_des_cblock *iv) | ||
187 | { | ||
188 | return DES_enc_write(fd, buf, len, (DES_key_schedule *)sched, iv); | ||
189 | } | ||
190 | char *_ossl_old_des_fcrypt(const char *buf,const char *salt, char *ret) | ||
191 | { | ||
192 | return DES_fcrypt(buf, salt, ret); | ||
193 | } | ||
194 | char *_ossl_old_des_crypt(const char *buf,const char *salt) | ||
195 | { | ||
196 | return DES_crypt(buf, salt); | ||
197 | } | ||
198 | char *_ossl_old_crypt(const char *buf,const char *salt) | ||
199 | { | ||
200 | return DES_crypt(buf, salt); | ||
201 | } | ||
202 | void _ossl_old_des_ofb_encrypt(unsigned char *in,unsigned char *out, | ||
203 | int numbits,long length,des_key_schedule schedule,_ossl_old_des_cblock *ivec) | ||
204 | { | ||
205 | DES_ofb_encrypt(in, out, numbits, length, (DES_key_schedule *)schedule, | ||
206 | ivec); | ||
207 | } | ||
208 | void _ossl_old_des_pcbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length, | ||
209 | des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc) | ||
210 | { | ||
211 | DES_pcbc_encrypt((unsigned char *)input, (unsigned char *)output, | ||
212 | length, (DES_key_schedule *)schedule, ivec, enc); | ||
213 | } | ||
214 | DES_LONG _ossl_old_des_quad_cksum(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output, | ||
215 | long length,int out_count,_ossl_old_des_cblock *seed) | ||
216 | { | ||
217 | return DES_quad_cksum((unsigned char *)input, output, length, | ||
218 | out_count, seed); | ||
219 | } | ||
220 | void _ossl_old_des_random_seed(_ossl_old_des_cblock key) | ||
221 | { | ||
222 | RAND_seed(key, sizeof(_ossl_old_des_cblock)); | ||
223 | } | ||
224 | void _ossl_old_des_random_key(_ossl_old_des_cblock ret) | ||
225 | { | ||
226 | DES_random_key((DES_cblock *)ret); | ||
227 | } | ||
228 | int _ossl_old_des_read_password(_ossl_old_des_cblock *key, const char *prompt, | ||
229 | int verify) | ||
230 | { | ||
231 | return DES_read_password(key, prompt, verify); | ||
232 | } | ||
233 | int _ossl_old_des_read_2passwords(_ossl_old_des_cblock *key1, _ossl_old_des_cblock *key2, | ||
234 | const char *prompt, int verify) | ||
235 | { | ||
236 | return DES_read_2passwords(key1, key2, prompt, verify); | ||
237 | } | ||
238 | void _ossl_old_des_set_odd_parity(_ossl_old_des_cblock *key) | ||
239 | { | ||
240 | DES_set_odd_parity(key); | ||
241 | } | ||
242 | int _ossl_old_des_is_weak_key(_ossl_old_des_cblock *key) | ||
243 | { | ||
244 | return DES_is_weak_key(key); | ||
245 | } | ||
246 | int _ossl_old_des_set_key(_ossl_old_des_cblock *key,des_key_schedule schedule) | ||
247 | { | ||
248 | return DES_set_key(key, (DES_key_schedule *)schedule); | ||
249 | } | ||
250 | int _ossl_old_des_key_sched(_ossl_old_des_cblock *key,des_key_schedule schedule) | ||
251 | { | ||
252 | return DES_key_sched(key, (DES_key_schedule *)schedule); | ||
253 | } | ||
254 | void _ossl_old_des_string_to_key(char *str,_ossl_old_des_cblock *key) | ||
255 | { | ||
256 | DES_string_to_key(str, key); | ||
257 | } | ||
258 | void _ossl_old_des_string_to_2keys(char *str,_ossl_old_des_cblock *key1,_ossl_old_des_cblock *key2) | ||
259 | { | ||
260 | DES_string_to_2keys(str, key1, key2); | ||
261 | } | ||
262 | void _ossl_old_des_cfb64_encrypt(unsigned char *in, unsigned char *out, long length, | ||
263 | des_key_schedule schedule, _ossl_old_des_cblock *ivec, int *num, int enc) | ||
264 | { | ||
265 | DES_cfb64_encrypt(in, out, length, (DES_key_schedule *)schedule, | ||
266 | ivec, num, enc); | ||
267 | } | ||
268 | void _ossl_old_des_ofb64_encrypt(unsigned char *in, unsigned char *out, long length, | ||
269 | des_key_schedule schedule, _ossl_old_des_cblock *ivec, int *num) | ||
270 | { | ||
271 | DES_ofb64_encrypt(in, out, length, (DES_key_schedule *)schedule, | ||
272 | ivec, num); | ||
273 | } | ||
diff --git a/src/lib/libcrypto/des/des_old.h b/src/lib/libcrypto/des/des_old.h deleted file mode 100644 index d75a6df2e8..0000000000 --- a/src/lib/libcrypto/des/des_old.h +++ /dev/null | |||
@@ -1,444 +0,0 @@ | |||
1 | /* crypto/des/des_old.h -*- mode:C; c-file-style: "eay" -*- */ | ||
2 | |||
3 | /* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING | ||
4 | * | ||
5 | * The function names in here are deprecated and are only present to | ||
6 | * provide an interface compatible with openssl 0.9.6 and older as | ||
7 | * well as libdes. OpenSSL now provides functions where "des_" has | ||
8 | * been replaced with "DES_" in the names, to make it possible to | ||
9 | * make incompatible changes that are needed for C type security and | ||
10 | * other stuff. | ||
11 | * | ||
12 | * This include files has two compatibility modes: | ||
13 | * | ||
14 | * - If OPENSSL_DES_LIBDES_COMPATIBILITY is defined, you get an API | ||
15 | * that is compatible with libdes and SSLeay. | ||
16 | * - If OPENSSL_DES_LIBDES_COMPATIBILITY isn't defined, you get an | ||
17 | * API that is compatible with OpenSSL 0.9.5x to 0.9.6x. | ||
18 | * | ||
19 | * Note that these modes break earlier snapshots of OpenSSL, where | ||
20 | * libdes compatibility was the only available mode or (later on) the | ||
21 | * prefered compatibility mode. However, after much consideration | ||
22 | * (and more or less violent discussions with external parties), it | ||
23 | * was concluded that OpenSSL should be compatible with earlier versions | ||
24 | * of itself before anything else. Also, in all honesty, libdes is | ||
25 | * an old beast that shouldn't really be used any more. | ||
26 | * | ||
27 | * Please consider starting to use the DES_ functions rather than the | ||
28 | * des_ ones. The des_ functions will disappear completely before | ||
29 | * OpenSSL 1.0! | ||
30 | * | ||
31 | * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING | ||
32 | */ | ||
33 | |||
34 | /* Written by Richard Levitte (richard@levitte.org) for the OpenSSL | ||
35 | * project 2001. | ||
36 | */ | ||
37 | /* ==================================================================== | ||
38 | * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. | ||
39 | * | ||
40 | * Redistribution and use in source and binary forms, with or without | ||
41 | * modification, are permitted provided that the following conditions | ||
42 | * are met: | ||
43 | * | ||
44 | * 1. Redistributions of source code must retain the above copyright | ||
45 | * notice, this list of conditions and the following disclaimer. | ||
46 | * | ||
47 | * 2. Redistributions in binary form must reproduce the above copyright | ||
48 | * notice, this list of conditions and the following disclaimer in | ||
49 | * the documentation and/or other materials provided with the | ||
50 | * distribution. | ||
51 | * | ||
52 | * 3. All advertising materials mentioning features or use of this | ||
53 | * software must display the following acknowledgment: | ||
54 | * "This product includes software developed by the OpenSSL Project | ||
55 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
56 | * | ||
57 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
58 | * endorse or promote products derived from this software without | ||
59 | * prior written permission. For written permission, please contact | ||
60 | * openssl-core@openssl.org. | ||
61 | * | ||
62 | * 5. Products derived from this software may not be called "OpenSSL" | ||
63 | * nor may "OpenSSL" appear in their names without prior written | ||
64 | * permission of the OpenSSL Project. | ||
65 | * | ||
66 | * 6. Redistributions of any form whatsoever must retain the following | ||
67 | * acknowledgment: | ||
68 | * "This product includes software developed by the OpenSSL Project | ||
69 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
70 | * | ||
71 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
72 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
73 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
74 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
75 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
76 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
77 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
78 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
79 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
80 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
81 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
82 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
83 | * ==================================================================== | ||
84 | * | ||
85 | * This product includes cryptographic software written by Eric Young | ||
86 | * (eay@cryptsoft.com). This product includes software written by Tim | ||
87 | * Hudson (tjh@cryptsoft.com). | ||
88 | * | ||
89 | */ | ||
90 | |||
91 | #ifndef HEADER_DES_H | ||
92 | #define HEADER_DES_H | ||
93 | |||
94 | #include <openssl/e_os2.h> /* OPENSSL_EXTERN, OPENSSL_NO_DES, DES_LONG */ | ||
95 | |||
96 | #ifdef OPENSSL_NO_DES | ||
97 | #error DES is disabled. | ||
98 | #endif | ||
99 | |||
100 | #ifndef HEADER_NEW_DES_H | ||
101 | #error You must include des.h, not des_old.h directly. | ||
102 | #endif | ||
103 | |||
104 | #ifdef _KERBEROS_DES_H | ||
105 | #error <openssl/des_old.h> replaces <kerberos/des.h>. | ||
106 | #endif | ||
107 | |||
108 | #ifdef OPENSSL_BUILD_SHLIBCRYPTO | ||
109 | # undef OPENSSL_EXTERN | ||
110 | # define OPENSSL_EXTERN OPENSSL_EXPORT | ||
111 | #endif | ||
112 | |||
113 | #ifdef __cplusplus | ||
114 | extern "C" { | ||
115 | #endif | ||
116 | |||
117 | #ifdef _ | ||
118 | #undef _ | ||
119 | #endif | ||
120 | |||
121 | typedef unsigned char _ossl_old_des_cblock[8]; | ||
122 | typedef struct _ossl_old_des_ks_struct | ||
123 | { | ||
124 | union { | ||
125 | _ossl_old_des_cblock _; | ||
126 | /* make sure things are correct size on machines with | ||
127 | * 8 byte longs */ | ||
128 | DES_LONG pad[2]; | ||
129 | } ks; | ||
130 | } _ossl_old_des_key_schedule[16]; | ||
131 | |||
132 | #ifndef OPENSSL_DES_LIBDES_COMPATIBILITY | ||
133 | #define des_cblock DES_cblock | ||
134 | #define const_des_cblock const_DES_cblock | ||
135 | #define des_key_schedule DES_key_schedule | ||
136 | #define des_ecb3_encrypt(i,o,k1,k2,k3,e)\ | ||
137 | DES_ecb3_encrypt((i),(o),&(k1),&(k2),&(k3),(e)) | ||
138 | #define des_ede3_cbc_encrypt(i,o,l,k1,k2,k3,iv,e)\ | ||
139 | DES_ede3_cbc_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(e)) | ||
140 | #define des_ede3_cbcm_encrypt(i,o,l,k1,k2,k3,iv1,iv2,e)\ | ||
141 | DES_ede3_cbcm_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv1),(iv2),(e)) | ||
142 | #define des_ede3_cfb64_encrypt(i,o,l,k1,k2,k3,iv,n,e)\ | ||
143 | DES_ede3_cfb64_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(n),(e)) | ||
144 | #define des_ede3_ofb64_encrypt(i,o,l,k1,k2,k3,iv,n)\ | ||
145 | DES_ede3_ofb64_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(n)) | ||
146 | #define des_options()\ | ||
147 | DES_options() | ||
148 | #define des_cbc_cksum(i,o,l,k,iv)\ | ||
149 | DES_cbc_cksum((i),(o),(l),&(k),(iv)) | ||
150 | #define des_cbc_encrypt(i,o,l,k,iv,e)\ | ||
151 | DES_cbc_encrypt((i),(o),(l),&(k),(iv),(e)) | ||
152 | #define des_ncbc_encrypt(i,o,l,k,iv,e)\ | ||
153 | DES_ncbc_encrypt((i),(o),(l),&(k),(iv),(e)) | ||
154 | #define des_xcbc_encrypt(i,o,l,k,iv,inw,outw,e)\ | ||
155 | DES_xcbc_encrypt((i),(o),(l),&(k),(iv),(inw),(outw),(e)) | ||
156 | #define des_cfb_encrypt(i,o,n,l,k,iv,e)\ | ||
157 | DES_cfb_encrypt((i),(o),(n),(l),&(k),(iv),(e)) | ||
158 | #define des_ecb_encrypt(i,o,k,e)\ | ||
159 | DES_ecb_encrypt((i),(o),&(k),(e)) | ||
160 | #define des_encrypt1(d,k,e)\ | ||
161 | DES_encrypt1((d),&(k),(e)) | ||
162 | #define des_encrypt2(d,k,e)\ | ||
163 | DES_encrypt2((d),&(k),(e)) | ||
164 | #define des_encrypt3(d,k1,k2,k3)\ | ||
165 | DES_encrypt3((d),&(k1),&(k2),&(k3)) | ||
166 | #define des_decrypt3(d,k1,k2,k3)\ | ||
167 | DES_decrypt3((d),&(k1),&(k2),&(k3)) | ||
168 | #define des_xwhite_in2out(k,i,o)\ | ||
169 | DES_xwhite_in2out((k),(i),(o)) | ||
170 | #define des_enc_read(f,b,l,k,iv)\ | ||
171 | DES_enc_read((f),(b),(l),&(k),(iv)) | ||
172 | #define des_enc_write(f,b,l,k,iv)\ | ||
173 | DES_enc_write((f),(b),(l),&(k),(iv)) | ||
174 | #define des_fcrypt(b,s,r)\ | ||
175 | DES_fcrypt((b),(s),(r)) | ||
176 | #if 0 | ||
177 | #define des_crypt(b,s)\ | ||
178 | DES_crypt((b),(s)) | ||
179 | #if !defined(PERL5) && !defined(__FreeBSD__) && !defined(NeXT) && !defined(__OpenBSD__) | ||
180 | #define crypt(b,s)\ | ||
181 | DES_crypt((b),(s)) | ||
182 | #endif | ||
183 | #endif | ||
184 | #define des_ofb_encrypt(i,o,n,l,k,iv)\ | ||
185 | DES_ofb_encrypt((i),(o),(n),(l),&(k),(iv)) | ||
186 | #define des_pcbc_encrypt(i,o,l,k,iv,e)\ | ||
187 | DES_pcbc_encrypt((i),(o),(l),&(k),(iv),(e)) | ||
188 | #define des_quad_cksum(i,o,l,c,s)\ | ||
189 | DES_quad_cksum((i),(o),(l),(c),(s)) | ||
190 | #define des_random_seed(k)\ | ||
191 | _ossl_096_des_random_seed((k)) | ||
192 | #define des_random_key(r)\ | ||
193 | DES_random_key((r)) | ||
194 | #define des_read_password(k,p,v) \ | ||
195 | DES_read_password((k),(p),(v)) | ||
196 | #define des_read_2passwords(k1,k2,p,v) \ | ||
197 | DES_read_2passwords((k1),(k2),(p),(v)) | ||
198 | #define des_set_odd_parity(k)\ | ||
199 | DES_set_odd_parity((k)) | ||
200 | #define des_check_key_parity(k)\ | ||
201 | DES_check_key_parity((k)) | ||
202 | #define des_is_weak_key(k)\ | ||
203 | DES_is_weak_key((k)) | ||
204 | #define des_set_key(k,ks)\ | ||
205 | DES_set_key((k),&(ks)) | ||
206 | #define des_key_sched(k,ks)\ | ||
207 | DES_key_sched((k),&(ks)) | ||
208 | #define des_set_key_checked(k,ks)\ | ||
209 | DES_set_key_checked((k),&(ks)) | ||
210 | #define des_set_key_unchecked(k,ks)\ | ||
211 | DES_set_key_unchecked((k),&(ks)) | ||
212 | #define des_string_to_key(s,k)\ | ||
213 | DES_string_to_key((s),(k)) | ||
214 | #define des_string_to_2keys(s,k1,k2)\ | ||
215 | DES_string_to_2keys((s),(k1),(k2)) | ||
216 | #define des_cfb64_encrypt(i,o,l,ks,iv,n,e)\ | ||
217 | DES_cfb64_encrypt((i),(o),(l),&(ks),(iv),(n),(e)) | ||
218 | #define des_ofb64_encrypt(i,o,l,ks,iv,n)\ | ||
219 | DES_ofb64_encrypt((i),(o),(l),&(ks),(iv),(n)) | ||
220 | |||
221 | |||
222 | #define des_ecb2_encrypt(i,o,k1,k2,e) \ | ||
223 | des_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e)) | ||
224 | |||
225 | #define des_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \ | ||
226 | des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e)) | ||
227 | |||
228 | #define des_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \ | ||
229 | des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e)) | ||
230 | |||
231 | #define des_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \ | ||
232 | des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n)) | ||
233 | |||
234 | #define des_check_key DES_check_key | ||
235 | #define des_rw_mode DES_rw_mode | ||
236 | #else /* libdes compatibility */ | ||
237 | /* Map all symbol names to _ossl_old_des_* form, so we avoid all | ||
238 | clashes with libdes */ | ||
239 | #define des_cblock _ossl_old_des_cblock | ||
240 | #define des_key_schedule _ossl_old_des_key_schedule | ||
241 | #define des_ecb3_encrypt(i,o,k1,k2,k3,e)\ | ||
242 | _ossl_old_des_ecb3_encrypt((i),(o),(k1),(k2),(k3),(e)) | ||
243 | #define des_ede3_cbc_encrypt(i,o,l,k1,k2,k3,iv,e)\ | ||
244 | _ossl_old_des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(e)) | ||
245 | #define des_ede3_cfb64_encrypt(i,o,l,k1,k2,k3,iv,n,e)\ | ||
246 | _ossl_old_des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(n),(e)) | ||
247 | #define des_ede3_ofb64_encrypt(i,o,l,k1,k2,k3,iv,n)\ | ||
248 | _ossl_old_des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(n)) | ||
249 | #define des_options()\ | ||
250 | _ossl_old_des_options() | ||
251 | #define des_cbc_cksum(i,o,l,k,iv)\ | ||
252 | _ossl_old_des_cbc_cksum((i),(o),(l),(k),(iv)) | ||
253 | #define des_cbc_encrypt(i,o,l,k,iv,e)\ | ||
254 | _ossl_old_des_cbc_encrypt((i),(o),(l),(k),(iv),(e)) | ||
255 | #define des_ncbc_encrypt(i,o,l,k,iv,e)\ | ||
256 | _ossl_old_des_ncbc_encrypt((i),(o),(l),(k),(iv),(e)) | ||
257 | #define des_xcbc_encrypt(i,o,l,k,iv,inw,outw,e)\ | ||
258 | _ossl_old_des_xcbc_encrypt((i),(o),(l),(k),(iv),(inw),(outw),(e)) | ||
259 | #define des_cfb_encrypt(i,o,n,l,k,iv,e)\ | ||
260 | _ossl_old_des_cfb_encrypt((i),(o),(n),(l),(k),(iv),(e)) | ||
261 | #define des_ecb_encrypt(i,o,k,e)\ | ||
262 | _ossl_old_des_ecb_encrypt((i),(o),(k),(e)) | ||
263 | #define des_encrypt(d,k,e)\ | ||
264 | _ossl_old_des_encrypt((d),(k),(e)) | ||
265 | #define des_encrypt2(d,k,e)\ | ||
266 | _ossl_old_des_encrypt2((d),(k),(e)) | ||
267 | #define des_encrypt3(d,k1,k2,k3)\ | ||
268 | _ossl_old_des_encrypt3((d),(k1),(k2),(k3)) | ||
269 | #define des_decrypt3(d,k1,k2,k3)\ | ||
270 | _ossl_old_des_decrypt3((d),(k1),(k2),(k3)) | ||
271 | #define des_xwhite_in2out(k,i,o)\ | ||
272 | _ossl_old_des_xwhite_in2out((k),(i),(o)) | ||
273 | #define des_enc_read(f,b,l,k,iv)\ | ||
274 | _ossl_old_des_enc_read((f),(b),(l),(k),(iv)) | ||
275 | #define des_enc_write(f,b,l,k,iv)\ | ||
276 | _ossl_old_des_enc_write((f),(b),(l),(k),(iv)) | ||
277 | #define des_fcrypt(b,s,r)\ | ||
278 | _ossl_old_des_fcrypt((b),(s),(r)) | ||
279 | #define des_crypt(b,s)\ | ||
280 | _ossl_old_des_crypt((b),(s)) | ||
281 | #if 0 | ||
282 | #define crypt(b,s)\ | ||
283 | _ossl_old_crypt((b),(s)) | ||
284 | #endif | ||
285 | #define des_ofb_encrypt(i,o,n,l,k,iv)\ | ||
286 | _ossl_old_des_ofb_encrypt((i),(o),(n),(l),(k),(iv)) | ||
287 | #define des_pcbc_encrypt(i,o,l,k,iv,e)\ | ||
288 | _ossl_old_des_pcbc_encrypt((i),(o),(l),(k),(iv),(e)) | ||
289 | #define des_quad_cksum(i,o,l,c,s)\ | ||
290 | _ossl_old_des_quad_cksum((i),(o),(l),(c),(s)) | ||
291 | #define des_random_seed(k)\ | ||
292 | _ossl_old_des_random_seed((k)) | ||
293 | #define des_random_key(r)\ | ||
294 | _ossl_old_des_random_key((r)) | ||
295 | #define des_read_password(k,p,v) \ | ||
296 | _ossl_old_des_read_password((k),(p),(v)) | ||
297 | #define des_read_2passwords(k1,k2,p,v) \ | ||
298 | _ossl_old_des_read_2passwords((k1),(k2),(p),(v)) | ||
299 | #define des_set_odd_parity(k)\ | ||
300 | _ossl_old_des_set_odd_parity((k)) | ||
301 | #define des_is_weak_key(k)\ | ||
302 | _ossl_old_des_is_weak_key((k)) | ||
303 | #define des_set_key(k,ks)\ | ||
304 | _ossl_old_des_set_key((k),(ks)) | ||
305 | #define des_key_sched(k,ks)\ | ||
306 | _ossl_old_des_key_sched((k),(ks)) | ||
307 | #define des_string_to_key(s,k)\ | ||
308 | _ossl_old_des_string_to_key((s),(k)) | ||
309 | #define des_string_to_2keys(s,k1,k2)\ | ||
310 | _ossl_old_des_string_to_2keys((s),(k1),(k2)) | ||
311 | #define des_cfb64_encrypt(i,o,l,ks,iv,n,e)\ | ||
312 | _ossl_old_des_cfb64_encrypt((i),(o),(l),(ks),(iv),(n),(e)) | ||
313 | #define des_ofb64_encrypt(i,o,l,ks,iv,n)\ | ||
314 | _ossl_old_des_ofb64_encrypt((i),(o),(l),(ks),(iv),(n)) | ||
315 | |||
316 | |||
317 | #define des_ecb2_encrypt(i,o,k1,k2,e) \ | ||
318 | des_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e)) | ||
319 | |||
320 | #define des_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \ | ||
321 | des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e)) | ||
322 | |||
323 | #define des_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \ | ||
324 | des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e)) | ||
325 | |||
326 | #define des_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \ | ||
327 | des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n)) | ||
328 | |||
329 | #define des_check_key DES_check_key | ||
330 | #define des_rw_mode DES_rw_mode | ||
331 | #endif | ||
332 | |||
333 | const char *_ossl_old_des_options(void); | ||
334 | void _ossl_old_des_ecb3_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output, | ||
335 | _ossl_old_des_key_schedule ks1,_ossl_old_des_key_schedule ks2, | ||
336 | _ossl_old_des_key_schedule ks3, int enc); | ||
337 | DES_LONG _ossl_old_des_cbc_cksum(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output, | ||
338 | long length,_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec); | ||
339 | void _ossl_old_des_cbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length, | ||
340 | _ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc); | ||
341 | void _ossl_old_des_ncbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length, | ||
342 | _ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc); | ||
343 | void _ossl_old_des_xcbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length, | ||
344 | _ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec, | ||
345 | _ossl_old_des_cblock *inw,_ossl_old_des_cblock *outw,int enc); | ||
346 | void _ossl_old_des_cfb_encrypt(unsigned char *in,unsigned char *out,int numbits, | ||
347 | long length,_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc); | ||
348 | void _ossl_old_des_ecb_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output, | ||
349 | _ossl_old_des_key_schedule ks,int enc); | ||
350 | void _ossl_old_des_encrypt(DES_LONG *data,_ossl_old_des_key_schedule ks, int enc); | ||
351 | void _ossl_old_des_encrypt2(DES_LONG *data,_ossl_old_des_key_schedule ks, int enc); | ||
352 | void _ossl_old_des_encrypt3(DES_LONG *data, _ossl_old_des_key_schedule ks1, | ||
353 | _ossl_old_des_key_schedule ks2, _ossl_old_des_key_schedule ks3); | ||
354 | void _ossl_old_des_decrypt3(DES_LONG *data, _ossl_old_des_key_schedule ks1, | ||
355 | _ossl_old_des_key_schedule ks2, _ossl_old_des_key_schedule ks3); | ||
356 | void _ossl_old_des_ede3_cbc_encrypt(_ossl_old_des_cblock *input, _ossl_old_des_cblock *output, | ||
357 | long length, _ossl_old_des_key_schedule ks1, _ossl_old_des_key_schedule ks2, | ||
358 | _ossl_old_des_key_schedule ks3, _ossl_old_des_cblock *ivec, int enc); | ||
359 | void _ossl_old_des_ede3_cfb64_encrypt(unsigned char *in, unsigned char *out, | ||
360 | long length, _ossl_old_des_key_schedule ks1, _ossl_old_des_key_schedule ks2, | ||
361 | _ossl_old_des_key_schedule ks3, _ossl_old_des_cblock *ivec, int *num, int enc); | ||
362 | void _ossl_old_des_ede3_ofb64_encrypt(unsigned char *in, unsigned char *out, | ||
363 | long length, _ossl_old_des_key_schedule ks1, _ossl_old_des_key_schedule ks2, | ||
364 | _ossl_old_des_key_schedule ks3, _ossl_old_des_cblock *ivec, int *num); | ||
365 | #if 0 | ||
366 | void _ossl_old_des_xwhite_in2out(_ossl_old_des_cblock (*des_key), _ossl_old_des_cblock (*in_white), | ||
367 | _ossl_old_des_cblock (*out_white)); | ||
368 | #endif | ||
369 | |||
370 | int _ossl_old_des_enc_read(int fd,char *buf,int len,_ossl_old_des_key_schedule sched, | ||
371 | _ossl_old_des_cblock *iv); | ||
372 | int _ossl_old_des_enc_write(int fd,char *buf,int len,_ossl_old_des_key_schedule sched, | ||
373 | _ossl_old_des_cblock *iv); | ||
374 | char *_ossl_old_des_fcrypt(const char *buf,const char *salt, char *ret); | ||
375 | char *_ossl_old_des_crypt(const char *buf,const char *salt); | ||
376 | #if !defined(PERL5) && !defined(NeXT) | ||
377 | char *_ossl_old_crypt(const char *buf,const char *salt); | ||
378 | #endif | ||
379 | void _ossl_old_des_ofb_encrypt(unsigned char *in,unsigned char *out, | ||
380 | int numbits,long length,_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec); | ||
381 | void _ossl_old_des_pcbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length, | ||
382 | _ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc); | ||
383 | DES_LONG _ossl_old_des_quad_cksum(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output, | ||
384 | long length,int out_count,_ossl_old_des_cblock *seed); | ||
385 | void _ossl_old_des_random_seed(_ossl_old_des_cblock key); | ||
386 | void _ossl_old_des_random_key(_ossl_old_des_cblock ret); | ||
387 | int _ossl_old_des_read_password(_ossl_old_des_cblock *key,const char *prompt,int verify); | ||
388 | int _ossl_old_des_read_2passwords(_ossl_old_des_cblock *key1,_ossl_old_des_cblock *key2, | ||
389 | const char *prompt,int verify); | ||
390 | void _ossl_old_des_set_odd_parity(_ossl_old_des_cblock *key); | ||
391 | int _ossl_old_des_is_weak_key(_ossl_old_des_cblock *key); | ||
392 | int _ossl_old_des_set_key(_ossl_old_des_cblock *key,_ossl_old_des_key_schedule schedule); | ||
393 | int _ossl_old_des_key_sched(_ossl_old_des_cblock *key,_ossl_old_des_key_schedule schedule); | ||
394 | void _ossl_old_des_string_to_key(char *str,_ossl_old_des_cblock *key); | ||
395 | void _ossl_old_des_string_to_2keys(char *str,_ossl_old_des_cblock *key1,_ossl_old_des_cblock *key2); | ||
396 | void _ossl_old_des_cfb64_encrypt(unsigned char *in, unsigned char *out, long length, | ||
397 | _ossl_old_des_key_schedule schedule, _ossl_old_des_cblock *ivec, int *num, int enc); | ||
398 | void _ossl_old_des_ofb64_encrypt(unsigned char *in, unsigned char *out, long length, | ||
399 | _ossl_old_des_key_schedule schedule, _ossl_old_des_cblock *ivec, int *num); | ||
400 | |||
401 | void _ossl_096_des_random_seed(des_cblock *key); | ||
402 | |||
403 | /* The following definitions provide compatibility with the MIT Kerberos | ||
404 | * library. The _ossl_old_des_key_schedule structure is not binary compatible. */ | ||
405 | |||
406 | #define _KERBEROS_DES_H | ||
407 | |||
408 | #define KRBDES_ENCRYPT DES_ENCRYPT | ||
409 | #define KRBDES_DECRYPT DES_DECRYPT | ||
410 | |||
411 | #ifdef KERBEROS | ||
412 | # define ENCRYPT DES_ENCRYPT | ||
413 | # define DECRYPT DES_DECRYPT | ||
414 | #endif | ||
415 | |||
416 | #ifndef NCOMPAT | ||
417 | # define C_Block des_cblock | ||
418 | # define Key_schedule des_key_schedule | ||
419 | # define KEY_SZ DES_KEY_SZ | ||
420 | # define string_to_key des_string_to_key | ||
421 | # define read_pw_string des_read_pw_string | ||
422 | # define random_key des_random_key | ||
423 | # define pcbc_encrypt des_pcbc_encrypt | ||
424 | # define set_key des_set_key | ||
425 | # define key_sched des_key_sched | ||
426 | # define ecb_encrypt des_ecb_encrypt | ||
427 | # define cbc_encrypt des_cbc_encrypt | ||
428 | # define ncbc_encrypt des_ncbc_encrypt | ||
429 | # define xcbc_encrypt des_xcbc_encrypt | ||
430 | # define cbc_cksum des_cbc_cksum | ||
431 | # define quad_cksum des_quad_cksum | ||
432 | # define check_parity des_check_key_parity | ||
433 | #endif | ||
434 | |||
435 | #define des_fixup_key_parity DES_fixup_key_parity | ||
436 | |||
437 | #ifdef __cplusplus | ||
438 | } | ||
439 | #endif | ||
440 | |||
441 | /* for DES_read_pw_string et al */ | ||
442 | #include <openssl/ui_compat.h> | ||
443 | |||
444 | #endif | ||
diff --git a/src/lib/libcrypto/des/des_old2.c b/src/lib/libcrypto/des/des_old2.c deleted file mode 100644 index c8fa3ee135..0000000000 --- a/src/lib/libcrypto/des/des_old2.c +++ /dev/null | |||
@@ -1,82 +0,0 @@ | |||
1 | /* crypto/des/des_old.c -*- mode:C; c-file-style: "eay" -*- */ | ||
2 | |||
3 | /* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING | ||
4 | * | ||
5 | * The function names in here are deprecated and are only present to | ||
6 | * provide an interface compatible with OpenSSL 0.9.6c. OpenSSL now | ||
7 | * provides functions where "des_" has been replaced with "DES_" in | ||
8 | * the names, to make it possible to make incompatible changes that | ||
9 | * are needed for C type security and other stuff. | ||
10 | * | ||
11 | * Please consider starting to use the DES_ functions rather than the | ||
12 | * des_ ones. The des_ functions will dissapear completely before | ||
13 | * OpenSSL 1.0! | ||
14 | * | ||
15 | * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING | ||
16 | */ | ||
17 | |||
18 | /* Written by Richard Levitte (richard@levitte.org) for the OpenSSL | ||
19 | * project 2001. | ||
20 | */ | ||
21 | /* ==================================================================== | ||
22 | * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. | ||
23 | * | ||
24 | * Redistribution and use in source and binary forms, with or without | ||
25 | * modification, are permitted provided that the following conditions | ||
26 | * are met: | ||
27 | * | ||
28 | * 1. Redistributions of source code must retain the above copyright | ||
29 | * notice, this list of conditions and the following disclaimer. | ||
30 | * | ||
31 | * 2. Redistributions in binary form must reproduce the above copyright | ||
32 | * notice, this list of conditions and the following disclaimer in | ||
33 | * the documentation and/or other materials provided with the | ||
34 | * distribution. | ||
35 | * | ||
36 | * 3. All advertising materials mentioning features or use of this | ||
37 | * software must display the following acknowledgment: | ||
38 | * "This product includes software developed by the OpenSSL Project | ||
39 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
40 | * | ||
41 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
42 | * endorse or promote products derived from this software without | ||
43 | * prior written permission. For written permission, please contact | ||
44 | * openssl-core@openssl.org. | ||
45 | * | ||
46 | * 5. Products derived from this software may not be called "OpenSSL" | ||
47 | * nor may "OpenSSL" appear in their names without prior written | ||
48 | * permission of the OpenSSL Project. | ||
49 | * | ||
50 | * 6. Redistributions of any form whatsoever must retain the following | ||
51 | * acknowledgment: | ||
52 | * "This product includes software developed by the OpenSSL Project | ||
53 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
54 | * | ||
55 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
56 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
57 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
58 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
59 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
60 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
61 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
62 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
63 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
64 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
65 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
66 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
67 | * ==================================================================== | ||
68 | * | ||
69 | * This product includes cryptographic software written by Eric Young | ||
70 | * (eay@cryptsoft.com). This product includes software written by Tim | ||
71 | * Hudson (tjh@cryptsoft.com). | ||
72 | * | ||
73 | */ | ||
74 | |||
75 | #undef OPENSSL_DES_LIBDES_COMPATIBILITY | ||
76 | #include <openssl/des.h> | ||
77 | #include <openssl/rand.h> | ||
78 | |||
79 | void _ossl_096_des_random_seed(DES_cblock *key) | ||
80 | { | ||
81 | RAND_seed(key, sizeof(DES_cblock)); | ||
82 | } | ||
diff --git a/src/lib/libssl/src/crypto/des/Makefile b/src/lib/libssl/src/crypto/des/Makefile index 9f54c243b4..50366fb40e 100644 --- a/src/lib/libssl/src/crypto/des/Makefile +++ b/src/lib/libssl/src/crypto/des/Makefile | |||
@@ -28,7 +28,7 @@ LIBSRC= cbc_cksm.c cbc_enc.c cfb64enc.c cfb_enc.c \ | |||
28 | qud_cksm.c rand_key.c rpc_enc.c set_key.c \ | 28 | qud_cksm.c rand_key.c rpc_enc.c set_key.c \ |
29 | des_enc.c fcrypt_b.c \ | 29 | des_enc.c fcrypt_b.c \ |
30 | xcbc_enc.c \ | 30 | xcbc_enc.c \ |
31 | str2key.c cfb64ede.c ofb64ede.c ede_cbcm_enc.c des_old.c des_old2.c \ | 31 | str2key.c cfb64ede.c ofb64ede.c ede_cbcm_enc.c \ |
32 | read2pwd.c | 32 | read2pwd.c |
33 | 33 | ||
34 | LIBOBJ= set_key.o ecb_enc.o cbc_enc.o \ | 34 | LIBOBJ= set_key.o ecb_enc.o cbc_enc.o \ |
@@ -37,11 +37,11 @@ LIBOBJ= set_key.o ecb_enc.o cbc_enc.o \ | |||
37 | ofb_enc.o str2key.o pcbc_enc.o qud_cksm.o rand_key.o \ | 37 | ofb_enc.o str2key.o pcbc_enc.o qud_cksm.o rand_key.o \ |
38 | ${DES_ENC} \ | 38 | ${DES_ENC} \ |
39 | fcrypt.o xcbc_enc.o rpc_enc.o cbc_cksm.o \ | 39 | fcrypt.o xcbc_enc.o rpc_enc.o cbc_cksm.o \ |
40 | ede_cbcm_enc.o des_old.o des_old2.o read2pwd.o | 40 | ede_cbcm_enc.o read2pwd.o |
41 | 41 | ||
42 | SRC= $(LIBSRC) | 42 | SRC= $(LIBSRC) |
43 | 43 | ||
44 | EXHEADER= des.h des_old.h | 44 | EXHEADER= des.h |
45 | HEADER= des_locl.h rpc_des.h spr.h des_ver.h $(EXHEADER) | 45 | HEADER= des_locl.h rpc_des.h spr.h des_ver.h $(EXHEADER) |
46 | 46 | ||
47 | ALL= $(GENERAL) $(SRC) $(HEADER) | 47 | ALL= $(GENERAL) $(SRC) $(HEADER) |
diff --git a/src/lib/libssl/src/crypto/des/des.h b/src/lib/libssl/src/crypto/des/des.h index 92b6663599..c06b706e9c 100644 --- a/src/lib/libssl/src/crypto/des/des.h +++ b/src/lib/libssl/src/crypto/des/des.h | |||
@@ -91,16 +91,6 @@ typedef struct DES_ks | |||
91 | } ks[16]; | 91 | } ks[16]; |
92 | } DES_key_schedule; | 92 | } DES_key_schedule; |
93 | 93 | ||
94 | #ifndef OPENSSL_DISABLE_OLD_DES_SUPPORT | ||
95 | # ifndef OPENSSL_ENABLE_OLD_DES_SUPPORT | ||
96 | # define OPENSSL_ENABLE_OLD_DES_SUPPORT | ||
97 | # endif | ||
98 | #endif | ||
99 | |||
100 | #ifdef OPENSSL_ENABLE_OLD_DES_SUPPORT | ||
101 | # include <openssl/des_old.h> | ||
102 | #endif | ||
103 | |||
104 | #define DES_KEY_SZ (sizeof(DES_cblock)) | 94 | #define DES_KEY_SZ (sizeof(DES_cblock)) |
105 | #define DES_SCHEDULE_SZ (sizeof(DES_key_schedule)) | 95 | #define DES_SCHEDULE_SZ (sizeof(DES_key_schedule)) |
106 | 96 | ||
diff --git a/src/lib/libssl/src/crypto/des/des_old.c b/src/lib/libssl/src/crypto/des/des_old.c deleted file mode 100644 index 7c33ed7a93..0000000000 --- a/src/lib/libssl/src/crypto/des/des_old.c +++ /dev/null | |||
@@ -1,273 +0,0 @@ | |||
1 | /* crypto/des/des_old.c -*- mode:C; c-file-style: "eay" -*- */ | ||
2 | |||
3 | /* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING | ||
4 | * | ||
5 | * The function names in here are deprecated and are only present to | ||
6 | * provide an interface compatible with libdes. OpenSSL now provides | ||
7 | * functions where "des_" has been replaced with "DES_" in the names, | ||
8 | * to make it possible to make incompatible changes that are needed | ||
9 | * for C type security and other stuff. | ||
10 | * | ||
11 | * Please consider starting to use the DES_ functions rather than the | ||
12 | * des_ ones. The des_ functions will dissapear completely before | ||
13 | * OpenSSL 1.0! | ||
14 | * | ||
15 | * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING | ||
16 | */ | ||
17 | |||
18 | /* Written by Richard Levitte (richard@levitte.org) for the OpenSSL | ||
19 | * project 2001. | ||
20 | */ | ||
21 | /* ==================================================================== | ||
22 | * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. | ||
23 | * | ||
24 | * Redistribution and use in source and binary forms, with or without | ||
25 | * modification, are permitted provided that the following conditions | ||
26 | * are met: | ||
27 | * | ||
28 | * 1. Redistributions of source code must retain the above copyright | ||
29 | * notice, this list of conditions and the following disclaimer. | ||
30 | * | ||
31 | * 2. Redistributions in binary form must reproduce the above copyright | ||
32 | * notice, this list of conditions and the following disclaimer in | ||
33 | * the documentation and/or other materials provided with the | ||
34 | * distribution. | ||
35 | * | ||
36 | * 3. All advertising materials mentioning features or use of this | ||
37 | * software must display the following acknowledgment: | ||
38 | * "This product includes software developed by the OpenSSL Project | ||
39 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
40 | * | ||
41 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
42 | * endorse or promote products derived from this software without | ||
43 | * prior written permission. For written permission, please contact | ||
44 | * openssl-core@openssl.org. | ||
45 | * | ||
46 | * 5. Products derived from this software may not be called "OpenSSL" | ||
47 | * nor may "OpenSSL" appear in their names without prior written | ||
48 | * permission of the OpenSSL Project. | ||
49 | * | ||
50 | * 6. Redistributions of any form whatsoever must retain the following | ||
51 | * acknowledgment: | ||
52 | * "This product includes software developed by the OpenSSL Project | ||
53 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
54 | * | ||
55 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
56 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
57 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
58 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
59 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
60 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
61 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
62 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
63 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
64 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
65 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
66 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
67 | * ==================================================================== | ||
68 | * | ||
69 | * This product includes cryptographic software written by Eric Young | ||
70 | * (eay@cryptsoft.com). This product includes software written by Tim | ||
71 | * Hudson (tjh@cryptsoft.com). | ||
72 | * | ||
73 | */ | ||
74 | |||
75 | #define OPENSSL_DES_LIBDES_COMPATIBILITY | ||
76 | #include <openssl/des.h> | ||
77 | #include <openssl/rand.h> | ||
78 | |||
79 | const char *_ossl_old_des_options(void) | ||
80 | { | ||
81 | return DES_options(); | ||
82 | } | ||
83 | void _ossl_old_des_ecb3_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output, | ||
84 | des_key_schedule ks1,des_key_schedule ks2, | ||
85 | des_key_schedule ks3, int enc) | ||
86 | { | ||
87 | DES_ecb3_encrypt((const_DES_cblock *)input, output, | ||
88 | (DES_key_schedule *)ks1, (DES_key_schedule *)ks2, | ||
89 | (DES_key_schedule *)ks3, enc); | ||
90 | } | ||
91 | DES_LONG _ossl_old_des_cbc_cksum(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output, | ||
92 | long length,des_key_schedule schedule,_ossl_old_des_cblock *ivec) | ||
93 | { | ||
94 | return DES_cbc_cksum((unsigned char *)input, output, length, | ||
95 | (DES_key_schedule *)schedule, ivec); | ||
96 | } | ||
97 | void _ossl_old_des_cbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length, | ||
98 | des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc) | ||
99 | { | ||
100 | DES_cbc_encrypt((unsigned char *)input, (unsigned char *)output, | ||
101 | length, (DES_key_schedule *)schedule, ivec, enc); | ||
102 | } | ||
103 | void _ossl_old_des_ncbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length, | ||
104 | des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc) | ||
105 | { | ||
106 | DES_ncbc_encrypt((unsigned char *)input, (unsigned char *)output, | ||
107 | length, (DES_key_schedule *)schedule, ivec, enc); | ||
108 | } | ||
109 | void _ossl_old_des_xcbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length, | ||
110 | des_key_schedule schedule,_ossl_old_des_cblock *ivec, | ||
111 | _ossl_old_des_cblock *inw,_ossl_old_des_cblock *outw,int enc) | ||
112 | { | ||
113 | DES_xcbc_encrypt((unsigned char *)input, (unsigned char *)output, | ||
114 | length, (DES_key_schedule *)schedule, ivec, inw, outw, enc); | ||
115 | } | ||
116 | void _ossl_old_des_cfb_encrypt(unsigned char *in,unsigned char *out,int numbits, | ||
117 | long length,des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc) | ||
118 | { | ||
119 | DES_cfb_encrypt(in, out, numbits, length, | ||
120 | (DES_key_schedule *)schedule, ivec, enc); | ||
121 | } | ||
122 | void _ossl_old_des_ecb_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output, | ||
123 | des_key_schedule ks,int enc) | ||
124 | { | ||
125 | DES_ecb_encrypt(input, output, (DES_key_schedule *)ks, enc); | ||
126 | } | ||
127 | void _ossl_old_des_encrypt(DES_LONG *data,des_key_schedule ks, int enc) | ||
128 | { | ||
129 | DES_encrypt1(data, (DES_key_schedule *)ks, enc); | ||
130 | } | ||
131 | void _ossl_old_des_encrypt2(DES_LONG *data,des_key_schedule ks, int enc) | ||
132 | { | ||
133 | DES_encrypt2(data, (DES_key_schedule *)ks, enc); | ||
134 | } | ||
135 | void _ossl_old_des_encrypt3(DES_LONG *data, des_key_schedule ks1, | ||
136 | des_key_schedule ks2, des_key_schedule ks3) | ||
137 | { | ||
138 | DES_encrypt3(data, (DES_key_schedule *)ks1, (DES_key_schedule *)ks2, | ||
139 | (DES_key_schedule *)ks3); | ||
140 | } | ||
141 | void _ossl_old_des_decrypt3(DES_LONG *data, des_key_schedule ks1, | ||
142 | des_key_schedule ks2, des_key_schedule ks3) | ||
143 | { | ||
144 | DES_decrypt3(data, (DES_key_schedule *)ks1, (DES_key_schedule *)ks2, | ||
145 | (DES_key_schedule *)ks3); | ||
146 | } | ||
147 | void _ossl_old_des_ede3_cbc_encrypt(_ossl_old_des_cblock *input, _ossl_old_des_cblock *output, | ||
148 | long length, des_key_schedule ks1, des_key_schedule ks2, | ||
149 | des_key_schedule ks3, _ossl_old_des_cblock *ivec, int enc) | ||
150 | { | ||
151 | DES_ede3_cbc_encrypt((unsigned char *)input, (unsigned char *)output, | ||
152 | length, (DES_key_schedule *)ks1, (DES_key_schedule *)ks2, | ||
153 | (DES_key_schedule *)ks3, ivec, enc); | ||
154 | } | ||
155 | void _ossl_old_des_ede3_cfb64_encrypt(unsigned char *in, unsigned char *out, | ||
156 | long length, des_key_schedule ks1, des_key_schedule ks2, | ||
157 | des_key_schedule ks3, _ossl_old_des_cblock *ivec, int *num, int enc) | ||
158 | { | ||
159 | DES_ede3_cfb64_encrypt(in, out, length, | ||
160 | (DES_key_schedule *)ks1, (DES_key_schedule *)ks2, | ||
161 | (DES_key_schedule *)ks3, ivec, num, enc); | ||
162 | } | ||
163 | void _ossl_old_des_ede3_ofb64_encrypt(unsigned char *in, unsigned char *out, | ||
164 | long length, des_key_schedule ks1, des_key_schedule ks2, | ||
165 | des_key_schedule ks3, _ossl_old_des_cblock *ivec, int *num) | ||
166 | { | ||
167 | DES_ede3_ofb64_encrypt(in, out, length, | ||
168 | (DES_key_schedule *)ks1, (DES_key_schedule *)ks2, | ||
169 | (DES_key_schedule *)ks3, ivec, num); | ||
170 | } | ||
171 | |||
172 | #if 0 /* broken code, preserved just in case anyone specifically looks for this */ | ||
173 | void _ossl_old_des_xwhite_in2out(_ossl_old_des_cblock (*des_key), _ossl_old_des_cblock (*in_white), | ||
174 | _ossl_old_des_cblock (*out_white)) | ||
175 | { | ||
176 | DES_xwhite_in2out(des_key, in_white, out_white); | ||
177 | } | ||
178 | #endif | ||
179 | |||
180 | int _ossl_old_des_enc_read(int fd,char *buf,int len,des_key_schedule sched, | ||
181 | _ossl_old_des_cblock *iv) | ||
182 | { | ||
183 | return DES_enc_read(fd, buf, len, (DES_key_schedule *)sched, iv); | ||
184 | } | ||
185 | int _ossl_old_des_enc_write(int fd,char *buf,int len,des_key_schedule sched, | ||
186 | _ossl_old_des_cblock *iv) | ||
187 | { | ||
188 | return DES_enc_write(fd, buf, len, (DES_key_schedule *)sched, iv); | ||
189 | } | ||
190 | char *_ossl_old_des_fcrypt(const char *buf,const char *salt, char *ret) | ||
191 | { | ||
192 | return DES_fcrypt(buf, salt, ret); | ||
193 | } | ||
194 | char *_ossl_old_des_crypt(const char *buf,const char *salt) | ||
195 | { | ||
196 | return DES_crypt(buf, salt); | ||
197 | } | ||
198 | char *_ossl_old_crypt(const char *buf,const char *salt) | ||
199 | { | ||
200 | return DES_crypt(buf, salt); | ||
201 | } | ||
202 | void _ossl_old_des_ofb_encrypt(unsigned char *in,unsigned char *out, | ||
203 | int numbits,long length,des_key_schedule schedule,_ossl_old_des_cblock *ivec) | ||
204 | { | ||
205 | DES_ofb_encrypt(in, out, numbits, length, (DES_key_schedule *)schedule, | ||
206 | ivec); | ||
207 | } | ||
208 | void _ossl_old_des_pcbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length, | ||
209 | des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc) | ||
210 | { | ||
211 | DES_pcbc_encrypt((unsigned char *)input, (unsigned char *)output, | ||
212 | length, (DES_key_schedule *)schedule, ivec, enc); | ||
213 | } | ||
214 | DES_LONG _ossl_old_des_quad_cksum(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output, | ||
215 | long length,int out_count,_ossl_old_des_cblock *seed) | ||
216 | { | ||
217 | return DES_quad_cksum((unsigned char *)input, output, length, | ||
218 | out_count, seed); | ||
219 | } | ||
220 | void _ossl_old_des_random_seed(_ossl_old_des_cblock key) | ||
221 | { | ||
222 | RAND_seed(key, sizeof(_ossl_old_des_cblock)); | ||
223 | } | ||
224 | void _ossl_old_des_random_key(_ossl_old_des_cblock ret) | ||
225 | { | ||
226 | DES_random_key((DES_cblock *)ret); | ||
227 | } | ||
228 | int _ossl_old_des_read_password(_ossl_old_des_cblock *key, const char *prompt, | ||
229 | int verify) | ||
230 | { | ||
231 | return DES_read_password(key, prompt, verify); | ||
232 | } | ||
233 | int _ossl_old_des_read_2passwords(_ossl_old_des_cblock *key1, _ossl_old_des_cblock *key2, | ||
234 | const char *prompt, int verify) | ||
235 | { | ||
236 | return DES_read_2passwords(key1, key2, prompt, verify); | ||
237 | } | ||
238 | void _ossl_old_des_set_odd_parity(_ossl_old_des_cblock *key) | ||
239 | { | ||
240 | DES_set_odd_parity(key); | ||
241 | } | ||
242 | int _ossl_old_des_is_weak_key(_ossl_old_des_cblock *key) | ||
243 | { | ||
244 | return DES_is_weak_key(key); | ||
245 | } | ||
246 | int _ossl_old_des_set_key(_ossl_old_des_cblock *key,des_key_schedule schedule) | ||
247 | { | ||
248 | return DES_set_key(key, (DES_key_schedule *)schedule); | ||
249 | } | ||
250 | int _ossl_old_des_key_sched(_ossl_old_des_cblock *key,des_key_schedule schedule) | ||
251 | { | ||
252 | return DES_key_sched(key, (DES_key_schedule *)schedule); | ||
253 | } | ||
254 | void _ossl_old_des_string_to_key(char *str,_ossl_old_des_cblock *key) | ||
255 | { | ||
256 | DES_string_to_key(str, key); | ||
257 | } | ||
258 | void _ossl_old_des_string_to_2keys(char *str,_ossl_old_des_cblock *key1,_ossl_old_des_cblock *key2) | ||
259 | { | ||
260 | DES_string_to_2keys(str, key1, key2); | ||
261 | } | ||
262 | void _ossl_old_des_cfb64_encrypt(unsigned char *in, unsigned char *out, long length, | ||
263 | des_key_schedule schedule, _ossl_old_des_cblock *ivec, int *num, int enc) | ||
264 | { | ||
265 | DES_cfb64_encrypt(in, out, length, (DES_key_schedule *)schedule, | ||
266 | ivec, num, enc); | ||
267 | } | ||
268 | void _ossl_old_des_ofb64_encrypt(unsigned char *in, unsigned char *out, long length, | ||
269 | des_key_schedule schedule, _ossl_old_des_cblock *ivec, int *num) | ||
270 | { | ||
271 | DES_ofb64_encrypt(in, out, length, (DES_key_schedule *)schedule, | ||
272 | ivec, num); | ||
273 | } | ||
diff --git a/src/lib/libssl/src/crypto/des/des_old.h b/src/lib/libssl/src/crypto/des/des_old.h deleted file mode 100644 index d75a6df2e8..0000000000 --- a/src/lib/libssl/src/crypto/des/des_old.h +++ /dev/null | |||
@@ -1,444 +0,0 @@ | |||
1 | /* crypto/des/des_old.h -*- mode:C; c-file-style: "eay" -*- */ | ||
2 | |||
3 | /* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING | ||
4 | * | ||
5 | * The function names in here are deprecated and are only present to | ||
6 | * provide an interface compatible with openssl 0.9.6 and older as | ||
7 | * well as libdes. OpenSSL now provides functions where "des_" has | ||
8 | * been replaced with "DES_" in the names, to make it possible to | ||
9 | * make incompatible changes that are needed for C type security and | ||
10 | * other stuff. | ||
11 | * | ||
12 | * This include files has two compatibility modes: | ||
13 | * | ||
14 | * - If OPENSSL_DES_LIBDES_COMPATIBILITY is defined, you get an API | ||
15 | * that is compatible with libdes and SSLeay. | ||
16 | * - If OPENSSL_DES_LIBDES_COMPATIBILITY isn't defined, you get an | ||
17 | * API that is compatible with OpenSSL 0.9.5x to 0.9.6x. | ||
18 | * | ||
19 | * Note that these modes break earlier snapshots of OpenSSL, where | ||
20 | * libdes compatibility was the only available mode or (later on) the | ||
21 | * prefered compatibility mode. However, after much consideration | ||
22 | * (and more or less violent discussions with external parties), it | ||
23 | * was concluded that OpenSSL should be compatible with earlier versions | ||
24 | * of itself before anything else. Also, in all honesty, libdes is | ||
25 | * an old beast that shouldn't really be used any more. | ||
26 | * | ||
27 | * Please consider starting to use the DES_ functions rather than the | ||
28 | * des_ ones. The des_ functions will disappear completely before | ||
29 | * OpenSSL 1.0! | ||
30 | * | ||
31 | * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING | ||
32 | */ | ||
33 | |||
34 | /* Written by Richard Levitte (richard@levitte.org) for the OpenSSL | ||
35 | * project 2001. | ||
36 | */ | ||
37 | /* ==================================================================== | ||
38 | * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. | ||
39 | * | ||
40 | * Redistribution and use in source and binary forms, with or without | ||
41 | * modification, are permitted provided that the following conditions | ||
42 | * are met: | ||
43 | * | ||
44 | * 1. Redistributions of source code must retain the above copyright | ||
45 | * notice, this list of conditions and the following disclaimer. | ||
46 | * | ||
47 | * 2. Redistributions in binary form must reproduce the above copyright | ||
48 | * notice, this list of conditions and the following disclaimer in | ||
49 | * the documentation and/or other materials provided with the | ||
50 | * distribution. | ||
51 | * | ||
52 | * 3. All advertising materials mentioning features or use of this | ||
53 | * software must display the following acknowledgment: | ||
54 | * "This product includes software developed by the OpenSSL Project | ||
55 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
56 | * | ||
57 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
58 | * endorse or promote products derived from this software without | ||
59 | * prior written permission. For written permission, please contact | ||
60 | * openssl-core@openssl.org. | ||
61 | * | ||
62 | * 5. Products derived from this software may not be called "OpenSSL" | ||
63 | * nor may "OpenSSL" appear in their names without prior written | ||
64 | * permission of the OpenSSL Project. | ||
65 | * | ||
66 | * 6. Redistributions of any form whatsoever must retain the following | ||
67 | * acknowledgment: | ||
68 | * "This product includes software developed by the OpenSSL Project | ||
69 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
70 | * | ||
71 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
72 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
73 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
74 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
75 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
76 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
77 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
78 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
79 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
80 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
81 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
82 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
83 | * ==================================================================== | ||
84 | * | ||
85 | * This product includes cryptographic software written by Eric Young | ||
86 | * (eay@cryptsoft.com). This product includes software written by Tim | ||
87 | * Hudson (tjh@cryptsoft.com). | ||
88 | * | ||
89 | */ | ||
90 | |||
91 | #ifndef HEADER_DES_H | ||
92 | #define HEADER_DES_H | ||
93 | |||
94 | #include <openssl/e_os2.h> /* OPENSSL_EXTERN, OPENSSL_NO_DES, DES_LONG */ | ||
95 | |||
96 | #ifdef OPENSSL_NO_DES | ||
97 | #error DES is disabled. | ||
98 | #endif | ||
99 | |||
100 | #ifndef HEADER_NEW_DES_H | ||
101 | #error You must include des.h, not des_old.h directly. | ||
102 | #endif | ||
103 | |||
104 | #ifdef _KERBEROS_DES_H | ||
105 | #error <openssl/des_old.h> replaces <kerberos/des.h>. | ||
106 | #endif | ||
107 | |||
108 | #ifdef OPENSSL_BUILD_SHLIBCRYPTO | ||
109 | # undef OPENSSL_EXTERN | ||
110 | # define OPENSSL_EXTERN OPENSSL_EXPORT | ||
111 | #endif | ||
112 | |||
113 | #ifdef __cplusplus | ||
114 | extern "C" { | ||
115 | #endif | ||
116 | |||
117 | #ifdef _ | ||
118 | #undef _ | ||
119 | #endif | ||
120 | |||
121 | typedef unsigned char _ossl_old_des_cblock[8]; | ||
122 | typedef struct _ossl_old_des_ks_struct | ||
123 | { | ||
124 | union { | ||
125 | _ossl_old_des_cblock _; | ||
126 | /* make sure things are correct size on machines with | ||
127 | * 8 byte longs */ | ||
128 | DES_LONG pad[2]; | ||
129 | } ks; | ||
130 | } _ossl_old_des_key_schedule[16]; | ||
131 | |||
132 | #ifndef OPENSSL_DES_LIBDES_COMPATIBILITY | ||
133 | #define des_cblock DES_cblock | ||
134 | #define const_des_cblock const_DES_cblock | ||
135 | #define des_key_schedule DES_key_schedule | ||
136 | #define des_ecb3_encrypt(i,o,k1,k2,k3,e)\ | ||
137 | DES_ecb3_encrypt((i),(o),&(k1),&(k2),&(k3),(e)) | ||
138 | #define des_ede3_cbc_encrypt(i,o,l,k1,k2,k3,iv,e)\ | ||
139 | DES_ede3_cbc_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(e)) | ||
140 | #define des_ede3_cbcm_encrypt(i,o,l,k1,k2,k3,iv1,iv2,e)\ | ||
141 | DES_ede3_cbcm_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv1),(iv2),(e)) | ||
142 | #define des_ede3_cfb64_encrypt(i,o,l,k1,k2,k3,iv,n,e)\ | ||
143 | DES_ede3_cfb64_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(n),(e)) | ||
144 | #define des_ede3_ofb64_encrypt(i,o,l,k1,k2,k3,iv,n)\ | ||
145 | DES_ede3_ofb64_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(n)) | ||
146 | #define des_options()\ | ||
147 | DES_options() | ||
148 | #define des_cbc_cksum(i,o,l,k,iv)\ | ||
149 | DES_cbc_cksum((i),(o),(l),&(k),(iv)) | ||
150 | #define des_cbc_encrypt(i,o,l,k,iv,e)\ | ||
151 | DES_cbc_encrypt((i),(o),(l),&(k),(iv),(e)) | ||
152 | #define des_ncbc_encrypt(i,o,l,k,iv,e)\ | ||
153 | DES_ncbc_encrypt((i),(o),(l),&(k),(iv),(e)) | ||
154 | #define des_xcbc_encrypt(i,o,l,k,iv,inw,outw,e)\ | ||
155 | DES_xcbc_encrypt((i),(o),(l),&(k),(iv),(inw),(outw),(e)) | ||
156 | #define des_cfb_encrypt(i,o,n,l,k,iv,e)\ | ||
157 | DES_cfb_encrypt((i),(o),(n),(l),&(k),(iv),(e)) | ||
158 | #define des_ecb_encrypt(i,o,k,e)\ | ||
159 | DES_ecb_encrypt((i),(o),&(k),(e)) | ||
160 | #define des_encrypt1(d,k,e)\ | ||
161 | DES_encrypt1((d),&(k),(e)) | ||
162 | #define des_encrypt2(d,k,e)\ | ||
163 | DES_encrypt2((d),&(k),(e)) | ||
164 | #define des_encrypt3(d,k1,k2,k3)\ | ||
165 | DES_encrypt3((d),&(k1),&(k2),&(k3)) | ||
166 | #define des_decrypt3(d,k1,k2,k3)\ | ||
167 | DES_decrypt3((d),&(k1),&(k2),&(k3)) | ||
168 | #define des_xwhite_in2out(k,i,o)\ | ||
169 | DES_xwhite_in2out((k),(i),(o)) | ||
170 | #define des_enc_read(f,b,l,k,iv)\ | ||
171 | DES_enc_read((f),(b),(l),&(k),(iv)) | ||
172 | #define des_enc_write(f,b,l,k,iv)\ | ||
173 | DES_enc_write((f),(b),(l),&(k),(iv)) | ||
174 | #define des_fcrypt(b,s,r)\ | ||
175 | DES_fcrypt((b),(s),(r)) | ||
176 | #if 0 | ||
177 | #define des_crypt(b,s)\ | ||
178 | DES_crypt((b),(s)) | ||
179 | #if !defined(PERL5) && !defined(__FreeBSD__) && !defined(NeXT) && !defined(__OpenBSD__) | ||
180 | #define crypt(b,s)\ | ||
181 | DES_crypt((b),(s)) | ||
182 | #endif | ||
183 | #endif | ||
184 | #define des_ofb_encrypt(i,o,n,l,k,iv)\ | ||
185 | DES_ofb_encrypt((i),(o),(n),(l),&(k),(iv)) | ||
186 | #define des_pcbc_encrypt(i,o,l,k,iv,e)\ | ||
187 | DES_pcbc_encrypt((i),(o),(l),&(k),(iv),(e)) | ||
188 | #define des_quad_cksum(i,o,l,c,s)\ | ||
189 | DES_quad_cksum((i),(o),(l),(c),(s)) | ||
190 | #define des_random_seed(k)\ | ||
191 | _ossl_096_des_random_seed((k)) | ||
192 | #define des_random_key(r)\ | ||
193 | DES_random_key((r)) | ||
194 | #define des_read_password(k,p,v) \ | ||
195 | DES_read_password((k),(p),(v)) | ||
196 | #define des_read_2passwords(k1,k2,p,v) \ | ||
197 | DES_read_2passwords((k1),(k2),(p),(v)) | ||
198 | #define des_set_odd_parity(k)\ | ||
199 | DES_set_odd_parity((k)) | ||
200 | #define des_check_key_parity(k)\ | ||
201 | DES_check_key_parity((k)) | ||
202 | #define des_is_weak_key(k)\ | ||
203 | DES_is_weak_key((k)) | ||
204 | #define des_set_key(k,ks)\ | ||
205 | DES_set_key((k),&(ks)) | ||
206 | #define des_key_sched(k,ks)\ | ||
207 | DES_key_sched((k),&(ks)) | ||
208 | #define des_set_key_checked(k,ks)\ | ||
209 | DES_set_key_checked((k),&(ks)) | ||
210 | #define des_set_key_unchecked(k,ks)\ | ||
211 | DES_set_key_unchecked((k),&(ks)) | ||
212 | #define des_string_to_key(s,k)\ | ||
213 | DES_string_to_key((s),(k)) | ||
214 | #define des_string_to_2keys(s,k1,k2)\ | ||
215 | DES_string_to_2keys((s),(k1),(k2)) | ||
216 | #define des_cfb64_encrypt(i,o,l,ks,iv,n,e)\ | ||
217 | DES_cfb64_encrypt((i),(o),(l),&(ks),(iv),(n),(e)) | ||
218 | #define des_ofb64_encrypt(i,o,l,ks,iv,n)\ | ||
219 | DES_ofb64_encrypt((i),(o),(l),&(ks),(iv),(n)) | ||
220 | |||
221 | |||
222 | #define des_ecb2_encrypt(i,o,k1,k2,e) \ | ||
223 | des_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e)) | ||
224 | |||
225 | #define des_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \ | ||
226 | des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e)) | ||
227 | |||
228 | #define des_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \ | ||
229 | des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e)) | ||
230 | |||
231 | #define des_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \ | ||
232 | des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n)) | ||
233 | |||
234 | #define des_check_key DES_check_key | ||
235 | #define des_rw_mode DES_rw_mode | ||
236 | #else /* libdes compatibility */ | ||
237 | /* Map all symbol names to _ossl_old_des_* form, so we avoid all | ||
238 | clashes with libdes */ | ||
239 | #define des_cblock _ossl_old_des_cblock | ||
240 | #define des_key_schedule _ossl_old_des_key_schedule | ||
241 | #define des_ecb3_encrypt(i,o,k1,k2,k3,e)\ | ||
242 | _ossl_old_des_ecb3_encrypt((i),(o),(k1),(k2),(k3),(e)) | ||
243 | #define des_ede3_cbc_encrypt(i,o,l,k1,k2,k3,iv,e)\ | ||
244 | _ossl_old_des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(e)) | ||
245 | #define des_ede3_cfb64_encrypt(i,o,l,k1,k2,k3,iv,n,e)\ | ||
246 | _ossl_old_des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(n),(e)) | ||
247 | #define des_ede3_ofb64_encrypt(i,o,l,k1,k2,k3,iv,n)\ | ||
248 | _ossl_old_des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(n)) | ||
249 | #define des_options()\ | ||
250 | _ossl_old_des_options() | ||
251 | #define des_cbc_cksum(i,o,l,k,iv)\ | ||
252 | _ossl_old_des_cbc_cksum((i),(o),(l),(k),(iv)) | ||
253 | #define des_cbc_encrypt(i,o,l,k,iv,e)\ | ||
254 | _ossl_old_des_cbc_encrypt((i),(o),(l),(k),(iv),(e)) | ||
255 | #define des_ncbc_encrypt(i,o,l,k,iv,e)\ | ||
256 | _ossl_old_des_ncbc_encrypt((i),(o),(l),(k),(iv),(e)) | ||
257 | #define des_xcbc_encrypt(i,o,l,k,iv,inw,outw,e)\ | ||
258 | _ossl_old_des_xcbc_encrypt((i),(o),(l),(k),(iv),(inw),(outw),(e)) | ||
259 | #define des_cfb_encrypt(i,o,n,l,k,iv,e)\ | ||
260 | _ossl_old_des_cfb_encrypt((i),(o),(n),(l),(k),(iv),(e)) | ||
261 | #define des_ecb_encrypt(i,o,k,e)\ | ||
262 | _ossl_old_des_ecb_encrypt((i),(o),(k),(e)) | ||
263 | #define des_encrypt(d,k,e)\ | ||
264 | _ossl_old_des_encrypt((d),(k),(e)) | ||
265 | #define des_encrypt2(d,k,e)\ | ||
266 | _ossl_old_des_encrypt2((d),(k),(e)) | ||
267 | #define des_encrypt3(d,k1,k2,k3)\ | ||
268 | _ossl_old_des_encrypt3((d),(k1),(k2),(k3)) | ||
269 | #define des_decrypt3(d,k1,k2,k3)\ | ||
270 | _ossl_old_des_decrypt3((d),(k1),(k2),(k3)) | ||
271 | #define des_xwhite_in2out(k,i,o)\ | ||
272 | _ossl_old_des_xwhite_in2out((k),(i),(o)) | ||
273 | #define des_enc_read(f,b,l,k,iv)\ | ||
274 | _ossl_old_des_enc_read((f),(b),(l),(k),(iv)) | ||
275 | #define des_enc_write(f,b,l,k,iv)\ | ||
276 | _ossl_old_des_enc_write((f),(b),(l),(k),(iv)) | ||
277 | #define des_fcrypt(b,s,r)\ | ||
278 | _ossl_old_des_fcrypt((b),(s),(r)) | ||
279 | #define des_crypt(b,s)\ | ||
280 | _ossl_old_des_crypt((b),(s)) | ||
281 | #if 0 | ||
282 | #define crypt(b,s)\ | ||
283 | _ossl_old_crypt((b),(s)) | ||
284 | #endif | ||
285 | #define des_ofb_encrypt(i,o,n,l,k,iv)\ | ||
286 | _ossl_old_des_ofb_encrypt((i),(o),(n),(l),(k),(iv)) | ||
287 | #define des_pcbc_encrypt(i,o,l,k,iv,e)\ | ||
288 | _ossl_old_des_pcbc_encrypt((i),(o),(l),(k),(iv),(e)) | ||
289 | #define des_quad_cksum(i,o,l,c,s)\ | ||
290 | _ossl_old_des_quad_cksum((i),(o),(l),(c),(s)) | ||
291 | #define des_random_seed(k)\ | ||
292 | _ossl_old_des_random_seed((k)) | ||
293 | #define des_random_key(r)\ | ||
294 | _ossl_old_des_random_key((r)) | ||
295 | #define des_read_password(k,p,v) \ | ||
296 | _ossl_old_des_read_password((k),(p),(v)) | ||
297 | #define des_read_2passwords(k1,k2,p,v) \ | ||
298 | _ossl_old_des_read_2passwords((k1),(k2),(p),(v)) | ||
299 | #define des_set_odd_parity(k)\ | ||
300 | _ossl_old_des_set_odd_parity((k)) | ||
301 | #define des_is_weak_key(k)\ | ||
302 | _ossl_old_des_is_weak_key((k)) | ||
303 | #define des_set_key(k,ks)\ | ||
304 | _ossl_old_des_set_key((k),(ks)) | ||
305 | #define des_key_sched(k,ks)\ | ||
306 | _ossl_old_des_key_sched((k),(ks)) | ||
307 | #define des_string_to_key(s,k)\ | ||
308 | _ossl_old_des_string_to_key((s),(k)) | ||
309 | #define des_string_to_2keys(s,k1,k2)\ | ||
310 | _ossl_old_des_string_to_2keys((s),(k1),(k2)) | ||
311 | #define des_cfb64_encrypt(i,o,l,ks,iv,n,e)\ | ||
312 | _ossl_old_des_cfb64_encrypt((i),(o),(l),(ks),(iv),(n),(e)) | ||
313 | #define des_ofb64_encrypt(i,o,l,ks,iv,n)\ | ||
314 | _ossl_old_des_ofb64_encrypt((i),(o),(l),(ks),(iv),(n)) | ||
315 | |||
316 | |||
317 | #define des_ecb2_encrypt(i,o,k1,k2,e) \ | ||
318 | des_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e)) | ||
319 | |||
320 | #define des_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \ | ||
321 | des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e)) | ||
322 | |||
323 | #define des_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \ | ||
324 | des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e)) | ||
325 | |||
326 | #define des_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \ | ||
327 | des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n)) | ||
328 | |||
329 | #define des_check_key DES_check_key | ||
330 | #define des_rw_mode DES_rw_mode | ||
331 | #endif | ||
332 | |||
333 | const char *_ossl_old_des_options(void); | ||
334 | void _ossl_old_des_ecb3_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output, | ||
335 | _ossl_old_des_key_schedule ks1,_ossl_old_des_key_schedule ks2, | ||
336 | _ossl_old_des_key_schedule ks3, int enc); | ||
337 | DES_LONG _ossl_old_des_cbc_cksum(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output, | ||
338 | long length,_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec); | ||
339 | void _ossl_old_des_cbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length, | ||
340 | _ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc); | ||
341 | void _ossl_old_des_ncbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length, | ||
342 | _ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc); | ||
343 | void _ossl_old_des_xcbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length, | ||
344 | _ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec, | ||
345 | _ossl_old_des_cblock *inw,_ossl_old_des_cblock *outw,int enc); | ||
346 | void _ossl_old_des_cfb_encrypt(unsigned char *in,unsigned char *out,int numbits, | ||
347 | long length,_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc); | ||
348 | void _ossl_old_des_ecb_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output, | ||
349 | _ossl_old_des_key_schedule ks,int enc); | ||
350 | void _ossl_old_des_encrypt(DES_LONG *data,_ossl_old_des_key_schedule ks, int enc); | ||
351 | void _ossl_old_des_encrypt2(DES_LONG *data,_ossl_old_des_key_schedule ks, int enc); | ||
352 | void _ossl_old_des_encrypt3(DES_LONG *data, _ossl_old_des_key_schedule ks1, | ||
353 | _ossl_old_des_key_schedule ks2, _ossl_old_des_key_schedule ks3); | ||
354 | void _ossl_old_des_decrypt3(DES_LONG *data, _ossl_old_des_key_schedule ks1, | ||
355 | _ossl_old_des_key_schedule ks2, _ossl_old_des_key_schedule ks3); | ||
356 | void _ossl_old_des_ede3_cbc_encrypt(_ossl_old_des_cblock *input, _ossl_old_des_cblock *output, | ||
357 | long length, _ossl_old_des_key_schedule ks1, _ossl_old_des_key_schedule ks2, | ||
358 | _ossl_old_des_key_schedule ks3, _ossl_old_des_cblock *ivec, int enc); | ||
359 | void _ossl_old_des_ede3_cfb64_encrypt(unsigned char *in, unsigned char *out, | ||
360 | long length, _ossl_old_des_key_schedule ks1, _ossl_old_des_key_schedule ks2, | ||
361 | _ossl_old_des_key_schedule ks3, _ossl_old_des_cblock *ivec, int *num, int enc); | ||
362 | void _ossl_old_des_ede3_ofb64_encrypt(unsigned char *in, unsigned char *out, | ||
363 | long length, _ossl_old_des_key_schedule ks1, _ossl_old_des_key_schedule ks2, | ||
364 | _ossl_old_des_key_schedule ks3, _ossl_old_des_cblock *ivec, int *num); | ||
365 | #if 0 | ||
366 | void _ossl_old_des_xwhite_in2out(_ossl_old_des_cblock (*des_key), _ossl_old_des_cblock (*in_white), | ||
367 | _ossl_old_des_cblock (*out_white)); | ||
368 | #endif | ||
369 | |||
370 | int _ossl_old_des_enc_read(int fd,char *buf,int len,_ossl_old_des_key_schedule sched, | ||
371 | _ossl_old_des_cblock *iv); | ||
372 | int _ossl_old_des_enc_write(int fd,char *buf,int len,_ossl_old_des_key_schedule sched, | ||
373 | _ossl_old_des_cblock *iv); | ||
374 | char *_ossl_old_des_fcrypt(const char *buf,const char *salt, char *ret); | ||
375 | char *_ossl_old_des_crypt(const char *buf,const char *salt); | ||
376 | #if !defined(PERL5) && !defined(NeXT) | ||
377 | char *_ossl_old_crypt(const char *buf,const char *salt); | ||
378 | #endif | ||
379 | void _ossl_old_des_ofb_encrypt(unsigned char *in,unsigned char *out, | ||
380 | int numbits,long length,_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec); | ||
381 | void _ossl_old_des_pcbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length, | ||
382 | _ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc); | ||
383 | DES_LONG _ossl_old_des_quad_cksum(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output, | ||
384 | long length,int out_count,_ossl_old_des_cblock *seed); | ||
385 | void _ossl_old_des_random_seed(_ossl_old_des_cblock key); | ||
386 | void _ossl_old_des_random_key(_ossl_old_des_cblock ret); | ||
387 | int _ossl_old_des_read_password(_ossl_old_des_cblock *key,const char *prompt,int verify); | ||
388 | int _ossl_old_des_read_2passwords(_ossl_old_des_cblock *key1,_ossl_old_des_cblock *key2, | ||
389 | const char *prompt,int verify); | ||
390 | void _ossl_old_des_set_odd_parity(_ossl_old_des_cblock *key); | ||
391 | int _ossl_old_des_is_weak_key(_ossl_old_des_cblock *key); | ||
392 | int _ossl_old_des_set_key(_ossl_old_des_cblock *key,_ossl_old_des_key_schedule schedule); | ||
393 | int _ossl_old_des_key_sched(_ossl_old_des_cblock *key,_ossl_old_des_key_schedule schedule); | ||
394 | void _ossl_old_des_string_to_key(char *str,_ossl_old_des_cblock *key); | ||
395 | void _ossl_old_des_string_to_2keys(char *str,_ossl_old_des_cblock *key1,_ossl_old_des_cblock *key2); | ||
396 | void _ossl_old_des_cfb64_encrypt(unsigned char *in, unsigned char *out, long length, | ||
397 | _ossl_old_des_key_schedule schedule, _ossl_old_des_cblock *ivec, int *num, int enc); | ||
398 | void _ossl_old_des_ofb64_encrypt(unsigned char *in, unsigned char *out, long length, | ||
399 | _ossl_old_des_key_schedule schedule, _ossl_old_des_cblock *ivec, int *num); | ||
400 | |||
401 | void _ossl_096_des_random_seed(des_cblock *key); | ||
402 | |||
403 | /* The following definitions provide compatibility with the MIT Kerberos | ||
404 | * library. The _ossl_old_des_key_schedule structure is not binary compatible. */ | ||
405 | |||
406 | #define _KERBEROS_DES_H | ||
407 | |||
408 | #define KRBDES_ENCRYPT DES_ENCRYPT | ||
409 | #define KRBDES_DECRYPT DES_DECRYPT | ||
410 | |||
411 | #ifdef KERBEROS | ||
412 | # define ENCRYPT DES_ENCRYPT | ||
413 | # define DECRYPT DES_DECRYPT | ||
414 | #endif | ||
415 | |||
416 | #ifndef NCOMPAT | ||
417 | # define C_Block des_cblock | ||
418 | # define Key_schedule des_key_schedule | ||
419 | # define KEY_SZ DES_KEY_SZ | ||
420 | # define string_to_key des_string_to_key | ||
421 | # define read_pw_string des_read_pw_string | ||
422 | # define random_key des_random_key | ||
423 | # define pcbc_encrypt des_pcbc_encrypt | ||
424 | # define set_key des_set_key | ||
425 | # define key_sched des_key_sched | ||
426 | # define ecb_encrypt des_ecb_encrypt | ||
427 | # define cbc_encrypt des_cbc_encrypt | ||
428 | # define ncbc_encrypt des_ncbc_encrypt | ||
429 | # define xcbc_encrypt des_xcbc_encrypt | ||
430 | # define cbc_cksum des_cbc_cksum | ||
431 | # define quad_cksum des_quad_cksum | ||
432 | # define check_parity des_check_key_parity | ||
433 | #endif | ||
434 | |||
435 | #define des_fixup_key_parity DES_fixup_key_parity | ||
436 | |||
437 | #ifdef __cplusplus | ||
438 | } | ||
439 | #endif | ||
440 | |||
441 | /* for DES_read_pw_string et al */ | ||
442 | #include <openssl/ui_compat.h> | ||
443 | |||
444 | #endif | ||
diff --git a/src/lib/libssl/src/crypto/des/des_old2.c b/src/lib/libssl/src/crypto/des/des_old2.c deleted file mode 100644 index c8fa3ee135..0000000000 --- a/src/lib/libssl/src/crypto/des/des_old2.c +++ /dev/null | |||
@@ -1,82 +0,0 @@ | |||
1 | /* crypto/des/des_old.c -*- mode:C; c-file-style: "eay" -*- */ | ||
2 | |||
3 | /* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING | ||
4 | * | ||
5 | * The function names in here are deprecated and are only present to | ||
6 | * provide an interface compatible with OpenSSL 0.9.6c. OpenSSL now | ||
7 | * provides functions where "des_" has been replaced with "DES_" in | ||
8 | * the names, to make it possible to make incompatible changes that | ||
9 | * are needed for C type security and other stuff. | ||
10 | * | ||
11 | * Please consider starting to use the DES_ functions rather than the | ||
12 | * des_ ones. The des_ functions will dissapear completely before | ||
13 | * OpenSSL 1.0! | ||
14 | * | ||
15 | * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING | ||
16 | */ | ||
17 | |||
18 | /* Written by Richard Levitte (richard@levitte.org) for the OpenSSL | ||
19 | * project 2001. | ||
20 | */ | ||
21 | /* ==================================================================== | ||
22 | * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. | ||
23 | * | ||
24 | * Redistribution and use in source and binary forms, with or without | ||
25 | * modification, are permitted provided that the following conditions | ||
26 | * are met: | ||
27 | * | ||
28 | * 1. Redistributions of source code must retain the above copyright | ||
29 | * notice, this list of conditions and the following disclaimer. | ||
30 | * | ||
31 | * 2. Redistributions in binary form must reproduce the above copyright | ||
32 | * notice, this list of conditions and the following disclaimer in | ||
33 | * the documentation and/or other materials provided with the | ||
34 | * distribution. | ||
35 | * | ||
36 | * 3. All advertising materials mentioning features or use of this | ||
37 | * software must display the following acknowledgment: | ||
38 | * "This product includes software developed by the OpenSSL Project | ||
39 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
40 | * | ||
41 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
42 | * endorse or promote products derived from this software without | ||
43 | * prior written permission. For written permission, please contact | ||
44 | * openssl-core@openssl.org. | ||
45 | * | ||
46 | * 5. Products derived from this software may not be called "OpenSSL" | ||
47 | * nor may "OpenSSL" appear in their names without prior written | ||
48 | * permission of the OpenSSL Project. | ||
49 | * | ||
50 | * 6. Redistributions of any form whatsoever must retain the following | ||
51 | * acknowledgment: | ||
52 | * "This product includes software developed by the OpenSSL Project | ||
53 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
54 | * | ||
55 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
56 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
57 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
58 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
59 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
60 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
61 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
62 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
63 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
64 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
65 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
66 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
67 | * ==================================================================== | ||
68 | * | ||
69 | * This product includes cryptographic software written by Eric Young | ||
70 | * (eay@cryptsoft.com). This product includes software written by Tim | ||
71 | * Hudson (tjh@cryptsoft.com). | ||
72 | * | ||
73 | */ | ||
74 | |||
75 | #undef OPENSSL_DES_LIBDES_COMPATIBILITY | ||
76 | #include <openssl/des.h> | ||
77 | #include <openssl/rand.h> | ||
78 | |||
79 | void _ossl_096_des_random_seed(DES_cblock *key) | ||
80 | { | ||
81 | RAND_seed(key, sizeof(DES_cblock)); | ||
82 | } | ||