diff options
Diffstat (limited to 'src/lib/libcrypto/evp')
68 files changed, 3419 insertions, 1747 deletions
diff --git a/src/lib/libcrypto/evp/Makefile.ssl b/src/lib/libcrypto/evp/Makefile.ssl index 8bf2516458..dda2586ed1 100644 --- a/src/lib/libcrypto/evp/Makefile.ssl +++ b/src/lib/libcrypto/evp/Makefile.ssl | |||
@@ -7,16 +7,16 @@ TOP= ../.. | |||
7 | CC= cc | 7 | CC= cc |
8 | INCLUDES= -I.. -I../../include | 8 | INCLUDES= -I.. -I../../include |
9 | CFLAG=-g | 9 | CFLAG=-g |
10 | INSTALL_PREFIX= | ||
11 | OPENSSLDIR= /usr/local/ssl | ||
10 | INSTALLTOP=/usr/local/ssl | 12 | INSTALLTOP=/usr/local/ssl |
11 | MAKE= make -f Makefile.ssl | 13 | MAKE= make -f Makefile.ssl |
12 | MAKEDEPEND= makedepend -f Makefile.ssl | 14 | MAKEDEPEND= $(TOP)/util/domd $(TOP) |
13 | MAKEFILE= Makefile.ssl | 15 | MAKEFILE= Makefile.ssl |
14 | AR= ar r | 16 | AR= ar r |
15 | 17 | ||
16 | CFLAGS= $(INCLUDES) $(CFLAG) | 18 | CFLAGS= $(INCLUDES) $(CFLAG) |
17 | 19 | ||
18 | ERR=evp | ||
19 | ERRC=evp_err | ||
20 | GENERAL=Makefile | 20 | GENERAL=Makefile |
21 | TEST= | 21 | TEST= |
22 | APPS= | 22 | APPS= |
@@ -34,8 +34,8 @@ LIBSRC= encode.c digest.c evp_enc.c evp_key.c \ | |||
34 | m_null.c m_md2.c m_md5.c m_sha.c m_sha1.c m_dss.c m_dss1.c m_mdc2.c \ | 34 | m_null.c m_md2.c m_md5.c m_sha.c m_sha1.c m_dss.c m_dss1.c m_mdc2.c \ |
35 | m_ripemd.c \ | 35 | m_ripemd.c \ |
36 | p_open.c p_seal.c p_sign.c p_verify.c p_lib.c p_enc.c p_dec.c \ | 36 | p_open.c p_seal.c p_sign.c p_verify.c p_lib.c p_enc.c p_dec.c \ |
37 | bio_md.c bio_b64.c bio_enc.c $(ERRC).c e_null.c \ | 37 | bio_md.c bio_b64.c bio_enc.c evp_err.c e_null.c \ |
38 | c_all.c evp_lib.c | 38 | c_all.c evp_lib.c bio_ok.c evp_pkey.c evp_pbe.c p5_crpt.c p5_crpt2.c |
39 | 39 | ||
40 | LIBOBJ= encode.o digest.o evp_enc.o evp_key.o \ | 40 | LIBOBJ= encode.o digest.o evp_enc.o evp_key.o \ |
41 | e_ecb_d.o e_cbc_d.o e_cfb_d.o e_ofb_d.o \ | 41 | e_ecb_d.o e_cbc_d.o e_cfb_d.o e_ofb_d.o \ |
@@ -49,8 +49,8 @@ LIBOBJ= encode.o digest.o evp_enc.o evp_key.o \ | |||
49 | m_null.o m_md2.o m_md5.o m_sha.o m_sha1.o m_dss.o m_dss1.o m_mdc2.o \ | 49 | m_null.o m_md2.o m_md5.o m_sha.o m_sha1.o m_dss.o m_dss1.o m_mdc2.o \ |
50 | m_ripemd.o \ | 50 | m_ripemd.o \ |
51 | p_open.o p_seal.o p_sign.o p_verify.o p_lib.o p_enc.o p_dec.o \ | 51 | p_open.o p_seal.o p_sign.o p_verify.o p_lib.o p_enc.o p_dec.o \ |
52 | bio_md.o bio_b64.o bio_enc.o $(ERRC).o e_null.o \ | 52 | bio_md.o bio_b64.o bio_enc.o evp_err.o e_null.o \ |
53 | c_all.o evp_lib.o | 53 | c_all.o evp_lib.o bio_ok.o evp_pkey.o evp_pbe.o p5_crpt.o p5_crpt2.o |
54 | 54 | ||
55 | SRC= $(LIBSRC) | 55 | SRC= $(LIBSRC) |
56 | 56 | ||
@@ -66,24 +66,23 @@ all: lib | |||
66 | 66 | ||
67 | lib: $(LIBOBJ) | 67 | lib: $(LIBOBJ) |
68 | $(AR) $(LIB) $(LIBOBJ) | 68 | $(AR) $(LIB) $(LIBOBJ) |
69 | sh $(TOP)/util/ranlib.sh $(LIB) | 69 | $(RANLIB) $(LIB) |
70 | @touch lib | 70 | @touch lib |
71 | 71 | ||
72 | files: | 72 | files: |
73 | perl $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO | 73 | $(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO |
74 | 74 | ||
75 | links: | 75 | links: |
76 | /bin/rm -f Makefile | 76 | @$(TOP)/util/point.sh Makefile.ssl Makefile |
77 | $(TOP)/util/point.sh Makefile.ssl Makefile ; | 77 | @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER) |
78 | $(TOP)/util/mklink.sh ../../include $(EXHEADER) | 78 | @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST) |
79 | $(TOP)/util/mklink.sh ../../test $(TEST) | 79 | @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS) |
80 | $(TOP)/util/mklink.sh ../../apps $(APPS) | ||
81 | 80 | ||
82 | install: | 81 | install: |
83 | @for i in $(EXHEADER) ; \ | 82 | @for i in $(EXHEADER) ; \ |
84 | do \ | 83 | do \ |
85 | (cp $$i $(INSTALLTOP)/include/$$i; \ | 84 | (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \ |
86 | chmod 644 $(INSTALLTOP)/include/$$i ); \ | 85 | chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \ |
87 | done; | 86 | done; |
88 | 87 | ||
89 | tags: | 88 | tags: |
@@ -95,17 +94,1006 @@ lint: | |||
95 | lint -DLINT $(INCLUDES) $(SRC)>fluff | 94 | lint -DLINT $(INCLUDES) $(SRC)>fluff |
96 | 95 | ||
97 | depend: | 96 | depend: |
98 | $(MAKEDEPEND) $(INCLUDES) $(LIBSRC) | 97 | $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(LIBSRC) |
99 | 98 | ||
100 | dclean: | 99 | dclean: |
101 | perl -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new | 100 | $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new |
102 | mv -f Makefile.new $(MAKEFILE) | 101 | mv -f Makefile.new $(MAKEFILE) |
103 | 102 | ||
104 | clean: | 103 | clean: |
105 | /bin/rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff | 104 | rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff |
106 | |||
107 | errors: | ||
108 | perl $(TOP)/util/err-ins.pl $(ERR).err $(ERR).h | ||
109 | perl ../err/err_genc.pl -s $(ERR).h $(ERRC).c | ||
110 | 105 | ||
111 | # DO NOT DELETE THIS LINE -- make depend depends on it. | 106 | # DO NOT DELETE THIS LINE -- make depend depends on it. |
107 | |||
108 | bio_b64.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
109 | bio_b64.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
110 | bio_b64.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
111 | bio_b64.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
112 | bio_b64.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
113 | bio_b64.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
114 | bio_b64.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
115 | bio_b64.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
116 | bio_b64.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
117 | bio_b64.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
118 | bio_b64.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h | ||
119 | bio_b64.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
120 | bio_b64.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
121 | bio_b64.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
122 | bio_b64.o: ../../include/openssl/stack.h ../cryptlib.h | ||
123 | bio_enc.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
124 | bio_enc.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
125 | bio_enc.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
126 | bio_enc.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
127 | bio_enc.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
128 | bio_enc.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
129 | bio_enc.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
130 | bio_enc.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
131 | bio_enc.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
132 | bio_enc.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
133 | bio_enc.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h | ||
134 | bio_enc.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
135 | bio_enc.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
136 | bio_enc.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
137 | bio_enc.o: ../../include/openssl/stack.h ../cryptlib.h | ||
138 | bio_md.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
139 | bio_md.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
140 | bio_md.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
141 | bio_md.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
142 | bio_md.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
143 | bio_md.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
144 | bio_md.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
145 | bio_md.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
146 | bio_md.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
147 | bio_md.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
148 | bio_md.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h | ||
149 | bio_md.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
150 | bio_md.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
151 | bio_md.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
152 | bio_md.o: ../../include/openssl/stack.h ../cryptlib.h | ||
153 | bio_ok.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
154 | bio_ok.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
155 | bio_ok.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
156 | bio_ok.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
157 | bio_ok.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
158 | bio_ok.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
159 | bio_ok.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
160 | bio_ok.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
161 | bio_ok.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
162 | bio_ok.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
163 | bio_ok.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h | ||
164 | bio_ok.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
165 | bio_ok.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
166 | bio_ok.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
167 | bio_ok.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
168 | bio_ok.o: ../cryptlib.h | ||
169 | c_all.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
170 | c_all.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
171 | c_all.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
172 | c_all.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
173 | c_all.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
174 | c_all.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
175 | c_all.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
176 | c_all.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
177 | c_all.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
178 | c_all.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
179 | c_all.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs12.h | ||
180 | c_all.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | ||
181 | c_all.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
182 | c_all.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
183 | c_all.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
184 | c_all.o: ../../include/openssl/stack.h ../../include/openssl/x509.h | ||
185 | c_all.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | ||
186 | digest.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
187 | digest.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
188 | digest.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
189 | digest.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
190 | digest.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
191 | digest.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
192 | digest.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
193 | digest.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
194 | digest.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
195 | digest.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
196 | digest.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h | ||
197 | digest.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
198 | digest.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
199 | digest.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
200 | digest.o: ../../include/openssl/stack.h ../cryptlib.h | ||
201 | e_cbc_3d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
202 | e_cbc_3d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
203 | e_cbc_3d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
204 | e_cbc_3d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
205 | e_cbc_3d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
206 | e_cbc_3d.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
207 | e_cbc_3d.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
208 | e_cbc_3d.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
209 | e_cbc_3d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
210 | e_cbc_3d.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
211 | e_cbc_3d.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h | ||
212 | e_cbc_3d.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
213 | e_cbc_3d.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
214 | e_cbc_3d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
215 | e_cbc_3d.o: ../../include/openssl/stack.h ../cryptlib.h | ||
216 | e_cbc_bf.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
217 | e_cbc_bf.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
218 | e_cbc_bf.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
219 | e_cbc_bf.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
220 | e_cbc_bf.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
221 | e_cbc_bf.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
222 | e_cbc_bf.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
223 | e_cbc_bf.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
224 | e_cbc_bf.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
225 | e_cbc_bf.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
226 | e_cbc_bf.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h | ||
227 | e_cbc_bf.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
228 | e_cbc_bf.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
229 | e_cbc_bf.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
230 | e_cbc_bf.o: ../../include/openssl/stack.h ../cryptlib.h | ||
231 | e_cbc_c.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
232 | e_cbc_c.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
233 | e_cbc_c.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
234 | e_cbc_c.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
235 | e_cbc_c.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
236 | e_cbc_c.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
237 | e_cbc_c.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
238 | e_cbc_c.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
239 | e_cbc_c.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
240 | e_cbc_c.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
241 | e_cbc_c.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h | ||
242 | e_cbc_c.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
243 | e_cbc_c.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
244 | e_cbc_c.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
245 | e_cbc_c.o: ../../include/openssl/stack.h ../cryptlib.h | ||
246 | e_cbc_d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
247 | e_cbc_d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
248 | e_cbc_d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
249 | e_cbc_d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
250 | e_cbc_d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
251 | e_cbc_d.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
252 | e_cbc_d.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
253 | e_cbc_d.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
254 | e_cbc_d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
255 | e_cbc_d.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
256 | e_cbc_d.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h | ||
257 | e_cbc_d.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
258 | e_cbc_d.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
259 | e_cbc_d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
260 | e_cbc_d.o: ../../include/openssl/stack.h ../cryptlib.h | ||
261 | e_cbc_i.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
262 | e_cbc_i.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
263 | e_cbc_i.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
264 | e_cbc_i.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
265 | e_cbc_i.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
266 | e_cbc_i.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
267 | e_cbc_i.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
268 | e_cbc_i.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
269 | e_cbc_i.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
270 | e_cbc_i.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
271 | e_cbc_i.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h | ||
272 | e_cbc_i.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
273 | e_cbc_i.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
274 | e_cbc_i.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
275 | e_cbc_i.o: ../../include/openssl/stack.h ../cryptlib.h | ||
276 | e_cbc_r2.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
277 | e_cbc_r2.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
278 | e_cbc_r2.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
279 | e_cbc_r2.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
280 | e_cbc_r2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
281 | e_cbc_r2.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
282 | e_cbc_r2.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
283 | e_cbc_r2.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
284 | e_cbc_r2.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
285 | e_cbc_r2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
286 | e_cbc_r2.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h | ||
287 | e_cbc_r2.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
288 | e_cbc_r2.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
289 | e_cbc_r2.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
290 | e_cbc_r2.o: ../../include/openssl/stack.h ../cryptlib.h | ||
291 | e_cbc_r5.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
292 | e_cbc_r5.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
293 | e_cbc_r5.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
294 | e_cbc_r5.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
295 | e_cbc_r5.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
296 | e_cbc_r5.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
297 | e_cbc_r5.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
298 | e_cbc_r5.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
299 | e_cbc_r5.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
300 | e_cbc_r5.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
301 | e_cbc_r5.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h | ||
302 | e_cbc_r5.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
303 | e_cbc_r5.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
304 | e_cbc_r5.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
305 | e_cbc_r5.o: ../../include/openssl/stack.h ../cryptlib.h | ||
306 | e_cfb_3d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
307 | e_cfb_3d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
308 | e_cfb_3d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
309 | e_cfb_3d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
310 | e_cfb_3d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
311 | e_cfb_3d.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
312 | e_cfb_3d.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
313 | e_cfb_3d.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
314 | e_cfb_3d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
315 | e_cfb_3d.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
316 | e_cfb_3d.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h | ||
317 | e_cfb_3d.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
318 | e_cfb_3d.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
319 | e_cfb_3d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
320 | e_cfb_3d.o: ../../include/openssl/stack.h ../cryptlib.h | ||
321 | e_cfb_bf.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
322 | e_cfb_bf.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
323 | e_cfb_bf.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
324 | e_cfb_bf.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
325 | e_cfb_bf.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
326 | e_cfb_bf.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
327 | e_cfb_bf.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
328 | e_cfb_bf.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
329 | e_cfb_bf.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
330 | e_cfb_bf.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
331 | e_cfb_bf.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h | ||
332 | e_cfb_bf.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
333 | e_cfb_bf.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
334 | e_cfb_bf.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
335 | e_cfb_bf.o: ../../include/openssl/stack.h ../cryptlib.h | ||
336 | e_cfb_c.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
337 | e_cfb_c.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
338 | e_cfb_c.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
339 | e_cfb_c.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
340 | e_cfb_c.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
341 | e_cfb_c.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
342 | e_cfb_c.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
343 | e_cfb_c.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
344 | e_cfb_c.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
345 | e_cfb_c.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
346 | e_cfb_c.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h | ||
347 | e_cfb_c.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
348 | e_cfb_c.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
349 | e_cfb_c.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
350 | e_cfb_c.o: ../../include/openssl/stack.h ../cryptlib.h | ||
351 | e_cfb_d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
352 | e_cfb_d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
353 | e_cfb_d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
354 | e_cfb_d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
355 | e_cfb_d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
356 | e_cfb_d.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
357 | e_cfb_d.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
358 | e_cfb_d.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
359 | e_cfb_d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
360 | e_cfb_d.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
361 | e_cfb_d.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h | ||
362 | e_cfb_d.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
363 | e_cfb_d.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
364 | e_cfb_d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
365 | e_cfb_d.o: ../../include/openssl/stack.h ../cryptlib.h | ||
366 | e_cfb_i.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
367 | e_cfb_i.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
368 | e_cfb_i.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
369 | e_cfb_i.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
370 | e_cfb_i.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
371 | e_cfb_i.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
372 | e_cfb_i.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
373 | e_cfb_i.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
374 | e_cfb_i.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
375 | e_cfb_i.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
376 | e_cfb_i.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h | ||
377 | e_cfb_i.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
378 | e_cfb_i.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
379 | e_cfb_i.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
380 | e_cfb_i.o: ../../include/openssl/stack.h ../cryptlib.h | ||
381 | e_cfb_r2.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
382 | e_cfb_r2.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
383 | e_cfb_r2.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
384 | e_cfb_r2.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
385 | e_cfb_r2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
386 | e_cfb_r2.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
387 | e_cfb_r2.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
388 | e_cfb_r2.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
389 | e_cfb_r2.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
390 | e_cfb_r2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
391 | e_cfb_r2.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h | ||
392 | e_cfb_r2.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
393 | e_cfb_r2.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
394 | e_cfb_r2.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
395 | e_cfb_r2.o: ../../include/openssl/stack.h ../cryptlib.h | ||
396 | e_cfb_r5.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
397 | e_cfb_r5.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
398 | e_cfb_r5.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
399 | e_cfb_r5.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
400 | e_cfb_r5.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
401 | e_cfb_r5.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
402 | e_cfb_r5.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
403 | e_cfb_r5.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
404 | e_cfb_r5.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
405 | e_cfb_r5.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
406 | e_cfb_r5.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h | ||
407 | e_cfb_r5.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
408 | e_cfb_r5.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
409 | e_cfb_r5.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
410 | e_cfb_r5.o: ../../include/openssl/stack.h ../cryptlib.h | ||
411 | e_ecb_3d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
412 | e_ecb_3d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
413 | e_ecb_3d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
414 | e_ecb_3d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
415 | e_ecb_3d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
416 | e_ecb_3d.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
417 | e_ecb_3d.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
418 | e_ecb_3d.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
419 | e_ecb_3d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
420 | e_ecb_3d.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
421 | e_ecb_3d.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h | ||
422 | e_ecb_3d.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
423 | e_ecb_3d.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
424 | e_ecb_3d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
425 | e_ecb_3d.o: ../../include/openssl/stack.h ../cryptlib.h | ||
426 | e_ecb_bf.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
427 | e_ecb_bf.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
428 | e_ecb_bf.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
429 | e_ecb_bf.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
430 | e_ecb_bf.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
431 | e_ecb_bf.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
432 | e_ecb_bf.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
433 | e_ecb_bf.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
434 | e_ecb_bf.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
435 | e_ecb_bf.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
436 | e_ecb_bf.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h | ||
437 | e_ecb_bf.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
438 | e_ecb_bf.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
439 | e_ecb_bf.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
440 | e_ecb_bf.o: ../../include/openssl/stack.h ../cryptlib.h | ||
441 | e_ecb_c.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
442 | e_ecb_c.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
443 | e_ecb_c.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
444 | e_ecb_c.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
445 | e_ecb_c.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
446 | e_ecb_c.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
447 | e_ecb_c.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
448 | e_ecb_c.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
449 | e_ecb_c.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
450 | e_ecb_c.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
451 | e_ecb_c.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h | ||
452 | e_ecb_c.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
453 | e_ecb_c.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
454 | e_ecb_c.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
455 | e_ecb_c.o: ../../include/openssl/stack.h ../cryptlib.h | ||
456 | e_ecb_d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
457 | e_ecb_d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
458 | e_ecb_d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
459 | e_ecb_d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
460 | e_ecb_d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
461 | e_ecb_d.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
462 | e_ecb_d.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
463 | e_ecb_d.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
464 | e_ecb_d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
465 | e_ecb_d.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
466 | e_ecb_d.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h | ||
467 | e_ecb_d.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
468 | e_ecb_d.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
469 | e_ecb_d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
470 | e_ecb_d.o: ../../include/openssl/stack.h ../cryptlib.h | ||
471 | e_ecb_i.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
472 | e_ecb_i.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
473 | e_ecb_i.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
474 | e_ecb_i.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
475 | e_ecb_i.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
476 | e_ecb_i.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
477 | e_ecb_i.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
478 | e_ecb_i.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
479 | e_ecb_i.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
480 | e_ecb_i.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
481 | e_ecb_i.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h | ||
482 | e_ecb_i.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
483 | e_ecb_i.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
484 | e_ecb_i.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
485 | e_ecb_i.o: ../../include/openssl/stack.h ../cryptlib.h | ||
486 | e_ecb_r2.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
487 | e_ecb_r2.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
488 | e_ecb_r2.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
489 | e_ecb_r2.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
490 | e_ecb_r2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
491 | e_ecb_r2.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
492 | e_ecb_r2.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
493 | e_ecb_r2.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
494 | e_ecb_r2.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
495 | e_ecb_r2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
496 | e_ecb_r2.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h | ||
497 | e_ecb_r2.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
498 | e_ecb_r2.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
499 | e_ecb_r2.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
500 | e_ecb_r2.o: ../../include/openssl/stack.h ../cryptlib.h | ||
501 | e_ecb_r5.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
502 | e_ecb_r5.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
503 | e_ecb_r5.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
504 | e_ecb_r5.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
505 | e_ecb_r5.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
506 | e_ecb_r5.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
507 | e_ecb_r5.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
508 | e_ecb_r5.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
509 | e_ecb_r5.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
510 | e_ecb_r5.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
511 | e_ecb_r5.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h | ||
512 | e_ecb_r5.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
513 | e_ecb_r5.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
514 | e_ecb_r5.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
515 | e_ecb_r5.o: ../../include/openssl/stack.h ../cryptlib.h | ||
516 | e_null.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
517 | e_null.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
518 | e_null.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
519 | e_null.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
520 | e_null.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
521 | e_null.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
522 | e_null.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
523 | e_null.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
524 | e_null.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
525 | e_null.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
526 | e_null.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h | ||
527 | e_null.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
528 | e_null.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
529 | e_null.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
530 | e_null.o: ../../include/openssl/stack.h ../cryptlib.h | ||
531 | e_ofb_3d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
532 | e_ofb_3d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
533 | e_ofb_3d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
534 | e_ofb_3d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
535 | e_ofb_3d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
536 | e_ofb_3d.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
537 | e_ofb_3d.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
538 | e_ofb_3d.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
539 | e_ofb_3d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
540 | e_ofb_3d.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
541 | e_ofb_3d.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h | ||
542 | e_ofb_3d.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
543 | e_ofb_3d.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
544 | e_ofb_3d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
545 | e_ofb_3d.o: ../../include/openssl/stack.h ../cryptlib.h | ||
546 | e_ofb_bf.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
547 | e_ofb_bf.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
548 | e_ofb_bf.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
549 | e_ofb_bf.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
550 | e_ofb_bf.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
551 | e_ofb_bf.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
552 | e_ofb_bf.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
553 | e_ofb_bf.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
554 | e_ofb_bf.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
555 | e_ofb_bf.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
556 | e_ofb_bf.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h | ||
557 | e_ofb_bf.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
558 | e_ofb_bf.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
559 | e_ofb_bf.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
560 | e_ofb_bf.o: ../../include/openssl/stack.h ../cryptlib.h | ||
561 | e_ofb_c.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
562 | e_ofb_c.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
563 | e_ofb_c.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
564 | e_ofb_c.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
565 | e_ofb_c.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
566 | e_ofb_c.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
567 | e_ofb_c.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
568 | e_ofb_c.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
569 | e_ofb_c.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
570 | e_ofb_c.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
571 | e_ofb_c.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h | ||
572 | e_ofb_c.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
573 | e_ofb_c.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
574 | e_ofb_c.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
575 | e_ofb_c.o: ../../include/openssl/stack.h ../cryptlib.h | ||
576 | e_ofb_d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
577 | e_ofb_d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
578 | e_ofb_d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
579 | e_ofb_d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
580 | e_ofb_d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
581 | e_ofb_d.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
582 | e_ofb_d.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
583 | e_ofb_d.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
584 | e_ofb_d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
585 | e_ofb_d.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
586 | e_ofb_d.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h | ||
587 | e_ofb_d.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
588 | e_ofb_d.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
589 | e_ofb_d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
590 | e_ofb_d.o: ../../include/openssl/stack.h ../cryptlib.h | ||
591 | e_ofb_i.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
592 | e_ofb_i.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
593 | e_ofb_i.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
594 | e_ofb_i.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
595 | e_ofb_i.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
596 | e_ofb_i.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
597 | e_ofb_i.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
598 | e_ofb_i.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
599 | e_ofb_i.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
600 | e_ofb_i.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
601 | e_ofb_i.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h | ||
602 | e_ofb_i.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
603 | e_ofb_i.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
604 | e_ofb_i.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
605 | e_ofb_i.o: ../../include/openssl/stack.h ../cryptlib.h | ||
606 | e_ofb_r2.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
607 | e_ofb_r2.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
608 | e_ofb_r2.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
609 | e_ofb_r2.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
610 | e_ofb_r2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
611 | e_ofb_r2.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
612 | e_ofb_r2.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
613 | e_ofb_r2.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
614 | e_ofb_r2.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
615 | e_ofb_r2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
616 | e_ofb_r2.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h | ||
617 | e_ofb_r2.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
618 | e_ofb_r2.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
619 | e_ofb_r2.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
620 | e_ofb_r2.o: ../../include/openssl/stack.h ../cryptlib.h | ||
621 | e_ofb_r5.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
622 | e_ofb_r5.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
623 | e_ofb_r5.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
624 | e_ofb_r5.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
625 | e_ofb_r5.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
626 | e_ofb_r5.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
627 | e_ofb_r5.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
628 | e_ofb_r5.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
629 | e_ofb_r5.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
630 | e_ofb_r5.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
631 | e_ofb_r5.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h | ||
632 | e_ofb_r5.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
633 | e_ofb_r5.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
634 | e_ofb_r5.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
635 | e_ofb_r5.o: ../../include/openssl/stack.h ../cryptlib.h | ||
636 | e_rc4.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
637 | e_rc4.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
638 | e_rc4.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
639 | e_rc4.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
640 | e_rc4.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
641 | e_rc4.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
642 | e_rc4.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
643 | e_rc4.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
644 | e_rc4.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
645 | e_rc4.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
646 | e_rc4.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h | ||
647 | e_rc4.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
648 | e_rc4.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
649 | e_rc4.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
650 | e_rc4.o: ../../include/openssl/stack.h ../cryptlib.h | ||
651 | e_xcbc_d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
652 | e_xcbc_d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
653 | e_xcbc_d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
654 | e_xcbc_d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
655 | e_xcbc_d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
656 | e_xcbc_d.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
657 | e_xcbc_d.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
658 | e_xcbc_d.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
659 | e_xcbc_d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
660 | e_xcbc_d.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
661 | e_xcbc_d.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h | ||
662 | e_xcbc_d.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
663 | e_xcbc_d.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
664 | e_xcbc_d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
665 | e_xcbc_d.o: ../../include/openssl/stack.h ../cryptlib.h | ||
666 | encode.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
667 | encode.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
668 | encode.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
669 | encode.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
670 | encode.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
671 | encode.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
672 | encode.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
673 | encode.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
674 | encode.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
675 | encode.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
676 | encode.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h | ||
677 | encode.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
678 | encode.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
679 | encode.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
680 | encode.o: ../../include/openssl/stack.h ../cryptlib.h | ||
681 | evp_enc.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
682 | evp_enc.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
683 | evp_enc.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
684 | evp_enc.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
685 | evp_enc.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
686 | evp_enc.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
687 | evp_enc.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
688 | evp_enc.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
689 | evp_enc.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
690 | evp_enc.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
691 | evp_enc.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h | ||
692 | evp_enc.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
693 | evp_enc.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
694 | evp_enc.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
695 | evp_enc.o: ../../include/openssl/stack.h ../cryptlib.h | ||
696 | evp_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
697 | evp_err.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
698 | evp_err.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h | ||
699 | evp_err.o: ../../include/openssl/des.h ../../include/openssl/dh.h | ||
700 | evp_err.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h | ||
701 | evp_err.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
702 | evp_err.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
703 | evp_err.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
704 | evp_err.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
705 | evp_err.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h | ||
706 | evp_err.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
707 | evp_err.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
708 | evp_err.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
709 | evp_err.o: ../../include/openssl/stack.h | ||
710 | evp_key.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
711 | evp_key.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
712 | evp_key.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
713 | evp_key.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
714 | evp_key.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
715 | evp_key.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
716 | evp_key.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
717 | evp_key.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
718 | evp_key.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
719 | evp_key.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
720 | evp_key.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | ||
721 | evp_key.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
722 | evp_key.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
723 | evp_key.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
724 | evp_key.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
725 | evp_key.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
726 | evp_key.o: ../cryptlib.h | ||
727 | evp_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
728 | evp_lib.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
729 | evp_lib.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
730 | evp_lib.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
731 | evp_lib.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
732 | evp_lib.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
733 | evp_lib.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
734 | evp_lib.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
735 | evp_lib.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
736 | evp_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
737 | evp_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h | ||
738 | evp_lib.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
739 | evp_lib.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
740 | evp_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
741 | evp_lib.o: ../../include/openssl/stack.h ../cryptlib.h | ||
742 | evp_pbe.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
743 | evp_pbe.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
744 | evp_pbe.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
745 | evp_pbe.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
746 | evp_pbe.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
747 | evp_pbe.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
748 | evp_pbe.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
749 | evp_pbe.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
750 | evp_pbe.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
751 | evp_pbe.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
752 | evp_pbe.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | ||
753 | evp_pbe.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
754 | evp_pbe.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
755 | evp_pbe.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
756 | evp_pbe.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
757 | evp_pbe.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
758 | evp_pbe.o: ../cryptlib.h | ||
759 | evp_pkey.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
760 | evp_pkey.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
761 | evp_pkey.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
762 | evp_pkey.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
763 | evp_pkey.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
764 | evp_pkey.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
765 | evp_pkey.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
766 | evp_pkey.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
767 | evp_pkey.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
768 | evp_pkey.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
769 | evp_pkey.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | ||
770 | evp_pkey.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h | ||
771 | evp_pkey.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
772 | evp_pkey.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
773 | evp_pkey.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
774 | evp_pkey.o: ../../include/openssl/stack.h ../../include/openssl/x509.h | ||
775 | evp_pkey.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | ||
776 | m_dss.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
777 | m_dss.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
778 | m_dss.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
779 | m_dss.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
780 | m_dss.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
781 | m_dss.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
782 | m_dss.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
783 | m_dss.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
784 | m_dss.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
785 | m_dss.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
786 | m_dss.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | ||
787 | m_dss.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
788 | m_dss.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
789 | m_dss.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
790 | m_dss.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
791 | m_dss.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
792 | m_dss.o: ../cryptlib.h | ||
793 | m_dss1.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
794 | m_dss1.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
795 | m_dss1.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
796 | m_dss1.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
797 | m_dss1.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
798 | m_dss1.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
799 | m_dss1.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
800 | m_dss1.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
801 | m_dss1.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
802 | m_dss1.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
803 | m_dss1.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | ||
804 | m_dss1.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
805 | m_dss1.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
806 | m_dss1.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
807 | m_dss1.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
808 | m_dss1.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
809 | m_dss1.o: ../cryptlib.h | ||
810 | m_md2.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
811 | m_md2.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
812 | m_md2.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
813 | m_md2.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
814 | m_md2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
815 | m_md2.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
816 | m_md2.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
817 | m_md2.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
818 | m_md2.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
819 | m_md2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
820 | m_md2.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | ||
821 | m_md2.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
822 | m_md2.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
823 | m_md2.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
824 | m_md2.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
825 | m_md2.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
826 | m_md2.o: ../cryptlib.h | ||
827 | m_md5.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
828 | m_md5.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
829 | m_md5.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
830 | m_md5.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
831 | m_md5.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
832 | m_md5.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
833 | m_md5.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
834 | m_md5.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
835 | m_md5.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
836 | m_md5.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
837 | m_md5.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | ||
838 | m_md5.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
839 | m_md5.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
840 | m_md5.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
841 | m_md5.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
842 | m_md5.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
843 | m_md5.o: ../cryptlib.h | ||
844 | m_mdc2.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
845 | m_mdc2.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
846 | m_mdc2.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
847 | m_mdc2.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
848 | m_mdc2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
849 | m_mdc2.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
850 | m_mdc2.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
851 | m_mdc2.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
852 | m_mdc2.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
853 | m_mdc2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
854 | m_mdc2.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | ||
855 | m_mdc2.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
856 | m_mdc2.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
857 | m_mdc2.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
858 | m_mdc2.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
859 | m_mdc2.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
860 | m_mdc2.o: ../cryptlib.h | ||
861 | m_null.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
862 | m_null.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
863 | m_null.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
864 | m_null.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
865 | m_null.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
866 | m_null.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
867 | m_null.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
868 | m_null.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
869 | m_null.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
870 | m_null.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
871 | m_null.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | ||
872 | m_null.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
873 | m_null.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
874 | m_null.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
875 | m_null.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
876 | m_null.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
877 | m_null.o: ../cryptlib.h | ||
878 | m_ripemd.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
879 | m_ripemd.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
880 | m_ripemd.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
881 | m_ripemd.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
882 | m_ripemd.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
883 | m_ripemd.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
884 | m_ripemd.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
885 | m_ripemd.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
886 | m_ripemd.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
887 | m_ripemd.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
888 | m_ripemd.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | ||
889 | m_ripemd.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
890 | m_ripemd.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
891 | m_ripemd.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
892 | m_ripemd.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
893 | m_ripemd.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
894 | m_ripemd.o: ../cryptlib.h | ||
895 | m_sha.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
896 | m_sha.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
897 | m_sha.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
898 | m_sha.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
899 | m_sha.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
900 | m_sha.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
901 | m_sha.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
902 | m_sha.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
903 | m_sha.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
904 | m_sha.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
905 | m_sha.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | ||
906 | m_sha.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
907 | m_sha.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
908 | m_sha.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
909 | m_sha.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
910 | m_sha.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
911 | m_sha.o: ../cryptlib.h | ||
912 | m_sha1.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
913 | m_sha1.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
914 | m_sha1.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
915 | m_sha1.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
916 | m_sha1.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
917 | m_sha1.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
918 | m_sha1.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
919 | m_sha1.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
920 | m_sha1.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
921 | m_sha1.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
922 | m_sha1.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | ||
923 | m_sha1.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
924 | m_sha1.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
925 | m_sha1.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
926 | m_sha1.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
927 | m_sha1.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
928 | m_sha1.o: ../cryptlib.h | ||
929 | names.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
930 | names.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
931 | names.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
932 | names.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
933 | names.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
934 | names.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
935 | names.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
936 | names.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
937 | names.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
938 | names.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
939 | names.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | ||
940 | names.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
941 | names.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
942 | names.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
943 | names.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
944 | names.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
945 | names.o: ../cryptlib.h | ||
946 | p5_crpt.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
947 | p5_crpt.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
948 | p5_crpt.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
949 | p5_crpt.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
950 | p5_crpt.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
951 | p5_crpt.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
952 | p5_crpt.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
953 | p5_crpt.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
954 | p5_crpt.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
955 | p5_crpt.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
956 | p5_crpt.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | ||
957 | p5_crpt.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
958 | p5_crpt.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
959 | p5_crpt.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
960 | p5_crpt.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
961 | p5_crpt.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
962 | p5_crpt.o: ../cryptlib.h | ||
963 | p5_crpt2.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
964 | p5_crpt2.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
965 | p5_crpt2.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
966 | p5_crpt2.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
967 | p5_crpt2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
968 | p5_crpt2.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
969 | p5_crpt2.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
970 | p5_crpt2.o: ../../include/openssl/hmac.h ../../include/openssl/idea.h | ||
971 | p5_crpt2.o: ../../include/openssl/md2.h ../../include/openssl/md5.h | ||
972 | p5_crpt2.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h | ||
973 | p5_crpt2.o: ../../include/openssl/opensslconf.h | ||
974 | p5_crpt2.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | ||
975 | p5_crpt2.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
976 | p5_crpt2.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
977 | p5_crpt2.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
978 | p5_crpt2.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
979 | p5_crpt2.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
980 | p5_crpt2.o: ../cryptlib.h | ||
981 | p_dec.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
982 | p_dec.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
983 | p_dec.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
984 | p_dec.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
985 | p_dec.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
986 | p_dec.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
987 | p_dec.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
988 | p_dec.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
989 | p_dec.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
990 | p_dec.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
991 | p_dec.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | ||
992 | p_dec.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h | ||
993 | p_dec.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
994 | p_dec.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
995 | p_dec.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
996 | p_dec.o: ../../include/openssl/stack.h ../../include/openssl/x509.h | ||
997 | p_dec.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | ||
998 | p_enc.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
999 | p_enc.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
1000 | p_enc.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
1001 | p_enc.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
1002 | p_enc.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
1003 | p_enc.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
1004 | p_enc.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
1005 | p_enc.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
1006 | p_enc.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
1007 | p_enc.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
1008 | p_enc.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | ||
1009 | p_enc.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h | ||
1010 | p_enc.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
1011 | p_enc.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
1012 | p_enc.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
1013 | p_enc.o: ../../include/openssl/stack.h ../../include/openssl/x509.h | ||
1014 | p_enc.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | ||
1015 | p_lib.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | ||
1016 | p_lib.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
1017 | p_lib.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | ||
1018 | p_lib.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h | ||
1019 | p_lib.o: ../../include/openssl/des.h ../../include/openssl/dh.h | ||
1020 | p_lib.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h | ||
1021 | p_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
1022 | p_lib.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | ||
1023 | p_lib.o: ../../include/openssl/md2.h ../../include/openssl/md5.h | ||
1024 | p_lib.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h | ||
1025 | p_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
1026 | p_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | ||
1027 | p_lib.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
1028 | p_lib.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
1029 | p_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
1030 | p_lib.o: ../../include/openssl/stack.h ../../include/openssl/x509.h | ||
1031 | p_lib.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | ||
1032 | p_open.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
1033 | p_open.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
1034 | p_open.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
1035 | p_open.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
1036 | p_open.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
1037 | p_open.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
1038 | p_open.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
1039 | p_open.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
1040 | p_open.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
1041 | p_open.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
1042 | p_open.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | ||
1043 | p_open.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
1044 | p_open.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
1045 | p_open.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
1046 | p_open.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
1047 | p_open.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
1048 | p_open.o: ../cryptlib.h | ||
1049 | p_seal.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
1050 | p_seal.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
1051 | p_seal.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
1052 | p_seal.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
1053 | p_seal.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
1054 | p_seal.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
1055 | p_seal.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
1056 | p_seal.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
1057 | p_seal.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
1058 | p_seal.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
1059 | p_seal.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | ||
1060 | p_seal.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h | ||
1061 | p_seal.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
1062 | p_seal.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
1063 | p_seal.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
1064 | p_seal.o: ../../include/openssl/stack.h ../../include/openssl/x509.h | ||
1065 | p_seal.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | ||
1066 | p_sign.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
1067 | p_sign.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
1068 | p_sign.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
1069 | p_sign.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
1070 | p_sign.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
1071 | p_sign.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
1072 | p_sign.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
1073 | p_sign.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
1074 | p_sign.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
1075 | p_sign.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
1076 | p_sign.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | ||
1077 | p_sign.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
1078 | p_sign.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
1079 | p_sign.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
1080 | p_sign.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
1081 | p_sign.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
1082 | p_sign.o: ../cryptlib.h | ||
1083 | p_verify.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
1084 | p_verify.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
1085 | p_verify.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
1086 | p_verify.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
1087 | p_verify.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
1088 | p_verify.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
1089 | p_verify.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
1090 | p_verify.o: ../../include/openssl/idea.h ../../include/openssl/md2.h | ||
1091 | p_verify.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
1092 | p_verify.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
1093 | p_verify.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | ||
1094 | p_verify.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
1095 | p_verify.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
1096 | p_verify.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
1097 | p_verify.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
1098 | p_verify.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
1099 | p_verify.o: ../cryptlib.h | ||
diff --git a/src/lib/libcrypto/evp/bio_b64.c b/src/lib/libcrypto/evp/bio_b64.c index 73172b9a07..84729119df 100644 --- a/src/lib/libcrypto/evp/bio_b64.c +++ b/src/lib/libcrypto/evp/bio_b64.c | |||
@@ -59,10 +59,9 @@ | |||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include <errno.h> | 60 | #include <errno.h> |
61 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
62 | #include "buffer.h" | 62 | #include <openssl/buffer.h> |
63 | #include "evp.h" | 63 | #include <openssl/evp.h> |
64 | 64 | ||
65 | #ifndef NOPROTO | ||
66 | static int b64_write(BIO *h,char *buf,int num); | 65 | static int b64_write(BIO *h,char *buf,int num); |
67 | static int b64_read(BIO *h,char *buf,int size); | 66 | static int b64_read(BIO *h,char *buf,int size); |
68 | /*static int b64_puts(BIO *h,char *str); */ | 67 | /*static int b64_puts(BIO *h,char *str); */ |
@@ -70,16 +69,6 @@ static int b64_read(BIO *h,char *buf,int size); | |||
70 | static long b64_ctrl(BIO *h,int cmd,long arg1,char *arg2); | 69 | static long b64_ctrl(BIO *h,int cmd,long arg1,char *arg2); |
71 | static int b64_new(BIO *h); | 70 | static int b64_new(BIO *h); |
72 | static int b64_free(BIO *data); | 71 | static int b64_free(BIO *data); |
73 | #else | ||
74 | static int b64_write(); | ||
75 | static int b64_read(); | ||
76 | /*static int b64_puts(); */ | ||
77 | /*static int b64_gets(); */ | ||
78 | static long b64_ctrl(); | ||
79 | static int b64_new(); | ||
80 | static int b64_free(); | ||
81 | #endif | ||
82 | |||
83 | #define B64_BLOCK_SIZE 1024 | 72 | #define B64_BLOCK_SIZE 1024 |
84 | #define B64_BLOCK_SIZE2 768 | 73 | #define B64_BLOCK_SIZE2 768 |
85 | #define B64_NONE 0 | 74 | #define B64_NONE 0 |
@@ -113,13 +102,12 @@ static BIO_METHOD methods_b64= | |||
113 | b64_free, | 102 | b64_free, |
114 | }; | 103 | }; |
115 | 104 | ||
116 | BIO_METHOD *BIO_f_base64() | 105 | BIO_METHOD *BIO_f_base64(void) |
117 | { | 106 | { |
118 | return(&methods_b64); | 107 | return(&methods_b64); |
119 | } | 108 | } |
120 | 109 | ||
121 | static int b64_new(bi) | 110 | static int b64_new(BIO *bi) |
122 | BIO *bi; | ||
123 | { | 111 | { |
124 | BIO_B64_CTX *ctx; | 112 | BIO_B64_CTX *ctx; |
125 | 113 | ||
@@ -140,8 +128,7 @@ BIO *bi; | |||
140 | return(1); | 128 | return(1); |
141 | } | 129 | } |
142 | 130 | ||
143 | static int b64_free(a) | 131 | static int b64_free(BIO *a) |
144 | BIO *a; | ||
145 | { | 132 | { |
146 | if (a == NULL) return(0); | 133 | if (a == NULL) return(0); |
147 | Free(a->ptr); | 134 | Free(a->ptr); |
@@ -151,10 +138,7 @@ BIO *a; | |||
151 | return(1); | 138 | return(1); |
152 | } | 139 | } |
153 | 140 | ||
154 | static int b64_read(b,out,outl) | 141 | static int b64_read(BIO *b, char *out, int outl) |
155 | BIO *b; | ||
156 | char *out; | ||
157 | int outl; | ||
158 | { | 142 | { |
159 | int ret=0,i,ii,j,k,x,n,num,ret_code=0; | 143 | int ret=0,i,ii,j,k,x,n,num,ret_code=0; |
160 | BIO_B64_CTX *ctx; | 144 | BIO_B64_CTX *ctx; |
@@ -354,10 +338,7 @@ int outl; | |||
354 | return((ret == 0)?ret_code:ret); | 338 | return((ret == 0)?ret_code:ret); |
355 | } | 339 | } |
356 | 340 | ||
357 | static int b64_write(b,in,inl) | 341 | static int b64_write(BIO *b, char *in, int inl) |
358 | BIO *b; | ||
359 | char *in; | ||
360 | int inl; | ||
361 | { | 342 | { |
362 | int ret=inl,n,i; | 343 | int ret=inl,n,i; |
363 | BIO_B64_CTX *ctx; | 344 | BIO_B64_CTX *ctx; |
@@ -451,11 +432,7 @@ int inl; | |||
451 | return(ret); | 432 | return(ret); |
452 | } | 433 | } |
453 | 434 | ||
454 | static long b64_ctrl(b,cmd,num,ptr) | 435 | static long b64_ctrl(BIO *b, int cmd, long num, char *ptr) |
455 | BIO *b; | ||
456 | int cmd; | ||
457 | long num; | ||
458 | char *ptr; | ||
459 | { | 436 | { |
460 | BIO_B64_CTX *ctx; | 437 | BIO_B64_CTX *ctx; |
461 | long ret=1; | 438 | long ret=1; |
diff --git a/src/lib/libcrypto/evp/bio_enc.c b/src/lib/libcrypto/evp/bio_enc.c index 6c30ddfc54..0a7b1ecf07 100644 --- a/src/lib/libcrypto/evp/bio_enc.c +++ b/src/lib/libcrypto/evp/bio_enc.c | |||
@@ -59,10 +59,9 @@ | |||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include <errno.h> | 60 | #include <errno.h> |
61 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
62 | #include "buffer.h" | 62 | #include <openssl/buffer.h> |
63 | #include "evp.h" | 63 | #include <openssl/evp.h> |
64 | 64 | ||
65 | #ifndef NOPROTO | ||
66 | static int enc_write(BIO *h,char *buf,int num); | 65 | static int enc_write(BIO *h,char *buf,int num); |
67 | static int enc_read(BIO *h,char *buf,int size); | 66 | static int enc_read(BIO *h,char *buf,int size); |
68 | /*static int enc_puts(BIO *h,char *str); */ | 67 | /*static int enc_puts(BIO *h,char *str); */ |
@@ -70,16 +69,6 @@ static int enc_read(BIO *h,char *buf,int size); | |||
70 | static long enc_ctrl(BIO *h,int cmd,long arg1,char *arg2); | 69 | static long enc_ctrl(BIO *h,int cmd,long arg1,char *arg2); |
71 | static int enc_new(BIO *h); | 70 | static int enc_new(BIO *h); |
72 | static int enc_free(BIO *data); | 71 | static int enc_free(BIO *data); |
73 | #else | ||
74 | static int enc_write(); | ||
75 | static int enc_read(); | ||
76 | /*static int enc_puts(); */ | ||
77 | /*static int enc_gets(); */ | ||
78 | static long enc_ctrl(); | ||
79 | static int enc_new(); | ||
80 | static int enc_free(); | ||
81 | #endif | ||
82 | |||
83 | #define ENC_BLOCK_SIZE (1024*4) | 72 | #define ENC_BLOCK_SIZE (1024*4) |
84 | 73 | ||
85 | typedef struct enc_struct | 74 | typedef struct enc_struct |
@@ -105,13 +94,12 @@ static BIO_METHOD methods_enc= | |||
105 | enc_free, | 94 | enc_free, |
106 | }; | 95 | }; |
107 | 96 | ||
108 | BIO_METHOD *BIO_f_cipher() | 97 | BIO_METHOD *BIO_f_cipher(void) |
109 | { | 98 | { |
110 | return(&methods_enc); | 99 | return(&methods_enc); |
111 | } | 100 | } |
112 | 101 | ||
113 | static int enc_new(bi) | 102 | static int enc_new(BIO *bi) |
114 | BIO *bi; | ||
115 | { | 103 | { |
116 | BIO_ENC_CTX *ctx; | 104 | BIO_ENC_CTX *ctx; |
117 | 105 | ||
@@ -131,8 +119,7 @@ BIO *bi; | |||
131 | return(1); | 119 | return(1); |
132 | } | 120 | } |
133 | 121 | ||
134 | static int enc_free(a) | 122 | static int enc_free(BIO *a) |
135 | BIO *a; | ||
136 | { | 123 | { |
137 | BIO_ENC_CTX *b; | 124 | BIO_ENC_CTX *b; |
138 | 125 | ||
@@ -147,10 +134,7 @@ BIO *a; | |||
147 | return(1); | 134 | return(1); |
148 | } | 135 | } |
149 | 136 | ||
150 | static int enc_read(b,out,outl) | 137 | static int enc_read(BIO *b, char *out, int outl) |
151 | BIO *b; | ||
152 | char *out; | ||
153 | int outl; | ||
154 | { | 138 | { |
155 | int ret=0,i; | 139 | int ret=0,i; |
156 | BIO_ENC_CTX *ctx; | 140 | BIO_ENC_CTX *ctx; |
@@ -230,10 +214,7 @@ int outl; | |||
230 | return((ret == 0)?ctx->cont:ret); | 214 | return((ret == 0)?ctx->cont:ret); |
231 | } | 215 | } |
232 | 216 | ||
233 | static int enc_write(b,in,inl) | 217 | static int enc_write(BIO *b, char *in, int inl) |
234 | BIO *b; | ||
235 | char *in; | ||
236 | int inl; | ||
237 | { | 218 | { |
238 | int ret=0,n,i; | 219 | int ret=0,n,i; |
239 | BIO_ENC_CTX *ctx; | 220 | BIO_ENC_CTX *ctx; |
@@ -288,16 +269,13 @@ int inl; | |||
288 | return(ret); | 269 | return(ret); |
289 | } | 270 | } |
290 | 271 | ||
291 | static long enc_ctrl(b,cmd,num,ptr) | 272 | static long enc_ctrl(BIO *b, int cmd, long num, char *ptr) |
292 | BIO *b; | ||
293 | int cmd; | ||
294 | long num; | ||
295 | char *ptr; | ||
296 | { | 273 | { |
297 | BIO *dbio; | 274 | BIO *dbio; |
298 | BIO_ENC_CTX *ctx,*dctx; | 275 | BIO_ENC_CTX *ctx,*dctx; |
299 | long ret=1; | 276 | long ret=1; |
300 | int i; | 277 | int i; |
278 | EVP_CIPHER_CTX **c_ctx; | ||
301 | 279 | ||
302 | ctx=(BIO_ENC_CTX *)b->ptr; | 280 | ctx=(BIO_ENC_CTX *)b->ptr; |
303 | 281 | ||
@@ -364,7 +342,11 @@ again: | |||
364 | ret=BIO_ctrl(b->next_bio,cmd,num,ptr); | 342 | ret=BIO_ctrl(b->next_bio,cmd,num,ptr); |
365 | BIO_copy_next_retry(b); | 343 | BIO_copy_next_retry(b); |
366 | break; | 344 | break; |
367 | 345 | case BIO_C_GET_CIPHER_CTX: | |
346 | c_ctx=(EVP_CIPHER_CTX **)ptr; | ||
347 | (*c_ctx)= &(ctx->cipher); | ||
348 | b->init=1; | ||
349 | break; | ||
368 | case BIO_CTRL_DUP: | 350 | case BIO_CTRL_DUP: |
369 | dbio=(BIO *)ptr; | 351 | dbio=(BIO *)ptr; |
370 | dctx=(BIO_ENC_CTX *)dbio->ptr; | 352 | dctx=(BIO_ENC_CTX *)dbio->ptr; |
@@ -398,19 +380,15 @@ EVP_CIPHER_ctx *c; | |||
398 | } | 380 | } |
399 | */ | 381 | */ |
400 | 382 | ||
401 | void BIO_set_cipher(b,c,k,i,e) | 383 | void BIO_set_cipher(BIO *b, const EVP_CIPHER *c, unsigned char *k, |
402 | BIO *b; | 384 | unsigned char *i, int e) |
403 | EVP_CIPHER *c; | ||
404 | unsigned char *k; | ||
405 | unsigned char *i; | ||
406 | int e; | ||
407 | { | 385 | { |
408 | BIO_ENC_CTX *ctx; | 386 | BIO_ENC_CTX *ctx; |
409 | 387 | ||
410 | if (b == NULL) return; | 388 | if (b == NULL) return; |
411 | 389 | ||
412 | if ((b->callback != NULL) && | 390 | if ((b->callback != NULL) && |
413 | (b->callback(b,BIO_CB_CTRL,(char *)c,BIO_CTRL_SET,e,0L) <= 0)) | 391 | (b->callback(b,BIO_CB_CTRL,(const char *)c,BIO_CTRL_SET,e,0L) <= 0)) |
414 | return; | 392 | return; |
415 | 393 | ||
416 | b->init=1; | 394 | b->init=1; |
@@ -418,6 +396,6 @@ int e; | |||
418 | EVP_CipherInit(&(ctx->cipher),c,k,i,e); | 396 | EVP_CipherInit(&(ctx->cipher),c,k,i,e); |
419 | 397 | ||
420 | if (b->callback != NULL) | 398 | if (b->callback != NULL) |
421 | b->callback(b,BIO_CB_CTRL,(char *)c,BIO_CTRL_SET,e,1L); | 399 | b->callback(b,BIO_CB_CTRL,(const char *)c,BIO_CTRL_SET,e,1L); |
422 | } | 400 | } |
423 | 401 | ||
diff --git a/src/lib/libcrypto/evp/bio_md.c b/src/lib/libcrypto/evp/bio_md.c index fa5fdc055b..317167f9c4 100644 --- a/src/lib/libcrypto/evp/bio_md.c +++ b/src/lib/libcrypto/evp/bio_md.c | |||
@@ -59,13 +59,12 @@ | |||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include <errno.h> | 60 | #include <errno.h> |
61 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
62 | #include "buffer.h" | 62 | #include <openssl/buffer.h> |
63 | #include "evp.h" | 63 | #include <openssl/evp.h> |
64 | 64 | ||
65 | /* BIO_put and BIO_get both add to the digest, | 65 | /* BIO_put and BIO_get both add to the digest, |
66 | * BIO_gets returns the digest */ | 66 | * BIO_gets returns the digest */ |
67 | 67 | ||
68 | #ifndef NOPROTO | ||
69 | static int md_write(BIO *h,char *buf,int num); | 68 | static int md_write(BIO *h,char *buf,int num); |
70 | static int md_read(BIO *h,char *buf,int size); | 69 | static int md_read(BIO *h,char *buf,int size); |
71 | /*static int md_puts(BIO *h,char *str); */ | 70 | /*static int md_puts(BIO *h,char *str); */ |
@@ -73,16 +72,6 @@ static int md_gets(BIO *h,char *str,int size); | |||
73 | static long md_ctrl(BIO *h,int cmd,long arg1,char *arg2); | 72 | static long md_ctrl(BIO *h,int cmd,long arg1,char *arg2); |
74 | static int md_new(BIO *h); | 73 | static int md_new(BIO *h); |
75 | static int md_free(BIO *data); | 74 | static int md_free(BIO *data); |
76 | #else | ||
77 | static int md_write(); | ||
78 | static int md_read(); | ||
79 | /*static int md_puts(); */ | ||
80 | static int md_gets(); | ||
81 | static long md_ctrl(); | ||
82 | static int md_new(); | ||
83 | static int md_free(); | ||
84 | #endif | ||
85 | |||
86 | static BIO_METHOD methods_md= | 75 | static BIO_METHOD methods_md= |
87 | { | 76 | { |
88 | BIO_TYPE_MD,"message digest", | 77 | BIO_TYPE_MD,"message digest", |
@@ -95,13 +84,12 @@ static BIO_METHOD methods_md= | |||
95 | md_free, | 84 | md_free, |
96 | }; | 85 | }; |
97 | 86 | ||
98 | BIO_METHOD *BIO_f_md() | 87 | BIO_METHOD *BIO_f_md(void) |
99 | { | 88 | { |
100 | return(&methods_md); | 89 | return(&methods_md); |
101 | } | 90 | } |
102 | 91 | ||
103 | static int md_new(bi) | 92 | static int md_new(BIO *bi) |
104 | BIO *bi; | ||
105 | { | 93 | { |
106 | EVP_MD_CTX *ctx; | 94 | EVP_MD_CTX *ctx; |
107 | 95 | ||
@@ -114,8 +102,7 @@ BIO *bi; | |||
114 | return(1); | 102 | return(1); |
115 | } | 103 | } |
116 | 104 | ||
117 | static int md_free(a) | 105 | static int md_free(BIO *a) |
118 | BIO *a; | ||
119 | { | 106 | { |
120 | if (a == NULL) return(0); | 107 | if (a == NULL) return(0); |
121 | Free(a->ptr); | 108 | Free(a->ptr); |
@@ -125,10 +112,7 @@ BIO *a; | |||
125 | return(1); | 112 | return(1); |
126 | } | 113 | } |
127 | 114 | ||
128 | static int md_read(b,out,outl) | 115 | static int md_read(BIO *b, char *out, int outl) |
129 | BIO *b; | ||
130 | char *out; | ||
131 | int outl; | ||
132 | { | 116 | { |
133 | int ret=0; | 117 | int ret=0; |
134 | EVP_MD_CTX *ctx; | 118 | EVP_MD_CTX *ctx; |
@@ -152,10 +136,7 @@ int outl; | |||
152 | return(ret); | 136 | return(ret); |
153 | } | 137 | } |
154 | 138 | ||
155 | static int md_write(b,in,inl) | 139 | static int md_write(BIO *b, char *in, int inl) |
156 | BIO *b; | ||
157 | char *in; | ||
158 | int inl; | ||
159 | { | 140 | { |
160 | int ret=0; | 141 | int ret=0; |
161 | EVP_MD_CTX *ctx; | 142 | EVP_MD_CTX *ctx; |
@@ -178,14 +159,10 @@ int inl; | |||
178 | return(ret); | 159 | return(ret); |
179 | } | 160 | } |
180 | 161 | ||
181 | static long md_ctrl(b,cmd,num,ptr) | 162 | static long md_ctrl(BIO *b, int cmd, long num, char *ptr) |
182 | BIO *b; | ||
183 | int cmd; | ||
184 | long num; | ||
185 | char *ptr; | ||
186 | { | 163 | { |
187 | EVP_MD_CTX *ctx,*dctx,**pctx; | 164 | EVP_MD_CTX *ctx,*dctx,**pctx; |
188 | EVP_MD **ppmd; | 165 | const EVP_MD **ppmd; |
189 | EVP_MD *md; | 166 | EVP_MD *md; |
190 | long ret=1; | 167 | long ret=1; |
191 | BIO *dbio; | 168 | BIO *dbio; |
@@ -204,7 +181,7 @@ char *ptr; | |||
204 | case BIO_C_GET_MD: | 181 | case BIO_C_GET_MD: |
205 | if (b->init) | 182 | if (b->init) |
206 | { | 183 | { |
207 | ppmd=(EVP_MD **)ptr; | 184 | ppmd=(const EVP_MD **)ptr; |
208 | *ppmd=ctx->digest; | 185 | *ppmd=ctx->digest; |
209 | } | 186 | } |
210 | else | 187 | else |
@@ -243,10 +220,7 @@ char *ptr; | |||
243 | return(ret); | 220 | return(ret); |
244 | } | 221 | } |
245 | 222 | ||
246 | static int md_gets(bp,buf,size) | 223 | static int md_gets(BIO *bp, char *buf, int size) |
247 | BIO *bp; | ||
248 | char *buf; | ||
249 | int size; | ||
250 | { | 224 | { |
251 | EVP_MD_CTX *ctx; | 225 | EVP_MD_CTX *ctx; |
252 | unsigned int ret; | 226 | unsigned int ret; |
diff --git a/src/lib/libcrypto/evp/bio_ok.c b/src/lib/libcrypto/evp/bio_ok.c new file mode 100644 index 0000000000..101275d648 --- /dev/null +++ b/src/lib/libcrypto/evp/bio_ok.c | |||
@@ -0,0 +1,552 @@ | |||
1 | /* crypto/evp/bio_ok.c */ | ||
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | ||
3 | * All rights reserved. | ||
4 | * | ||
5 | * This package is an SSL implementation written | ||
6 | * by Eric Young (eay@cryptsoft.com). | ||
7 | * The implementation was written so as to conform with Netscapes SSL. | ||
8 | * | ||
9 | * This library is free for commercial and non-commercial use as long as | ||
10 | * the following conditions are aheared to. The following conditions | ||
11 | * apply to all code found in this distribution, be it the RC4, RSA, | ||
12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation | ||
13 | * included with this distribution is covered by the same copyright terms | ||
14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). | ||
15 | * | ||
16 | * Copyright remains Eric Young's, and as such any Copyright notices in | ||
17 | * the code are not to be removed. | ||
18 | * If this package is used in a product, Eric Young should be given attribution | ||
19 | * as the author of the parts of the library used. | ||
20 | * This can be in the form of a textual message at program startup or | ||
21 | * in documentation (online or textual) provided with the package. | ||
22 | * | ||
23 | * Redistribution and use in source and binary forms, with or without | ||
24 | * modification, are permitted provided that the following conditions | ||
25 | * are met: | ||
26 | * 1. Redistributions of source code must retain the copyright | ||
27 | * notice, this list of conditions and the following disclaimer. | ||
28 | * 2. Redistributions in binary form must reproduce the above copyright | ||
29 | * notice, this list of conditions and the following disclaimer in the | ||
30 | * documentation and/or other materials provided with the distribution. | ||
31 | * 3. All advertising materials mentioning features or use of this software | ||
32 | * must display the following acknowledgement: | ||
33 | * "This product includes cryptographic software written by | ||
34 | * Eric Young (eay@cryptsoft.com)" | ||
35 | * The word 'cryptographic' can be left out if the rouines from the library | ||
36 | * being used are not cryptographic related :-). | ||
37 | * 4. If you include any Windows specific code (or a derivative thereof) from | ||
38 | * the apps directory (application code) you must include an acknowledgement: | ||
39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" | ||
40 | * | ||
41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND | ||
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | ||
45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
51 | * SUCH DAMAGE. | ||
52 | * | ||
53 | * The licence and distribution terms for any publically available version or | ||
54 | * derivative of this code cannot be changed. i.e. this code cannot simply be | ||
55 | * copied and put under another distribution licence | ||
56 | * [including the GNU Public Licence.] | ||
57 | */ | ||
58 | |||
59 | /* | ||
60 | From: Arne Ansper <arne@cyber.ee> | ||
61 | |||
62 | Why BIO_f_reliable? | ||
63 | |||
64 | I wrote function which took BIO* as argument, read data from it | ||
65 | and processed it. Then I wanted to store the input file in | ||
66 | encrypted form. OK I pushed BIO_f_cipher to the BIO stack | ||
67 | and everything was OK. BUT if user types wrong password | ||
68 | BIO_f_cipher outputs only garbage and my function crashes. Yes | ||
69 | I can and I should fix my function, but BIO_f_cipher is | ||
70 | easy way to add encryption support to many exisiting applications | ||
71 | and it's hard to debug and fix them all. | ||
72 | |||
73 | So I wanted another BIO which would catch the incorrect passwords and | ||
74 | file damages which cause garbage on BIO_f_cipher's output. | ||
75 | |||
76 | The easy way is to push the BIO_f_md and save the checksum at | ||
77 | the end of the file. However there are several problems with this | ||
78 | approach: | ||
79 | |||
80 | 1) you must somehow separate checksum from actual data. | ||
81 | 2) you need lot's of memory when reading the file, because you | ||
82 | must read to the end of the file and verify the checksum before | ||
83 | leting the application to read the data. | ||
84 | |||
85 | BIO_f_reliable tries to solve both problems, so that you can | ||
86 | read and write arbitraly long streams using only fixed amount | ||
87 | of memory. | ||
88 | |||
89 | BIO_f_reliable splits data stream into blocks. Each block is prefixed | ||
90 | with it's length and suffixed with it's digest. So you need only | ||
91 | several Kbytes of memory to buffer single block before verifying | ||
92 | it's digest. | ||
93 | |||
94 | BIO_f_reliable goes futher and adds several important capabilities: | ||
95 | |||
96 | 1) the digest of the block is computed over the whole stream | ||
97 | -- so nobody can rearrange the blocks or remove or replace them. | ||
98 | |||
99 | 2) to detect invalid passwords right at the start BIO_f_reliable | ||
100 | adds special prefix to the stream. In order to avoid known plain-text | ||
101 | attacks this prefix is generated as follows: | ||
102 | |||
103 | *) digest is initialized with random seed instead of | ||
104 | standardized one. | ||
105 | *) same seed is written to ouput | ||
106 | *) well-known text is then hashed and the output | ||
107 | of the digest is also written to output. | ||
108 | |||
109 | reader can now read the seed from stream, hash the same string | ||
110 | and then compare the digest output. | ||
111 | |||
112 | Bad things: BIO_f_reliable knows what's going on in EVP_Digest. I | ||
113 | initialy wrote and tested this code on x86 machine and wrote the | ||
114 | digests out in machine-dependent order :( There are people using | ||
115 | this code and I cannot change this easily without making existing | ||
116 | data files unreadable. | ||
117 | |||
118 | */ | ||
119 | |||
120 | #include <stdio.h> | ||
121 | #include <errno.h> | ||
122 | #include "cryptlib.h" | ||
123 | #include <openssl/buffer.h> | ||
124 | #include <openssl/bio.h> | ||
125 | #include <openssl/evp.h> | ||
126 | #include <openssl/rand.h> | ||
127 | |||
128 | static int ok_write(BIO *h,char *buf,int num); | ||
129 | static int ok_read(BIO *h,char *buf,int size); | ||
130 | static long ok_ctrl(BIO *h,int cmd,long arg1,char *arg2); | ||
131 | static int ok_new(BIO *h); | ||
132 | static int ok_free(BIO *data); | ||
133 | static void sig_out(BIO* b); | ||
134 | static void sig_in(BIO* b); | ||
135 | static void block_out(BIO* b); | ||
136 | static void block_in(BIO* b); | ||
137 | #define OK_BLOCK_SIZE (1024*4) | ||
138 | #define OK_BLOCK_BLOCK 4 | ||
139 | #define IOBS (OK_BLOCK_SIZE+ OK_BLOCK_BLOCK+ 3*EVP_MAX_MD_SIZE) | ||
140 | #define WELLKNOWN "The quick brown fox jumped over the lazy dog's back." | ||
141 | |||
142 | #ifndef L_ENDIAN | ||
143 | #define swapem(x) \ | ||
144 | ((unsigned long int)((((unsigned long int)(x) & 0x000000ffU) << 24) | \ | ||
145 | (((unsigned long int)(x) & 0x0000ff00U) << 8) | \ | ||
146 | (((unsigned long int)(x) & 0x00ff0000U) >> 8) | \ | ||
147 | (((unsigned long int)(x) & 0xff000000U) >> 24))) | ||
148 | #else | ||
149 | #define swapem(x) (x) | ||
150 | #endif | ||
151 | |||
152 | typedef struct ok_struct | ||
153 | { | ||
154 | int buf_len; | ||
155 | int buf_off; | ||
156 | int buf_len_save; | ||
157 | int buf_off_save; | ||
158 | int cont; /* <= 0 when finished */ | ||
159 | int finished; | ||
160 | EVP_MD_CTX md; | ||
161 | int blockout; /* output block is ready */ | ||
162 | int sigio; /* must process signature */ | ||
163 | char buf[IOBS]; | ||
164 | } BIO_OK_CTX; | ||
165 | |||
166 | static BIO_METHOD methods_ok= | ||
167 | { | ||
168 | BIO_TYPE_CIPHER,"reliable", | ||
169 | ok_write, | ||
170 | ok_read, | ||
171 | NULL, /* ok_puts, */ | ||
172 | NULL, /* ok_gets, */ | ||
173 | ok_ctrl, | ||
174 | ok_new, | ||
175 | ok_free, | ||
176 | }; | ||
177 | |||
178 | BIO_METHOD *BIO_f_reliable(void) | ||
179 | { | ||
180 | return(&methods_ok); | ||
181 | } | ||
182 | |||
183 | static int ok_new(BIO *bi) | ||
184 | { | ||
185 | BIO_OK_CTX *ctx; | ||
186 | |||
187 | ctx=(BIO_OK_CTX *)Malloc(sizeof(BIO_OK_CTX)); | ||
188 | if (ctx == NULL) return(0); | ||
189 | |||
190 | ctx->buf_len=0; | ||
191 | ctx->buf_off=0; | ||
192 | ctx->buf_len_save=0; | ||
193 | ctx->buf_off_save=0; | ||
194 | ctx->cont=1; | ||
195 | ctx->finished=0; | ||
196 | ctx->blockout= 0; | ||
197 | ctx->sigio=1; | ||
198 | |||
199 | bi->init=0; | ||
200 | bi->ptr=(char *)ctx; | ||
201 | bi->flags=0; | ||
202 | return(1); | ||
203 | } | ||
204 | |||
205 | static int ok_free(BIO *a) | ||
206 | { | ||
207 | if (a == NULL) return(0); | ||
208 | memset(a->ptr,0,sizeof(BIO_OK_CTX)); | ||
209 | Free(a->ptr); | ||
210 | a->ptr=NULL; | ||
211 | a->init=0; | ||
212 | a->flags=0; | ||
213 | return(1); | ||
214 | } | ||
215 | |||
216 | static int ok_read(BIO *b, char *out, int outl) | ||
217 | { | ||
218 | int ret=0,i,n; | ||
219 | BIO_OK_CTX *ctx; | ||
220 | |||
221 | if (out == NULL) return(0); | ||
222 | ctx=(BIO_OK_CTX *)b->ptr; | ||
223 | |||
224 | if ((ctx == NULL) || (b->next_bio == NULL) || (b->init == 0)) return(0); | ||
225 | |||
226 | while(outl > 0) | ||
227 | { | ||
228 | |||
229 | /* copy clean bytes to output buffer */ | ||
230 | if (ctx->blockout) | ||
231 | { | ||
232 | i=ctx->buf_len-ctx->buf_off; | ||
233 | if (i > outl) i=outl; | ||
234 | memcpy(out,&(ctx->buf[ctx->buf_off]),i); | ||
235 | ret+=i; | ||
236 | out+=i; | ||
237 | outl-=i; | ||
238 | ctx->buf_off+=i; | ||
239 | |||
240 | /* all clean bytes are out */ | ||
241 | if (ctx->buf_len == ctx->buf_off) | ||
242 | { | ||
243 | ctx->buf_off=0; | ||
244 | |||
245 | /* copy start of the next block into proper place */ | ||
246 | if(ctx->buf_len_save- ctx->buf_off_save > 0) | ||
247 | { | ||
248 | ctx->buf_len= ctx->buf_len_save- ctx->buf_off_save; | ||
249 | memmove(ctx->buf, &(ctx->buf[ctx->buf_off_save]), | ||
250 | ctx->buf_len); | ||
251 | } | ||
252 | else | ||
253 | { | ||
254 | ctx->buf_len=0; | ||
255 | } | ||
256 | ctx->blockout= 0; | ||
257 | } | ||
258 | } | ||
259 | |||
260 | /* output buffer full -- cancel */ | ||
261 | if (outl == 0) break; | ||
262 | |||
263 | /* no clean bytes in buffer -- fill it */ | ||
264 | n=IOBS- ctx->buf_len; | ||
265 | i=BIO_read(b->next_bio,&(ctx->buf[ctx->buf_len]),n); | ||
266 | |||
267 | if (i <= 0) break; /* nothing new */ | ||
268 | |||
269 | ctx->buf_len+= i; | ||
270 | |||
271 | /* no signature yet -- check if we got one */ | ||
272 | if (ctx->sigio == 1) sig_in(b); | ||
273 | |||
274 | /* signature ok -- check if we got block */ | ||
275 | if (ctx->sigio == 0) block_in(b); | ||
276 | |||
277 | /* invalid block -- cancel */ | ||
278 | if (ctx->cont <= 0) break; | ||
279 | |||
280 | } | ||
281 | |||
282 | BIO_clear_retry_flags(b); | ||
283 | BIO_copy_next_retry(b); | ||
284 | return(ret); | ||
285 | } | ||
286 | |||
287 | static int ok_write(BIO *b, char *in, int inl) | ||
288 | { | ||
289 | int ret=0,n,i; | ||
290 | BIO_OK_CTX *ctx; | ||
291 | |||
292 | ctx=(BIO_OK_CTX *)b->ptr; | ||
293 | ret=inl; | ||
294 | |||
295 | if ((ctx == NULL) || (b->next_bio == NULL) || (b->init == 0)) return(0); | ||
296 | |||
297 | if(ctx->sigio) sig_out(b); | ||
298 | |||
299 | do{ | ||
300 | BIO_clear_retry_flags(b); | ||
301 | n=ctx->buf_len-ctx->buf_off; | ||
302 | while (ctx->blockout && n > 0) | ||
303 | { | ||
304 | i=BIO_write(b->next_bio,&(ctx->buf[ctx->buf_off]),n); | ||
305 | if (i <= 0) | ||
306 | { | ||
307 | BIO_copy_next_retry(b); | ||
308 | if(!BIO_should_retry(b)) | ||
309 | ctx->cont= 0; | ||
310 | return(i); | ||
311 | } | ||
312 | ctx->buf_off+=i; | ||
313 | n-=i; | ||
314 | } | ||
315 | |||
316 | /* at this point all pending data has been written */ | ||
317 | ctx->blockout= 0; | ||
318 | if (ctx->buf_len == ctx->buf_off) | ||
319 | { | ||
320 | ctx->buf_len=OK_BLOCK_BLOCK; | ||
321 | ctx->buf_off=0; | ||
322 | } | ||
323 | |||
324 | if ((in == NULL) || (inl <= 0)) return(0); | ||
325 | |||
326 | n= (inl+ ctx->buf_len > OK_BLOCK_SIZE+ OK_BLOCK_BLOCK) ? | ||
327 | OK_BLOCK_SIZE+ OK_BLOCK_BLOCK- ctx->buf_len : inl; | ||
328 | |||
329 | memcpy((unsigned char *)(&(ctx->buf[ctx->buf_len])),(unsigned char *)in,n); | ||
330 | ctx->buf_len+= n; | ||
331 | inl-=n; | ||
332 | in+=n; | ||
333 | |||
334 | if(ctx->buf_len >= OK_BLOCK_SIZE+ OK_BLOCK_BLOCK) | ||
335 | { | ||
336 | block_out(b); | ||
337 | } | ||
338 | }while(inl > 0); | ||
339 | |||
340 | BIO_clear_retry_flags(b); | ||
341 | BIO_copy_next_retry(b); | ||
342 | return(ret); | ||
343 | } | ||
344 | |||
345 | static long ok_ctrl(BIO *b, int cmd, long num, char *ptr) | ||
346 | { | ||
347 | BIO_OK_CTX *ctx; | ||
348 | EVP_MD *md; | ||
349 | const EVP_MD **ppmd; | ||
350 | long ret=1; | ||
351 | int i; | ||
352 | |||
353 | ctx=(BIO_OK_CTX *)b->ptr; | ||
354 | |||
355 | switch (cmd) | ||
356 | { | ||
357 | case BIO_CTRL_RESET: | ||
358 | ctx->buf_len=0; | ||
359 | ctx->buf_off=0; | ||
360 | ctx->buf_len_save=0; | ||
361 | ctx->buf_off_save=0; | ||
362 | ctx->cont=1; | ||
363 | ctx->finished=0; | ||
364 | ctx->blockout= 0; | ||
365 | ctx->sigio=1; | ||
366 | ret=BIO_ctrl(b->next_bio,cmd,num,ptr); | ||
367 | break; | ||
368 | case BIO_CTRL_EOF: /* More to read */ | ||
369 | if (ctx->cont <= 0) | ||
370 | ret=1; | ||
371 | else | ||
372 | ret=BIO_ctrl(b->next_bio,cmd,num,ptr); | ||
373 | break; | ||
374 | case BIO_CTRL_PENDING: /* More to read in buffer */ | ||
375 | case BIO_CTRL_WPENDING: /* More to read in buffer */ | ||
376 | ret=ctx->blockout ? ctx->buf_len-ctx->buf_off : 0; | ||
377 | if (ret <= 0) | ||
378 | ret=BIO_ctrl(b->next_bio,cmd,num,ptr); | ||
379 | break; | ||
380 | case BIO_CTRL_FLUSH: | ||
381 | /* do a final write */ | ||
382 | if(ctx->blockout == 0) | ||
383 | block_out(b); | ||
384 | |||
385 | while (ctx->blockout) | ||
386 | { | ||
387 | i=ok_write(b,NULL,0); | ||
388 | if (i < 0) | ||
389 | { | ||
390 | ret=i; | ||
391 | break; | ||
392 | } | ||
393 | } | ||
394 | |||
395 | ctx->finished=1; | ||
396 | ctx->buf_off=ctx->buf_len=0; | ||
397 | ctx->cont=(int)ret; | ||
398 | |||
399 | /* Finally flush the underlying BIO */ | ||
400 | ret=BIO_ctrl(b->next_bio,cmd,num,ptr); | ||
401 | break; | ||
402 | case BIO_C_DO_STATE_MACHINE: | ||
403 | BIO_clear_retry_flags(b); | ||
404 | ret=BIO_ctrl(b->next_bio,cmd,num,ptr); | ||
405 | BIO_copy_next_retry(b); | ||
406 | break; | ||
407 | case BIO_CTRL_INFO: | ||
408 | ret=(long)ctx->cont; | ||
409 | break; | ||
410 | case BIO_C_SET_MD: | ||
411 | md=(EVP_MD *)ptr; | ||
412 | EVP_DigestInit(&(ctx->md),md); | ||
413 | b->init=1; | ||
414 | break; | ||
415 | case BIO_C_GET_MD: | ||
416 | if (b->init) | ||
417 | { | ||
418 | ppmd=(const EVP_MD **)ptr; | ||
419 | *ppmd=ctx->md.digest; | ||
420 | } | ||
421 | else | ||
422 | ret=0; | ||
423 | break; | ||
424 | default: | ||
425 | ret=BIO_ctrl(b->next_bio,cmd,num,ptr); | ||
426 | break; | ||
427 | } | ||
428 | return(ret); | ||
429 | } | ||
430 | |||
431 | static void longswap(void *_ptr, int len) | ||
432 | { | ||
433 | #ifndef L_ENDIAN | ||
434 | int i; | ||
435 | char *ptr=_ptr; | ||
436 | |||
437 | for(i= 0;i < len;i+= 4){ | ||
438 | *((unsigned long *)&(ptr[i]))= swapem(*((unsigned long *)&(ptr[i]))); | ||
439 | } | ||
440 | #endif | ||
441 | } | ||
442 | |||
443 | static void sig_out(BIO* b) | ||
444 | { | ||
445 | BIO_OK_CTX *ctx; | ||
446 | EVP_MD_CTX *md; | ||
447 | |||
448 | ctx=(BIO_OK_CTX *)b->ptr; | ||
449 | md= &(ctx->md); | ||
450 | |||
451 | if(ctx->buf_len+ 2* md->digest->md_size > OK_BLOCK_SIZE) return; | ||
452 | |||
453 | EVP_DigestInit(md, md->digest); | ||
454 | RAND_bytes(&(md->md.base[0]), md->digest->md_size); | ||
455 | memcpy(&(ctx->buf[ctx->buf_len]), &(md->md.base[0]), md->digest->md_size); | ||
456 | longswap(&(ctx->buf[ctx->buf_len]), md->digest->md_size); | ||
457 | ctx->buf_len+= md->digest->md_size; | ||
458 | |||
459 | EVP_DigestUpdate(md, (unsigned char*)WELLKNOWN, strlen(WELLKNOWN)); | ||
460 | md->digest->final(&(ctx->buf[ctx->buf_len]), &(md->md.base[0])); | ||
461 | ctx->buf_len+= md->digest->md_size; | ||
462 | ctx->blockout= 1; | ||
463 | ctx->sigio= 0; | ||
464 | } | ||
465 | |||
466 | static void sig_in(BIO* b) | ||
467 | { | ||
468 | BIO_OK_CTX *ctx; | ||
469 | EVP_MD_CTX *md; | ||
470 | unsigned char tmp[EVP_MAX_MD_SIZE]; | ||
471 | int ret= 0; | ||
472 | |||
473 | ctx=(BIO_OK_CTX *)b->ptr; | ||
474 | md= &(ctx->md); | ||
475 | |||
476 | if(ctx->buf_len- ctx->buf_off < 2* md->digest->md_size) return; | ||
477 | |||
478 | EVP_DigestInit(md, md->digest); | ||
479 | memcpy(&(md->md.base[0]), &(ctx->buf[ctx->buf_off]), md->digest->md_size); | ||
480 | longswap(&(md->md.base[0]), md->digest->md_size); | ||
481 | ctx->buf_off+= md->digest->md_size; | ||
482 | |||
483 | EVP_DigestUpdate(md, (unsigned char*)WELLKNOWN, strlen(WELLKNOWN)); | ||
484 | md->digest->final(tmp, &(md->md.base[0])); | ||
485 | ret= memcmp(&(ctx->buf[ctx->buf_off]), tmp, md->digest->md_size) == 0; | ||
486 | ctx->buf_off+= md->digest->md_size; | ||
487 | if(ret == 1) | ||
488 | { | ||
489 | ctx->sigio= 0; | ||
490 | if(ctx->buf_len != ctx->buf_off) | ||
491 | { | ||
492 | memmove(ctx->buf, &(ctx->buf[ctx->buf_off]), ctx->buf_len- ctx->buf_off); | ||
493 | } | ||
494 | ctx->buf_len-= ctx->buf_off; | ||
495 | ctx->buf_off= 0; | ||
496 | } | ||
497 | else | ||
498 | { | ||
499 | ctx->cont= 0; | ||
500 | } | ||
501 | } | ||
502 | |||
503 | static void block_out(BIO* b) | ||
504 | { | ||
505 | BIO_OK_CTX *ctx; | ||
506 | EVP_MD_CTX *md; | ||
507 | unsigned long tl; | ||
508 | |||
509 | ctx=(BIO_OK_CTX *)b->ptr; | ||
510 | md= &(ctx->md); | ||
511 | |||
512 | tl= ctx->buf_len- OK_BLOCK_BLOCK; | ||
513 | tl= swapem(tl); | ||
514 | memcpy(ctx->buf, &tl, OK_BLOCK_BLOCK); | ||
515 | tl= swapem(tl); | ||
516 | EVP_DigestUpdate(md, (unsigned char*) &(ctx->buf[OK_BLOCK_BLOCK]), tl); | ||
517 | md->digest->final(&(ctx->buf[ctx->buf_len]), &(md->md.base[0])); | ||
518 | ctx->buf_len+= md->digest->md_size; | ||
519 | ctx->blockout= 1; | ||
520 | } | ||
521 | |||
522 | static void block_in(BIO* b) | ||
523 | { | ||
524 | BIO_OK_CTX *ctx; | ||
525 | EVP_MD_CTX *md; | ||
526 | long tl= 0; | ||
527 | unsigned char tmp[EVP_MAX_MD_SIZE]; | ||
528 | |||
529 | ctx=(BIO_OK_CTX *)b->ptr; | ||
530 | md= &(ctx->md); | ||
531 | |||
532 | memcpy(&tl, ctx->buf, OK_BLOCK_BLOCK); | ||
533 | tl= swapem(tl); | ||
534 | if (ctx->buf_len < tl+ OK_BLOCK_BLOCK+ md->digest->md_size) return; | ||
535 | |||
536 | EVP_DigestUpdate(md, (unsigned char*) &(ctx->buf[OK_BLOCK_BLOCK]), tl); | ||
537 | md->digest->final(tmp, &(md->md.base[0])); | ||
538 | if(memcmp(&(ctx->buf[tl+ OK_BLOCK_BLOCK]), tmp, md->digest->md_size) == 0) | ||
539 | { | ||
540 | /* there might be parts from next block lurking around ! */ | ||
541 | ctx->buf_off_save= tl+ OK_BLOCK_BLOCK+ md->digest->md_size; | ||
542 | ctx->buf_len_save= ctx->buf_len; | ||
543 | ctx->buf_off= OK_BLOCK_BLOCK; | ||
544 | ctx->buf_len= tl+ OK_BLOCK_BLOCK; | ||
545 | ctx->blockout= 1; | ||
546 | } | ||
547 | else | ||
548 | { | ||
549 | ctx->cont= 0; | ||
550 | } | ||
551 | } | ||
552 | |||
diff --git a/src/lib/libcrypto/evp/c_all.c b/src/lib/libcrypto/evp/c_all.c index e77d1c896b..a4d3b43fb9 100644 --- a/src/lib/libcrypto/evp/c_all.c +++ b/src/lib/libcrypto/evp/c_all.c | |||
@@ -58,16 +58,17 @@ | |||
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include "evp.h" | 61 | #include <openssl/evp.h> |
62 | #include "objects.h" | 62 | #include <openssl/pkcs12.h> |
63 | #include <openssl/objects.h> | ||
63 | 64 | ||
64 | void SSLeay_add_all_algorithms() | 65 | void SSLeay_add_all_algorithms(void) |
65 | { | 66 | { |
66 | SSLeay_add_all_ciphers(); | 67 | SSLeay_add_all_ciphers(); |
67 | SSLeay_add_all_digests(); | 68 | SSLeay_add_all_digests(); |
68 | } | 69 | } |
69 | 70 | ||
70 | void SSLeay_add_all_ciphers() | 71 | void SSLeay_add_all_ciphers(void) |
71 | { | 72 | { |
72 | #ifndef NO_DES | 73 | #ifndef NO_DES |
73 | EVP_add_cipher(EVP_des_cfb()); | 74 | EVP_add_cipher(EVP_des_cfb()); |
@@ -79,16 +80,16 @@ void SSLeay_add_all_ciphers() | |||
79 | EVP_add_cipher(EVP_des_ede3_ofb()); | 80 | EVP_add_cipher(EVP_des_ede3_ofb()); |
80 | 81 | ||
81 | EVP_add_cipher(EVP_desx_cbc()); | 82 | EVP_add_cipher(EVP_desx_cbc()); |
82 | EVP_add_alias(SN_desx_cbc,"DESX"); | 83 | EVP_add_cipher_alias(SN_desx_cbc,"DESX"); |
83 | EVP_add_alias(SN_desx_cbc,"desx"); | 84 | EVP_add_cipher_alias(SN_desx_cbc,"desx"); |
84 | 85 | ||
85 | EVP_add_cipher(EVP_des_cbc()); | 86 | EVP_add_cipher(EVP_des_cbc()); |
86 | EVP_add_alias(SN_des_cbc,"DES"); | 87 | EVP_add_cipher_alias(SN_des_cbc,"DES"); |
87 | EVP_add_alias(SN_des_cbc,"des"); | 88 | EVP_add_cipher_alias(SN_des_cbc,"des"); |
88 | EVP_add_cipher(EVP_des_ede_cbc()); | 89 | EVP_add_cipher(EVP_des_ede_cbc()); |
89 | EVP_add_cipher(EVP_des_ede3_cbc()); | 90 | EVP_add_cipher(EVP_des_ede3_cbc()); |
90 | EVP_add_alias(SN_des_ede3_cbc,"DES3"); | 91 | EVP_add_cipher_alias(SN_des_ede3_cbc,"DES3"); |
91 | EVP_add_alias(SN_des_ede3_cbc,"des3"); | 92 | EVP_add_cipher_alias(SN_des_ede3_cbc,"des3"); |
92 | 93 | ||
93 | EVP_add_cipher(EVP_des_ecb()); | 94 | EVP_add_cipher(EVP_des_ecb()); |
94 | EVP_add_cipher(EVP_des_ede()); | 95 | EVP_add_cipher(EVP_des_ede()); |
@@ -105,8 +106,8 @@ void SSLeay_add_all_ciphers() | |||
105 | EVP_add_cipher(EVP_idea_cfb()); | 106 | EVP_add_cipher(EVP_idea_cfb()); |
106 | EVP_add_cipher(EVP_idea_ofb()); | 107 | EVP_add_cipher(EVP_idea_ofb()); |
107 | EVP_add_cipher(EVP_idea_cbc()); | 108 | EVP_add_cipher(EVP_idea_cbc()); |
108 | EVP_add_alias(SN_idea_cbc,"IDEA"); | 109 | EVP_add_cipher_alias(SN_idea_cbc,"IDEA"); |
109 | EVP_add_alias(SN_idea_cbc,"idea"); | 110 | EVP_add_cipher_alias(SN_idea_cbc,"idea"); |
110 | #endif | 111 | #endif |
111 | 112 | ||
112 | #ifndef NO_RC2 | 113 | #ifndef NO_RC2 |
@@ -115,18 +116,19 @@ void SSLeay_add_all_ciphers() | |||
115 | EVP_add_cipher(EVP_rc2_ofb()); | 116 | EVP_add_cipher(EVP_rc2_ofb()); |
116 | EVP_add_cipher(EVP_rc2_cbc()); | 117 | EVP_add_cipher(EVP_rc2_cbc()); |
117 | EVP_add_cipher(EVP_rc2_40_cbc()); | 118 | EVP_add_cipher(EVP_rc2_40_cbc()); |
118 | EVP_add_alias(SN_rc2_cbc,"RC2"); | 119 | EVP_add_cipher(EVP_rc2_64_cbc()); |
119 | EVP_add_alias(SN_rc2_cbc,"rc2"); | 120 | EVP_add_cipher_alias(SN_rc2_cbc,"RC2"); |
121 | EVP_add_cipher_alias(SN_rc2_cbc,"rc2"); | ||
120 | #endif | 122 | #endif |
121 | 123 | ||
122 | #ifndef NO_BLOWFISH | 124 | #ifndef NO_BF |
123 | EVP_add_cipher(EVP_bf_ecb()); | 125 | EVP_add_cipher(EVP_bf_ecb()); |
124 | EVP_add_cipher(EVP_bf_cfb()); | 126 | EVP_add_cipher(EVP_bf_cfb()); |
125 | EVP_add_cipher(EVP_bf_ofb()); | 127 | EVP_add_cipher(EVP_bf_ofb()); |
126 | EVP_add_cipher(EVP_bf_cbc()); | 128 | EVP_add_cipher(EVP_bf_cbc()); |
127 | EVP_add_alias(SN_bf_cbc,"BF"); | 129 | EVP_add_cipher_alias(SN_bf_cbc,"BF"); |
128 | EVP_add_alias(SN_bf_cbc,"bf"); | 130 | EVP_add_cipher_alias(SN_bf_cbc,"bf"); |
129 | EVP_add_alias(SN_bf_cbc,"blowfish"); | 131 | EVP_add_cipher_alias(SN_bf_cbc,"blowfish"); |
130 | #endif | 132 | #endif |
131 | 133 | ||
132 | #ifndef NO_CAST | 134 | #ifndef NO_CAST |
@@ -134,10 +136,10 @@ void SSLeay_add_all_ciphers() | |||
134 | EVP_add_cipher(EVP_cast5_cfb()); | 136 | EVP_add_cipher(EVP_cast5_cfb()); |
135 | EVP_add_cipher(EVP_cast5_ofb()); | 137 | EVP_add_cipher(EVP_cast5_ofb()); |
136 | EVP_add_cipher(EVP_cast5_cbc()); | 138 | EVP_add_cipher(EVP_cast5_cbc()); |
137 | EVP_add_alias(SN_cast5_cbc,"CAST"); | 139 | EVP_add_cipher_alias(SN_cast5_cbc,"CAST"); |
138 | EVP_add_alias(SN_cast5_cbc,"cast"); | 140 | EVP_add_cipher_alias(SN_cast5_cbc,"cast"); |
139 | EVP_add_alias(SN_cast5_cbc,"CAST-cbc"); | 141 | EVP_add_cipher_alias(SN_cast5_cbc,"CAST-cbc"); |
140 | EVP_add_alias(SN_cast5_cbc,"cast-cbc"); | 142 | EVP_add_cipher_alias(SN_cast5_cbc,"cast-cbc"); |
141 | #endif | 143 | #endif |
142 | 144 | ||
143 | #ifndef NO_RC5 | 145 | #ifndef NO_RC5 |
@@ -145,23 +147,21 @@ void SSLeay_add_all_ciphers() | |||
145 | EVP_add_cipher(EVP_rc5_32_12_16_cfb()); | 147 | EVP_add_cipher(EVP_rc5_32_12_16_cfb()); |
146 | EVP_add_cipher(EVP_rc5_32_12_16_ofb()); | 148 | EVP_add_cipher(EVP_rc5_32_12_16_ofb()); |
147 | EVP_add_cipher(EVP_rc5_32_12_16_cbc()); | 149 | EVP_add_cipher(EVP_rc5_32_12_16_cbc()); |
148 | EVP_add_alias(SN_rc5_cbc,"rc5"); | 150 | EVP_add_cipher_alias(SN_rc5_cbc,"rc5"); |
149 | EVP_add_alias(SN_rc5_cbc,"RC5"); | 151 | EVP_add_cipher_alias(SN_rc5_cbc,"RC5"); |
150 | EVP_add_alias(SN_rc5_cbc,"rc5-cbc"); | ||
151 | EVP_add_alias(SN_rc5_cbc,"RC5-cbc"); | ||
152 | #endif | 152 | #endif |
153 | } | 153 | } |
154 | 154 | ||
155 | 155 | ||
156 | void SSLeay_add_all_digests() | 156 | void SSLeay_add_all_digests(void) |
157 | { | 157 | { |
158 | #ifndef NO_MD2 | 158 | #ifndef NO_MD2 |
159 | EVP_add_digest(EVP_md2()); | 159 | EVP_add_digest(EVP_md2()); |
160 | #endif | 160 | #endif |
161 | #ifndef NO_MD5 | 161 | #ifndef NO_MD5 |
162 | EVP_add_digest(EVP_md5()); | 162 | EVP_add_digest(EVP_md5()); |
163 | EVP_add_alias(SN_md5,"ssl2-md5"); | 163 | EVP_add_digest_alias(SN_md5,"ssl2-md5"); |
164 | EVP_add_alias(SN_md5,"ssl3-md5"); | 164 | EVP_add_digest_alias(SN_md5,"ssl3-md5"); |
165 | #endif | 165 | #endif |
166 | #ifndef NO_SHA | 166 | #ifndef NO_SHA |
167 | EVP_add_digest(EVP_sha()); | 167 | EVP_add_digest(EVP_sha()); |
@@ -169,22 +169,25 @@ void SSLeay_add_all_digests() | |||
169 | EVP_add_digest(EVP_dss()); | 169 | EVP_add_digest(EVP_dss()); |
170 | #endif | 170 | #endif |
171 | #endif | 171 | #endif |
172 | #ifndef NO_SHA1 | 172 | #ifndef NO_SHA |
173 | EVP_add_digest(EVP_sha1()); | 173 | EVP_add_digest(EVP_sha1()); |
174 | EVP_add_alias(SN_sha1,"ssl3-sha1"); | 174 | EVP_add_digest_alias(SN_sha1,"ssl3-sha1"); |
175 | EVP_add_digest_alias(SN_sha1WithRSAEncryption,SN_sha1WithRSA); | ||
175 | #ifndef NO_DSA | 176 | #ifndef NO_DSA |
176 | EVP_add_digest(EVP_dss1()); | 177 | EVP_add_digest(EVP_dss1()); |
177 | EVP_add_alias(SN_dsaWithSHA1,SN_dsaWithSHA1_2); | 178 | EVP_add_digest_alias(SN_dsaWithSHA1,SN_dsaWithSHA1_2); |
178 | EVP_add_alias(SN_dsaWithSHA1,"DSS1"); | 179 | EVP_add_digest_alias(SN_dsaWithSHA1,"DSS1"); |
179 | EVP_add_alias(SN_dsaWithSHA1,"dss1"); | 180 | EVP_add_digest_alias(SN_dsaWithSHA1,"dss1"); |
180 | #endif | 181 | #endif |
181 | #endif | 182 | #endif |
182 | #if !defined(NO_MDC2) && !defined(NO_DES) | 183 | #if !defined(NO_MDC2) && !defined(NO_DES) |
183 | EVP_add_digest(EVP_mdc2()); | 184 | EVP_add_digest(EVP_mdc2()); |
184 | #endif | 185 | #endif |
185 | #ifndef NO_RIPEMD160 | 186 | #ifndef NO_RIPEMD |
186 | EVP_add_digest(EVP_ripemd160()); | 187 | EVP_add_digest(EVP_ripemd160()); |
187 | EVP_add_alias(SN_ripemd160,"ripemd"); | 188 | EVP_add_digest_alias(SN_ripemd160,"ripemd"); |
188 | EVP_add_alias(SN_ripemd160,"rmd160"); | 189 | EVP_add_digest_alias(SN_ripemd160,"rmd160"); |
189 | #endif | 190 | #endif |
191 | PKCS12_PBE_add(); | ||
192 | PKCS5_PBE_add(); | ||
190 | } | 193 | } |
diff --git a/src/lib/libcrypto/evp/digest.c b/src/lib/libcrypto/evp/digest.c index d65f0036f7..c560733568 100644 --- a/src/lib/libcrypto/evp/digest.c +++ b/src/lib/libcrypto/evp/digest.c | |||
@@ -58,32 +58,35 @@ | |||
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include "objects.h" | 61 | #include <openssl/objects.h> |
62 | #include "evp.h" | 62 | #include <openssl/evp.h> |
63 | 63 | ||
64 | void EVP_DigestInit(ctx,type) | 64 | void EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type) |
65 | EVP_MD_CTX *ctx; | ||
66 | EVP_MD *type; | ||
67 | { | 65 | { |
68 | ctx->digest=type; | 66 | ctx->digest=type; |
69 | type->init(&(ctx->md)); | 67 | type->init(&(ctx->md)); |
70 | } | 68 | } |
71 | 69 | ||
72 | void EVP_DigestUpdate(ctx,data,count) | 70 | void EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *data, |
73 | EVP_MD_CTX *ctx; | 71 | unsigned int count) |
74 | unsigned char *data; | ||
75 | unsigned int count; | ||
76 | { | 72 | { |
77 | ctx->digest->update(&(ctx->md.base[0]),data,(unsigned long)count); | 73 | ctx->digest->update(&(ctx->md.base[0]),data,(unsigned long)count); |
78 | } | 74 | } |
79 | 75 | ||
80 | void EVP_DigestFinal(ctx,md,size) | 76 | void EVP_DigestFinal(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *size) |
81 | EVP_MD_CTX *ctx; | ||
82 | unsigned char *md; | ||
83 | unsigned int *size; | ||
84 | { | 77 | { |
85 | ctx->digest->final(md,&(ctx->md.base[0])); | 78 | ctx->digest->final(md,&(ctx->md.base[0])); |
86 | if (size != NULL) | 79 | if (size != NULL) |
87 | *size=ctx->digest->md_size; | 80 | *size=ctx->digest->md_size; |
88 | memset(&(ctx->md),0,sizeof(ctx->md)); | 81 | memset(&(ctx->md),0,sizeof(ctx->md)); |
89 | } | 82 | } |
83 | |||
84 | int EVP_MD_CTX_copy(EVP_MD_CTX *out, EVP_MD_CTX *in) | ||
85 | { | ||
86 | if ((in == NULL) || (in->digest == NULL)) { | ||
87 | EVPerr(EVP_F_EVP_MD_CTX_COPY,EVP_R_INPUT_NOT_INITIALIZED); | ||
88 | return 0; | ||
89 | } | ||
90 | memcpy((char *)out,(char *)in,in->digest->ctx_size); | ||
91 | return 1; | ||
92 | } | ||
diff --git a/src/lib/libcrypto/evp/e_cbc_3d.c b/src/lib/libcrypto/evp/e_cbc_3d.c index 5761bf186a..02ccc6dc90 100644 --- a/src/lib/libcrypto/evp/e_cbc_3d.c +++ b/src/lib/libcrypto/evp/e_cbc_3d.c | |||
@@ -56,24 +56,18 @@ | |||
56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
57 | */ | 57 | */ |
58 | 58 | ||
59 | #ifndef NO_DES | ||
59 | #include <stdio.h> | 60 | #include <stdio.h> |
60 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
61 | #include "evp.h" | 62 | #include <openssl/evp.h> |
62 | #include "objects.h" | 63 | #include <openssl/objects.h> |
63 | 64 | ||
64 | #ifndef NOPROTO | ||
65 | static void des_cbc_ede_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, | 65 | static void des_cbc_ede_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
66 | unsigned char *iv,int enc); | 66 | unsigned char *iv,int enc); |
67 | static void des_cbc_ede3_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, | 67 | static void des_cbc_ede3_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
68 | unsigned char *iv,int enc); | 68 | unsigned char *iv,int enc); |
69 | static void des_cbc_ede_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 69 | static void des_cbc_ede_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
70 | unsigned char *in, unsigned int inl); | 70 | unsigned char *in, unsigned int inl); |
71 | #else | ||
72 | static void des_cbc_ede_init_key(); | ||
73 | static void des_cbc_ede3_init_key(); | ||
74 | static void des_cbc_ede_cipher(); | ||
75 | #endif | ||
76 | |||
77 | static EVP_CIPHER d_cbc_ede_cipher2= | 71 | static EVP_CIPHER d_cbc_ede_cipher2= |
78 | { | 72 | { |
79 | NID_des_ede_cbc, | 73 | NID_des_ede_cbc, |
@@ -83,8 +77,8 @@ static EVP_CIPHER d_cbc_ede_cipher2= | |||
83 | NULL, | 77 | NULL, |
84 | sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ | 78 | sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ |
85 | sizeof((((EVP_CIPHER_CTX *)NULL)->c.des_ede)), | 79 | sizeof((((EVP_CIPHER_CTX *)NULL)->c.des_ede)), |
86 | EVP_CIPHER_get_asn1_iv, | ||
87 | EVP_CIPHER_set_asn1_iv, | 80 | EVP_CIPHER_set_asn1_iv, |
81 | EVP_CIPHER_get_asn1_iv, | ||
88 | }; | 82 | }; |
89 | 83 | ||
90 | static EVP_CIPHER d_cbc_ede_cipher3= | 84 | static EVP_CIPHER d_cbc_ede_cipher3= |
@@ -100,64 +94,58 @@ static EVP_CIPHER d_cbc_ede_cipher3= | |||
100 | EVP_CIPHER_get_asn1_iv, | 94 | EVP_CIPHER_get_asn1_iv, |
101 | }; | 95 | }; |
102 | 96 | ||
103 | EVP_CIPHER *EVP_des_ede_cbc() | 97 | EVP_CIPHER *EVP_des_ede_cbc(void) |
104 | { | 98 | { |
105 | return(&d_cbc_ede_cipher2); | 99 | return(&d_cbc_ede_cipher2); |
106 | } | 100 | } |
107 | 101 | ||
108 | EVP_CIPHER *EVP_des_ede3_cbc() | 102 | EVP_CIPHER *EVP_des_ede3_cbc(void) |
109 | { | 103 | { |
110 | return(&d_cbc_ede_cipher3); | 104 | return(&d_cbc_ede_cipher3); |
111 | } | 105 | } |
112 | 106 | ||
113 | static void des_cbc_ede_init_key(ctx,key,iv,enc) | 107 | static void des_cbc_ede_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
114 | EVP_CIPHER_CTX *ctx; | 108 | unsigned char *iv, int enc) |
115 | unsigned char *key; | ||
116 | unsigned char *iv; | ||
117 | int enc; | ||
118 | { | 109 | { |
110 | des_cblock *deskey = (des_cblock *)key; | ||
111 | |||
119 | if (iv != NULL) | 112 | if (iv != NULL) |
120 | memcpy(&(ctx->oiv[0]),iv,8); | 113 | memcpy(&(ctx->oiv[0]),iv,8); |
121 | memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); | 114 | memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); |
122 | 115 | ||
123 | if (key != NULL) | 116 | if (deskey != NULL) |
124 | { | 117 | { |
125 | des_set_key((des_cblock *)key,ctx->c.des_ede.ks1); | 118 | des_set_key(&deskey[0],ctx->c.des_ede.ks1); |
126 | des_set_key((des_cblock *)&(key[8]),ctx->c.des_ede.ks2); | 119 | des_set_key(&deskey[1],ctx->c.des_ede.ks2); |
127 | memcpy( (char *)ctx->c.des_ede.ks3, | 120 | memcpy( (char *)ctx->c.des_ede.ks3, |
128 | (char *)ctx->c.des_ede.ks1, | 121 | (char *)ctx->c.des_ede.ks1, |
129 | sizeof(ctx->c.des_ede.ks1)); | 122 | sizeof(ctx->c.des_ede.ks1)); |
130 | } | 123 | } |
131 | } | 124 | } |
132 | 125 | ||
133 | static void des_cbc_ede3_init_key(ctx,key,iv,enc) | 126 | static void des_cbc_ede3_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
134 | EVP_CIPHER_CTX *ctx; | 127 | unsigned char *iv, int enc) |
135 | unsigned char *key; | ||
136 | unsigned char *iv; | ||
137 | int enc; | ||
138 | { | 128 | { |
129 | des_cblock *deskey = (des_cblock *)key; | ||
130 | |||
139 | if (iv != NULL) | 131 | if (iv != NULL) |
140 | memcpy(&(ctx->oiv[0]),iv,8); | 132 | memcpy(&(ctx->oiv[0]),iv,8); |
141 | memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); | 133 | memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); |
142 | 134 | ||
143 | if (key != NULL) | 135 | if (deskey != NULL) |
144 | { | 136 | { |
145 | des_set_key((des_cblock *)key,ctx->c.des_ede.ks1); | 137 | des_set_key(&deskey[0],ctx->c.des_ede.ks1); |
146 | des_set_key((des_cblock *)&(key[8]),ctx->c.des_ede.ks2); | 138 | des_set_key(&deskey[1],ctx->c.des_ede.ks2); |
147 | des_set_key((des_cblock *)&(key[16]),ctx->c.des_ede.ks3); | 139 | des_set_key(&deskey[2],ctx->c.des_ede.ks3); |
148 | } | 140 | } |
149 | } | 141 | } |
150 | 142 | ||
151 | static void des_cbc_ede_cipher(ctx,out,in,inl) | 143 | static void des_cbc_ede_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
152 | EVP_CIPHER_CTX *ctx; | 144 | unsigned char *in, unsigned int inl) |
153 | unsigned char *out; | ||
154 | unsigned char *in; | ||
155 | unsigned int inl; | ||
156 | { | 145 | { |
157 | des_ede3_cbc_encrypt( | 146 | des_ede3_cbc_encrypt(in,out,inl, ctx->c.des_ede.ks1, |
158 | (des_cblock *)in,(des_cblock *)out, | ||
159 | (long)inl, ctx->c.des_ede.ks1, | ||
160 | ctx->c.des_ede.ks2,ctx->c.des_ede.ks3, | 147 | ctx->c.des_ede.ks2,ctx->c.des_ede.ks3, |
161 | (des_cblock *)&(ctx->iv[0]), | 148 | (des_cblock *) &(ctx->iv[0]), |
162 | ctx->encrypt); | 149 | ctx->encrypt); |
163 | } | 150 | } |
151 | #endif | ||
diff --git a/src/lib/libcrypto/evp/e_cbc_bf.c b/src/lib/libcrypto/evp/e_cbc_bf.c index be605f4a13..9bcba3c516 100644 --- a/src/lib/libcrypto/evp/e_cbc_bf.c +++ b/src/lib/libcrypto/evp/e_cbc_bf.c | |||
@@ -56,23 +56,16 @@ | |||
56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
57 | */ | 57 | */ |
58 | 58 | ||
59 | #ifndef NO_BLOWFISH | 59 | #ifndef NO_BF |
60 | |||
61 | #include <stdio.h> | 60 | #include <stdio.h> |
62 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
63 | #include "evp.h" | 62 | #include <openssl/evp.h> |
64 | #include "objects.h" | 63 | #include <openssl/objects.h> |
65 | 64 | ||
66 | #ifndef NOPROTO | ||
67 | static void bf_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, | 65 | static void bf_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
68 | unsigned char *iv,int enc); | 66 | unsigned char *iv,int enc); |
69 | static void bf_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 67 | static void bf_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
70 | unsigned char *in, unsigned int inl); | 68 | unsigned char *in, unsigned int inl); |
71 | #else | ||
72 | static void bf_cbc_init_key(); | ||
73 | static void bf_cbc_cipher(); | ||
74 | #endif | ||
75 | |||
76 | static EVP_CIPHER bfish_cbc_cipher= | 69 | static EVP_CIPHER bfish_cbc_cipher= |
77 | { | 70 | { |
78 | NID_bf_cbc, | 71 | NID_bf_cbc, |
@@ -82,20 +75,17 @@ static EVP_CIPHER bfish_cbc_cipher= | |||
82 | NULL, | 75 | NULL, |
83 | sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ | 76 | sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ |
84 | sizeof((((EVP_CIPHER_CTX *)NULL)->c.bf_ks)), | 77 | sizeof((((EVP_CIPHER_CTX *)NULL)->c.bf_ks)), |
85 | EVP_CIPHER_get_asn1_iv, | ||
86 | EVP_CIPHER_set_asn1_iv, | 78 | EVP_CIPHER_set_asn1_iv, |
79 | EVP_CIPHER_get_asn1_iv, | ||
87 | }; | 80 | }; |
88 | 81 | ||
89 | EVP_CIPHER *EVP_bf_cbc() | 82 | EVP_CIPHER *EVP_bf_cbc(void) |
90 | { | 83 | { |
91 | return(&bfish_cbc_cipher); | 84 | return(&bfish_cbc_cipher); |
92 | } | 85 | } |
93 | 86 | ||
94 | static void bf_cbc_init_key(ctx,key,iv,enc) | 87 | static void bf_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
95 | EVP_CIPHER_CTX *ctx; | 88 | unsigned char *iv, int enc) |
96 | unsigned char *key; | ||
97 | unsigned char *iv; | ||
98 | int enc; | ||
99 | { | 89 | { |
100 | if (iv != NULL) | 90 | if (iv != NULL) |
101 | memcpy(&(ctx->oiv[0]),iv,8); | 91 | memcpy(&(ctx->oiv[0]),iv,8); |
@@ -104,11 +94,8 @@ int enc; | |||
104 | BF_set_key(&(ctx->c.bf_ks),EVP_BLOWFISH_KEY_SIZE,key); | 94 | BF_set_key(&(ctx->c.bf_ks),EVP_BLOWFISH_KEY_SIZE,key); |
105 | } | 95 | } |
106 | 96 | ||
107 | static void bf_cbc_cipher(ctx,out,in,inl) | 97 | static void bf_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
108 | EVP_CIPHER_CTX *ctx; | 98 | unsigned char *in, unsigned int inl) |
109 | unsigned char *out; | ||
110 | unsigned char *in; | ||
111 | unsigned int inl; | ||
112 | { | 99 | { |
113 | BF_cbc_encrypt( | 100 | BF_cbc_encrypt( |
114 | in,out,(long)inl, | 101 | in,out,(long)inl, |
diff --git a/src/lib/libcrypto/evp/e_cbc_c.c b/src/lib/libcrypto/evp/e_cbc_c.c index b50c7874b3..6845b0b44c 100644 --- a/src/lib/libcrypto/evp/e_cbc_c.c +++ b/src/lib/libcrypto/evp/e_cbc_c.c | |||
@@ -60,19 +60,13 @@ | |||
60 | 60 | ||
61 | #include <stdio.h> | 61 | #include <stdio.h> |
62 | #include "cryptlib.h" | 62 | #include "cryptlib.h" |
63 | #include "evp.h" | 63 | #include <openssl/evp.h> |
64 | #include "objects.h" | 64 | #include <openssl/objects.h> |
65 | 65 | ||
66 | #ifndef NOPROTO | ||
67 | static void cast_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, | 66 | static void cast_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
68 | unsigned char *iv,int enc); | 67 | unsigned char *iv,int enc); |
69 | static void cast_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 68 | static void cast_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
70 | unsigned char *in, unsigned int inl); | 69 | unsigned char *in, unsigned int inl); |
71 | #else | ||
72 | static void cast_cbc_init_key(); | ||
73 | static void cast_cbc_cipher(); | ||
74 | #endif | ||
75 | |||
76 | static EVP_CIPHER cast5_cbc_cipher= | 70 | static EVP_CIPHER cast5_cbc_cipher= |
77 | { | 71 | { |
78 | NID_cast5_cbc, | 72 | NID_cast5_cbc, |
@@ -82,20 +76,17 @@ static EVP_CIPHER cast5_cbc_cipher= | |||
82 | NULL, | 76 | NULL, |
83 | sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ | 77 | sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ |
84 | sizeof((((EVP_CIPHER_CTX *)NULL)->c.cast_ks)), | 78 | sizeof((((EVP_CIPHER_CTX *)NULL)->c.cast_ks)), |
85 | EVP_CIPHER_get_asn1_iv, | ||
86 | EVP_CIPHER_set_asn1_iv, | 79 | EVP_CIPHER_set_asn1_iv, |
80 | EVP_CIPHER_get_asn1_iv, | ||
87 | }; | 81 | }; |
88 | 82 | ||
89 | EVP_CIPHER *EVP_cast5_cbc() | 83 | EVP_CIPHER *EVP_cast5_cbc(void) |
90 | { | 84 | { |
91 | return(&cast5_cbc_cipher); | 85 | return(&cast5_cbc_cipher); |
92 | } | 86 | } |
93 | 87 | ||
94 | static void cast_cbc_init_key(ctx,key,iv,enc) | 88 | static void cast_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
95 | EVP_CIPHER_CTX *ctx; | 89 | unsigned char *iv, int enc) |
96 | unsigned char *key; | ||
97 | unsigned char *iv; | ||
98 | int enc; | ||
99 | { | 90 | { |
100 | if (iv != NULL) | 91 | if (iv != NULL) |
101 | memcpy(&(ctx->oiv[0]),iv,8); | 92 | memcpy(&(ctx->oiv[0]),iv,8); |
@@ -104,11 +95,8 @@ int enc; | |||
104 | CAST_set_key(&(ctx->c.cast_ks),EVP_CAST5_KEY_SIZE,key); | 95 | CAST_set_key(&(ctx->c.cast_ks),EVP_CAST5_KEY_SIZE,key); |
105 | } | 96 | } |
106 | 97 | ||
107 | static void cast_cbc_cipher(ctx,out,in,inl) | 98 | static void cast_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
108 | EVP_CIPHER_CTX *ctx; | 99 | unsigned char *in, unsigned int inl) |
109 | unsigned char *out; | ||
110 | unsigned char *in; | ||
111 | unsigned int inl; | ||
112 | { | 100 | { |
113 | CAST_cbc_encrypt( | 101 | CAST_cbc_encrypt( |
114 | in,out,(long)inl, | 102 | in,out,(long)inl, |
diff --git a/src/lib/libcrypto/evp/e_cbc_d.c b/src/lib/libcrypto/evp/e_cbc_d.c index c67706e3a0..9203f3f52d 100644 --- a/src/lib/libcrypto/evp/e_cbc_d.c +++ b/src/lib/libcrypto/evp/e_cbc_d.c | |||
@@ -56,21 +56,16 @@ | |||
56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
57 | */ | 57 | */ |
58 | 58 | ||
59 | #ifndef NO_DES | ||
59 | #include <stdio.h> | 60 | #include <stdio.h> |
60 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
61 | #include "evp.h" | 62 | #include <openssl/evp.h> |
62 | #include "objects.h" | 63 | #include <openssl/objects.h> |
63 | 64 | ||
64 | #ifndef NOPROTO | ||
65 | static void des_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, | 65 | static void des_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
66 | unsigned char *iv,int enc); | 66 | unsigned char *iv,int enc); |
67 | static void des_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 67 | static void des_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
68 | unsigned char *in, unsigned int inl); | 68 | unsigned char *in, unsigned int inl); |
69 | #else | ||
70 | static void des_cbc_init_key(); | ||
71 | static void des_cbc_cipher(); | ||
72 | #endif | ||
73 | |||
74 | static EVP_CIPHER d_cbc_cipher= | 69 | static EVP_CIPHER d_cbc_cipher= |
75 | { | 70 | { |
76 | NID_des_cbc, | 71 | NID_des_cbc, |
@@ -80,37 +75,32 @@ static EVP_CIPHER d_cbc_cipher= | |||
80 | NULL, | 75 | NULL, |
81 | sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ | 76 | sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ |
82 | sizeof((((EVP_CIPHER_CTX *)NULL)->c.des_ks)), | 77 | sizeof((((EVP_CIPHER_CTX *)NULL)->c.des_ks)), |
83 | EVP_CIPHER_get_asn1_iv, | ||
84 | EVP_CIPHER_set_asn1_iv, | 78 | EVP_CIPHER_set_asn1_iv, |
79 | EVP_CIPHER_get_asn1_iv, | ||
85 | }; | 80 | }; |
86 | 81 | ||
87 | EVP_CIPHER *EVP_des_cbc() | 82 | EVP_CIPHER *EVP_des_cbc(void) |
88 | { | 83 | { |
89 | return(&d_cbc_cipher); | 84 | return(&d_cbc_cipher); |
90 | } | 85 | } |
91 | 86 | ||
92 | static void des_cbc_init_key(ctx,key,iv,enc) | 87 | static void des_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
93 | EVP_CIPHER_CTX *ctx; | 88 | unsigned char *iv, int enc) |
94 | unsigned char *key; | ||
95 | unsigned char *iv; | ||
96 | int enc; | ||
97 | { | 89 | { |
90 | des_cblock *deskey = (des_cblock *)key; | ||
91 | |||
98 | if (iv != NULL) | 92 | if (iv != NULL) |
99 | memcpy(&(ctx->oiv[0]),iv,8); | 93 | memcpy(&(ctx->oiv[0]),iv,8); |
100 | memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); | 94 | memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); |
101 | if (key != NULL) | 95 | if (deskey != NULL) |
102 | des_set_key((des_cblock *)key,ctx->c.des_ks); | 96 | des_set_key(deskey,ctx->c.des_ks); |
103 | } | 97 | } |
104 | 98 | ||
105 | static void des_cbc_cipher(ctx,out,in,inl) | 99 | static void des_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
106 | EVP_CIPHER_CTX *ctx; | 100 | unsigned char *in, unsigned int inl) |
107 | unsigned char *out; | ||
108 | unsigned char *in; | ||
109 | unsigned int inl; | ||
110 | { | 101 | { |
111 | des_ncbc_encrypt( | 102 | des_ncbc_encrypt(in,out,inl,ctx->c.des_ks, |
112 | (des_cblock *)in,(des_cblock *)out, | ||
113 | (long)inl, ctx->c.des_ks, | ||
114 | (des_cblock *)&(ctx->iv[0]), | 103 | (des_cblock *)&(ctx->iv[0]), |
115 | ctx->encrypt); | 104 | ctx->encrypt); |
116 | } | 105 | } |
106 | #endif | ||
diff --git a/src/lib/libcrypto/evp/e_cbc_i.c b/src/lib/libcrypto/evp/e_cbc_i.c index 312ffcb721..34b44aa21f 100644 --- a/src/lib/libcrypto/evp/e_cbc_i.c +++ b/src/lib/libcrypto/evp/e_cbc_i.c | |||
@@ -60,19 +60,13 @@ | |||
60 | 60 | ||
61 | #include <stdio.h> | 61 | #include <stdio.h> |
62 | #include "cryptlib.h" | 62 | #include "cryptlib.h" |
63 | #include "evp.h" | 63 | #include <openssl/evp.h> |
64 | #include "objects.h" | 64 | #include <openssl/objects.h> |
65 | 65 | ||
66 | #ifndef NOPROTO | ||
67 | static void idea_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, | 66 | static void idea_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
68 | unsigned char *iv,int enc); | 67 | unsigned char *iv,int enc); |
69 | static void idea_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 68 | static void idea_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
70 | unsigned char *in, unsigned int inl); | 69 | unsigned char *in, unsigned int inl); |
71 | #else | ||
72 | static void idea_cbc_init_key(); | ||
73 | static void idea_cbc_cipher(); | ||
74 | #endif | ||
75 | |||
76 | static EVP_CIPHER i_cbc_cipher= | 70 | static EVP_CIPHER i_cbc_cipher= |
77 | { | 71 | { |
78 | NID_idea_cbc, | 72 | NID_idea_cbc, |
@@ -82,20 +76,17 @@ static EVP_CIPHER i_cbc_cipher= | |||
82 | NULL, | 76 | NULL, |
83 | sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ | 77 | sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ |
84 | sizeof((((EVP_CIPHER_CTX *)NULL)->c.idea_ks)), | 78 | sizeof((((EVP_CIPHER_CTX *)NULL)->c.idea_ks)), |
85 | EVP_CIPHER_get_asn1_iv, | ||
86 | EVP_CIPHER_set_asn1_iv, | 79 | EVP_CIPHER_set_asn1_iv, |
80 | EVP_CIPHER_get_asn1_iv, | ||
87 | }; | 81 | }; |
88 | 82 | ||
89 | EVP_CIPHER *EVP_idea_cbc() | 83 | EVP_CIPHER *EVP_idea_cbc(void) |
90 | { | 84 | { |
91 | return(&i_cbc_cipher); | 85 | return(&i_cbc_cipher); |
92 | } | 86 | } |
93 | 87 | ||
94 | static void idea_cbc_init_key(ctx,key,iv,enc) | 88 | static void idea_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
95 | EVP_CIPHER_CTX *ctx; | 89 | unsigned char *iv, int enc) |
96 | unsigned char *key; | ||
97 | unsigned char *iv; | ||
98 | int enc; | ||
99 | { | 90 | { |
100 | if (iv != NULL) | 91 | if (iv != NULL) |
101 | memcpy(&(ctx->oiv[0]),iv,8); | 92 | memcpy(&(ctx->oiv[0]),iv,8); |
@@ -116,11 +107,8 @@ int enc; | |||
116 | } | 107 | } |
117 | } | 108 | } |
118 | 109 | ||
119 | static void idea_cbc_cipher(ctx,out,in,inl) | 110 | static void idea_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
120 | EVP_CIPHER_CTX *ctx; | 111 | unsigned char *in, unsigned int inl) |
121 | unsigned char *out; | ||
122 | unsigned char *in; | ||
123 | unsigned int inl; | ||
124 | { | 112 | { |
125 | idea_cbc_encrypt( | 113 | idea_cbc_encrypt( |
126 | in,out,(long)inl, | 114 | in,out,(long)inl, |
diff --git a/src/lib/libcrypto/evp/e_cbc_r2.c b/src/lib/libcrypto/evp/e_cbc_r2.c index 4f8002f16d..9dfada4ea6 100644 --- a/src/lib/libcrypto/evp/e_cbc_r2.c +++ b/src/lib/libcrypto/evp/e_cbc_r2.c | |||
@@ -60,18 +60,21 @@ | |||
60 | 60 | ||
61 | #include <stdio.h> | 61 | #include <stdio.h> |
62 | #include "cryptlib.h" | 62 | #include "cryptlib.h" |
63 | #include "evp.h" | 63 | #include <openssl/evp.h> |
64 | #include "objects.h" | 64 | #include <openssl/objects.h> |
65 | 65 | ||
66 | #ifndef NOPROTO | ||
67 | static void rc2_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, | 66 | static void rc2_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
68 | unsigned char *iv,int enc); | 67 | unsigned char *iv,int enc); |
69 | static void rc2_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 68 | static void rc2_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
70 | unsigned char *in, unsigned int inl); | 69 | unsigned char *in, unsigned int inl); |
71 | #else | 70 | static int rc2_meth_to_magic(const EVP_CIPHER *e); |
72 | static void rc2_cbc_init_key(); | 71 | static EVP_CIPHER *rc2_magic_to_meth(int i); |
73 | static void rc2_cbc_cipher(); | 72 | static int rc2_set_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type); |
74 | #endif | 73 | static int rc2_get_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type); |
74 | |||
75 | #define RC2_40_MAGIC 0xa0 | ||
76 | #define RC2_64_MAGIC 0x78 | ||
77 | #define RC2_128_MAGIC 0x3a | ||
75 | 78 | ||
76 | static EVP_CIPHER r2_cbc_cipher= | 79 | static EVP_CIPHER r2_cbc_cipher= |
77 | { | 80 | { |
@@ -82,8 +85,21 @@ static EVP_CIPHER r2_cbc_cipher= | |||
82 | NULL, | 85 | NULL, |
83 | sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ | 86 | sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ |
84 | sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc2_ks)), | 87 | sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc2_ks)), |
85 | EVP_CIPHER_get_asn1_iv, | 88 | rc2_set_asn1_type_and_iv, |
86 | EVP_CIPHER_set_asn1_iv, | 89 | rc2_get_asn1_type_and_iv, |
90 | }; | ||
91 | |||
92 | static EVP_CIPHER r2_64_cbc_cipher= | ||
93 | { | ||
94 | NID_rc2_64_cbc, | ||
95 | 8,8 /* 64 bit */,8, | ||
96 | rc2_cbc_init_key, | ||
97 | rc2_cbc_cipher, | ||
98 | NULL, | ||
99 | sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ | ||
100 | sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc2_ks)), | ||
101 | rc2_set_asn1_type_and_iv, | ||
102 | rc2_get_asn1_type_and_iv, | ||
87 | }; | 103 | }; |
88 | 104 | ||
89 | static EVP_CIPHER r2_40_cbc_cipher= | 105 | static EVP_CIPHER r2_40_cbc_cipher= |
@@ -95,23 +111,27 @@ static EVP_CIPHER r2_40_cbc_cipher= | |||
95 | NULL, | 111 | NULL, |
96 | sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ | 112 | sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ |
97 | sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc2_ks)), | 113 | sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc2_ks)), |
114 | rc2_set_asn1_type_and_iv, | ||
115 | rc2_get_asn1_type_and_iv, | ||
98 | }; | 116 | }; |
99 | 117 | ||
100 | EVP_CIPHER *EVP_rc2_cbc() | 118 | EVP_CIPHER *EVP_rc2_cbc(void) |
101 | { | 119 | { |
102 | return(&r2_cbc_cipher); | 120 | return(&r2_cbc_cipher); |
103 | } | 121 | } |
104 | 122 | ||
105 | EVP_CIPHER *EVP_rc2_40_cbc() | 123 | EVP_CIPHER *EVP_rc2_64_cbc(void) |
124 | { | ||
125 | return(&r2_64_cbc_cipher); | ||
126 | } | ||
127 | |||
128 | EVP_CIPHER *EVP_rc2_40_cbc(void) | ||
106 | { | 129 | { |
107 | return(&r2_40_cbc_cipher); | 130 | return(&r2_40_cbc_cipher); |
108 | } | 131 | } |
109 | 132 | ||
110 | static void rc2_cbc_init_key(ctx,key,iv,enc) | 133 | static void rc2_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
111 | EVP_CIPHER_CTX *ctx; | 134 | unsigned char *iv, int enc) |
112 | unsigned char *key; | ||
113 | unsigned char *iv; | ||
114 | int enc; | ||
115 | { | 135 | { |
116 | if (iv != NULL) | 136 | if (iv != NULL) |
117 | memcpy(&(ctx->oiv[0]),iv,8); | 137 | memcpy(&(ctx->oiv[0]),iv,8); |
@@ -121,11 +141,8 @@ int enc; | |||
121 | key,EVP_CIPHER_CTX_key_length(ctx)*8); | 141 | key,EVP_CIPHER_CTX_key_length(ctx)*8); |
122 | } | 142 | } |
123 | 143 | ||
124 | static void rc2_cbc_cipher(ctx,out,in,inl) | 144 | static void rc2_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
125 | EVP_CIPHER_CTX *ctx; | 145 | unsigned char *in, unsigned int inl) |
126 | unsigned char *out; | ||
127 | unsigned char *in; | ||
128 | unsigned int inl; | ||
129 | { | 146 | { |
130 | RC2_cbc_encrypt( | 147 | RC2_cbc_encrypt( |
131 | in,out,(long)inl, | 148 | in,out,(long)inl, |
@@ -133,4 +150,67 @@ unsigned int inl; | |||
133 | ctx->encrypt); | 150 | ctx->encrypt); |
134 | } | 151 | } |
135 | 152 | ||
153 | static int rc2_meth_to_magic(const EVP_CIPHER *e) | ||
154 | { | ||
155 | int i; | ||
156 | |||
157 | i=EVP_CIPHER_key_length(e); | ||
158 | if (i == 16) return(RC2_128_MAGIC); | ||
159 | else if (i == 8) return(RC2_64_MAGIC); | ||
160 | else if (i == 5) return(RC2_40_MAGIC); | ||
161 | else return(0); | ||
162 | } | ||
163 | |||
164 | static EVP_CIPHER *rc2_magic_to_meth(int i) | ||
165 | { | ||
166 | if (i == RC2_128_MAGIC) return(EVP_rc2_cbc()); | ||
167 | else if (i == RC2_64_MAGIC) return(EVP_rc2_64_cbc()); | ||
168 | else if (i == RC2_40_MAGIC) return(EVP_rc2_40_cbc()); | ||
169 | else | ||
170 | { | ||
171 | EVPerr(EVP_F_RC2_MAGIC_TO_METH,EVP_R_UNSUPPORTED_KEY_SIZE); | ||
172 | return(NULL); | ||
173 | } | ||
174 | } | ||
175 | |||
176 | static int rc2_get_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type) | ||
177 | { | ||
178 | long num=0; | ||
179 | int i=0,l; | ||
180 | EVP_CIPHER *e; | ||
181 | |||
182 | if (type != NULL) | ||
183 | { | ||
184 | l=EVP_CIPHER_CTX_iv_length(c); | ||
185 | i=ASN1_TYPE_get_int_octetstring(type,&num,c->oiv,l); | ||
186 | if (i != l) | ||
187 | return(-1); | ||
188 | else if (i > 0) | ||
189 | memcpy(c->iv,c->oiv,l); | ||
190 | e=rc2_magic_to_meth((int)num); | ||
191 | if (e == NULL) | ||
192 | return(-1); | ||
193 | if (e != EVP_CIPHER_CTX_cipher(c)) | ||
194 | { | ||
195 | EVP_CIPHER_CTX_cipher(c)=e; | ||
196 | rc2_cbc_init_key(c,NULL,NULL,1); | ||
197 | } | ||
198 | } | ||
199 | return(i); | ||
200 | } | ||
201 | |||
202 | static int rc2_set_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type) | ||
203 | { | ||
204 | long num; | ||
205 | int i=0,j; | ||
206 | |||
207 | if (type != NULL) | ||
208 | { | ||
209 | num=rc2_meth_to_magic(EVP_CIPHER_CTX_cipher(c)); | ||
210 | j=EVP_CIPHER_CTX_iv_length(c); | ||
211 | i=ASN1_TYPE_set_int_octetstring(type,num,c->oiv,j); | ||
212 | } | ||
213 | return(i); | ||
214 | } | ||
215 | |||
136 | #endif | 216 | #endif |
diff --git a/src/lib/libcrypto/evp/e_cbc_r5.c b/src/lib/libcrypto/evp/e_cbc_r5.c index f7d46ca91f..cea3fe333a 100644 --- a/src/lib/libcrypto/evp/e_cbc_r5.c +++ b/src/lib/libcrypto/evp/e_cbc_r5.c | |||
@@ -60,19 +60,13 @@ | |||
60 | 60 | ||
61 | #include <stdio.h> | 61 | #include <stdio.h> |
62 | #include "cryptlib.h" | 62 | #include "cryptlib.h" |
63 | #include "evp.h" | 63 | #include <openssl/evp.h> |
64 | #include "objects.h" | 64 | #include <openssl/objects.h> |
65 | 65 | ||
66 | #ifndef NOPROTO | ||
67 | static void r_32_12_16_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, | 66 | static void r_32_12_16_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
68 | unsigned char *iv,int enc); | 67 | unsigned char *iv,int enc); |
69 | static void r_32_12_16_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 68 | static void r_32_12_16_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
70 | unsigned char *in, unsigned int inl); | 69 | unsigned char *in, unsigned int inl); |
71 | #else | ||
72 | static void r_32_12_16_cbc_init_key(); | ||
73 | static void r_32_12_16_cbc_cipher(); | ||
74 | #endif | ||
75 | |||
76 | static EVP_CIPHER rc5_32_12_16_cbc_cipher= | 70 | static EVP_CIPHER rc5_32_12_16_cbc_cipher= |
77 | { | 71 | { |
78 | NID_rc5_cbc, | 72 | NID_rc5_cbc, |
@@ -86,16 +80,13 @@ static EVP_CIPHER rc5_32_12_16_cbc_cipher= | |||
86 | NULL, | 80 | NULL, |
87 | }; | 81 | }; |
88 | 82 | ||
89 | EVP_CIPHER *EVP_rc5_32_12_16_cbc() | 83 | EVP_CIPHER *EVP_rc5_32_12_16_cbc(void) |
90 | { | 84 | { |
91 | return(&rc5_32_12_16_cbc_cipher); | 85 | return(&rc5_32_12_16_cbc_cipher); |
92 | } | 86 | } |
93 | 87 | ||
94 | static void r_32_12_16_cbc_init_key(ctx,key,iv,enc) | 88 | static void r_32_12_16_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
95 | EVP_CIPHER_CTX *ctx; | 89 | unsigned char *iv, int enc) |
96 | unsigned char *key; | ||
97 | unsigned char *iv; | ||
98 | int enc; | ||
99 | { | 90 | { |
100 | if (iv != NULL) | 91 | if (iv != NULL) |
101 | memcpy(&(ctx->oiv[0]),iv,8); | 92 | memcpy(&(ctx->oiv[0]),iv,8); |
@@ -105,11 +96,8 @@ int enc; | |||
105 | key,RC5_12_ROUNDS); | 96 | key,RC5_12_ROUNDS); |
106 | } | 97 | } |
107 | 98 | ||
108 | static void r_32_12_16_cbc_cipher(ctx,out,in,inl) | 99 | static void r_32_12_16_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
109 | EVP_CIPHER_CTX *ctx; | 100 | unsigned char *in, unsigned int inl) |
110 | unsigned char *out; | ||
111 | unsigned char *in; | ||
112 | unsigned int inl; | ||
113 | { | 101 | { |
114 | RC5_32_cbc_encrypt( | 102 | RC5_32_cbc_encrypt( |
115 | in,out,(long)inl, | 103 | in,out,(long)inl, |
diff --git a/src/lib/libcrypto/evp/e_cfb_3d.c b/src/lib/libcrypto/evp/e_cfb_3d.c index e7e3419411..bd32b072e2 100644 --- a/src/lib/libcrypto/evp/e_cfb_3d.c +++ b/src/lib/libcrypto/evp/e_cfb_3d.c | |||
@@ -56,24 +56,18 @@ | |||
56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
57 | */ | 57 | */ |
58 | 58 | ||
59 | #ifndef NO_DES | ||
59 | #include <stdio.h> | 60 | #include <stdio.h> |
60 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
61 | #include "evp.h" | 62 | #include <openssl/evp.h> |
62 | #include "objects.h" | 63 | #include <openssl/objects.h> |
63 | 64 | ||
64 | #ifndef NOPROTO | ||
65 | static void des_ede_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, | 65 | static void des_ede_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
66 | unsigned char *iv,int enc); | 66 | unsigned char *iv,int enc); |
67 | static void des_ede3_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, | 67 | static void des_ede3_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
68 | unsigned char *iv,int enc); | 68 | unsigned char *iv,int enc); |
69 | static void des_ede_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 69 | static void des_ede_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
70 | unsigned char *in, unsigned int inl); | 70 | unsigned char *in, unsigned int inl); |
71 | #else | ||
72 | static void des_ede_cfb_init_key(); | ||
73 | static void des_ede3_cfb_init_key(); | ||
74 | static void des_ede_cfb_cipher(); | ||
75 | #endif | ||
76 | |||
77 | static EVP_CIPHER d_ede_cfb_cipher2= | 71 | static EVP_CIPHER d_ede_cfb_cipher2= |
78 | { | 72 | { |
79 | NID_des_ede_cfb64, | 73 | NID_des_ede_cfb64, |
@@ -100,67 +94,62 @@ static EVP_CIPHER d_ede3_cfb_cipher3= | |||
100 | EVP_CIPHER_get_asn1_iv, | 94 | EVP_CIPHER_get_asn1_iv, |
101 | }; | 95 | }; |
102 | 96 | ||
103 | EVP_CIPHER *EVP_des_ede_cfb() | 97 | EVP_CIPHER *EVP_des_ede_cfb(void) |
104 | { | 98 | { |
105 | return(&d_ede_cfb_cipher2); | 99 | return(&d_ede_cfb_cipher2); |
106 | } | 100 | } |
107 | 101 | ||
108 | EVP_CIPHER *EVP_des_ede3_cfb() | 102 | EVP_CIPHER *EVP_des_ede3_cfb(void) |
109 | { | 103 | { |
110 | return(&d_ede3_cfb_cipher3); | 104 | return(&d_ede3_cfb_cipher3); |
111 | } | 105 | } |
112 | 106 | ||
113 | static void des_ede_cfb_init_key(ctx,key,iv,enc) | 107 | static void des_ede_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
114 | EVP_CIPHER_CTX *ctx; | 108 | unsigned char *iv, int enc) |
115 | unsigned char *key; | ||
116 | unsigned char *iv; | ||
117 | int enc; | ||
118 | { | 109 | { |
110 | des_cblock *deskey = (des_cblock *)key; | ||
111 | |||
119 | ctx->num=0; | 112 | ctx->num=0; |
120 | 113 | ||
121 | if (iv != NULL) | 114 | if (iv != NULL) |
122 | memcpy(&(ctx->oiv[0]),iv,8); | 115 | memcpy(&(ctx->oiv[0]),iv,8); |
123 | memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); | 116 | memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); |
124 | if (key != NULL) | 117 | if (deskey != NULL) |
125 | { | 118 | { |
126 | des_set_key((des_cblock *)key,ctx->c.des_ede.ks1); | 119 | des_set_key(&deskey[0],ctx->c.des_ede.ks1); |
127 | des_set_key((des_cblock *)&(key[8]),ctx->c.des_ede.ks2); | 120 | des_set_key(&deskey[1],ctx->c.des_ede.ks2); |
128 | memcpy( (char *)ctx->c.des_ede.ks3, | 121 | memcpy( (char *)ctx->c.des_ede.ks3, |
129 | (char *)ctx->c.des_ede.ks1, | 122 | (char *)ctx->c.des_ede.ks1, |
130 | sizeof(ctx->c.des_ede.ks1)); | 123 | sizeof(ctx->c.des_ede.ks1)); |
131 | } | 124 | } |
132 | } | 125 | } |
133 | 126 | ||
134 | static void des_ede3_cfb_init_key(ctx,key,iv,enc) | 127 | static void des_ede3_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
135 | EVP_CIPHER_CTX *ctx; | 128 | unsigned char *iv, int enc) |
136 | unsigned char *key; | ||
137 | unsigned char *iv; | ||
138 | int enc; | ||
139 | { | 129 | { |
130 | des_cblock *deskey = (des_cblock *)key; | ||
131 | |||
140 | ctx->num=0; | 132 | ctx->num=0; |
141 | 133 | ||
142 | if (iv != NULL) | 134 | if (iv != NULL) |
143 | memcpy(&(ctx->oiv[0]),iv,8); | 135 | memcpy(&(ctx->oiv[0]),iv,8); |
144 | memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); | 136 | memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); |
145 | if (key != NULL) | 137 | if (deskey != NULL) |
146 | { | 138 | { |
147 | des_set_key((des_cblock *)key,ctx->c.des_ede.ks1); | 139 | des_set_key(&deskey[0],ctx->c.des_ede.ks1); |
148 | des_set_key((des_cblock *)&(key[8]),ctx->c.des_ede.ks2); | 140 | des_set_key(&deskey[1],ctx->c.des_ede.ks2); |
149 | des_set_key((des_cblock *)&(key[16]),ctx->c.des_ede.ks3); | 141 | des_set_key(&deskey[2],ctx->c.des_ede.ks3); |
150 | } | 142 | } |
151 | } | 143 | } |
152 | 144 | ||
153 | static void des_ede_cfb_cipher(ctx,out,in,inl) | 145 | static void des_ede_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
154 | EVP_CIPHER_CTX *ctx; | 146 | unsigned char *in, unsigned int inl) |
155 | unsigned char *out; | ||
156 | unsigned char *in; | ||
157 | unsigned int inl; | ||
158 | { | 147 | { |
159 | des_ede3_cfb64_encrypt( | 148 | des_ede3_cfb64_encrypt(in,out,(long)inl, |
160 | in,out,(long)inl, | 149 | ctx->c.des_ede.ks1, |
161 | ctx->c.des_ede.ks1, | 150 | ctx->c.des_ede.ks2, |
162 | ctx->c.des_ede.ks2, | 151 | ctx->c.des_ede.ks3, |
163 | ctx->c.des_ede.ks3, | 152 | (des_cblock*)&(ctx->iv[0]), |
164 | (des_cblock *)&(ctx->iv[0]), | 153 | &ctx->num,ctx->encrypt); |
165 | &ctx->num,ctx->encrypt); | ||
166 | } | 154 | } |
155 | #endif | ||
diff --git a/src/lib/libcrypto/evp/e_cfb_bf.c b/src/lib/libcrypto/evp/e_cfb_bf.c index 8aba2564b8..63e1e624ea 100644 --- a/src/lib/libcrypto/evp/e_cfb_bf.c +++ b/src/lib/libcrypto/evp/e_cfb_bf.c | |||
@@ -56,23 +56,16 @@ | |||
56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
57 | */ | 57 | */ |
58 | 58 | ||
59 | #ifndef NO_BLOWFISH | 59 | #ifndef NO_BF |
60 | |||
61 | #include <stdio.h> | 60 | #include <stdio.h> |
62 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
63 | #include "evp.h" | 62 | #include <openssl/evp.h> |
64 | #include "objects.h" | 63 | #include <openssl/objects.h> |
65 | 64 | ||
66 | #ifndef NOPROTO | ||
67 | static void bf_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, | 65 | static void bf_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
68 | unsigned char *iv,int enc); | 66 | unsigned char *iv,int enc); |
69 | static void bf_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 67 | static void bf_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
70 | unsigned char *in, unsigned int inl); | 68 | unsigned char *in, unsigned int inl); |
71 | #else | ||
72 | static void bf_cfb_init_key(); | ||
73 | static void bf_cfb_cipher(); | ||
74 | #endif | ||
75 | |||
76 | static EVP_CIPHER bfish_cfb_cipher= | 69 | static EVP_CIPHER bfish_cfb_cipher= |
77 | { | 70 | { |
78 | NID_bf_cfb64, | 71 | NID_bf_cfb64, |
@@ -86,16 +79,13 @@ static EVP_CIPHER bfish_cfb_cipher= | |||
86 | EVP_CIPHER_get_asn1_iv, | 79 | EVP_CIPHER_get_asn1_iv, |
87 | }; | 80 | }; |
88 | 81 | ||
89 | EVP_CIPHER *EVP_bf_cfb() | 82 | EVP_CIPHER *EVP_bf_cfb(void) |
90 | { | 83 | { |
91 | return(&bfish_cfb_cipher); | 84 | return(&bfish_cfb_cipher); |
92 | } | 85 | } |
93 | 86 | ||
94 | static void bf_cfb_init_key(ctx,key,iv,enc) | 87 | static void bf_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
95 | EVP_CIPHER_CTX *ctx; | 88 | unsigned char *iv, int enc) |
96 | unsigned char *key; | ||
97 | unsigned char *iv; | ||
98 | int enc; | ||
99 | { | 89 | { |
100 | ctx->num=0; | 90 | ctx->num=0; |
101 | 91 | ||
@@ -106,11 +96,8 @@ int enc; | |||
106 | BF_set_key(&(ctx->c.bf_ks),EVP_BLOWFISH_KEY_SIZE,key); | 96 | BF_set_key(&(ctx->c.bf_ks),EVP_BLOWFISH_KEY_SIZE,key); |
107 | } | 97 | } |
108 | 98 | ||
109 | static void bf_cfb_cipher(ctx,out,in,inl) | 99 | static void bf_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
110 | EVP_CIPHER_CTX *ctx; | 100 | unsigned char *in, unsigned int inl) |
111 | unsigned char *out; | ||
112 | unsigned char *in; | ||
113 | unsigned int inl; | ||
114 | { | 101 | { |
115 | BF_cfb64_encrypt( | 102 | BF_cfb64_encrypt( |
116 | in,out, | 103 | in,out, |
diff --git a/src/lib/libcrypto/evp/e_cfb_c.c b/src/lib/libcrypto/evp/e_cfb_c.c index 936df55fd8..f04bac034b 100644 --- a/src/lib/libcrypto/evp/e_cfb_c.c +++ b/src/lib/libcrypto/evp/e_cfb_c.c | |||
@@ -60,19 +60,13 @@ | |||
60 | 60 | ||
61 | #include <stdio.h> | 61 | #include <stdio.h> |
62 | #include "cryptlib.h" | 62 | #include "cryptlib.h" |
63 | #include "evp.h" | 63 | #include <openssl/evp.h> |
64 | #include "objects.h" | 64 | #include <openssl/objects.h> |
65 | 65 | ||
66 | #ifndef NOPROTO | ||
67 | static void cast_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, | 66 | static void cast_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
68 | unsigned char *iv,int enc); | 67 | unsigned char *iv,int enc); |
69 | static void cast_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 68 | static void cast_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
70 | unsigned char *in, unsigned int inl); | 69 | unsigned char *in, unsigned int inl); |
71 | #else | ||
72 | static void cast_cfb_init_key(); | ||
73 | static void cast_cfb_cipher(); | ||
74 | #endif | ||
75 | |||
76 | static EVP_CIPHER cast5_cfb_cipher= | 70 | static EVP_CIPHER cast5_cfb_cipher= |
77 | { | 71 | { |
78 | NID_cast5_cfb64, | 72 | NID_cast5_cfb64, |
@@ -86,16 +80,13 @@ static EVP_CIPHER cast5_cfb_cipher= | |||
86 | EVP_CIPHER_get_asn1_iv, | 80 | EVP_CIPHER_get_asn1_iv, |
87 | }; | 81 | }; |
88 | 82 | ||
89 | EVP_CIPHER *EVP_cast5_cfb() | 83 | EVP_CIPHER *EVP_cast5_cfb(void) |
90 | { | 84 | { |
91 | return(&cast5_cfb_cipher); | 85 | return(&cast5_cfb_cipher); |
92 | } | 86 | } |
93 | 87 | ||
94 | static void cast_cfb_init_key(ctx,key,iv,enc) | 88 | static void cast_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
95 | EVP_CIPHER_CTX *ctx; | 89 | unsigned char *iv, int enc) |
96 | unsigned char *key; | ||
97 | unsigned char *iv; | ||
98 | int enc; | ||
99 | { | 90 | { |
100 | ctx->num=0; | 91 | ctx->num=0; |
101 | 92 | ||
@@ -106,11 +97,8 @@ int enc; | |||
106 | CAST_set_key(&(ctx->c.cast_ks),EVP_CAST5_KEY_SIZE,key); | 97 | CAST_set_key(&(ctx->c.cast_ks),EVP_CAST5_KEY_SIZE,key); |
107 | } | 98 | } |
108 | 99 | ||
109 | static void cast_cfb_cipher(ctx,out,in,inl) | 100 | static void cast_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
110 | EVP_CIPHER_CTX *ctx; | 101 | unsigned char *in, unsigned int inl) |
111 | unsigned char *out; | ||
112 | unsigned char *in; | ||
113 | unsigned int inl; | ||
114 | { | 102 | { |
115 | CAST_cfb64_encrypt( | 103 | CAST_cfb64_encrypt( |
116 | in,out, | 104 | in,out, |
diff --git a/src/lib/libcrypto/evp/e_cfb_d.c b/src/lib/libcrypto/evp/e_cfb_d.c index 9ae4558f51..6bdf20b646 100644 --- a/src/lib/libcrypto/evp/e_cfb_d.c +++ b/src/lib/libcrypto/evp/e_cfb_d.c | |||
@@ -58,19 +58,14 @@ | |||
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include "evp.h" | 61 | #include <openssl/evp.h> |
62 | #include "objects.h" | 62 | #include <openssl/objects.h> |
63 | 63 | ||
64 | #ifndef NOPROTO | 64 | #ifndef NO_DES |
65 | static void des_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, | 65 | static void des_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
66 | unsigned char *iv,int enc); | 66 | unsigned char *iv,int enc); |
67 | static void des_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 67 | static void des_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
68 | unsigned char *in, unsigned int inl); | 68 | unsigned char *in, unsigned int inl); |
69 | #else | ||
70 | static void des_cfb_init_key(); | ||
71 | static void des_cfb_cipher(); | ||
72 | #endif | ||
73 | |||
74 | static EVP_CIPHER d_cfb_cipher= | 69 | static EVP_CIPHER d_cfb_cipher= |
75 | { | 70 | { |
76 | NID_des_cfb64, | 71 | NID_des_cfb64, |
@@ -84,31 +79,27 @@ static EVP_CIPHER d_cfb_cipher= | |||
84 | EVP_CIPHER_get_asn1_iv, | 79 | EVP_CIPHER_get_asn1_iv, |
85 | }; | 80 | }; |
86 | 81 | ||
87 | EVP_CIPHER *EVP_des_cfb() | 82 | EVP_CIPHER *EVP_des_cfb(void) |
88 | { | 83 | { |
89 | return(&d_cfb_cipher); | 84 | return(&d_cfb_cipher); |
90 | } | 85 | } |
91 | 86 | ||
92 | static void des_cfb_init_key(ctx,key,iv,enc) | 87 | static void des_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
93 | EVP_CIPHER_CTX *ctx; | 88 | unsigned char *iv, int enc) |
94 | unsigned char *key; | ||
95 | unsigned char *iv; | ||
96 | int enc; | ||
97 | { | 89 | { |
90 | des_cblock *deskey = (des_cblock *)key; | ||
91 | |||
98 | ctx->num=0; | 92 | ctx->num=0; |
99 | 93 | ||
100 | if (iv != NULL) | 94 | if (iv != NULL) |
101 | memcpy(&(ctx->oiv[0]),iv,8); | 95 | memcpy(&(ctx->oiv[0]),iv,8); |
102 | memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); | 96 | memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); |
103 | if (key != NULL) | 97 | if (deskey != NULL) |
104 | des_set_key((des_cblock *)key,ctx->c.des_ks); | 98 | des_set_key(deskey,ctx->c.des_ks); |
105 | } | 99 | } |
106 | 100 | ||
107 | static void des_cfb_cipher(ctx,out,in,inl) | 101 | static void des_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
108 | EVP_CIPHER_CTX *ctx; | 102 | unsigned char *in, unsigned int inl) |
109 | unsigned char *out; | ||
110 | unsigned char *in; | ||
111 | unsigned int inl; | ||
112 | { | 103 | { |
113 | des_cfb64_encrypt( | 104 | des_cfb64_encrypt( |
114 | in,out, | 105 | in,out, |
@@ -116,3 +107,4 @@ unsigned int inl; | |||
116 | (des_cblock *)&(ctx->iv[0]), | 107 | (des_cblock *)&(ctx->iv[0]), |
117 | &ctx->num,ctx->encrypt); | 108 | &ctx->num,ctx->encrypt); |
118 | } | 109 | } |
110 | #endif | ||
diff --git a/src/lib/libcrypto/evp/e_cfb_i.c b/src/lib/libcrypto/evp/e_cfb_i.c index 9225efaa86..31c76c6dac 100644 --- a/src/lib/libcrypto/evp/e_cfb_i.c +++ b/src/lib/libcrypto/evp/e_cfb_i.c | |||
@@ -60,19 +60,13 @@ | |||
60 | 60 | ||
61 | #include <stdio.h> | 61 | #include <stdio.h> |
62 | #include "cryptlib.h" | 62 | #include "cryptlib.h" |
63 | #include "evp.h" | 63 | #include <openssl/evp.h> |
64 | #include "objects.h" | 64 | #include <openssl/objects.h> |
65 | 65 | ||
66 | #ifndef NOPROTO | ||
67 | static void idea_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, | 66 | static void idea_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
68 | unsigned char *iv,int enc); | 67 | unsigned char *iv,int enc); |
69 | static void idea_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 68 | static void idea_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
70 | unsigned char *in, unsigned int inl); | 69 | unsigned char *in, unsigned int inl); |
71 | #else | ||
72 | static void idea_cfb_init_key(); | ||
73 | static void idea_cfb_cipher(); | ||
74 | #endif | ||
75 | |||
76 | static EVP_CIPHER i_cfb_cipher= | 70 | static EVP_CIPHER i_cfb_cipher= |
77 | { | 71 | { |
78 | NID_idea_cfb64, | 72 | NID_idea_cfb64, |
@@ -86,16 +80,13 @@ static EVP_CIPHER i_cfb_cipher= | |||
86 | EVP_CIPHER_get_asn1_iv, | 80 | EVP_CIPHER_get_asn1_iv, |
87 | }; | 81 | }; |
88 | 82 | ||
89 | EVP_CIPHER *EVP_idea_cfb() | 83 | EVP_CIPHER *EVP_idea_cfb(void) |
90 | { | 84 | { |
91 | return(&i_cfb_cipher); | 85 | return(&i_cfb_cipher); |
92 | } | 86 | } |
93 | 87 | ||
94 | static void idea_cfb_init_key(ctx,key,iv,enc) | 88 | static void idea_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
95 | EVP_CIPHER_CTX *ctx; | 89 | unsigned char *iv, int enc) |
96 | unsigned char *key; | ||
97 | unsigned char *iv; | ||
98 | int enc; | ||
99 | { | 90 | { |
100 | ctx->num=0; | 91 | ctx->num=0; |
101 | 92 | ||
@@ -106,11 +97,8 @@ int enc; | |||
106 | idea_set_encrypt_key(key,&(ctx->c.idea_ks)); | 97 | idea_set_encrypt_key(key,&(ctx->c.idea_ks)); |
107 | } | 98 | } |
108 | 99 | ||
109 | static void idea_cfb_cipher(ctx,out,in,inl) | 100 | static void idea_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
110 | EVP_CIPHER_CTX *ctx; | 101 | unsigned char *in, unsigned int inl) |
111 | unsigned char *out; | ||
112 | unsigned char *in; | ||
113 | unsigned int inl; | ||
114 | { | 102 | { |
115 | idea_cfb64_encrypt( | 103 | idea_cfb64_encrypt( |
116 | in,out,(long)inl, | 104 | in,out,(long)inl, |
diff --git a/src/lib/libcrypto/evp/e_cfb_r2.c b/src/lib/libcrypto/evp/e_cfb_r2.c index af5a39d1f4..32dd77eb7c 100644 --- a/src/lib/libcrypto/evp/e_cfb_r2.c +++ b/src/lib/libcrypto/evp/e_cfb_r2.c | |||
@@ -60,19 +60,13 @@ | |||
60 | 60 | ||
61 | #include <stdio.h> | 61 | #include <stdio.h> |
62 | #include "cryptlib.h" | 62 | #include "cryptlib.h" |
63 | #include "evp.h" | 63 | #include <openssl/evp.h> |
64 | #include "objects.h" | 64 | #include <openssl/objects.h> |
65 | 65 | ||
66 | #ifndef NOPROTO | ||
67 | static void rc2_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, | 66 | static void rc2_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
68 | unsigned char *iv,int enc); | 67 | unsigned char *iv,int enc); |
69 | static void rc2_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 68 | static void rc2_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
70 | unsigned char *in, unsigned int inl); | 69 | unsigned char *in, unsigned int inl); |
71 | #else | ||
72 | static void rc2_cfb_init_key(); | ||
73 | static void rc2_cfb_cipher(); | ||
74 | #endif | ||
75 | |||
76 | static EVP_CIPHER r2_cfb_cipher= | 70 | static EVP_CIPHER r2_cfb_cipher= |
77 | { | 71 | { |
78 | NID_rc2_cfb64, | 72 | NID_rc2_cfb64, |
@@ -86,16 +80,13 @@ static EVP_CIPHER r2_cfb_cipher= | |||
86 | EVP_CIPHER_get_asn1_iv, | 80 | EVP_CIPHER_get_asn1_iv, |
87 | }; | 81 | }; |
88 | 82 | ||
89 | EVP_CIPHER *EVP_rc2_cfb() | 83 | EVP_CIPHER *EVP_rc2_cfb(void) |
90 | { | 84 | { |
91 | return(&r2_cfb_cipher); | 85 | return(&r2_cfb_cipher); |
92 | } | 86 | } |
93 | 87 | ||
94 | static void rc2_cfb_init_key(ctx,key,iv,enc) | 88 | static void rc2_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
95 | EVP_CIPHER_CTX *ctx; | 89 | unsigned char *iv, int enc) |
96 | unsigned char *key; | ||
97 | unsigned char *iv; | ||
98 | int enc; | ||
99 | { | 90 | { |
100 | ctx->num=0; | 91 | ctx->num=0; |
101 | 92 | ||
@@ -103,15 +94,12 @@ int enc; | |||
103 | memcpy(&(ctx->oiv[0]),iv,8); | 94 | memcpy(&(ctx->oiv[0]),iv,8); |
104 | memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); | 95 | memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); |
105 | if (key != NULL) | 96 | if (key != NULL) |
106 | RC2_set_key(&(ctx->c.rc2_ks),EVP_RC2_KEY_SIZE,key, | 97 | RC2_set_key(&(ctx->c.rc2_ks),EVP_CIPHER_CTX_key_length(ctx), |
107 | EVP_RC2_KEY_SIZE*8); | 98 | key,EVP_CIPHER_CTX_key_length(ctx)*8); |
108 | } | 99 | } |
109 | 100 | ||
110 | static void rc2_cfb_cipher(ctx,out,in,inl) | 101 | static void rc2_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
111 | EVP_CIPHER_CTX *ctx; | 102 | unsigned char *in, unsigned int inl) |
112 | unsigned char *out; | ||
113 | unsigned char *in; | ||
114 | unsigned int inl; | ||
115 | { | 103 | { |
116 | RC2_cfb64_encrypt( | 104 | RC2_cfb64_encrypt( |
117 | in,out, | 105 | in,out, |
diff --git a/src/lib/libcrypto/evp/e_cfb_r5.c b/src/lib/libcrypto/evp/e_cfb_r5.c index a2fddaedc0..8e79728946 100644 --- a/src/lib/libcrypto/evp/e_cfb_r5.c +++ b/src/lib/libcrypto/evp/e_cfb_r5.c | |||
@@ -60,19 +60,13 @@ | |||
60 | 60 | ||
61 | #include <stdio.h> | 61 | #include <stdio.h> |
62 | #include "cryptlib.h" | 62 | #include "cryptlib.h" |
63 | #include "evp.h" | 63 | #include <openssl/evp.h> |
64 | #include "objects.h" | 64 | #include <openssl/objects.h> |
65 | 65 | ||
66 | #ifndef NOPROTO | ||
67 | static void rc5_32_12_16_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, | 66 | static void rc5_32_12_16_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
68 | unsigned char *iv,int enc); | 67 | unsigned char *iv,int enc); |
69 | static void rc5_32_12_16_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 68 | static void rc5_32_12_16_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
70 | unsigned char *in, unsigned int inl); | 69 | unsigned char *in, unsigned int inl); |
71 | #else | ||
72 | static void rc5_32_12_16_cfb_init_key(); | ||
73 | static void rc5_32_12_16_cfb_cipher(); | ||
74 | #endif | ||
75 | |||
76 | static EVP_CIPHER rc5_cfb_cipher= | 70 | static EVP_CIPHER rc5_cfb_cipher= |
77 | { | 71 | { |
78 | NID_rc5_cfb64, | 72 | NID_rc5_cfb64, |
@@ -86,16 +80,13 @@ static EVP_CIPHER rc5_cfb_cipher= | |||
86 | EVP_CIPHER_get_asn1_iv, | 80 | EVP_CIPHER_get_asn1_iv, |
87 | }; | 81 | }; |
88 | 82 | ||
89 | EVP_CIPHER *EVP_rc5_32_12_16_cfb() | 83 | EVP_CIPHER *EVP_rc5_32_12_16_cfb(void) |
90 | { | 84 | { |
91 | return(&rc5_cfb_cipher); | 85 | return(&rc5_cfb_cipher); |
92 | } | 86 | } |
93 | 87 | ||
94 | static void rc5_32_12_16_cfb_init_key(ctx,key,iv,enc) | 88 | static void rc5_32_12_16_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
95 | EVP_CIPHER_CTX *ctx; | 89 | unsigned char *iv, int enc) |
96 | unsigned char *key; | ||
97 | unsigned char *iv; | ||
98 | int enc; | ||
99 | { | 90 | { |
100 | ctx->num=0; | 91 | ctx->num=0; |
101 | 92 | ||
@@ -107,11 +98,8 @@ int enc; | |||
107 | RC5_12_ROUNDS); | 98 | RC5_12_ROUNDS); |
108 | } | 99 | } |
109 | 100 | ||
110 | static void rc5_32_12_16_cfb_cipher(ctx,out,in,inl) | 101 | static void rc5_32_12_16_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
111 | EVP_CIPHER_CTX *ctx; | 102 | unsigned char *in, unsigned int inl) |
112 | unsigned char *out; | ||
113 | unsigned char *in; | ||
114 | unsigned int inl; | ||
115 | { | 103 | { |
116 | RC5_32_cfb64_encrypt( | 104 | RC5_32_cfb64_encrypt( |
117 | in,out, | 105 | in,out, |
diff --git a/src/lib/libcrypto/evp/e_dsa.c b/src/lib/libcrypto/evp/e_dsa.c index 6715c3e95e..b96f2738b3 100644 --- a/src/lib/libcrypto/evp/e_dsa.c +++ b/src/lib/libcrypto/evp/e_dsa.c | |||
@@ -58,9 +58,9 @@ | |||
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include "evp.h" | 61 | #include <openssl/evp.h> |
62 | #include "objects.h" | 62 | #include <openssl/objects.h> |
63 | #include "x509.h" | 63 | #include <openssl/x509.h> |
64 | 64 | ||
65 | static EVP_PKEY_METHOD dss_method= | 65 | static EVP_PKEY_METHOD dss_method= |
66 | { | 66 | { |
diff --git a/src/lib/libcrypto/evp/e_ecb_3d.c b/src/lib/libcrypto/evp/e_ecb_3d.c index 908fc0760a..354a8b79a7 100644 --- a/src/lib/libcrypto/evp/e_ecb_3d.c +++ b/src/lib/libcrypto/evp/e_ecb_3d.c | |||
@@ -56,24 +56,18 @@ | |||
56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
57 | */ | 57 | */ |
58 | 58 | ||
59 | #ifndef NO_DES | ||
59 | #include <stdio.h> | 60 | #include <stdio.h> |
60 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
61 | #include "evp.h" | 62 | #include <openssl/evp.h> |
62 | #include "objects.h" | 63 | #include <openssl/objects.h> |
63 | 64 | ||
64 | #ifndef NOPROTO | ||
65 | static void des_ede_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, | 65 | static void des_ede_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
66 | unsigned char *iv,int enc); | 66 | unsigned char *iv,int enc); |
67 | static void des_ede3_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, | 67 | static void des_ede3_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
68 | unsigned char *iv,int enc); | 68 | unsigned char *iv,int enc); |
69 | static void des_ede_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 69 | static void des_ede_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
70 | unsigned char *in, unsigned int inl); | 70 | unsigned char *in, unsigned int inl); |
71 | #else | ||
72 | static void des_ede_init_key(); | ||
73 | static void des_ede3_init_key(); | ||
74 | static void des_ede_cipher(); | ||
75 | #endif | ||
76 | |||
77 | static EVP_CIPHER d_ede_cipher2= | 71 | static EVP_CIPHER d_ede_cipher2= |
78 | { | 72 | { |
79 | NID_des_ede, | 73 | NID_des_ede, |
@@ -99,63 +93,66 @@ static EVP_CIPHER d_ede3_cipher3= | |||
99 | NULL, | 93 | NULL, |
100 | }; | 94 | }; |
101 | 95 | ||
102 | EVP_CIPHER *EVP_des_ede() | 96 | EVP_CIPHER *EVP_des_ede(void) |
103 | { | 97 | { |
104 | return(&d_ede_cipher2); | 98 | return(&d_ede_cipher2); |
105 | } | 99 | } |
106 | 100 | ||
107 | EVP_CIPHER *EVP_des_ede3() | 101 | EVP_CIPHER *EVP_des_ede3(void) |
108 | { | 102 | { |
109 | return(&d_ede3_cipher3); | 103 | return(&d_ede3_cipher3); |
110 | } | 104 | } |
111 | 105 | ||
112 | static void des_ede_init_key(ctx,key,iv,enc) | 106 | static void des_ede_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
113 | EVP_CIPHER_CTX *ctx; | 107 | unsigned char *iv, int enc) |
114 | unsigned char *key; | ||
115 | unsigned char *iv; | ||
116 | int enc; | ||
117 | { | 108 | { |
118 | if (key != NULL) | 109 | des_cblock *deskey = (des_cblock *)key; |
110 | |||
111 | if (deskey != NULL) | ||
119 | { | 112 | { |
120 | des_set_key((des_cblock *)key,ctx->c.des_ede.ks1); | 113 | des_set_key(&deskey[0],ctx->c.des_ede.ks1); |
121 | des_set_key((des_cblock *)&(key[8]),ctx->c.des_ede.ks2); | 114 | des_set_key(&deskey[1],ctx->c.des_ede.ks2); |
122 | memcpy( (char *)ctx->c.des_ede.ks3, | 115 | memcpy( (char *)ctx->c.des_ede.ks3, |
123 | (char *)ctx->c.des_ede.ks1, | 116 | (char *)ctx->c.des_ede.ks1, |
124 | sizeof(ctx->c.des_ede.ks1)); | 117 | sizeof(ctx->c.des_ede.ks1)); |
125 | } | 118 | } |
126 | } | 119 | } |
127 | 120 | ||
128 | static void des_ede3_init_key(ctx,key,iv,enc) | 121 | static void des_ede3_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
129 | EVP_CIPHER_CTX *ctx; | 122 | unsigned char *iv, int enc) |
130 | unsigned char *key; | ||
131 | unsigned char *iv; | ||
132 | int enc; | ||
133 | { | 123 | { |
134 | if (key != NULL) | 124 | des_cblock *deskey = (des_cblock *)key; |
125 | |||
126 | if (deskey != NULL) | ||
135 | { | 127 | { |
136 | des_set_key((des_cblock *)key,ctx->c.des_ede.ks1); | 128 | des_set_key(&deskey[0],ctx->c.des_ede.ks1); |
137 | des_set_key((des_cblock *)&(key[8]),ctx->c.des_ede.ks2); | 129 | des_set_key(&deskey[1],ctx->c.des_ede.ks2); |
138 | des_set_key((des_cblock *)&(key[16]),ctx->c.des_ede.ks3); | 130 | des_set_key(&deskey[2],ctx->c.des_ede.ks3); |
139 | } | 131 | } |
140 | } | 132 | } |
141 | 133 | ||
142 | static void des_ede_cipher(ctx,out,in,inl) | 134 | static void des_ede_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
143 | EVP_CIPHER_CTX *ctx; | 135 | unsigned char *in, unsigned int inl) |
144 | unsigned char *out; | ||
145 | unsigned char *in; | ||
146 | unsigned int inl; | ||
147 | { | 136 | { |
148 | unsigned int i; | 137 | unsigned int i; |
138 | des_cblock *output /* = (des_cblock *)out */; | ||
139 | des_cblock *input /* = (des_cblock *)in */; | ||
149 | 140 | ||
150 | if (inl < 8) return; | 141 | if (inl < 8) return; |
151 | inl-=8; | 142 | inl-=8; |
152 | for (i=0; i<=inl; i+=8) | 143 | for (i=0; i<=inl; i+=8) |
153 | { | 144 | { |
154 | des_ecb3_encrypt( | 145 | output = (des_cblock *)(out + i); |
155 | (des_cblock *)&(in[i]),(des_cblock *)&(out[i]), | 146 | input = (des_cblock *)(in + i); |
147 | |||
148 | des_ecb3_encrypt(input,output, | ||
156 | ctx->c.des_ede.ks1, | 149 | ctx->c.des_ede.ks1, |
157 | ctx->c.des_ede.ks2, | 150 | ctx->c.des_ede.ks2, |
158 | ctx->c.des_ede.ks3, | 151 | ctx->c.des_ede.ks3, |
159 | ctx->encrypt); | 152 | ctx->encrypt); |
153 | |||
154 | /* output++; */ | ||
155 | /* input++; */ | ||
160 | } | 156 | } |
161 | } | 157 | } |
158 | #endif | ||
diff --git a/src/lib/libcrypto/evp/e_ecb_bf.c b/src/lib/libcrypto/evp/e_ecb_bf.c index 142a9d3123..334736d253 100644 --- a/src/lib/libcrypto/evp/e_ecb_bf.c +++ b/src/lib/libcrypto/evp/e_ecb_bf.c | |||
@@ -56,23 +56,16 @@ | |||
56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
57 | */ | 57 | */ |
58 | 58 | ||
59 | #ifndef NO_BLOWFISH | 59 | #ifndef NO_BF |
60 | |||
61 | #include <stdio.h> | 60 | #include <stdio.h> |
62 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
63 | #include "evp.h" | 62 | #include <openssl/evp.h> |
64 | #include "objects.h" | 63 | #include <openssl/objects.h> |
65 | 64 | ||
66 | #ifndef NOPROTO | ||
67 | static void bf_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, | 65 | static void bf_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
68 | unsigned char *iv,int enc); | 66 | unsigned char *iv,int enc); |
69 | static void bf_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 67 | static void bf_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
70 | unsigned char *in, unsigned int inl); | 68 | unsigned char *in, unsigned int inl); |
71 | #else | ||
72 | static void bf_ecb_init_key(); | ||
73 | static void bf_ecb_cipher(); | ||
74 | #endif | ||
75 | |||
76 | static EVP_CIPHER bfish_ecb_cipher= | 69 | static EVP_CIPHER bfish_ecb_cipher= |
77 | { | 70 | { |
78 | NID_bf_ecb, | 71 | NID_bf_ecb, |
@@ -86,26 +79,20 @@ static EVP_CIPHER bfish_ecb_cipher= | |||
86 | NULL, | 79 | NULL, |
87 | }; | 80 | }; |
88 | 81 | ||
89 | EVP_CIPHER *EVP_bf_ecb() | 82 | EVP_CIPHER *EVP_bf_ecb(void) |
90 | { | 83 | { |
91 | return(&bfish_ecb_cipher); | 84 | return(&bfish_ecb_cipher); |
92 | } | 85 | } |
93 | 86 | ||
94 | static void bf_ecb_init_key(ctx,key,iv,enc) | 87 | static void bf_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
95 | EVP_CIPHER_CTX *ctx; | 88 | unsigned char *iv, int enc) |
96 | unsigned char *key; | ||
97 | unsigned char *iv; | ||
98 | int enc; | ||
99 | { | 89 | { |
100 | if (key != NULL) | 90 | if (key != NULL) |
101 | BF_set_key(&(ctx->c.bf_ks),EVP_BLOWFISH_KEY_SIZE,key); | 91 | BF_set_key(&(ctx->c.bf_ks),EVP_BLOWFISH_KEY_SIZE,key); |
102 | } | 92 | } |
103 | 93 | ||
104 | static void bf_ecb_cipher(ctx,out,in,inl) | 94 | static void bf_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
105 | EVP_CIPHER_CTX *ctx; | 95 | unsigned char *in, unsigned int inl) |
106 | unsigned char *out; | ||
107 | unsigned char *in; | ||
108 | unsigned int inl; | ||
109 | { | 96 | { |
110 | unsigned int i; | 97 | unsigned int i; |
111 | 98 | ||
diff --git a/src/lib/libcrypto/evp/e_ecb_c.c b/src/lib/libcrypto/evp/e_ecb_c.c index 34e0c18296..ad14e203cb 100644 --- a/src/lib/libcrypto/evp/e_ecb_c.c +++ b/src/lib/libcrypto/evp/e_ecb_c.c | |||
@@ -60,19 +60,13 @@ | |||
60 | 60 | ||
61 | #include <stdio.h> | 61 | #include <stdio.h> |
62 | #include "cryptlib.h" | 62 | #include "cryptlib.h" |
63 | #include "evp.h" | 63 | #include <openssl/evp.h> |
64 | #include "objects.h" | 64 | #include <openssl/objects.h> |
65 | 65 | ||
66 | #ifndef NOPROTO | ||
67 | static void cast_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, | 66 | static void cast_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
68 | unsigned char *iv,int enc); | 67 | unsigned char *iv,int enc); |
69 | static void cast_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 68 | static void cast_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
70 | unsigned char *in, unsigned int inl); | 69 | unsigned char *in, unsigned int inl); |
71 | #else | ||
72 | static void cast_ecb_init_key(); | ||
73 | static void cast_ecb_cipher(); | ||
74 | #endif | ||
75 | |||
76 | static EVP_CIPHER cast5_ecb_cipher= | 70 | static EVP_CIPHER cast5_ecb_cipher= |
77 | { | 71 | { |
78 | NID_cast5_ecb, | 72 | NID_cast5_ecb, |
@@ -86,26 +80,20 @@ static EVP_CIPHER cast5_ecb_cipher= | |||
86 | NULL, | 80 | NULL, |
87 | }; | 81 | }; |
88 | 82 | ||
89 | EVP_CIPHER *EVP_cast5_ecb() | 83 | EVP_CIPHER *EVP_cast5_ecb(void) |
90 | { | 84 | { |
91 | return(&cast5_ecb_cipher); | 85 | return(&cast5_ecb_cipher); |
92 | } | 86 | } |
93 | 87 | ||
94 | static void cast_ecb_init_key(ctx,key,iv,enc) | 88 | static void cast_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
95 | EVP_CIPHER_CTX *ctx; | 89 | unsigned char *iv, int enc) |
96 | unsigned char *key; | ||
97 | unsigned char *iv; | ||
98 | int enc; | ||
99 | { | 90 | { |
100 | if (key != NULL) | 91 | if (key != NULL) |
101 | CAST_set_key(&(ctx->c.cast_ks),EVP_CAST5_KEY_SIZE,key); | 92 | CAST_set_key(&(ctx->c.cast_ks),EVP_CAST5_KEY_SIZE,key); |
102 | } | 93 | } |
103 | 94 | ||
104 | static void cast_ecb_cipher(ctx,out,in,inl) | 95 | static void cast_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
105 | EVP_CIPHER_CTX *ctx; | 96 | unsigned char *in, unsigned int inl) |
106 | unsigned char *out; | ||
107 | unsigned char *in; | ||
108 | unsigned int inl; | ||
109 | { | 97 | { |
110 | unsigned int i; | 98 | unsigned int i; |
111 | 99 | ||
diff --git a/src/lib/libcrypto/evp/e_ecb_d.c b/src/lib/libcrypto/evp/e_ecb_d.c index 7a409d6459..5fb4e64b1c 100644 --- a/src/lib/libcrypto/evp/e_ecb_d.c +++ b/src/lib/libcrypto/evp/e_ecb_d.c | |||
@@ -56,21 +56,16 @@ | |||
56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
57 | */ | 57 | */ |
58 | 58 | ||
59 | #ifndef NO_DES | ||
59 | #include <stdio.h> | 60 | #include <stdio.h> |
60 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
61 | #include "evp.h" | 62 | #include <openssl/evp.h> |
62 | #include "objects.h" | 63 | #include <openssl/objects.h> |
63 | 64 | ||
64 | #ifndef NOPROTO | ||
65 | static void des_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, | 65 | static void des_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
66 | unsigned char *iv,int enc); | 66 | unsigned char *iv,int enc); |
67 | static void des_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 67 | static void des_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
68 | unsigned char *in, unsigned int inl); | 68 | unsigned char *in, unsigned int inl); |
69 | #else | ||
70 | static void des_ecb_init_key(); | ||
71 | static void des_ecb_cipher(); | ||
72 | #endif | ||
73 | |||
74 | static EVP_CIPHER d_ecb_cipher= | 69 | static EVP_CIPHER d_ecb_cipher= |
75 | { | 70 | { |
76 | NID_des_ecb, | 71 | NID_des_ecb, |
@@ -84,35 +79,40 @@ static EVP_CIPHER d_ecb_cipher= | |||
84 | NULL, | 79 | NULL, |
85 | }; | 80 | }; |
86 | 81 | ||
87 | EVP_CIPHER *EVP_des_ecb() | 82 | EVP_CIPHER *EVP_des_ecb(void) |
88 | { | 83 | { |
89 | return(&d_ecb_cipher); | 84 | return(&d_ecb_cipher); |
90 | } | 85 | } |
91 | 86 | ||
92 | static void des_ecb_init_key(ctx,key,iv,enc) | 87 | static void des_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
93 | EVP_CIPHER_CTX *ctx; | 88 | unsigned char *iv, int enc) |
94 | unsigned char *key; | ||
95 | unsigned char *iv; | ||
96 | int enc; | ||
97 | { | 89 | { |
98 | if (key != NULL) | 90 | des_cblock *deskey = (des_cblock *)key; |
99 | des_set_key((des_cblock *)key,ctx->c.des_ks); | 91 | |
92 | if (deskey != NULL) | ||
93 | des_set_key(deskey,ctx->c.des_ks); | ||
100 | } | 94 | } |
101 | 95 | ||
102 | static void des_ecb_cipher(ctx,out,in,inl) | 96 | static void des_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
103 | EVP_CIPHER_CTX *ctx; | 97 | unsigned char *in, unsigned int inl) |
104 | unsigned char *out; | ||
105 | unsigned char *in; | ||
106 | unsigned int inl; | ||
107 | { | 98 | { |
108 | unsigned int i; | 99 | unsigned int i; |
100 | des_cblock *output /* = (des_cblock *)out */; | ||
101 | des_cblock *input /* = (des_cblock *)in */; | ||
109 | 102 | ||
110 | if (inl < 8) return; | 103 | if (inl < 8) return; |
111 | inl-=8; | 104 | inl-=8; |
112 | for (i=0; i<=inl; i+=8) | 105 | for (i=0; i<=inl; i+=8) |
113 | { | 106 | { |
114 | des_ecb_encrypt( | 107 | /* Either this ... */ |
115 | (des_cblock *)&(in[i]),(des_cblock *)&(out[i]), | 108 | output = (des_cblock *)(out + i); |
116 | ctx->c.des_ks,ctx->encrypt); | 109 | input = (des_cblock *)(in + i); |
110 | |||
111 | des_ecb_encrypt(input,output,ctx->c.des_ks,ctx->encrypt); | ||
112 | |||
113 | /* ... or this. */ | ||
114 | /* output++; */ | ||
115 | /* input++; */ | ||
117 | } | 116 | } |
118 | } | 117 | } |
118 | #endif | ||
diff --git a/src/lib/libcrypto/evp/e_ecb_i.c b/src/lib/libcrypto/evp/e_ecb_i.c index e24022a12c..50a3da1bba 100644 --- a/src/lib/libcrypto/evp/e_ecb_i.c +++ b/src/lib/libcrypto/evp/e_ecb_i.c | |||
@@ -60,19 +60,13 @@ | |||
60 | 60 | ||
61 | #include <stdio.h> | 61 | #include <stdio.h> |
62 | #include "cryptlib.h" | 62 | #include "cryptlib.h" |
63 | #include "evp.h" | 63 | #include <openssl/evp.h> |
64 | #include "objects.h" | 64 | #include <openssl/objects.h> |
65 | 65 | ||
66 | #ifndef NOPROTO | ||
67 | static void idea_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, | 66 | static void idea_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
68 | unsigned char *iv,int enc); | 67 | unsigned char *iv,int enc); |
69 | static void idea_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 68 | static void idea_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
70 | unsigned char *in, unsigned int inl); | 69 | unsigned char *in, unsigned int inl); |
71 | #else | ||
72 | static void idea_ecb_init_key(); | ||
73 | static void idea_ecb_cipher(); | ||
74 | #endif | ||
75 | |||
76 | static EVP_CIPHER i_ecb_cipher= | 70 | static EVP_CIPHER i_ecb_cipher= |
77 | { | 71 | { |
78 | NID_idea_ecb, | 72 | NID_idea_ecb, |
@@ -86,16 +80,13 @@ static EVP_CIPHER i_ecb_cipher= | |||
86 | NULL, | 80 | NULL, |
87 | }; | 81 | }; |
88 | 82 | ||
89 | EVP_CIPHER *EVP_idea_ecb() | 83 | EVP_CIPHER *EVP_idea_ecb(void) |
90 | { | 84 | { |
91 | return(&i_ecb_cipher); | 85 | return(&i_ecb_cipher); |
92 | } | 86 | } |
93 | 87 | ||
94 | static void idea_ecb_init_key(ctx,key,iv,enc) | 88 | static void idea_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
95 | EVP_CIPHER_CTX *ctx; | 89 | unsigned char *iv, int enc) |
96 | unsigned char *key; | ||
97 | unsigned char *iv; | ||
98 | int enc; | ||
99 | { | 90 | { |
100 | if (key != NULL) | 91 | if (key != NULL) |
101 | { | 92 | { |
@@ -113,11 +104,8 @@ int enc; | |||
113 | } | 104 | } |
114 | } | 105 | } |
115 | 106 | ||
116 | static void idea_ecb_cipher(ctx,out,in,inl) | 107 | static void idea_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
117 | EVP_CIPHER_CTX *ctx; | 108 | unsigned char *in, unsigned int inl) |
118 | unsigned char *out; | ||
119 | unsigned char *in; | ||
120 | unsigned int inl; | ||
121 | { | 109 | { |
122 | unsigned int i; | 110 | unsigned int i; |
123 | 111 | ||
diff --git a/src/lib/libcrypto/evp/e_ecb_r2.c b/src/lib/libcrypto/evp/e_ecb_r2.c index e35b06dc6d..3c2330130d 100644 --- a/src/lib/libcrypto/evp/e_ecb_r2.c +++ b/src/lib/libcrypto/evp/e_ecb_r2.c | |||
@@ -60,19 +60,13 @@ | |||
60 | 60 | ||
61 | #include <stdio.h> | 61 | #include <stdio.h> |
62 | #include "cryptlib.h" | 62 | #include "cryptlib.h" |
63 | #include "evp.h" | 63 | #include <openssl/evp.h> |
64 | #include "objects.h" | 64 | #include <openssl/objects.h> |
65 | 65 | ||
66 | #ifndef NOPROTO | ||
67 | static void rc2_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, | 66 | static void rc2_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
68 | unsigned char *iv,int enc); | 67 | unsigned char *iv,int enc); |
69 | static void rc2_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 68 | static void rc2_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
70 | unsigned char *in, unsigned int inl); | 69 | unsigned char *in, unsigned int inl); |
71 | #else | ||
72 | static void rc2_ecb_init_key(); | ||
73 | static void rc2_ecb_cipher(); | ||
74 | #endif | ||
75 | |||
76 | static EVP_CIPHER r2_ecb_cipher= | 70 | static EVP_CIPHER r2_ecb_cipher= |
77 | { | 71 | { |
78 | NID_rc2_ecb, | 72 | NID_rc2_ecb, |
@@ -86,27 +80,21 @@ static EVP_CIPHER r2_ecb_cipher= | |||
86 | NULL, | 80 | NULL, |
87 | }; | 81 | }; |
88 | 82 | ||
89 | EVP_CIPHER *EVP_rc2_ecb() | 83 | EVP_CIPHER *EVP_rc2_ecb(void) |
90 | { | 84 | { |
91 | return(&r2_ecb_cipher); | 85 | return(&r2_ecb_cipher); |
92 | } | 86 | } |
93 | 87 | ||
94 | static void rc2_ecb_init_key(ctx,key,iv,enc) | 88 | static void rc2_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
95 | EVP_CIPHER_CTX *ctx; | 89 | unsigned char *iv, int enc) |
96 | unsigned char *key; | ||
97 | unsigned char *iv; | ||
98 | int enc; | ||
99 | { | 90 | { |
100 | if (key != NULL) | 91 | if (key != NULL) |
101 | RC2_set_key(&(ctx->c.rc2_ks),EVP_RC2_KEY_SIZE,key, | 92 | RC2_set_key(&(ctx->c.rc2_ks),EVP_CIPHER_CTX_key_length(ctx), |
102 | EVP_RC2_KEY_SIZE*8); | 93 | key,EVP_CIPHER_CTX_key_length(ctx)*8); |
103 | } | 94 | } |
104 | 95 | ||
105 | static void rc2_ecb_cipher(ctx,out,in,inl) | 96 | static void rc2_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
106 | EVP_CIPHER_CTX *ctx; | 97 | unsigned char *in, unsigned int inl) |
107 | unsigned char *out; | ||
108 | unsigned char *in; | ||
109 | unsigned int inl; | ||
110 | { | 98 | { |
111 | unsigned int i; | 99 | unsigned int i; |
112 | 100 | ||
diff --git a/src/lib/libcrypto/evp/e_ecb_r5.c b/src/lib/libcrypto/evp/e_ecb_r5.c index 08f4a82651..ef43ce34bf 100644 --- a/src/lib/libcrypto/evp/e_ecb_r5.c +++ b/src/lib/libcrypto/evp/e_ecb_r5.c | |||
@@ -60,19 +60,13 @@ | |||
60 | 60 | ||
61 | #include <stdio.h> | 61 | #include <stdio.h> |
62 | #include "cryptlib.h" | 62 | #include "cryptlib.h" |
63 | #include "evp.h" | 63 | #include <openssl/evp.h> |
64 | #include "objects.h" | 64 | #include <openssl/objects.h> |
65 | 65 | ||
66 | #ifndef NOPROTO | ||
67 | static void rc5_32_12_16_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, | 66 | static void rc5_32_12_16_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
68 | unsigned char *iv,int enc); | 67 | unsigned char *iv,int enc); |
69 | static void rc5_32_12_16_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 68 | static void rc5_32_12_16_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
70 | unsigned char *in, unsigned int inl); | 69 | unsigned char *in, unsigned int inl); |
71 | #else | ||
72 | static void rc5_32_12_16_ecb_init_key(); | ||
73 | static void rc5_32_12_16_ecb_cipher(); | ||
74 | #endif | ||
75 | |||
76 | static EVP_CIPHER rc5_ecb_cipher= | 70 | static EVP_CIPHER rc5_ecb_cipher= |
77 | { | 71 | { |
78 | NID_rc5_ecb, | 72 | NID_rc5_ecb, |
@@ -86,27 +80,21 @@ static EVP_CIPHER rc5_ecb_cipher= | |||
86 | NULL, | 80 | NULL, |
87 | }; | 81 | }; |
88 | 82 | ||
89 | EVP_CIPHER *EVP_rc5_32_12_16_ecb() | 83 | EVP_CIPHER *EVP_rc5_32_12_16_ecb(void) |
90 | { | 84 | { |
91 | return(&rc5_ecb_cipher); | 85 | return(&rc5_ecb_cipher); |
92 | } | 86 | } |
93 | 87 | ||
94 | static void rc5_32_12_16_ecb_init_key(ctx,key,iv,enc) | 88 | static void rc5_32_12_16_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
95 | EVP_CIPHER_CTX *ctx; | 89 | unsigned char *iv, int enc) |
96 | unsigned char *key; | ||
97 | unsigned char *iv; | ||
98 | int enc; | ||
99 | { | 90 | { |
100 | if (key != NULL) | 91 | if (key != NULL) |
101 | RC5_32_set_key(&(ctx->c.rc5_ks),EVP_RC5_32_12_16_KEY_SIZE,key, | 92 | RC5_32_set_key(&(ctx->c.rc5_ks),EVP_RC5_32_12_16_KEY_SIZE,key, |
102 | RC5_12_ROUNDS); | 93 | RC5_12_ROUNDS); |
103 | } | 94 | } |
104 | 95 | ||
105 | static void rc5_32_12_16_ecb_cipher(ctx,out,in,inl) | 96 | static void rc5_32_12_16_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
106 | EVP_CIPHER_CTX *ctx; | 97 | unsigned char *in, unsigned int inl) |
107 | unsigned char *out; | ||
108 | unsigned char *in; | ||
109 | unsigned int inl; | ||
110 | { | 98 | { |
111 | unsigned int i; | 99 | unsigned int i; |
112 | 100 | ||
diff --git a/src/lib/libcrypto/evp/e_null.c b/src/lib/libcrypto/evp/e_null.c index e4e7ca7606..0a62c10aa9 100644 --- a/src/lib/libcrypto/evp/e_null.c +++ b/src/lib/libcrypto/evp/e_null.c | |||
@@ -58,19 +58,13 @@ | |||
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include "evp.h" | 61 | #include <openssl/evp.h> |
62 | #include "objects.h" | 62 | #include <openssl/objects.h> |
63 | 63 | ||
64 | #ifndef NOPROTO | ||
65 | static void null_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, | 64 | static void null_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
66 | unsigned char *iv,int enc); | 65 | unsigned char *iv,int enc); |
67 | static void null_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 66 | static void null_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
68 | unsigned char *in, unsigned int inl); | 67 | unsigned char *in, unsigned int inl); |
69 | #else | ||
70 | static void null_init_key(); | ||
71 | static void null_cipher(); | ||
72 | #endif | ||
73 | |||
74 | static EVP_CIPHER n_cipher= | 68 | static EVP_CIPHER n_cipher= |
75 | { | 69 | { |
76 | NID_undef, | 70 | NID_undef, |
@@ -83,25 +77,19 @@ static EVP_CIPHER n_cipher= | |||
83 | NULL, | 77 | NULL, |
84 | }; | 78 | }; |
85 | 79 | ||
86 | EVP_CIPHER *EVP_enc_null() | 80 | EVP_CIPHER *EVP_enc_null(void) |
87 | { | 81 | { |
88 | return(&n_cipher); | 82 | return(&n_cipher); |
89 | } | 83 | } |
90 | 84 | ||
91 | static void null_init_key(ctx,key,iv,enc) | 85 | static void null_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
92 | EVP_CIPHER_CTX *ctx; | 86 | unsigned char *iv, int enc) |
93 | unsigned char *key; | ||
94 | unsigned char *iv; | ||
95 | int enc; | ||
96 | { | 87 | { |
97 | memset(&(ctx->c),0,sizeof(ctx->c)); | 88 | memset(&(ctx->c),0,sizeof(ctx->c)); |
98 | } | 89 | } |
99 | 90 | ||
100 | static void null_cipher(ctx,out,in,inl) | 91 | static void null_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
101 | EVP_CIPHER_CTX *ctx; | 92 | unsigned char *in, unsigned int inl) |
102 | unsigned char *out; | ||
103 | unsigned char *in; | ||
104 | unsigned int inl; | ||
105 | { | 93 | { |
106 | if (in != out) | 94 | if (in != out) |
107 | memcpy((char *)out,(char *)in,(int)inl); | 95 | memcpy((char *)out,(char *)in,(int)inl); |
diff --git a/src/lib/libcrypto/evp/e_ofb_3d.c b/src/lib/libcrypto/evp/e_ofb_3d.c index c3add18e93..5233567c0c 100644 --- a/src/lib/libcrypto/evp/e_ofb_3d.c +++ b/src/lib/libcrypto/evp/e_ofb_3d.c | |||
@@ -56,24 +56,18 @@ | |||
56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
57 | */ | 57 | */ |
58 | 58 | ||
59 | #ifndef NO_DES | ||
59 | #include <stdio.h> | 60 | #include <stdio.h> |
60 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
61 | #include "evp.h" | 62 | #include <openssl/evp.h> |
62 | #include "objects.h" | 63 | #include <openssl/objects.h> |
63 | 64 | ||
64 | #ifndef NOPROTO | ||
65 | static void des_ede_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, | 65 | static void des_ede_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
66 | unsigned char *iv,int enc); | 66 | unsigned char *iv,int enc); |
67 | static void des_ede3_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, | 67 | static void des_ede3_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
68 | unsigned char *iv,int enc); | 68 | unsigned char *iv,int enc); |
69 | static void des_ede_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 69 | static void des_ede_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
70 | unsigned char *in, unsigned int inl); | 70 | unsigned char *in, unsigned int inl); |
71 | #else | ||
72 | static void des_ede_ofb_init_key(); | ||
73 | static void des_ede3_ofb_init_key(); | ||
74 | static void des_ede_ofb_cipher(); | ||
75 | #endif | ||
76 | |||
77 | static EVP_CIPHER d_ede_ofb_cipher2= | 71 | static EVP_CIPHER d_ede_ofb_cipher2= |
78 | { | 72 | { |
79 | NID_des_ede_ofb64, | 73 | NID_des_ede_ofb64, |
@@ -100,66 +94,59 @@ static EVP_CIPHER d_ede3_ofb_cipher3= | |||
100 | EVP_CIPHER_get_asn1_iv, | 94 | EVP_CIPHER_get_asn1_iv, |
101 | }; | 95 | }; |
102 | 96 | ||
103 | EVP_CIPHER *EVP_des_ede_ofb() | 97 | EVP_CIPHER *EVP_des_ede_ofb(void) |
104 | { | 98 | { |
105 | return(&d_ede_ofb_cipher2); | 99 | return(&d_ede_ofb_cipher2); |
106 | } | 100 | } |
107 | 101 | ||
108 | EVP_CIPHER *EVP_des_ede3_ofb() | 102 | EVP_CIPHER *EVP_des_ede3_ofb(void) |
109 | { | 103 | { |
110 | return(&d_ede3_ofb_cipher3); | 104 | return(&d_ede3_ofb_cipher3); |
111 | } | 105 | } |
112 | 106 | ||
113 | static void des_ede_ofb_init_key(ctx,key,iv,enc) | 107 | static void des_ede_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
114 | EVP_CIPHER_CTX *ctx; | 108 | unsigned char *iv, int enc) |
115 | unsigned char *key; | ||
116 | unsigned char *iv; | ||
117 | int enc; | ||
118 | { | 109 | { |
110 | des_cblock *deskey = (des_cblock *)key; | ||
111 | |||
119 | ctx->num=0; | 112 | ctx->num=0; |
120 | 113 | ||
121 | if (iv != NULL) | 114 | if (iv != NULL) |
122 | memcpy(&(ctx->oiv[0]),iv,8); | 115 | memcpy(&(ctx->oiv[0]),iv,8); |
123 | memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); | 116 | memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); |
124 | if (key != NULL) | 117 | if (deskey != NULL) |
125 | { | 118 | { |
126 | des_set_key((des_cblock *)key,ctx->c.des_ede.ks1); | 119 | des_set_key(&deskey[0],ctx->c.des_ede.ks1); |
127 | des_set_key((des_cblock *)&(key[8]),ctx->c.des_ede.ks2); | 120 | des_set_key(&deskey[1],ctx->c.des_ede.ks2); |
128 | memcpy( (char *)ctx->c.des_ede.ks3, | 121 | memcpy( (char *)ctx->c.des_ede.ks3, |
129 | (char *)ctx->c.des_ede.ks1, | 122 | (char *)ctx->c.des_ede.ks1, |
130 | sizeof(ctx->c.des_ede.ks1)); | 123 | sizeof(ctx->c.des_ede.ks1)); |
131 | } | 124 | } |
132 | } | 125 | } |
133 | 126 | ||
134 | static void des_ede3_ofb_init_key(ctx,key,iv,enc) | 127 | static void des_ede3_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
135 | EVP_CIPHER_CTX *ctx; | 128 | unsigned char *iv, int enc) |
136 | unsigned char *key; | ||
137 | unsigned char *iv; | ||
138 | int enc; | ||
139 | { | 129 | { |
130 | des_cblock *deskey = (des_cblock *)key; | ||
131 | |||
140 | ctx->num=0; | 132 | ctx->num=0; |
141 | 133 | ||
142 | if (iv != NULL) | 134 | if (iv != NULL) |
143 | memcpy(&(ctx->oiv[0]),iv,8); | 135 | memcpy(&(ctx->oiv[0]),iv,8); |
144 | memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); | 136 | memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); |
145 | if (key != NULL) | 137 | if (deskey != NULL) |
146 | { | 138 | { |
147 | des_set_key((des_cblock *)key,ctx->c.des_ede.ks1); | 139 | des_set_key(&deskey[0],ctx->c.des_ede.ks1); |
148 | des_set_key((des_cblock *)&(key[8]),ctx->c.des_ede.ks2); | 140 | des_set_key(&deskey[1],ctx->c.des_ede.ks2); |
149 | des_set_key((des_cblock *)&(key[16]),ctx->c.des_ede.ks3); | 141 | des_set_key(&deskey[2],ctx->c.des_ede.ks3); |
150 | } | 142 | } |
151 | } | 143 | } |
152 | 144 | ||
153 | static void des_ede_ofb_cipher(ctx,out,in,inl) | 145 | static void des_ede_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
154 | EVP_CIPHER_CTX *ctx; | 146 | unsigned char *in, unsigned int inl) |
155 | unsigned char *out; | ||
156 | unsigned char *in; | ||
157 | unsigned int inl; | ||
158 | { | 147 | { |
159 | des_ede3_ofb64_encrypt( | 148 | des_ede3_ofb64_encrypt(in,out,inl,ctx->c.des_ede.ks1, |
160 | in,out, | 149 | ctx->c.des_ede.ks2, ctx->c.des_ede.ks3, |
161 | (long)inl, | 150 | (des_cblock *)&(ctx->iv[0]),&ctx->num); |
162 | ctx->c.des_ede.ks1, ctx->c.des_ede.ks2, ctx->c.des_ede.ks3, | ||
163 | (des_cblock *)&(ctx->iv[0]), | ||
164 | &ctx->num); | ||
165 | } | 151 | } |
152 | #endif | ||
diff --git a/src/lib/libcrypto/evp/e_ofb_bf.c b/src/lib/libcrypto/evp/e_ofb_bf.c index 492f9b9082..c82154b549 100644 --- a/src/lib/libcrypto/evp/e_ofb_bf.c +++ b/src/lib/libcrypto/evp/e_ofb_bf.c | |||
@@ -56,23 +56,16 @@ | |||
56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
57 | */ | 57 | */ |
58 | 58 | ||
59 | #ifndef NO_BLOWFISH | 59 | #ifndef NO_BF |
60 | |||
61 | #include <stdio.h> | 60 | #include <stdio.h> |
62 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
63 | #include "evp.h" | 62 | #include <openssl/evp.h> |
64 | #include "objects.h" | 63 | #include <openssl/objects.h> |
65 | 64 | ||
66 | #ifndef NOPROTO | ||
67 | static void bf_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, | 65 | static void bf_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
68 | unsigned char *iv,int enc); | 66 | unsigned char *iv,int enc); |
69 | static void bf_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 67 | static void bf_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
70 | unsigned char *in, unsigned int inl); | 68 | unsigned char *in, unsigned int inl); |
71 | #else | ||
72 | static void bf_ofb_init_key(); | ||
73 | static void bf_ofb_cipher(); | ||
74 | #endif | ||
75 | |||
76 | static EVP_CIPHER bfish_ofb_cipher= | 69 | static EVP_CIPHER bfish_ofb_cipher= |
77 | { | 70 | { |
78 | NID_bf_ofb64, | 71 | NID_bf_ofb64, |
@@ -86,16 +79,13 @@ static EVP_CIPHER bfish_ofb_cipher= | |||
86 | EVP_CIPHER_get_asn1_iv, | 79 | EVP_CIPHER_get_asn1_iv, |
87 | }; | 80 | }; |
88 | 81 | ||
89 | EVP_CIPHER *EVP_bf_ofb() | 82 | EVP_CIPHER *EVP_bf_ofb(void) |
90 | { | 83 | { |
91 | return(&bfish_ofb_cipher); | 84 | return(&bfish_ofb_cipher); |
92 | } | 85 | } |
93 | 86 | ||
94 | static void bf_ofb_init_key(ctx,key,iv,enc) | 87 | static void bf_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
95 | EVP_CIPHER_CTX *ctx; | 88 | unsigned char *iv, int enc) |
96 | unsigned char *key; | ||
97 | unsigned char *iv; | ||
98 | int enc; | ||
99 | { | 89 | { |
100 | ctx->num=0; | 90 | ctx->num=0; |
101 | 91 | ||
@@ -106,11 +96,8 @@ int enc; | |||
106 | BF_set_key(&(ctx->c.bf_ks),EVP_BLOWFISH_KEY_SIZE,key); | 96 | BF_set_key(&(ctx->c.bf_ks),EVP_BLOWFISH_KEY_SIZE,key); |
107 | } | 97 | } |
108 | 98 | ||
109 | static void bf_ofb_cipher(ctx,out,in,inl) | 99 | static void bf_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
110 | EVP_CIPHER_CTX *ctx; | 100 | unsigned char *in, unsigned int inl) |
111 | unsigned char *out; | ||
112 | unsigned char *in; | ||
113 | unsigned int inl; | ||
114 | { | 101 | { |
115 | BF_ofb64_encrypt( | 102 | BF_ofb64_encrypt( |
116 | in,out, | 103 | in,out, |
diff --git a/src/lib/libcrypto/evp/e_ofb_c.c b/src/lib/libcrypto/evp/e_ofb_c.c index f1eef4469c..971043de4c 100644 --- a/src/lib/libcrypto/evp/e_ofb_c.c +++ b/src/lib/libcrypto/evp/e_ofb_c.c | |||
@@ -60,19 +60,13 @@ | |||
60 | 60 | ||
61 | #include <stdio.h> | 61 | #include <stdio.h> |
62 | #include "cryptlib.h" | 62 | #include "cryptlib.h" |
63 | #include "evp.h" | 63 | #include <openssl/evp.h> |
64 | #include "objects.h" | 64 | #include <openssl/objects.h> |
65 | 65 | ||
66 | #ifndef NOPROTO | ||
67 | static void cast_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, | 66 | static void cast_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
68 | unsigned char *iv,int enc); | 67 | unsigned char *iv,int enc); |
69 | static void cast_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 68 | static void cast_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
70 | unsigned char *in, unsigned int inl); | 69 | unsigned char *in, unsigned int inl); |
71 | #else | ||
72 | static void cast_ofb_init_key(); | ||
73 | static void cast_ofb_cipher(); | ||
74 | #endif | ||
75 | |||
76 | static EVP_CIPHER cast5_ofb_cipher= | 70 | static EVP_CIPHER cast5_ofb_cipher= |
77 | { | 71 | { |
78 | NID_cast5_ofb64, | 72 | NID_cast5_ofb64, |
@@ -86,16 +80,13 @@ static EVP_CIPHER cast5_ofb_cipher= | |||
86 | EVP_CIPHER_get_asn1_iv, | 80 | EVP_CIPHER_get_asn1_iv, |
87 | }; | 81 | }; |
88 | 82 | ||
89 | EVP_CIPHER *EVP_cast5_ofb() | 83 | EVP_CIPHER *EVP_cast5_ofb(void) |
90 | { | 84 | { |
91 | return(&cast5_ofb_cipher); | 85 | return(&cast5_ofb_cipher); |
92 | } | 86 | } |
93 | 87 | ||
94 | static void cast_ofb_init_key(ctx,key,iv,enc) | 88 | static void cast_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
95 | EVP_CIPHER_CTX *ctx; | 89 | unsigned char *iv, int enc) |
96 | unsigned char *key; | ||
97 | unsigned char *iv; | ||
98 | int enc; | ||
99 | { | 90 | { |
100 | ctx->num=0; | 91 | ctx->num=0; |
101 | 92 | ||
@@ -106,11 +97,8 @@ int enc; | |||
106 | CAST_set_key(&(ctx->c.cast_ks),EVP_CAST5_KEY_SIZE,key); | 97 | CAST_set_key(&(ctx->c.cast_ks),EVP_CAST5_KEY_SIZE,key); |
107 | } | 98 | } |
108 | 99 | ||
109 | static void cast_ofb_cipher(ctx,out,in,inl) | 100 | static void cast_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
110 | EVP_CIPHER_CTX *ctx; | 101 | unsigned char *in, unsigned int inl) |
111 | unsigned char *out; | ||
112 | unsigned char *in; | ||
113 | unsigned int inl; | ||
114 | { | 102 | { |
115 | CAST_ofb64_encrypt( | 103 | CAST_ofb64_encrypt( |
116 | in,out, | 104 | in,out, |
diff --git a/src/lib/libcrypto/evp/e_ofb_d.c b/src/lib/libcrypto/evp/e_ofb_d.c index 09d4b4139d..398b3a002e 100644 --- a/src/lib/libcrypto/evp/e_ofb_d.c +++ b/src/lib/libcrypto/evp/e_ofb_d.c | |||
@@ -56,21 +56,16 @@ | |||
56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
57 | */ | 57 | */ |
58 | 58 | ||
59 | #ifndef NO_DES | ||
59 | #include <stdio.h> | 60 | #include <stdio.h> |
60 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
61 | #include "evp.h" | 62 | #include <openssl/evp.h> |
62 | #include "objects.h" | 63 | #include <openssl/objects.h> |
63 | 64 | ||
64 | #ifndef NOPROTO | ||
65 | static void des_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, | 65 | static void des_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
66 | unsigned char *iv,int enc); | 66 | unsigned char *iv,int enc); |
67 | static void des_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 67 | static void des_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
68 | unsigned char *in, unsigned int inl); | 68 | unsigned char *in, unsigned int inl); |
69 | #else | ||
70 | static void des_ofb_init_key(); | ||
71 | static void des_ofb_cipher(); | ||
72 | #endif | ||
73 | |||
74 | static EVP_CIPHER d_ofb_cipher= | 69 | static EVP_CIPHER d_ofb_cipher= |
75 | { | 70 | { |
76 | NID_des_ofb64, | 71 | NID_des_ofb64, |
@@ -84,35 +79,29 @@ static EVP_CIPHER d_ofb_cipher= | |||
84 | EVP_CIPHER_get_asn1_iv, | 79 | EVP_CIPHER_get_asn1_iv, |
85 | }; | 80 | }; |
86 | 81 | ||
87 | EVP_CIPHER *EVP_des_ofb() | 82 | EVP_CIPHER *EVP_des_ofb(void) |
88 | { | 83 | { |
89 | return(&d_ofb_cipher); | 84 | return(&d_ofb_cipher); |
90 | } | 85 | } |
91 | 86 | ||
92 | static void des_ofb_init_key(ctx,key,iv,enc) | 87 | static void des_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
93 | EVP_CIPHER_CTX *ctx; | 88 | unsigned char *iv, int enc) |
94 | unsigned char *key; | ||
95 | unsigned char *iv; | ||
96 | int enc; | ||
97 | { | 89 | { |
90 | des_cblock *deskey = (des_cblock *)key; | ||
91 | |||
98 | ctx->num=0; | 92 | ctx->num=0; |
99 | 93 | ||
100 | if (iv != NULL) | 94 | if (iv != NULL) |
101 | memcpy(&(ctx->oiv[0]),iv,8); | 95 | memcpy(&(ctx->oiv[0]),iv,8); |
102 | memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); | 96 | memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); |
103 | if (key != NULL) | 97 | if (deskey != NULL) |
104 | des_set_key((des_cblock *)key,ctx->c.des_ks); | 98 | des_set_key(deskey,ctx->c.des_ks); |
105 | } | 99 | } |
106 | 100 | ||
107 | static void des_ofb_cipher(ctx,out,in,inl) | 101 | static void des_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
108 | EVP_CIPHER_CTX *ctx; | 102 | unsigned char *in, unsigned int inl) |
109 | unsigned char *out; | ||
110 | unsigned char *in; | ||
111 | unsigned int inl; | ||
112 | { | 103 | { |
113 | des_ofb64_encrypt( | 104 | des_ofb64_encrypt(in,out,inl,ctx->c.des_ks, |
114 | in,out, | 105 | (des_cblock *)&(ctx->iv[0]),&ctx->num); |
115 | (long)inl, ctx->c.des_ks, | ||
116 | (des_cblock *)&(ctx->iv[0]), | ||
117 | &ctx->num); | ||
118 | } | 106 | } |
107 | #endif | ||
diff --git a/src/lib/libcrypto/evp/e_ofb_i.c b/src/lib/libcrypto/evp/e_ofb_i.c index 96c8afd9c8..389206ef36 100644 --- a/src/lib/libcrypto/evp/e_ofb_i.c +++ b/src/lib/libcrypto/evp/e_ofb_i.c | |||
@@ -60,19 +60,13 @@ | |||
60 | 60 | ||
61 | #include <stdio.h> | 61 | #include <stdio.h> |
62 | #include "cryptlib.h" | 62 | #include "cryptlib.h" |
63 | #include "evp.h" | 63 | #include <openssl/evp.h> |
64 | #include "objects.h" | 64 | #include <openssl/objects.h> |
65 | 65 | ||
66 | #ifndef NOPROTO | ||
67 | static void idea_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, | 66 | static void idea_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
68 | unsigned char *iv,int enc); | 67 | unsigned char *iv,int enc); |
69 | static void idea_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 68 | static void idea_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
70 | unsigned char *in, unsigned int inl); | 69 | unsigned char *in, unsigned int inl); |
71 | #else | ||
72 | static void idea_ofb_init_key(); | ||
73 | static void idea_ofb_cipher(); | ||
74 | #endif | ||
75 | |||
76 | static EVP_CIPHER i_ofb_cipher= | 70 | static EVP_CIPHER i_ofb_cipher= |
77 | { | 71 | { |
78 | NID_idea_ofb64, | 72 | NID_idea_ofb64, |
@@ -86,16 +80,13 @@ static EVP_CIPHER i_ofb_cipher= | |||
86 | EVP_CIPHER_get_asn1_iv, | 80 | EVP_CIPHER_get_asn1_iv, |
87 | }; | 81 | }; |
88 | 82 | ||
89 | EVP_CIPHER *EVP_idea_ofb() | 83 | EVP_CIPHER *EVP_idea_ofb(void) |
90 | { | 84 | { |
91 | return(&i_ofb_cipher); | 85 | return(&i_ofb_cipher); |
92 | } | 86 | } |
93 | 87 | ||
94 | static void idea_ofb_init_key(ctx,key,iv,enc) | 88 | static void idea_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
95 | EVP_CIPHER_CTX *ctx; | 89 | unsigned char *iv, int enc) |
96 | unsigned char *key; | ||
97 | unsigned char *iv; | ||
98 | int enc; | ||
99 | { | 90 | { |
100 | ctx->num=0; | 91 | ctx->num=0; |
101 | 92 | ||
@@ -106,11 +97,8 @@ int enc; | |||
106 | idea_set_encrypt_key(key,&(ctx->c.idea_ks)); | 97 | idea_set_encrypt_key(key,&(ctx->c.idea_ks)); |
107 | } | 98 | } |
108 | 99 | ||
109 | static void idea_ofb_cipher(ctx,out,in,inl) | 100 | static void idea_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
110 | EVP_CIPHER_CTX *ctx; | 101 | unsigned char *in, unsigned int inl) |
111 | unsigned char *out; | ||
112 | unsigned char *in; | ||
113 | unsigned int inl; | ||
114 | { | 102 | { |
115 | idea_ofb64_encrypt( | 103 | idea_ofb64_encrypt( |
116 | in,out,(long)inl, | 104 | in,out,(long)inl, |
diff --git a/src/lib/libcrypto/evp/e_ofb_r2.c b/src/lib/libcrypto/evp/e_ofb_r2.c index 0f6d729988..60ae3d4507 100644 --- a/src/lib/libcrypto/evp/e_ofb_r2.c +++ b/src/lib/libcrypto/evp/e_ofb_r2.c | |||
@@ -60,19 +60,13 @@ | |||
60 | 60 | ||
61 | #include <stdio.h> | 61 | #include <stdio.h> |
62 | #include "cryptlib.h" | 62 | #include "cryptlib.h" |
63 | #include "evp.h" | 63 | #include <openssl/evp.h> |
64 | #include "objects.h" | 64 | #include <openssl/objects.h> |
65 | 65 | ||
66 | #ifndef NOPROTO | ||
67 | static void rc2_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, | 66 | static void rc2_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
68 | unsigned char *iv,int enc); | 67 | unsigned char *iv,int enc); |
69 | static void rc2_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 68 | static void rc2_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
70 | unsigned char *in, unsigned int inl); | 69 | unsigned char *in, unsigned int inl); |
71 | #else | ||
72 | static void rc2_ofb_init_key(); | ||
73 | static void rc2_ofb_cipher(); | ||
74 | #endif | ||
75 | |||
76 | static EVP_CIPHER r2_ofb_cipher= | 70 | static EVP_CIPHER r2_ofb_cipher= |
77 | { | 71 | { |
78 | NID_rc2_ofb64, | 72 | NID_rc2_ofb64, |
@@ -86,16 +80,13 @@ static EVP_CIPHER r2_ofb_cipher= | |||
86 | EVP_CIPHER_get_asn1_iv, | 80 | EVP_CIPHER_get_asn1_iv, |
87 | }; | 81 | }; |
88 | 82 | ||
89 | EVP_CIPHER *EVP_rc2_ofb() | 83 | EVP_CIPHER *EVP_rc2_ofb(void) |
90 | { | 84 | { |
91 | return(&r2_ofb_cipher); | 85 | return(&r2_ofb_cipher); |
92 | } | 86 | } |
93 | 87 | ||
94 | static void rc2_ofb_init_key(ctx,key,iv,enc) | 88 | static void rc2_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
95 | EVP_CIPHER_CTX *ctx; | 89 | unsigned char *iv, int enc) |
96 | unsigned char *key; | ||
97 | unsigned char *iv; | ||
98 | int enc; | ||
99 | { | 90 | { |
100 | ctx->num=0; | 91 | ctx->num=0; |
101 | 92 | ||
@@ -103,15 +94,12 @@ int enc; | |||
103 | memcpy(&(ctx->oiv[0]),iv,8); | 94 | memcpy(&(ctx->oiv[0]),iv,8); |
104 | memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); | 95 | memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); |
105 | if (key != NULL) | 96 | if (key != NULL) |
106 | RC2_set_key(&(ctx->c.rc2_ks),EVP_RC2_KEY_SIZE,key, | 97 | RC2_set_key(&(ctx->c.rc2_ks),EVP_CIPHER_CTX_key_length(ctx), |
107 | EVP_RC2_KEY_SIZE*8); | 98 | key,EVP_CIPHER_CTX_key_length(ctx)*8); |
108 | } | 99 | } |
109 | 100 | ||
110 | static void rc2_ofb_cipher(ctx,out,in,inl) | 101 | static void rc2_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
111 | EVP_CIPHER_CTX *ctx; | 102 | unsigned char *in, unsigned int inl) |
112 | unsigned char *out; | ||
113 | unsigned char *in; | ||
114 | unsigned int inl; | ||
115 | { | 103 | { |
116 | RC2_ofb64_encrypt( | 104 | RC2_ofb64_encrypt( |
117 | in,out, | 105 | in,out, |
diff --git a/src/lib/libcrypto/evp/e_ofb_r5.c b/src/lib/libcrypto/evp/e_ofb_r5.c index db28d6c317..30136824eb 100644 --- a/src/lib/libcrypto/evp/e_ofb_r5.c +++ b/src/lib/libcrypto/evp/e_ofb_r5.c | |||
@@ -60,19 +60,13 @@ | |||
60 | 60 | ||
61 | #include <stdio.h> | 61 | #include <stdio.h> |
62 | #include "cryptlib.h" | 62 | #include "cryptlib.h" |
63 | #include "evp.h" | 63 | #include <openssl/evp.h> |
64 | #include "objects.h" | 64 | #include <openssl/objects.h> |
65 | 65 | ||
66 | #ifndef NOPROTO | ||
67 | static void rc5_32_12_16_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, | 66 | static void rc5_32_12_16_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
68 | unsigned char *iv,int enc); | 67 | unsigned char *iv,int enc); |
69 | static void rc5_32_12_16_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 68 | static void rc5_32_12_16_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
70 | unsigned char *in, unsigned int inl); | 69 | unsigned char *in, unsigned int inl); |
71 | #else | ||
72 | static void rc5_32_12_16_ofb_init_key(); | ||
73 | static void rc5_32_12_16_ofb_cipher(); | ||
74 | #endif | ||
75 | |||
76 | static EVP_CIPHER rc5_ofb_cipher= | 70 | static EVP_CIPHER rc5_ofb_cipher= |
77 | { | 71 | { |
78 | NID_rc5_ofb64, | 72 | NID_rc5_ofb64, |
@@ -86,16 +80,13 @@ static EVP_CIPHER rc5_ofb_cipher= | |||
86 | EVP_CIPHER_get_asn1_iv, | 80 | EVP_CIPHER_get_asn1_iv, |
87 | }; | 81 | }; |
88 | 82 | ||
89 | EVP_CIPHER *EVP_rc5_32_12_16_ofb() | 83 | EVP_CIPHER *EVP_rc5_32_12_16_ofb(void) |
90 | { | 84 | { |
91 | return(&rc5_ofb_cipher); | 85 | return(&rc5_ofb_cipher); |
92 | } | 86 | } |
93 | 87 | ||
94 | static void rc5_32_12_16_ofb_init_key(ctx,key,iv,enc) | 88 | static void rc5_32_12_16_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
95 | EVP_CIPHER_CTX *ctx; | 89 | unsigned char *iv, int enc) |
96 | unsigned char *key; | ||
97 | unsigned char *iv; | ||
98 | int enc; | ||
99 | { | 90 | { |
100 | ctx->num=0; | 91 | ctx->num=0; |
101 | 92 | ||
@@ -107,11 +98,8 @@ int enc; | |||
107 | RC5_12_ROUNDS); | 98 | RC5_12_ROUNDS); |
108 | } | 99 | } |
109 | 100 | ||
110 | static void rc5_32_12_16_ofb_cipher(ctx,out,in,inl) | 101 | static void rc5_32_12_16_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
111 | EVP_CIPHER_CTX *ctx; | 102 | unsigned char *in, unsigned int inl) |
112 | unsigned char *out; | ||
113 | unsigned char *in; | ||
114 | unsigned int inl; | ||
115 | { | 103 | { |
116 | RC5_32_ofb64_encrypt( | 104 | RC5_32_ofb64_encrypt( |
117 | in,out, | 105 | in,out, |
diff --git a/src/lib/libcrypto/evp/e_rc4.c b/src/lib/libcrypto/evp/e_rc4.c index 7e9790a94c..c7e58a75cc 100644 --- a/src/lib/libcrypto/evp/e_rc4.c +++ b/src/lib/libcrypto/evp/e_rc4.c | |||
@@ -60,19 +60,13 @@ | |||
60 | 60 | ||
61 | #include <stdio.h> | 61 | #include <stdio.h> |
62 | #include "cryptlib.h" | 62 | #include "cryptlib.h" |
63 | #include "evp.h" | 63 | #include <openssl/evp.h> |
64 | #include "objects.h" | 64 | #include <openssl/objects.h> |
65 | 65 | ||
66 | #ifndef NOPROTO | ||
67 | static void rc4_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, | 66 | static void rc4_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
68 | unsigned char *iv,int enc); | 67 | unsigned char *iv,int enc); |
69 | static void rc4_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 68 | static void rc4_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
70 | unsigned char *in, unsigned int inl); | 69 | unsigned char *in, unsigned int inl); |
71 | #else | ||
72 | static void rc4_init_key(); | ||
73 | static void rc4_cipher(); | ||
74 | #endif | ||
75 | |||
76 | static EVP_CIPHER r4_cipher= | 70 | static EVP_CIPHER r4_cipher= |
77 | { | 71 | { |
78 | NID_rc4, | 72 | NID_rc4, |
@@ -94,21 +88,18 @@ static EVP_CIPHER r4_40_cipher= | |||
94 | rc4_cipher, | 88 | rc4_cipher, |
95 | }; | 89 | }; |
96 | 90 | ||
97 | EVP_CIPHER *EVP_rc4() | 91 | EVP_CIPHER *EVP_rc4(void) |
98 | { | 92 | { |
99 | return(&r4_cipher); | 93 | return(&r4_cipher); |
100 | } | 94 | } |
101 | 95 | ||
102 | EVP_CIPHER *EVP_rc4_40() | 96 | EVP_CIPHER *EVP_rc4_40(void) |
103 | { | 97 | { |
104 | return(&r4_40_cipher); | 98 | return(&r4_40_cipher); |
105 | } | 99 | } |
106 | 100 | ||
107 | static void rc4_init_key(ctx,key,iv,enc) | 101 | static void rc4_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
108 | EVP_CIPHER_CTX *ctx; | 102 | unsigned char *iv, int enc) |
109 | unsigned char *key; | ||
110 | unsigned char *iv; | ||
111 | int enc; | ||
112 | { | 103 | { |
113 | if (key != NULL) | 104 | if (key != NULL) |
114 | memcpy(&(ctx->c.rc4.key[0]),key,EVP_CIPHER_CTX_key_length(ctx)); | 105 | memcpy(&(ctx->c.rc4.key[0]),key,EVP_CIPHER_CTX_key_length(ctx)); |
@@ -116,11 +107,8 @@ int enc; | |||
116 | ctx->c.rc4.key); | 107 | ctx->c.rc4.key); |
117 | } | 108 | } |
118 | 109 | ||
119 | static void rc4_cipher(ctx,out,in,inl) | 110 | static void rc4_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
120 | EVP_CIPHER_CTX *ctx; | 111 | unsigned char *in, unsigned int inl) |
121 | unsigned char *out; | ||
122 | unsigned char *in; | ||
123 | unsigned int inl; | ||
124 | { | 112 | { |
125 | RC4(&(ctx->c.rc4.ks),inl,in,out); | 113 | RC4(&(ctx->c.rc4.ks),inl,in,out); |
126 | } | 114 | } |
diff --git a/src/lib/libcrypto/evp/e_xcbc_d.c b/src/lib/libcrypto/evp/e_xcbc_d.c index 0d7fda0c47..3a6628a75c 100644 --- a/src/lib/libcrypto/evp/e_xcbc_d.c +++ b/src/lib/libcrypto/evp/e_xcbc_d.c | |||
@@ -56,21 +56,16 @@ | |||
56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
57 | */ | 57 | */ |
58 | 58 | ||
59 | #ifndef NO_DES | ||
59 | #include <stdio.h> | 60 | #include <stdio.h> |
60 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
61 | #include "evp.h" | 62 | #include <openssl/evp.h> |
62 | #include "objects.h" | 63 | #include <openssl/objects.h> |
63 | 64 | ||
64 | #ifndef NOPROTO | ||
65 | static void desx_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, | 65 | static void desx_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
66 | unsigned char *iv,int enc); | 66 | unsigned char *iv,int enc); |
67 | static void desx_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 67 | static void desx_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
68 | unsigned char *in, unsigned int inl); | 68 | unsigned char *in, unsigned int inl); |
69 | #else | ||
70 | static void desx_cbc_init_key(); | ||
71 | static void desx_cbc_cipher(); | ||
72 | #endif | ||
73 | |||
74 | static EVP_CIPHER d_xcbc_cipher= | 69 | static EVP_CIPHER d_xcbc_cipher= |
75 | { | 70 | { |
76 | NID_desx_cbc, | 71 | NID_desx_cbc, |
@@ -84,39 +79,34 @@ static EVP_CIPHER d_xcbc_cipher= | |||
84 | EVP_CIPHER_get_asn1_iv, | 79 | EVP_CIPHER_get_asn1_iv, |
85 | }; | 80 | }; |
86 | 81 | ||
87 | EVP_CIPHER *EVP_desx_cbc() | 82 | EVP_CIPHER *EVP_desx_cbc(void) |
88 | { | 83 | { |
89 | return(&d_xcbc_cipher); | 84 | return(&d_xcbc_cipher); |
90 | } | 85 | } |
91 | 86 | ||
92 | static void desx_cbc_init_key(ctx,key,iv,enc) | 87 | static void desx_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
93 | EVP_CIPHER_CTX *ctx; | 88 | unsigned char *iv, int enc) |
94 | unsigned char *key; | ||
95 | unsigned char *iv; | ||
96 | int enc; | ||
97 | { | 89 | { |
90 | des_cblock *deskey = (des_cblock *)key; | ||
91 | |||
98 | if (iv != NULL) | 92 | if (iv != NULL) |
99 | memcpy(&(ctx->oiv[0]),iv,8); | 93 | memcpy(&(ctx->oiv[0]),iv,8); |
100 | memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); | 94 | memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); |
101 | if (key != NULL) | 95 | if (deskey != NULL) |
102 | { | 96 | { |
103 | des_set_key((des_cblock *)key,ctx->c.desx_cbc.ks); | 97 | des_set_key(deskey,ctx->c.desx_cbc.ks); |
104 | memcpy(&(ctx->c.desx_cbc.inw[0]),&(key[8]),8); | 98 | memcpy(&(ctx->c.desx_cbc.inw[0]),&(key[8]),8); |
105 | memcpy(&(ctx->c.desx_cbc.outw[0]),&(key[16]),8); | 99 | memcpy(&(ctx->c.desx_cbc.outw[0]),&(key[16]),8); |
106 | } | 100 | } |
107 | } | 101 | } |
108 | 102 | ||
109 | static void desx_cbc_cipher(ctx,out,in,inl) | 103 | static void desx_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
110 | EVP_CIPHER_CTX *ctx; | 104 | unsigned char *in, unsigned int inl) |
111 | unsigned char *out; | ||
112 | unsigned char *in; | ||
113 | unsigned int inl; | ||
114 | { | 105 | { |
115 | des_xcbc_encrypt( | 106 | des_xcbc_encrypt(in,out,inl,ctx->c.desx_cbc.ks, |
116 | (des_cblock *)in,(des_cblock *)out, | ||
117 | (long)inl, ctx->c.desx_cbc.ks, | ||
118 | (des_cblock *)&(ctx->iv[0]), | 107 | (des_cblock *)&(ctx->iv[0]), |
119 | (des_cblock *)&(ctx->c.desx_cbc.inw[0]), | 108 | &ctx->c.desx_cbc.inw, |
120 | (des_cblock *)&(ctx->c.desx_cbc.outw[0]), | 109 | &ctx->c.desx_cbc.outw, |
121 | ctx->encrypt); | 110 | ctx->encrypt); |
122 | } | 111 | } |
112 | #endif | ||
diff --git a/src/lib/libcrypto/evp/encode.c b/src/lib/libcrypto/evp/encode.c index 14d47c1eed..0152624a76 100644 --- a/src/lib/libcrypto/evp/encode.c +++ b/src/lib/libcrypto/evp/encode.c | |||
@@ -58,10 +58,21 @@ | |||
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include "evp.h" | 61 | #include <openssl/evp.h> |
62 | 62 | ||
63 | #ifndef CHARSET_EBCDIC | ||
63 | #define conv_bin2ascii(a) (data_bin2ascii[(a)&0x3f]) | 64 | #define conv_bin2ascii(a) (data_bin2ascii[(a)&0x3f]) |
64 | #define conv_ascii2bin(a) (data_ascii2bin[(a)&0x7f]) | 65 | #define conv_ascii2bin(a) (data_ascii2bin[(a)&0x7f]) |
66 | #else | ||
67 | /* We assume that PEM encoded files are EBCDIC files | ||
68 | * (i.e., printable text files). Convert them here while decoding. | ||
69 | * When encoding, output is EBCDIC (text) format again. | ||
70 | * (No need for conversion in the conv_bin2ascii macro, as the | ||
71 | * underlying textstring data_bin2ascii[] is already EBCDIC) | ||
72 | */ | ||
73 | #define conv_bin2ascii(a) (data_bin2ascii[(a)&0x3f]) | ||
74 | #define conv_ascii2bin(a) (data_ascii2bin[os_toascii[a]&0x7f]) | ||
75 | #endif | ||
65 | 76 | ||
66 | /* 64 char lines | 77 | /* 64 char lines |
67 | * pad input with 0 | 78 | * pad input with 0 |
@@ -110,20 +121,15 @@ static unsigned char data_ascii2bin[128]={ | |||
110 | 0x31,0x32,0x33,0xFF,0xFF,0xFF,0xFF,0xFF, | 121 | 0x31,0x32,0x33,0xFF,0xFF,0xFF,0xFF,0xFF, |
111 | }; | 122 | }; |
112 | 123 | ||
113 | void EVP_EncodeInit(ctx) | 124 | void EVP_EncodeInit(EVP_ENCODE_CTX *ctx) |
114 | EVP_ENCODE_CTX *ctx; | ||
115 | { | 125 | { |
116 | ctx->length=48; | 126 | ctx->length=48; |
117 | ctx->num=0; | 127 | ctx->num=0; |
118 | ctx->line_num=0; | 128 | ctx->line_num=0; |
119 | } | 129 | } |
120 | 130 | ||
121 | void EVP_EncodeUpdate(ctx,out,outl,in,inl) | 131 | void EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, |
122 | EVP_ENCODE_CTX *ctx; | 132 | unsigned char *in, int inl) |
123 | unsigned char *out; | ||
124 | int *outl; | ||
125 | unsigned char *in; | ||
126 | int inl; | ||
127 | { | 133 | { |
128 | int i,j; | 134 | int i,j; |
129 | unsigned int total=0; | 135 | unsigned int total=0; |
@@ -165,10 +171,7 @@ int inl; | |||
165 | *outl=total; | 171 | *outl=total; |
166 | } | 172 | } |
167 | 173 | ||
168 | void EVP_EncodeFinal(ctx,out,outl) | 174 | void EVP_EncodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl) |
169 | EVP_ENCODE_CTX *ctx; | ||
170 | unsigned char *out; | ||
171 | int *outl; | ||
172 | { | 175 | { |
173 | unsigned int ret=0; | 176 | unsigned int ret=0; |
174 | 177 | ||
@@ -182,9 +185,7 @@ int *outl; | |||
182 | *outl=ret; | 185 | *outl=ret; |
183 | } | 186 | } |
184 | 187 | ||
185 | int EVP_EncodeBlock(t,f,dlen) | 188 | int EVP_EncodeBlock(unsigned char *t, unsigned char *f, int dlen) |
186 | unsigned char *t,*f; | ||
187 | int dlen; | ||
188 | { | 189 | { |
189 | int i,ret=0; | 190 | int i,ret=0; |
190 | unsigned long l; | 191 | unsigned long l; |
@@ -218,8 +219,7 @@ int dlen; | |||
218 | return(ret); | 219 | return(ret); |
219 | } | 220 | } |
220 | 221 | ||
221 | void EVP_DecodeInit(ctx) | 222 | void EVP_DecodeInit(EVP_ENCODE_CTX *ctx) |
222 | EVP_ENCODE_CTX *ctx; | ||
223 | { | 223 | { |
224 | ctx->length=30; | 224 | ctx->length=30; |
225 | ctx->num=0; | 225 | ctx->num=0; |
@@ -231,12 +231,8 @@ EVP_ENCODE_CTX *ctx; | |||
231 | * 0 for last line | 231 | * 0 for last line |
232 | * 1 for full line | 232 | * 1 for full line |
233 | */ | 233 | */ |
234 | int EVP_DecodeUpdate(ctx,out,outl,in,inl) | 234 | int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, |
235 | EVP_ENCODE_CTX *ctx; | 235 | unsigned char *in, int inl) |
236 | unsigned char *out; | ||
237 | int *outl; | ||
238 | unsigned char *in; | ||
239 | int inl; | ||
240 | { | 236 | { |
241 | int seof= -1,eof=0,rv= -1,ret=0,i,v,tmp,n,ln,tmp2,exp_nl; | 237 | int seof= -1,eof=0,rv= -1,ret=0,i,v,tmp,n,ln,tmp2,exp_nl; |
242 | unsigned char *d; | 238 | unsigned char *d; |
@@ -341,9 +337,7 @@ end: | |||
341 | return(rv); | 337 | return(rv); |
342 | } | 338 | } |
343 | 339 | ||
344 | int EVP_DecodeBlock(t,f,n) | 340 | int EVP_DecodeBlock(unsigned char *t, unsigned char *f, int n) |
345 | unsigned char *t,*f; | ||
346 | int n; | ||
347 | { | 341 | { |
348 | int i,ret=0,a,b,c,d; | 342 | int i,ret=0,a,b,c,d; |
349 | unsigned long l; | 343 | unsigned long l; |
@@ -383,10 +377,7 @@ int n; | |||
383 | return(ret); | 377 | return(ret); |
384 | } | 378 | } |
385 | 379 | ||
386 | int EVP_DecodeFinal(ctx,out,outl) | 380 | int EVP_DecodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl) |
387 | EVP_ENCODE_CTX *ctx; | ||
388 | unsigned char *out; | ||
389 | int *outl; | ||
390 | { | 381 | { |
391 | int i; | 382 | int i; |
392 | 383 | ||
@@ -404,9 +395,7 @@ int *outl; | |||
404 | } | 395 | } |
405 | 396 | ||
406 | #ifdef undef | 397 | #ifdef undef |
407 | int EVP_DecodeValid(buf,len) | 398 | int EVP_DecodeValid(unsigned char *buf, int len) |
408 | unsigned char *buf; | ||
409 | int len; | ||
410 | { | 399 | { |
411 | int i,num=0,bad=0; | 400 | int i,num=0,bad=0; |
412 | 401 | ||
diff --git a/src/lib/libcrypto/evp/evp.err b/src/lib/libcrypto/evp/evp.err deleted file mode 100644 index cfc17437bc..0000000000 --- a/src/lib/libcrypto/evp/evp.err +++ /dev/null | |||
@@ -1,24 +0,0 @@ | |||
1 | /* Error codes for the EVP functions. */ | ||
2 | |||
3 | /* Function codes. */ | ||
4 | #define EVP_F_D2I_PKEY 100 | ||
5 | #define EVP_F_EVP_DECRYPTFINAL 101 | ||
6 | #define EVP_F_EVP_OPENINIT 102 | ||
7 | #define EVP_F_EVP_PKEY_COPY_PARAMETERS 103 | ||
8 | #define EVP_F_EVP_PKEY_DECRYPT 104 | ||
9 | #define EVP_F_EVP_PKEY_ENCRYPT 105 | ||
10 | #define EVP_F_EVP_PKEY_NEW 106 | ||
11 | #define EVP_F_EVP_SIGNFINAL 107 | ||
12 | #define EVP_F_EVP_VERIFYFINAL 108 | ||
13 | |||
14 | /* Reason codes. */ | ||
15 | #define EVP_R_BAD_DECRYPT 100 | ||
16 | #define EVP_R_DIFFERENT_KEY_TYPES 101 | ||
17 | #define EVP_R_IV_TOO_LARGE 102 | ||
18 | #define EVP_R_MISSING_PARMATERS 103 | ||
19 | #define EVP_R_NO_SIGN_FUNCTION_CONFIGURED 104 | ||
20 | #define EVP_R_NO_VERIFY_FUNCTION_CONFIGURED 105 | ||
21 | #define EVP_R_PUBLIC_KEY_NOT_RSA 106 | ||
22 | #define EVP_R_UNSUPPORTED_CIPHER 107 | ||
23 | #define EVP_R_WRONG_FINAL_BLOCK_LENGTH 108 | ||
24 | #define EVP_R_WRONG_PUBLIC_KEY_TYPE 109 | ||
diff --git a/src/lib/libcrypto/evp/evp.h b/src/lib/libcrypto/evp/evp.h index b39fad93a4..570fe27d39 100644 --- a/src/lib/libcrypto/evp/evp.h +++ b/src/lib/libcrypto/evp/evp.h | |||
@@ -64,40 +64,40 @@ extern "C" { | |||
64 | #endif | 64 | #endif |
65 | 65 | ||
66 | #ifndef NO_MD2 | 66 | #ifndef NO_MD2 |
67 | #include "md2.h" | 67 | #include <openssl/md2.h> |
68 | #endif | 68 | #endif |
69 | #ifndef NO_MD5 | 69 | #ifndef NO_MD5 |
70 | #include "md5.h" | 70 | #include <openssl/md5.h> |
71 | #endif | 71 | #endif |
72 | #if !defined(NO_SHA) || !defined(NO_SHA1) | 72 | #ifndef NO_SHA |
73 | #include "sha.h" | 73 | #include <openssl/sha.h> |
74 | #endif | 74 | #endif |
75 | #ifndef NO_RIPEMD | 75 | #ifndef NO_RIPEMD |
76 | #include "ripemd.h" | 76 | #include <openssl/ripemd.h> |
77 | #endif | 77 | #endif |
78 | #ifndef NO_DES | 78 | #ifndef NO_DES |
79 | #include "des.h" | 79 | #include <openssl/des.h> |
80 | #endif | 80 | #endif |
81 | #ifndef NO_RC4 | 81 | #ifndef NO_RC4 |
82 | #include "rc4.h" | 82 | #include <openssl/rc4.h> |
83 | #endif | 83 | #endif |
84 | #ifndef NO_RC2 | 84 | #ifndef NO_RC2 |
85 | #include "rc2.h" | 85 | #include <openssl/rc2.h> |
86 | #endif | 86 | #endif |
87 | #ifndef NO_RC5 | 87 | #ifndef NO_RC5 |
88 | #include "rc5.h" | 88 | #include <openssl/rc5.h> |
89 | #endif | 89 | #endif |
90 | #ifndef NO_BLOWFISH | 90 | #ifndef NO_BF |
91 | #include "blowfish.h" | 91 | #include <openssl/blowfish.h> |
92 | #endif | 92 | #endif |
93 | #ifndef NO_CAST | 93 | #ifndef NO_CAST |
94 | #include "cast.h" | 94 | #include <openssl/cast.h> |
95 | #endif | 95 | #endif |
96 | #ifndef NO_IDEA | 96 | #ifndef NO_IDEA |
97 | #include "idea.h" | 97 | #include <openssl/idea.h> |
98 | #endif | 98 | #endif |
99 | #ifndef NO_MDC2 | 99 | #ifndef NO_MDC2 |
100 | #include "mdc2.h" | 100 | #include <openssl/mdc2.h> |
101 | #endif | 101 | #endif |
102 | 102 | ||
103 | #define EVP_RC2_KEY_SIZE 16 | 103 | #define EVP_RC2_KEY_SIZE 16 |
@@ -109,25 +109,23 @@ extern "C" { | |||
109 | #define EVP_MAX_KEY_LENGTH 24 | 109 | #define EVP_MAX_KEY_LENGTH 24 |
110 | #define EVP_MAX_IV_LENGTH 8 | 110 | #define EVP_MAX_IV_LENGTH 8 |
111 | 111 | ||
112 | #define PKCS5_SALT_LEN 8 | ||
113 | /* Default PKCS#5 iteration count */ | ||
114 | #define PKCS5_DEFAULT_ITER 2048 | ||
115 | |||
112 | #ifndef NO_RSA | 116 | #ifndef NO_RSA |
113 | #include "rsa.h" | 117 | #include <openssl/rsa.h> |
114 | #else | ||
115 | #define RSA long | ||
116 | #endif | 118 | #endif |
117 | 119 | ||
118 | #ifndef NO_DSA | 120 | #ifndef NO_DSA |
119 | #include "dsa.h" | 121 | #include <openssl/dsa.h> |
120 | #else | ||
121 | #define DSA long | ||
122 | #endif | 122 | #endif |
123 | 123 | ||
124 | #ifndef NO_DH | 124 | #ifndef NO_DH |
125 | #include "dh.h" | 125 | #include <openssl/dh.h> |
126 | #else | ||
127 | #define DH long | ||
128 | #endif | 126 | #endif |
129 | 127 | ||
130 | #include "objects.h" | 128 | #include <openssl/objects.h> |
131 | 129 | ||
132 | #define EVP_PK_RSA 0x0001 | 130 | #define EVP_PK_RSA 0x0001 |
133 | #define EVP_PK_DSA 0x0002 | 131 | #define EVP_PK_DSA 0x0002 |
@@ -159,16 +157,18 @@ typedef struct evp_pkey_st | |||
159 | int references; | 157 | int references; |
160 | union { | 158 | union { |
161 | char *ptr; | 159 | char *ptr; |
160 | #ifndef NO_RSA | ||
162 | struct rsa_st *rsa; /* RSA */ | 161 | struct rsa_st *rsa; /* RSA */ |
162 | #endif | ||
163 | #ifndef NO_DSA | ||
163 | struct dsa_st *dsa; /* DSA */ | 164 | struct dsa_st *dsa; /* DSA */ |
165 | #endif | ||
166 | #ifndef NO_DH | ||
164 | struct dh_st *dh; /* DH */ | 167 | struct dh_st *dh; /* DH */ |
168 | #endif | ||
165 | } pkey; | 169 | } pkey; |
166 | int save_parameters; | 170 | int save_parameters; |
167 | #ifdef HEADER_STACK_H | 171 | STACK /*X509_ATTRIBUTE*/ *attributes; /* [ 0 ] */ |
168 | STACK /* X509_ATTRIBUTE */ *attributes; /* [ 0 ] */ | ||
169 | #else | ||
170 | char /* X509_ATTRIBUTE */ *attributes; /* [ 0 ] */ | ||
171 | #endif | ||
172 | } EVP_PKEY; | 172 | } EVP_PKEY; |
173 | 173 | ||
174 | #define EVP_PKEY_MO_SIGN 0x0001 | 174 | #define EVP_PKEY_MO_SIGN 0x0001 |
@@ -183,7 +183,7 @@ typedef struct evp_pkey_st | |||
183 | * This is required because for various smart-card perform the digest and | 183 | * This is required because for various smart-card perform the digest and |
184 | * signing/verification on-board. To handle this case, the specific | 184 | * signing/verification on-board. To handle this case, the specific |
185 | * EVP_MD and EVP_PKEY_METHODs need to be closely associated. | 185 | * EVP_MD and EVP_PKEY_METHODs need to be closely associated. |
186 | * When a PKEY is created, it will have a EVP_PKEY_METHOD ossociated with it. | 186 | * When a PKEY is created, it will have a EVP_PKEY_METHOD associated with it. |
187 | * This can either be software or a token to provide the required low level | 187 | * This can either be software or a token to provide the required low level |
188 | * routines. | 188 | * routines. |
189 | */ | 189 | */ |
@@ -194,28 +194,28 @@ typedef struct evp_pkey_md_st | |||
194 | EVP_PKEY_METHOD *pkey; | 194 | EVP_PKEY_METHOD *pkey; |
195 | } EVP_PKEY_MD; | 195 | } EVP_PKEY_MD; |
196 | 196 | ||
197 | #define EVP_rsa_md2() | 197 | #define EVP_rsa_md2() \ |
198 | EVP_PKEY_MD_add(NID_md2WithRSAEncryption,\ | 198 | EVP_PKEY_MD_add(NID_md2WithRSAEncryption,\ |
199 | EVP_rsa_pkcs1(),EVP_md2()) | 199 | EVP_rsa_pkcs1(),EVP_md2()) |
200 | #define EVP_rsa_md5() | 200 | #define EVP_rsa_md5() \ |
201 | EVP_PKEY_MD_add(NID_md5WithRSAEncryption,\ | 201 | EVP_PKEY_MD_add(NID_md5WithRSAEncryption,\ |
202 | EVP_rsa_pkcs1(),EVP_md5()) | 202 | EVP_rsa_pkcs1(),EVP_md5()) |
203 | #define EVP_rsa_sha0() | 203 | #define EVP_rsa_sha0() \ |
204 | EVP_PKEY_MD_add(NID_shaWithRSAEncryption,\ | 204 | EVP_PKEY_MD_add(NID_shaWithRSAEncryption,\ |
205 | EVP_rsa_pkcs1(),EVP_sha()) | 205 | EVP_rsa_pkcs1(),EVP_sha()) |
206 | #define EVP_rsa_sha1() | 206 | #define EVP_rsa_sha1() \ |
207 | EVP_PKEY_MD_add(NID_sha1WithRSAEncryption,\ | 207 | EVP_PKEY_MD_add(NID_sha1WithRSAEncryption,\ |
208 | EVP_rsa_pkcs1(),EVP_sha1()) | 208 | EVP_rsa_pkcs1(),EVP_sha1()) |
209 | #define EVP_rsa_ripemd160() | 209 | #define EVP_rsa_ripemd160() \ |
210 | EVP_PKEY_MD_add(NID_ripemd160WithRSA,\ | 210 | EVP_PKEY_MD_add(NID_ripemd160WithRSA,\ |
211 | EVP_rsa_pkcs1(),EVP_ripemd160()) | 211 | EVP_rsa_pkcs1(),EVP_ripemd160()) |
212 | #define EVP_rsa_mdc2() | 212 | #define EVP_rsa_mdc2() \ |
213 | EVP_PKEY_MD_add(NID_mdc2WithRSA,\ | 213 | EVP_PKEY_MD_add(NID_mdc2WithRSA,\ |
214 | EVP_rsa_octet_string(),EVP_mdc2()) | 214 | EVP_rsa_octet_string(),EVP_mdc2()) |
215 | #define EVP_dsa_sha() | 215 | #define EVP_dsa_sha() \ |
216 | EVP_PKEY_MD_add(NID_dsaWithSHA,\ | 216 | EVP_PKEY_MD_add(NID_dsaWithSHA,\ |
217 | EVP_dsa(),EVP_mdc2()) | 217 | EVP_dsa(),EVP_mdc2()) |
218 | #define EVP_dsa_sha1() | 218 | #define EVP_dsa_sha1() \ |
219 | EVP_PKEY_MD_add(NID_dsaWithSHA1,\ | 219 | EVP_PKEY_MD_add(NID_dsaWithSHA1,\ |
220 | EVP_dsa(),EVP_sha1()) | 220 | EVP_dsa(),EVP_sha1()) |
221 | 221 | ||
@@ -261,6 +261,8 @@ typedef struct env_md_st | |||
261 | int ctx_size; /* how big does the ctx need to be */ | 261 | int ctx_size; /* how big does the ctx need to be */ |
262 | } EVP_MD; | 262 | } EVP_MD; |
263 | 263 | ||
264 | |||
265 | |||
264 | #define EVP_PKEY_NULL_method NULL,NULL,{0,0,0,0} | 266 | #define EVP_PKEY_NULL_method NULL,NULL,{0,0,0,0} |
265 | 267 | ||
266 | #ifndef NO_DSA | 268 | #ifndef NO_DSA |
@@ -287,7 +289,7 @@ typedef struct env_md_st | |||
287 | 289 | ||
288 | typedef struct env_md_ctx_st | 290 | typedef struct env_md_ctx_st |
289 | { | 291 | { |
290 | EVP_MD *digest; | 292 | const EVP_MD *digest; |
291 | union { | 293 | union { |
292 | unsigned char base[4]; | 294 | unsigned char base[4]; |
293 | #ifndef NO_MD2 | 295 | #ifndef NO_MD2 |
@@ -296,10 +298,10 @@ typedef struct env_md_ctx_st | |||
296 | #ifndef NO_MD5 | 298 | #ifndef NO_MD5 |
297 | MD5_CTX md5; | 299 | MD5_CTX md5; |
298 | #endif | 300 | #endif |
299 | #ifndef NO_MD5 | 301 | #ifndef NO_RIPEMD |
300 | RIPEMD160_CTX ripemd160; | 302 | RIPEMD160_CTX ripemd160; |
301 | #endif | 303 | #endif |
302 | #if !defined(NO_SHA) || !defined(NO_SHA1) | 304 | #ifndef NO_SHA |
303 | SHA_CTX sha; | 305 | SHA_CTX sha; |
304 | #endif | 306 | #endif |
305 | #ifndef NO_MDC2 | 307 | #ifndef NO_MDC2 |
@@ -326,13 +328,13 @@ typedef struct evp_cipher_st | |||
326 | 328 | ||
327 | typedef struct evp_cipher_info_st | 329 | typedef struct evp_cipher_info_st |
328 | { | 330 | { |
329 | EVP_CIPHER *cipher; | 331 | const EVP_CIPHER *cipher; |
330 | unsigned char iv[EVP_MAX_IV_LENGTH]; | 332 | unsigned char iv[EVP_MAX_IV_LENGTH]; |
331 | } EVP_CIPHER_INFO; | 333 | } EVP_CIPHER_INFO; |
332 | 334 | ||
333 | typedef struct evp_cipher_ctx_st | 335 | typedef struct evp_cipher_ctx_st |
334 | { | 336 | { |
335 | EVP_CIPHER *cipher; | 337 | const EVP_CIPHER *cipher; |
336 | int encrypt; /* encrypt or decrypt */ | 338 | int encrypt; /* encrypt or decrypt */ |
337 | int buf_len; /* number we have left */ | 339 | int buf_len; /* number we have left */ |
338 | 340 | ||
@@ -355,8 +357,8 @@ typedef struct evp_cipher_ctx_st | |||
355 | struct | 357 | struct |
356 | { | 358 | { |
357 | des_key_schedule ks;/* key schedule */ | 359 | des_key_schedule ks;/* key schedule */ |
358 | C_Block inw; | 360 | des_cblock inw; |
359 | C_Block outw; | 361 | des_cblock outw; |
360 | } desx_cbc; | 362 | } desx_cbc; |
361 | struct | 363 | struct |
362 | { | 364 | { |
@@ -374,7 +376,7 @@ typedef struct evp_cipher_ctx_st | |||
374 | #ifndef NO_RC5 | 376 | #ifndef NO_RC5 |
375 | RC5_32_KEY rc5_ks;/* key schedule */ | 377 | RC5_32_KEY rc5_ks;/* key schedule */ |
376 | #endif | 378 | #endif |
377 | #ifndef NO_BLOWFISH | 379 | #ifndef NO_BF |
378 | BF_KEY bf_ks;/* key schedule */ | 380 | BF_KEY bf_ks;/* key schedule */ |
379 | #endif | 381 | #endif |
380 | #ifndef NO_CAST | 382 | #ifndef NO_CAST |
@@ -396,6 +398,11 @@ typedef struct evp_Encode_Ctx_st | |||
396 | int expect_nl; | 398 | int expect_nl; |
397 | } EVP_ENCODE_CTX; | 399 | } EVP_ENCODE_CTX; |
398 | 400 | ||
401 | /* Password based encryption function */ | ||
402 | typedef int (EVP_PBE_KEYGEN)(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, | ||
403 | ASN1_TYPE *param, EVP_CIPHER *cipher, | ||
404 | EVP_MD *md, int en_de); | ||
405 | |||
399 | #define EVP_PKEY_assign_RSA(pkey,rsa) EVP_PKEY_assign((pkey),EVP_PKEY_RSA,\ | 406 | #define EVP_PKEY_assign_RSA(pkey,rsa) EVP_PKEY_assign((pkey),EVP_PKEY_RSA,\ |
400 | (char *)(rsa)) | 407 | (char *)(rsa)) |
401 | #define EVP_PKEY_assign_DSA(pkey,dsa) EVP_PKEY_assign((pkey),EVP_PKEY_DSA,\ | 408 | #define EVP_PKEY_assign_DSA(pkey,dsa) EVP_PKEY_assign((pkey),EVP_PKEY_DSA,\ |
@@ -430,6 +437,7 @@ typedef struct evp_Encode_Ctx_st | |||
430 | #define EVP_CIPHER_CTX_iv_length(e) ((e)->cipher->iv_len) | 437 | #define EVP_CIPHER_CTX_iv_length(e) ((e)->cipher->iv_len) |
431 | #define EVP_CIPHER_CTX_get_app_data(e) ((e)->app_data) | 438 | #define EVP_CIPHER_CTX_get_app_data(e) ((e)->app_data) |
432 | #define EVP_CIPHER_CTX_set_app_data(e,d) ((e)->app_data=(char *)(d)) | 439 | #define EVP_CIPHER_CTX_set_app_data(e,d) ((e)->app_data=(char *)(d)) |
440 | #define EVP_CIPHER_CTX_type(c) EVP_CIPHER_type(EVP_CIPHER_CTX_cipher(c)) | ||
433 | 441 | ||
434 | #define EVP_ENCODE_LENGTH(l) (((l+2)/3*4)+(l/48+1)*2+80) | 442 | #define EVP_ENCODE_LENGTH(l) (((l+2)/3*4)+(l/48+1)*2+80) |
435 | #define EVP_DECODE_LENGTH(l) ((l+3)/4*3+80) | 443 | #define EVP_DECODE_LENGTH(l) ((l+3)/4*3+80) |
@@ -441,43 +449,56 @@ typedef struct evp_Encode_Ctx_st | |||
441 | #define EVP_OpenUpdate(a,b,c,d,e) EVP_DecryptUpdate(a,b,c,d,e) | 449 | #define EVP_OpenUpdate(a,b,c,d,e) EVP_DecryptUpdate(a,b,c,d,e) |
442 | #define EVP_SealUpdate(a,b,c,d,e) EVP_EncryptUpdate(a,b,c,d,e) | 450 | #define EVP_SealUpdate(a,b,c,d,e) EVP_EncryptUpdate(a,b,c,d,e) |
443 | 451 | ||
444 | #define BIO_set_md(b,md) BIO_ctrl(b,BIO_C_SET_MD,0,(char *)md) | 452 | #ifdef CONST_STRICT |
453 | void BIO_set_md(BIO *,const EVP_MD *md); | ||
454 | #else | ||
455 | # define BIO_set_md(b,md) BIO_ctrl(b,BIO_C_SET_MD,0,(char *)md) | ||
456 | #endif | ||
445 | #define BIO_get_md(b,mdp) BIO_ctrl(b,BIO_C_GET_MD,0,(char *)mdp) | 457 | #define BIO_get_md(b,mdp) BIO_ctrl(b,BIO_C_GET_MD,0,(char *)mdp) |
446 | #define BIO_get_md_ctx(b,mdcp) BIO_ctrl(b,BIO_C_GET_MD_CTX,0,(char *)mdcp) | 458 | #define BIO_get_md_ctx(b,mdcp) BIO_ctrl(b,BIO_C_GET_MD_CTX,0,(char *)mdcp) |
447 | #define BIO_get_cipher_status(b) BIO_ctrl(b,BIO_C_GET_CIPHER_STATUS,0,NULL) | 459 | #define BIO_get_cipher_status(b) BIO_ctrl(b,BIO_C_GET_CIPHER_STATUS,0,NULL) |
460 | #define BIO_get_cipher_ctx(b,c_pp) BIO_ctrl(b,BIO_C_GET_CIPHER_CTX,0,(char *)c_pp) | ||
448 | 461 | ||
449 | #define EVP_Cipher(c,o,i,l) (c)->cipher->do_cipher((c),(o),(i),(l)) | 462 | #define EVP_Cipher(c,o,i,l) (c)->cipher->do_cipher((c),(o),(i),(l)) |
450 | 463 | ||
451 | #ifndef NOPROTO | 464 | #define EVP_add_cipher_alias(n,alias) \ |
465 | OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n)) | ||
466 | #define EVP_add_digest_alias(n,alias) \ | ||
467 | OBJ_NAME_add((alias),OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS,(n)) | ||
468 | #define EVP_delete_cipher_alias(alias) \ | ||
469 | OBJ_NAME_remove(alias,OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS); | ||
470 | #define EVP_delete_digest_alias(alias) \ | ||
471 | OBJ_NAME_remove(alias,OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS); | ||
452 | 472 | ||
453 | void EVP_DigestInit(EVP_MD_CTX *ctx, EVP_MD *type); | 473 | |
454 | void EVP_DigestUpdate(EVP_MD_CTX *ctx,unsigned char *d,unsigned int cnt); | 474 | int EVP_MD_CTX_copy(EVP_MD_CTX *out,EVP_MD_CTX *in); |
475 | void EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type); | ||
476 | void EVP_DigestUpdate(EVP_MD_CTX *ctx,const void *d, | ||
477 | unsigned int cnt); | ||
455 | void EVP_DigestFinal(EVP_MD_CTX *ctx,unsigned char *md,unsigned int *s); | 478 | void EVP_DigestFinal(EVP_MD_CTX *ctx,unsigned char *md,unsigned int *s); |
456 | 479 | ||
457 | int EVP_read_pw_string(char *buf,int length,char *prompt,int verify); | 480 | int EVP_read_pw_string(char *buf,int length,const char *prompt,int verify); |
458 | void EVP_set_pw_prompt(char *prompt); | 481 | void EVP_set_pw_prompt(char *prompt); |
459 | char * EVP_get_pw_prompt(void); | 482 | char * EVP_get_pw_prompt(void); |
460 | 483 | ||
461 | int EVP_BytesToKey(EVP_CIPHER *type,EVP_MD *md,unsigned char *salt, | 484 | int EVP_BytesToKey(const EVP_CIPHER *type,EVP_MD *md,unsigned char *salt, |
462 | unsigned char *data, int datal, int count, | 485 | unsigned char *data, int datal, int count, |
463 | unsigned char *key,unsigned char *iv); | 486 | unsigned char *key,unsigned char *iv); |
464 | 487 | ||
465 | EVP_CIPHER *EVP_get_cipherbyname(char *name); | 488 | void EVP_EncryptInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *type, |
466 | |||
467 | void EVP_EncryptInit(EVP_CIPHER_CTX *ctx,EVP_CIPHER *type, | ||
468 | unsigned char *key, unsigned char *iv); | 489 | unsigned char *key, unsigned char *iv); |
469 | void EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, | 490 | void EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, |
470 | int *outl, unsigned char *in, int inl); | 491 | int *outl, unsigned char *in, int inl); |
471 | void EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); | 492 | void EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); |
472 | 493 | ||
473 | void EVP_DecryptInit(EVP_CIPHER_CTX *ctx,EVP_CIPHER *type, | 494 | void EVP_DecryptInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *type, |
474 | unsigned char *key, unsigned char *iv); | 495 | unsigned char *key, unsigned char *iv); |
475 | void EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, | 496 | void EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, |
476 | int *outl, unsigned char *in, int inl); | 497 | int *outl, unsigned char *in, int inl); |
477 | int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); | 498 | int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); |
478 | 499 | ||
479 | void EVP_CipherInit(EVP_CIPHER_CTX *ctx,EVP_CIPHER *type, unsigned char *key, | 500 | void EVP_CipherInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *type, |
480 | unsigned char *iv,int enc); | 501 | unsigned char *key,unsigned char *iv,int enc); |
481 | void EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, | 502 | void EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, |
482 | int *outl, unsigned char *in, int inl); | 503 | int *outl, unsigned char *in, int inl); |
483 | int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); | 504 | int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); |
@@ -519,7 +540,8 @@ void EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *a); | |||
519 | BIO_METHOD *BIO_f_md(void); | 540 | BIO_METHOD *BIO_f_md(void); |
520 | BIO_METHOD *BIO_f_base64(void); | 541 | BIO_METHOD *BIO_f_base64(void); |
521 | BIO_METHOD *BIO_f_cipher(void); | 542 | BIO_METHOD *BIO_f_cipher(void); |
522 | void BIO_set_cipher(BIO *b,EVP_CIPHER *c,unsigned char *k, | 543 | BIO_METHOD *BIO_f_reliable(void); |
544 | void BIO_set_cipher(BIO *b,const EVP_CIPHER *c,unsigned char *k, | ||
523 | unsigned char *i, int enc); | 545 | unsigned char *i, int enc); |
524 | #endif | 546 | #endif |
525 | 547 | ||
@@ -556,6 +578,7 @@ EVP_CIPHER *EVP_idea_cbc(void); | |||
556 | EVP_CIPHER *EVP_rc2_ecb(void); | 578 | EVP_CIPHER *EVP_rc2_ecb(void); |
557 | EVP_CIPHER *EVP_rc2_cbc(void); | 579 | EVP_CIPHER *EVP_rc2_cbc(void); |
558 | EVP_CIPHER *EVP_rc2_40_cbc(void); | 580 | EVP_CIPHER *EVP_rc2_40_cbc(void); |
581 | EVP_CIPHER *EVP_rc2_64_cbc(void); | ||
559 | EVP_CIPHER *EVP_rc2_cfb(void); | 582 | EVP_CIPHER *EVP_rc2_cfb(void); |
560 | EVP_CIPHER *EVP_rc2_ofb(void); | 583 | EVP_CIPHER *EVP_rc2_ofb(void); |
561 | EVP_CIPHER *EVP_bf_ecb(void); | 584 | EVP_CIPHER *EVP_bf_ecb(void); |
@@ -577,11 +600,9 @@ void SSLeay_add_all_digests(void); | |||
577 | 600 | ||
578 | int EVP_add_cipher(EVP_CIPHER *cipher); | 601 | int EVP_add_cipher(EVP_CIPHER *cipher); |
579 | int EVP_add_digest(EVP_MD *digest); | 602 | int EVP_add_digest(EVP_MD *digest); |
580 | int EVP_add_alias(char *name,char *alias); | ||
581 | int EVP_delete_alias(char *name); | ||
582 | 603 | ||
583 | EVP_CIPHER *EVP_get_cipherbyname(char *name); | 604 | const EVP_CIPHER *EVP_get_cipherbyname(const char *name); |
584 | EVP_MD *EVP_get_digestbyname(char *name); | 605 | const EVP_MD *EVP_get_digestbyname(const char *name); |
585 | void EVP_cleanup(void); | 606 | void EVP_cleanup(void); |
586 | 607 | ||
587 | int EVP_PKEY_decrypt(unsigned char *dec_key,unsigned char *enc_key, | 608 | int EVP_PKEY_decrypt(unsigned char *dec_key,unsigned char *enc_key, |
@@ -607,6 +628,8 @@ int EVP_PKEY_missing_parameters(EVP_PKEY *pkey); | |||
607 | int EVP_PKEY_save_parameters(EVP_PKEY *pkey,int mode); | 628 | int EVP_PKEY_save_parameters(EVP_PKEY *pkey,int mode); |
608 | int EVP_PKEY_cmp_parameters(EVP_PKEY *a,EVP_PKEY *b); | 629 | int EVP_PKEY_cmp_parameters(EVP_PKEY *a,EVP_PKEY *b); |
609 | 630 | ||
631 | int EVP_CIPHER_type(const EVP_CIPHER *ctx); | ||
632 | |||
610 | /* calls methods */ | 633 | /* calls methods */ |
611 | int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type); | 634 | int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type); |
612 | int EVP_CIPHER_asn1_to_param(EVP_CIPHER_CTX *c, ASN1_TYPE *type); | 635 | int EVP_CIPHER_asn1_to_param(EVP_CIPHER_CTX *c, ASN1_TYPE *type); |
@@ -615,177 +638,81 @@ int EVP_CIPHER_asn1_to_param(EVP_CIPHER_CTX *c, ASN1_TYPE *type); | |||
615 | int EVP_CIPHER_set_asn1_iv(EVP_CIPHER_CTX *c,ASN1_TYPE *type); | 638 | int EVP_CIPHER_set_asn1_iv(EVP_CIPHER_CTX *c,ASN1_TYPE *type); |
616 | int EVP_CIPHER_get_asn1_iv(EVP_CIPHER_CTX *c,ASN1_TYPE *type); | 639 | int EVP_CIPHER_get_asn1_iv(EVP_CIPHER_CTX *c,ASN1_TYPE *type); |
617 | 640 | ||
618 | #else | 641 | /* PKCS5 password based encryption */ |
619 | 642 | int PKCS5_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, | |
620 | void EVP_DigestInit(); | 643 | ASN1_TYPE *param, EVP_CIPHER *cipher, EVP_MD *md, |
621 | void EVP_DigestUpdate(); | 644 | int en_de); |
622 | void EVP_DigestFinal(); | 645 | int PKCS5_PBKDF2_HMAC_SHA1(const char *pass, int passlen, |
623 | 646 | unsigned char *salt, int saltlen, int iter, | |
624 | int EVP_read_pw_string(); | 647 | int keylen, unsigned char *out); |
625 | void EVP_set_pw_prompt(); | 648 | int PKCS5_v2_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, |
626 | char * EVP_get_pw_prompt(); | 649 | ASN1_TYPE *param, EVP_CIPHER *cipher, EVP_MD *md, |
627 | 650 | int en_de); | |
628 | int EVP_BytesToKey(); | 651 | |
629 | 652 | void PKCS5_PBE_add(void); | |
630 | EVP_CIPHER *EVP_get_cipherbyname(); | 653 | |
631 | 654 | int EVP_PBE_CipherInit (ASN1_OBJECT *pbe_obj, const char *pass, int passlen, | |
632 | void EVP_EncryptInit(); | 655 | ASN1_TYPE *param, EVP_CIPHER_CTX *ctx, int en_de); |
633 | void EVP_EncryptUpdate(); | 656 | int EVP_PBE_alg_add(int nid, EVP_CIPHER *cipher, EVP_MD *md, |
634 | void EVP_EncryptFinal(); | 657 | EVP_PBE_KEYGEN *keygen); |
635 | 658 | void EVP_PBE_cleanup(void); | |
636 | void EVP_DecryptInit(); | ||
637 | void EVP_DecryptUpdate(); | ||
638 | int EVP_DecryptFinal(); | ||
639 | |||
640 | void EVP_CipherInit(); | ||
641 | void EVP_CipherUpdate(); | ||
642 | int EVP_CipherFinal(); | ||
643 | |||
644 | int EVP_SignFinal(); | ||
645 | |||
646 | int EVP_VerifyFinal(); | ||
647 | |||
648 | int EVP_OpenInit(); | ||
649 | int EVP_OpenFinal(); | ||
650 | |||
651 | int EVP_SealInit(); | ||
652 | void EVP_SealFinal(); | ||
653 | |||
654 | void EVP_EncodeInit(); | ||
655 | void EVP_EncodeUpdate(); | ||
656 | void EVP_EncodeFinal(); | ||
657 | int EVP_EncodeBlock(); | ||
658 | |||
659 | void EVP_DecodeInit(); | ||
660 | int EVP_DecodeUpdate(); | ||
661 | int EVP_DecodeFinal(); | ||
662 | int EVP_DecodeBlock(); | ||
663 | |||
664 | void ERR_load_EVP_strings(); | ||
665 | |||
666 | void EVP_CIPHER_CTX_init(); | ||
667 | void EVP_CIPHER_CTX_cleanup(); | ||
668 | |||
669 | #ifdef HEADER_BIO_H | ||
670 | BIO_METHOD *BIO_f_md(); | ||
671 | BIO_METHOD *BIO_f_base64(); | ||
672 | BIO_METHOD *BIO_f_cipher(); | ||
673 | void BIO_set_cipher(); | ||
674 | #endif | ||
675 | |||
676 | EVP_MD *EVP_md_null(); | ||
677 | EVP_MD *EVP_md2(); | ||
678 | EVP_MD *EVP_md5(); | ||
679 | EVP_MD *EVP_sha(); | ||
680 | EVP_MD *EVP_sha1(); | ||
681 | EVP_MD *EVP_dss(); | ||
682 | EVP_MD *EVP_dss1(); | ||
683 | EVP_MD *EVP_mdc2(); | ||
684 | |||
685 | EVP_CIPHER *EVP_enc_null(); | ||
686 | EVP_CIPHER *EVP_des_ecb(); | ||
687 | EVP_CIPHER *EVP_des_ede(); | ||
688 | EVP_CIPHER *EVP_des_ede3(); | ||
689 | EVP_CIPHER *EVP_des_cfb(); | ||
690 | EVP_CIPHER *EVP_des_ede_cfb(); | ||
691 | EVP_CIPHER *EVP_des_ede3_cfb(); | ||
692 | EVP_CIPHER *EVP_des_ofb(); | ||
693 | EVP_CIPHER *EVP_des_ede_ofb(); | ||
694 | EVP_CIPHER *EVP_des_ede3_ofb(); | ||
695 | EVP_CIPHER *EVP_des_cbc(); | ||
696 | EVP_CIPHER *EVP_des_ede_cbc(); | ||
697 | EVP_CIPHER *EVP_des_ede3_cbc(); | ||
698 | EVP_CIPHER *EVP_desx_cbc(); | ||
699 | EVP_CIPHER *EVP_rc4(); | ||
700 | EVP_CIPHER *EVP_rc4_40(); | ||
701 | EVP_CIPHER *EVP_idea_ecb(); | ||
702 | EVP_CIPHER *EVP_idea_cfb(); | ||
703 | EVP_CIPHER *EVP_idea_ofb(); | ||
704 | EVP_CIPHER *EVP_idea_cbc(); | ||
705 | EVP_CIPHER *EVP_rc2_ecb(); | ||
706 | EVP_CIPHER *EVP_rc2_cbc(); | ||
707 | EVP_CIPHER *EVP_rc2_40_cbc(); | ||
708 | EVP_CIPHER *EVP_rc2_cfb(); | ||
709 | EVP_CIPHER *EVP_rc2_ofb(); | ||
710 | EVP_CIPHER *EVP_bf_ecb(); | ||
711 | EVP_CIPHER *EVP_bf_cbc(); | ||
712 | EVP_CIPHER *EVP_bf_cfb(); | ||
713 | EVP_CIPHER *EVP_bf_ofb(); | ||
714 | EVP_CIPHER *EVP_cast5_ecb(); | ||
715 | EVP_CIPHER *EVP_cast5_cbc(); | ||
716 | EVP_CIPHER *EVP_cast5_cfb(); | ||
717 | EVP_CIPHER *EVP_cast5_ofb(); | ||
718 | EVP_CIPHER *EVP_rc5_32_12_16_cbc(); | ||
719 | EVP_CIPHER *EVP_rc5_32_12_16_ecb(); | ||
720 | EVP_CIPHER *EVP_rc5_32_12_16_cfb(); | ||
721 | EVP_CIPHER *EVP_rc5_32_12_16_ofb(); | ||
722 | |||
723 | void SSLeay_add_all_algorithms(); | ||
724 | void SSLeay_add_all_ciphers(); | ||
725 | void SSLeay_add_all_digests(); | ||
726 | |||
727 | int EVP_add_cipher(); | ||
728 | int EVP_add_digest(); | ||
729 | int EVP_add_alias(); | ||
730 | int EVP_delete_alias(); | ||
731 | |||
732 | EVP_CIPHER *EVP_get_cipherbyname(); | ||
733 | EVP_MD *EVP_get_digestbyname(); | ||
734 | void EVP_cleanup(); | ||
735 | |||
736 | int EVP_PKEY_decrypt(); | ||
737 | int EVP_PKEY_encrypt(); | ||
738 | int EVP_PKEY_type(); | ||
739 | int EVP_PKEY_bits(); | ||
740 | int EVP_PKEY_size(); | ||
741 | int EVP_PKEY_assign(); | ||
742 | EVP_PKEY * EVP_PKEY_new(); | ||
743 | void EVP_PKEY_free(); | ||
744 | EVP_PKEY * d2i_PublicKey(); | ||
745 | int i2d_PublicKey(); | ||
746 | |||
747 | EVP_PKEY * d2i_PrivateKey(); | ||
748 | int i2d_PrivateKey(); | ||
749 | |||
750 | int EVP_PKEY_copy_parameters(); | ||
751 | int EVP_PKEY_missing_parameters(); | ||
752 | int EVP_PKEY_save_parameters(); | ||
753 | int EVP_PKEY_cmp_parameters(); | ||
754 | |||
755 | int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type); | ||
756 | int EVP_CIPHER_asn1_to_param(EVP_CIPHER_CTX *c, ASN1_TYPE *type); | ||
757 | |||
758 | int EVP_CIPHER_set_asn1_iv(); | ||
759 | int EVP_CIPHER_get_asn1_iv(); | ||
760 | |||
761 | #endif | ||
762 | 659 | ||
763 | /* BEGIN ERROR CODES */ | 660 | /* BEGIN ERROR CODES */ |
661 | /* The following lines are auto generated by the script mkerr.pl. Any changes | ||
662 | * made after this point may be overwritten when the script is next run. | ||
663 | */ | ||
664 | |||
764 | /* Error codes for the EVP functions. */ | 665 | /* Error codes for the EVP functions. */ |
765 | 666 | ||
766 | /* Function codes. */ | 667 | /* Function codes. */ |
767 | #define EVP_F_D2I_PKEY 100 | 668 | #define EVP_F_D2I_PKEY 100 |
768 | #define EVP_F_EVP_DECRYPTFINAL 101 | 669 | #define EVP_F_EVP_DECRYPTFINAL 101 |
670 | #define EVP_F_EVP_MD_CTX_COPY 110 | ||
769 | #define EVP_F_EVP_OPENINIT 102 | 671 | #define EVP_F_EVP_OPENINIT 102 |
672 | #define EVP_F_EVP_PBE_ALG_ADD 115 | ||
673 | #define EVP_F_EVP_PBE_CIPHERINIT 116 | ||
674 | #define EVP_F_EVP_PKCS82PKEY 111 | ||
675 | #define EVP_F_EVP_PKCS8_SET_BROKEN 112 | ||
676 | #define EVP_F_EVP_PKEY2PKCS8 113 | ||
770 | #define EVP_F_EVP_PKEY_COPY_PARAMETERS 103 | 677 | #define EVP_F_EVP_PKEY_COPY_PARAMETERS 103 |
771 | #define EVP_F_EVP_PKEY_DECRYPT 104 | 678 | #define EVP_F_EVP_PKEY_DECRYPT 104 |
772 | #define EVP_F_EVP_PKEY_ENCRYPT 105 | 679 | #define EVP_F_EVP_PKEY_ENCRYPT 105 |
773 | #define EVP_F_EVP_PKEY_NEW 106 | 680 | #define EVP_F_EVP_PKEY_NEW 106 |
774 | #define EVP_F_EVP_SIGNFINAL 107 | 681 | #define EVP_F_EVP_SIGNFINAL 107 |
775 | #define EVP_F_EVP_VERIFYFINAL 108 | 682 | #define EVP_F_EVP_VERIFYFINAL 108 |
683 | #define EVP_F_PKCS5_PBE_KEYIVGEN 117 | ||
684 | #define EVP_F_PKCS5_V2_PBE_KEYIVGEN 118 | ||
685 | #define EVP_F_RC2_MAGIC_TO_METH 109 | ||
776 | 686 | ||
777 | /* Reason codes. */ | 687 | /* Reason codes. */ |
778 | #define EVP_R_BAD_DECRYPT 100 | 688 | #define EVP_R_BAD_DECRYPT 100 |
689 | #define EVP_R_BN_DECODE_ERROR 112 | ||
690 | #define EVP_R_BN_PUBKEY_ERROR 113 | ||
691 | #define EVP_R_CIPHER_PARAMETER_ERROR 122 | ||
692 | #define EVP_R_DECODE_ERROR 114 | ||
779 | #define EVP_R_DIFFERENT_KEY_TYPES 101 | 693 | #define EVP_R_DIFFERENT_KEY_TYPES 101 |
694 | #define EVP_R_ENCODE_ERROR 115 | ||
695 | #define EVP_R_EVP_PBE_CIPHERINIT_ERROR 119 | ||
696 | #define EVP_R_INPUT_NOT_INITIALIZED 111 | ||
780 | #define EVP_R_IV_TOO_LARGE 102 | 697 | #define EVP_R_IV_TOO_LARGE 102 |
698 | #define EVP_R_KEYGEN_FAILURE 120 | ||
781 | #define EVP_R_MISSING_PARMATERS 103 | 699 | #define EVP_R_MISSING_PARMATERS 103 |
700 | #define EVP_R_NO_DSA_PARAMETERS 116 | ||
782 | #define EVP_R_NO_SIGN_FUNCTION_CONFIGURED 104 | 701 | #define EVP_R_NO_SIGN_FUNCTION_CONFIGURED 104 |
783 | #define EVP_R_NO_VERIFY_FUNCTION_CONFIGURED 105 | 702 | #define EVP_R_NO_VERIFY_FUNCTION_CONFIGURED 105 |
703 | #define EVP_R_PKCS8_UNKNOWN_BROKEN_TYPE 117 | ||
784 | #define EVP_R_PUBLIC_KEY_NOT_RSA 106 | 704 | #define EVP_R_PUBLIC_KEY_NOT_RSA 106 |
705 | #define EVP_R_UNKNOWN_PBE_ALGORITHM 121 | ||
785 | #define EVP_R_UNSUPPORTED_CIPHER 107 | 706 | #define EVP_R_UNSUPPORTED_CIPHER 107 |
786 | #define EVP_R_WRONG_FINAL_BLOCK_LENGTH 108 | 707 | #define EVP_R_UNSUPPORTED_KEYLENGTH 123 |
787 | #define EVP_R_WRONG_PUBLIC_KEY_TYPE 109 | 708 | #define EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION 124 |
788 | 709 | #define EVP_R_UNSUPPORTED_KEY_SIZE 108 | |
710 | #define EVP_R_UNSUPPORTED_PRF 125 | ||
711 | #define EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM 118 | ||
712 | #define EVP_R_UNSUPPORTED_SALT_TYPE 126 | ||
713 | #define EVP_R_WRONG_FINAL_BLOCK_LENGTH 109 | ||
714 | #define EVP_R_WRONG_PUBLIC_KEY_TYPE 110 | ||
715 | |||
789 | #ifdef __cplusplus | 716 | #ifdef __cplusplus |
790 | } | 717 | } |
791 | #endif | 718 | #endif |
diff --git a/src/lib/libcrypto/evp/evp_enc.c b/src/lib/libcrypto/evp/evp_enc.c index 93cc3a9464..5299a65b6a 100644 --- a/src/lib/libcrypto/evp/evp_enc.c +++ b/src/lib/libcrypto/evp/evp_enc.c | |||
@@ -58,23 +58,18 @@ | |||
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include "evp.h" | 61 | #include <openssl/evp.h> |
62 | 62 | ||
63 | char *EVP_version="EVP part of SSLeay 0.9.0b 29-Jun-1998"; | 63 | const char *EVP_version="EVP" OPENSSL_VERSION_PTEXT; |
64 | 64 | ||
65 | void EVP_CIPHER_CTX_init(ctx) | 65 | void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *ctx) |
66 | EVP_CIPHER_CTX *ctx; | ||
67 | { | 66 | { |
68 | memset(ctx,0,sizeof(EVP_CIPHER_CTX)); | 67 | memset(ctx,0,sizeof(EVP_CIPHER_CTX)); |
69 | /* ctx->cipher=NULL; */ | 68 | /* ctx->cipher=NULL; */ |
70 | } | 69 | } |
71 | 70 | ||
72 | void EVP_CipherInit(ctx,data,key,iv,enc) | 71 | void EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *data, |
73 | EVP_CIPHER_CTX *ctx; | 72 | unsigned char *key, unsigned char *iv, int enc) |
74 | EVP_CIPHER *data; | ||
75 | unsigned char *key; | ||
76 | unsigned char *iv; | ||
77 | int enc; | ||
78 | { | 73 | { |
79 | if (enc) | 74 | if (enc) |
80 | EVP_EncryptInit(ctx,data,key,iv); | 75 | EVP_EncryptInit(ctx,data,key,iv); |
@@ -82,22 +77,15 @@ int enc; | |||
82 | EVP_DecryptInit(ctx,data,key,iv); | 77 | EVP_DecryptInit(ctx,data,key,iv); |
83 | } | 78 | } |
84 | 79 | ||
85 | void EVP_CipherUpdate(ctx,out,outl,in,inl) | 80 | void EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, |
86 | EVP_CIPHER_CTX *ctx; | 81 | unsigned char *in, int inl) |
87 | unsigned char *out; | ||
88 | int *outl; | ||
89 | unsigned char *in; | ||
90 | int inl; | ||
91 | { | 82 | { |
92 | if (ctx->encrypt) | 83 | if (ctx->encrypt) |
93 | EVP_EncryptUpdate(ctx,out,outl,in,inl); | 84 | EVP_EncryptUpdate(ctx,out,outl,in,inl); |
94 | else EVP_DecryptUpdate(ctx,out,outl,in,inl); | 85 | else EVP_DecryptUpdate(ctx,out,outl,in,inl); |
95 | } | 86 | } |
96 | 87 | ||
97 | int EVP_CipherFinal(ctx,out,outl) | 88 | int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) |
98 | EVP_CIPHER_CTX *ctx; | ||
99 | unsigned char *out; | ||
100 | int *outl; | ||
101 | { | 89 | { |
102 | if (ctx->encrypt) | 90 | if (ctx->encrypt) |
103 | { | 91 | { |
@@ -107,11 +95,8 @@ int *outl; | |||
107 | else return(EVP_DecryptFinal(ctx,out,outl)); | 95 | else return(EVP_DecryptFinal(ctx,out,outl)); |
108 | } | 96 | } |
109 | 97 | ||
110 | void EVP_EncryptInit(ctx,cipher,key,iv) | 98 | void EVP_EncryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, |
111 | EVP_CIPHER_CTX *ctx; | 99 | unsigned char *key, unsigned char *iv) |
112 | EVP_CIPHER *cipher; | ||
113 | unsigned char *key; | ||
114 | unsigned char *iv; | ||
115 | { | 100 | { |
116 | if (cipher != NULL) | 101 | if (cipher != NULL) |
117 | ctx->cipher=cipher; | 102 | ctx->cipher=cipher; |
@@ -120,11 +105,8 @@ unsigned char *iv; | |||
120 | ctx->buf_len=0; | 105 | ctx->buf_len=0; |
121 | } | 106 | } |
122 | 107 | ||
123 | void EVP_DecryptInit(ctx,cipher,key,iv) | 108 | void EVP_DecryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, |
124 | EVP_CIPHER_CTX *ctx; | 109 | unsigned char *key, unsigned char *iv) |
125 | EVP_CIPHER *cipher; | ||
126 | unsigned char *key; | ||
127 | unsigned char *iv; | ||
128 | { | 110 | { |
129 | if (cipher != NULL) | 111 | if (cipher != NULL) |
130 | ctx->cipher=cipher; | 112 | ctx->cipher=cipher; |
@@ -134,12 +116,8 @@ unsigned char *iv; | |||
134 | } | 116 | } |
135 | 117 | ||
136 | 118 | ||
137 | void EVP_EncryptUpdate(ctx,out,outl,in,inl) | 119 | void EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, |
138 | EVP_CIPHER_CTX *ctx; | 120 | unsigned char *in, int inl) |
139 | unsigned char *out; | ||
140 | int *outl; | ||
141 | unsigned char *in; | ||
142 | int inl; | ||
143 | { | 121 | { |
144 | int i,j,bl; | 122 | int i,j,bl; |
145 | 123 | ||
@@ -179,10 +157,7 @@ int inl; | |||
179 | ctx->buf_len=i; | 157 | ctx->buf_len=i; |
180 | } | 158 | } |
181 | 159 | ||
182 | void EVP_EncryptFinal(ctx,out,outl) | 160 | void EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) |
183 | EVP_CIPHER_CTX *ctx; | ||
184 | unsigned char *out; | ||
185 | int *outl; | ||
186 | { | 161 | { |
187 | int i,n,b,bl; | 162 | int i,n,b,bl; |
188 | 163 | ||
@@ -200,12 +175,8 @@ int *outl; | |||
200 | *outl=b; | 175 | *outl=b; |
201 | } | 176 | } |
202 | 177 | ||
203 | void EVP_DecryptUpdate(ctx,out,outl,in,inl) | 178 | void EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, |
204 | EVP_CIPHER_CTX *ctx; | 179 | unsigned char *in, int inl) |
205 | unsigned char *out; | ||
206 | int *outl; | ||
207 | unsigned char *in; | ||
208 | int inl; | ||
209 | { | 180 | { |
210 | int b,bl,n; | 181 | int b,bl,n; |
211 | int keep_last=0; | 182 | int keep_last=0; |
@@ -249,10 +220,7 @@ int inl; | |||
249 | } | 220 | } |
250 | } | 221 | } |
251 | 222 | ||
252 | int EVP_DecryptFinal(ctx,out,outl) | 223 | int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) |
253 | EVP_CIPHER_CTX *ctx; | ||
254 | unsigned char *out; | ||
255 | int *outl; | ||
256 | { | 224 | { |
257 | int i,b; | 225 | int i,b; |
258 | int n; | 226 | int n; |
@@ -293,8 +261,7 @@ int *outl; | |||
293 | return(1); | 261 | return(1); |
294 | } | 262 | } |
295 | 263 | ||
296 | void EVP_CIPHER_CTX_cleanup(c) | 264 | void EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *c) |
297 | EVP_CIPHER_CTX *c; | ||
298 | { | 265 | { |
299 | if ((c->cipher != NULL) && (c->cipher->cleanup != NULL)) | 266 | if ((c->cipher != NULL) && (c->cipher->cleanup != NULL)) |
300 | c->cipher->cleanup(c); | 267 | c->cipher->cleanup(c); |
diff --git a/src/lib/libcrypto/evp/evp_err.c b/src/lib/libcrypto/evp/evp_err.c index 2b0a0ab93f..c61cc922e8 100644 --- a/src/lib/libcrypto/evp/evp_err.c +++ b/src/lib/libcrypto/evp/evp_err.c | |||
@@ -1,63 +1,65 @@ | |||
1 | /* lib/evp/evp_err.c */ | 1 | /* crypto/evp/evp_err.c */ |
2 | /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) | 2 | /* ==================================================================== |
3 | * All rights reserved. | 3 | * Copyright (c) 1999 The OpenSSL Project. All rights reserved. |
4 | * | 4 | * |
5 | * This package is an SSL implementation written | ||
6 | * by Eric Young (eay@cryptsoft.com). | ||
7 | * The implementation was written so as to conform with Netscapes SSL. | ||
8 | * | ||
9 | * This library is free for commercial and non-commercial use as long as | ||
10 | * the following conditions are aheared to. The following conditions | ||
11 | * apply to all code found in this distribution, be it the RC4, RSA, | ||
12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation | ||
13 | * included with this distribution is covered by the same copyright terms | ||
14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). | ||
15 | * | ||
16 | * Copyright remains Eric Young's, and as such any Copyright notices in | ||
17 | * the code are not to be removed. | ||
18 | * If this package is used in a product, Eric Young should be given attribution | ||
19 | * as the author of the parts of the library used. | ||
20 | * This can be in the form of a textual message at program startup or | ||
21 | * in documentation (online or textual) provided with the package. | ||
22 | * | ||
23 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
24 | * modification, are permitted provided that the following conditions | 6 | * modification, are permitted provided that the following conditions |
25 | * are met: | 7 | * are met: |
26 | * 1. Redistributions of source code must retain the copyright | 8 | * |
27 | * notice, this list of conditions and the following disclaimer. | 9 | * 1. Redistributions of source code must retain the above copyright |
10 | * notice, this list of conditions and the following disclaimer. | ||
11 | * | ||
28 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright |
29 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in |
30 | * documentation and/or other materials provided with the distribution. | 14 | * the documentation and/or other materials provided with the |
31 | * 3. All advertising materials mentioning features or use of this software | 15 | * distribution. |
32 | * must display the following acknowledgement: | 16 | * |
33 | * "This product includes cryptographic software written by | 17 | * 3. All advertising materials mentioning features or use of this |
34 | * Eric Young (eay@cryptsoft.com)" | 18 | * software must display the following acknowledgment: |
35 | * The word 'cryptographic' can be left out if the rouines from the library | 19 | * "This product includes software developed by the OpenSSL Project |
36 | * being used are not cryptographic related :-). | 20 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" |
37 | * 4. If you include any Windows specific code (or a derivative thereof) from | 21 | * |
38 | * the apps directory (application code) you must include an acknowledgement: | 22 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to |
39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" | 23 | * endorse or promote products derived from this software without |
40 | * | 24 | * prior written permission. For written permission, please contact |
41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND | 25 | * openssl-core@OpenSSL.org. |
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 26 | * |
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 27 | * 5. Products derived from this software may not be called "OpenSSL" |
44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | 28 | * nor may "OpenSSL" appear in their names without prior written |
45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 29 | * permission of the OpenSSL Project. |
46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 30 | * |
47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 31 | * 6. Redistributions of any form whatsoever must retain the following |
48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 32 | * acknowledgment: |
49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 33 | * "This product includes software developed by the OpenSSL Project |
50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 34 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" |
51 | * SUCH DAMAGE. | 35 | * |
52 | * | 36 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY |
53 | * The licence and distribution terms for any publically available version or | 37 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
54 | * derivative of this code cannot be changed. i.e. this code cannot simply be | 38 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
55 | * copied and put under another distribution licence | 39 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR |
56 | * [including the GNU Public Licence.] | 40 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
41 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
42 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
43 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
44 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
45 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
46 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
47 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
48 | * ==================================================================== | ||
49 | * | ||
50 | * This product includes cryptographic software written by Eric Young | ||
51 | * (eay@cryptsoft.com). This product includes software written by Tim | ||
52 | * Hudson (tjh@cryptsoft.com). | ||
53 | * | ||
57 | */ | 54 | */ |
55 | |||
56 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes | ||
57 | * made to it will be overwritten when the script next updates this file. | ||
58 | */ | ||
59 | |||
58 | #include <stdio.h> | 60 | #include <stdio.h> |
59 | #include "err.h" | 61 | #include <openssl/err.h> |
60 | #include "evp.h" | 62 | #include <openssl/evp.h> |
61 | 63 | ||
62 | /* BEGIN ERROR CODES */ | 64 | /* BEGIN ERROR CODES */ |
63 | #ifndef NO_ERR | 65 | #ifndef NO_ERR |
@@ -65,39 +67,65 @@ static ERR_STRING_DATA EVP_str_functs[]= | |||
65 | { | 67 | { |
66 | {ERR_PACK(0,EVP_F_D2I_PKEY,0), "D2I_PKEY"}, | 68 | {ERR_PACK(0,EVP_F_D2I_PKEY,0), "D2I_PKEY"}, |
67 | {ERR_PACK(0,EVP_F_EVP_DECRYPTFINAL,0), "EVP_DecryptFinal"}, | 69 | {ERR_PACK(0,EVP_F_EVP_DECRYPTFINAL,0), "EVP_DecryptFinal"}, |
70 | {ERR_PACK(0,EVP_F_EVP_MD_CTX_COPY,0), "EVP_MD_CTX_copy"}, | ||
68 | {ERR_PACK(0,EVP_F_EVP_OPENINIT,0), "EVP_OpenInit"}, | 71 | {ERR_PACK(0,EVP_F_EVP_OPENINIT,0), "EVP_OpenInit"}, |
72 | {ERR_PACK(0,EVP_F_EVP_PBE_ALG_ADD,0), "EVP_PBE_alg_add"}, | ||
73 | {ERR_PACK(0,EVP_F_EVP_PBE_CIPHERINIT,0), "EVP_PBE_CipherInit"}, | ||
74 | {ERR_PACK(0,EVP_F_EVP_PKCS82PKEY,0), "EVP_PKCS82PKEY"}, | ||
75 | {ERR_PACK(0,EVP_F_EVP_PKCS8_SET_BROKEN,0), "EVP_PKCS8_SET_BROKEN"}, | ||
76 | {ERR_PACK(0,EVP_F_EVP_PKEY2PKCS8,0), "EVP_PKEY2PKCS8"}, | ||
69 | {ERR_PACK(0,EVP_F_EVP_PKEY_COPY_PARAMETERS,0), "EVP_PKEY_copy_parameters"}, | 77 | {ERR_PACK(0,EVP_F_EVP_PKEY_COPY_PARAMETERS,0), "EVP_PKEY_copy_parameters"}, |
70 | {ERR_PACK(0,EVP_F_EVP_PKEY_DECRYPT,0), "EVP_PKEY_decrypt"}, | 78 | {ERR_PACK(0,EVP_F_EVP_PKEY_DECRYPT,0), "EVP_PKEY_decrypt"}, |
71 | {ERR_PACK(0,EVP_F_EVP_PKEY_ENCRYPT,0), "EVP_PKEY_encrypt"}, | 79 | {ERR_PACK(0,EVP_F_EVP_PKEY_ENCRYPT,0), "EVP_PKEY_encrypt"}, |
72 | {ERR_PACK(0,EVP_F_EVP_PKEY_NEW,0), "EVP_PKEY_new"}, | 80 | {ERR_PACK(0,EVP_F_EVP_PKEY_NEW,0), "EVP_PKEY_new"}, |
73 | {ERR_PACK(0,EVP_F_EVP_SIGNFINAL,0), "EVP_SignFinal"}, | 81 | {ERR_PACK(0,EVP_F_EVP_SIGNFINAL,0), "EVP_SignFinal"}, |
74 | {ERR_PACK(0,EVP_F_EVP_VERIFYFINAL,0), "EVP_VerifyFinal"}, | 82 | {ERR_PACK(0,EVP_F_EVP_VERIFYFINAL,0), "EVP_VerifyFinal"}, |
75 | {0,NULL}, | 83 | {ERR_PACK(0,EVP_F_PKCS5_PBE_KEYIVGEN,0), "PKCS5_PBE_keyivgen"}, |
84 | {ERR_PACK(0,EVP_F_PKCS5_V2_PBE_KEYIVGEN,0), "PKCS5_v2_PBE_keyivgen"}, | ||
85 | {ERR_PACK(0,EVP_F_RC2_MAGIC_TO_METH,0), "RC2_MAGIC_TO_METH"}, | ||
86 | {0,NULL} | ||
76 | }; | 87 | }; |
77 | 88 | ||
78 | static ERR_STRING_DATA EVP_str_reasons[]= | 89 | static ERR_STRING_DATA EVP_str_reasons[]= |
79 | { | 90 | { |
80 | {EVP_R_BAD_DECRYPT ,"bad decrypt"}, | 91 | {EVP_R_BAD_DECRYPT ,"bad decrypt"}, |
92 | {EVP_R_BN_DECODE_ERROR ,"bn decode error"}, | ||
93 | {EVP_R_BN_PUBKEY_ERROR ,"bn pubkey error"}, | ||
94 | {EVP_R_CIPHER_PARAMETER_ERROR ,"cipher parameter error"}, | ||
95 | {EVP_R_DECODE_ERROR ,"decode error"}, | ||
81 | {EVP_R_DIFFERENT_KEY_TYPES ,"different key types"}, | 96 | {EVP_R_DIFFERENT_KEY_TYPES ,"different key types"}, |
97 | {EVP_R_ENCODE_ERROR ,"encode error"}, | ||
98 | {EVP_R_EVP_PBE_CIPHERINIT_ERROR ,"evp pbe cipherinit error"}, | ||
99 | {EVP_R_INPUT_NOT_INITIALIZED ,"input not initialized"}, | ||
82 | {EVP_R_IV_TOO_LARGE ,"iv too large"}, | 100 | {EVP_R_IV_TOO_LARGE ,"iv too large"}, |
101 | {EVP_R_KEYGEN_FAILURE ,"keygen failure"}, | ||
83 | {EVP_R_MISSING_PARMATERS ,"missing parmaters"}, | 102 | {EVP_R_MISSING_PARMATERS ,"missing parmaters"}, |
103 | {EVP_R_NO_DSA_PARAMETERS ,"no dsa parameters"}, | ||
84 | {EVP_R_NO_SIGN_FUNCTION_CONFIGURED ,"no sign function configured"}, | 104 | {EVP_R_NO_SIGN_FUNCTION_CONFIGURED ,"no sign function configured"}, |
85 | {EVP_R_NO_VERIFY_FUNCTION_CONFIGURED ,"no verify function configured"}, | 105 | {EVP_R_NO_VERIFY_FUNCTION_CONFIGURED ,"no verify function configured"}, |
106 | {EVP_R_PKCS8_UNKNOWN_BROKEN_TYPE ,"pkcs8 unknown broken type"}, | ||
86 | {EVP_R_PUBLIC_KEY_NOT_RSA ,"public key not rsa"}, | 107 | {EVP_R_PUBLIC_KEY_NOT_RSA ,"public key not rsa"}, |
108 | {EVP_R_UNKNOWN_PBE_ALGORITHM ,"unknown pbe algorithm"}, | ||
87 | {EVP_R_UNSUPPORTED_CIPHER ,"unsupported cipher"}, | 109 | {EVP_R_UNSUPPORTED_CIPHER ,"unsupported cipher"}, |
110 | {EVP_R_UNSUPPORTED_KEYLENGTH ,"unsupported keylength"}, | ||
111 | {EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION,"unsupported key derivation function"}, | ||
112 | {EVP_R_UNSUPPORTED_KEY_SIZE ,"unsupported key size"}, | ||
113 | {EVP_R_UNSUPPORTED_PRF ,"unsupported prf"}, | ||
114 | {EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM ,"unsupported private key algorithm"}, | ||
115 | {EVP_R_UNSUPPORTED_SALT_TYPE ,"unsupported salt type"}, | ||
88 | {EVP_R_WRONG_FINAL_BLOCK_LENGTH ,"wrong final block length"}, | 116 | {EVP_R_WRONG_FINAL_BLOCK_LENGTH ,"wrong final block length"}, |
89 | {EVP_R_WRONG_PUBLIC_KEY_TYPE ,"wrong public key type"}, | 117 | {EVP_R_WRONG_PUBLIC_KEY_TYPE ,"wrong public key type"}, |
90 | {0,NULL}, | 118 | {0,NULL} |
91 | }; | 119 | }; |
92 | 120 | ||
93 | #endif | 121 | #endif |
94 | 122 | ||
95 | void ERR_load_EVP_strings() | 123 | void ERR_load_EVP_strings(void) |
96 | { | 124 | { |
97 | static int init=1; | 125 | static int init=1; |
98 | 126 | ||
99 | if (init); | 127 | if (init) |
100 | {; | 128 | { |
101 | init=0; | 129 | init=0; |
102 | #ifndef NO_ERR | 130 | #ifndef NO_ERR |
103 | ERR_load_strings(ERR_LIB_EVP,EVP_str_functs); | 131 | ERR_load_strings(ERR_LIB_EVP,EVP_str_functs); |
diff --git a/src/lib/libcrypto/evp/evp_key.c b/src/lib/libcrypto/evp/evp_key.c index dafa686f64..21eda418bc 100644 --- a/src/lib/libcrypto/evp/evp_key.c +++ b/src/lib/libcrypto/evp/evp_key.c | |||
@@ -58,15 +58,14 @@ | |||
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include "x509.h" | 61 | #include <openssl/x509.h> |
62 | #include "objects.h" | 62 | #include <openssl/objects.h> |
63 | #include "evp.h" | 63 | #include <openssl/evp.h> |
64 | 64 | ||
65 | /* should be init to zeros. */ | 65 | /* should be init to zeros. */ |
66 | static char prompt_string[80]; | 66 | static char prompt_string[80]; |
67 | 67 | ||
68 | void EVP_set_pw_prompt(prompt) | 68 | void EVP_set_pw_prompt(char *prompt) |
69 | char *prompt; | ||
70 | { | 69 | { |
71 | if (prompt == NULL) | 70 | if (prompt == NULL) |
72 | prompt_string[0]='\0'; | 71 | prompt_string[0]='\0'; |
@@ -74,7 +73,7 @@ char *prompt; | |||
74 | strncpy(prompt_string,prompt,79); | 73 | strncpy(prompt_string,prompt,79); |
75 | } | 74 | } |
76 | 75 | ||
77 | char *EVP_get_pw_prompt() | 76 | char *EVP_get_pw_prompt(void) |
78 | { | 77 | { |
79 | if (prompt_string[0] == '\0') | 78 | if (prompt_string[0] == '\0') |
80 | return(NULL); | 79 | return(NULL); |
@@ -83,29 +82,19 @@ char *EVP_get_pw_prompt() | |||
83 | } | 82 | } |
84 | 83 | ||
85 | #ifdef NO_DES | 84 | #ifdef NO_DES |
86 | int des_read_pw_string(char *buf,int len,char *prompt,int verify); | 85 | int des_read_pw_string(char *buf,int len,const char *prompt,int verify); |
87 | #endif | 86 | #endif |
88 | 87 | ||
89 | int EVP_read_pw_string(buf,len,prompt,verify) | 88 | int EVP_read_pw_string(char *buf, int len, const char *prompt, int verify) |
90 | char *buf; | ||
91 | int len; | ||
92 | char *prompt; | ||
93 | int verify; | ||
94 | { | 89 | { |
95 | if ((prompt == NULL) && (prompt_string[0] != '\0')) | 90 | if ((prompt == NULL) && (prompt_string[0] != '\0')) |
96 | prompt=prompt_string; | 91 | prompt=prompt_string; |
97 | return(des_read_pw_string(buf,len,prompt,verify)); | 92 | return(des_read_pw_string(buf,len,prompt,verify)); |
98 | } | 93 | } |
99 | 94 | ||
100 | int EVP_BytesToKey(type,md,salt,data,datal,count,key,iv) | 95 | int EVP_BytesToKey(const EVP_CIPHER *type, EVP_MD *md, unsigned char *salt, |
101 | EVP_CIPHER *type; | 96 | unsigned char *data, int datal, int count, unsigned char *key, |
102 | EVP_MD *md; | 97 | unsigned char *iv) |
103 | unsigned char *salt; | ||
104 | unsigned char *data; | ||
105 | int datal; | ||
106 | int count; | ||
107 | unsigned char *key; | ||
108 | unsigned char *iv; | ||
109 | { | 98 | { |
110 | EVP_MD_CTX c; | 99 | EVP_MD_CTX c; |
111 | unsigned char md_buf[EVP_MAX_MD_SIZE]; | 100 | unsigned char md_buf[EVP_MAX_MD_SIZE]; |
diff --git a/src/lib/libcrypto/evp/evp_lib.c b/src/lib/libcrypto/evp/evp_lib.c index 69784eb555..3f9bf55828 100644 --- a/src/lib/libcrypto/evp/evp_lib.c +++ b/src/lib/libcrypto/evp/evp_lib.c | |||
@@ -58,12 +58,10 @@ | |||
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include "evp.h" | 61 | #include <openssl/evp.h> |
62 | #include "objects.h" | 62 | #include <openssl/objects.h> |
63 | 63 | ||
64 | int EVP_CIPHER_param_to_asn1(c,type) | 64 | int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type) |
65 | EVP_CIPHER_CTX *c; | ||
66 | ASN1_TYPE *type; | ||
67 | { | 65 | { |
68 | int ret; | 66 | int ret; |
69 | 67 | ||
@@ -74,9 +72,7 @@ ASN1_TYPE *type; | |||
74 | return(ret); | 72 | return(ret); |
75 | } | 73 | } |
76 | 74 | ||
77 | int EVP_CIPHER_asn1_to_param(c,type) | 75 | int EVP_CIPHER_asn1_to_param(EVP_CIPHER_CTX *c, ASN1_TYPE *type) |
78 | EVP_CIPHER_CTX *c; | ||
79 | ASN1_TYPE *type; | ||
80 | { | 76 | { |
81 | int ret; | 77 | int ret; |
82 | 78 | ||
@@ -87,9 +83,7 @@ ASN1_TYPE *type; | |||
87 | return(ret); | 83 | return(ret); |
88 | } | 84 | } |
89 | 85 | ||
90 | int EVP_CIPHER_get_asn1_iv(c,type) | 86 | int EVP_CIPHER_get_asn1_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type) |
91 | EVP_CIPHER_CTX *c; | ||
92 | ASN1_TYPE *type; | ||
93 | { | 87 | { |
94 | int i=0,l; | 88 | int i=0,l; |
95 | 89 | ||
@@ -97,14 +91,15 @@ ASN1_TYPE *type; | |||
97 | { | 91 | { |
98 | l=EVP_CIPHER_CTX_iv_length(c); | 92 | l=EVP_CIPHER_CTX_iv_length(c); |
99 | i=ASN1_TYPE_get_octetstring(type,c->oiv,l); | 93 | i=ASN1_TYPE_get_octetstring(type,c->oiv,l); |
100 | memcpy(c->iv,c->oiv,l); | 94 | if (i != l) |
95 | return(-1); | ||
96 | else if (i > 0) | ||
97 | memcpy(c->iv,c->oiv,l); | ||
101 | } | 98 | } |
102 | return(i); | 99 | return(i); |
103 | } | 100 | } |
104 | 101 | ||
105 | int EVP_CIPHER_set_asn1_iv(c,type) | 102 | int EVP_CIPHER_set_asn1_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type) |
106 | EVP_CIPHER_CTX *c; | ||
107 | ASN1_TYPE *type; | ||
108 | { | 103 | { |
109 | int i=0,j; | 104 | int i=0,j; |
110 | 105 | ||
@@ -115,3 +110,29 @@ ASN1_TYPE *type; | |||
115 | } | 110 | } |
116 | return(i); | 111 | return(i); |
117 | } | 112 | } |
113 | |||
114 | /* Convert the various cipher NIDs and dummies to a proper OID NID */ | ||
115 | int EVP_CIPHER_type(const EVP_CIPHER *ctx) | ||
116 | { | ||
117 | int nid; | ||
118 | nid = EVP_CIPHER_nid(ctx); | ||
119 | |||
120 | switch(nid) { | ||
121 | |||
122 | case NID_rc2_cbc: | ||
123 | case NID_rc2_64_cbc: | ||
124 | case NID_rc2_40_cbc: | ||
125 | |||
126 | return NID_rc2_cbc; | ||
127 | |||
128 | case NID_rc4: | ||
129 | case NID_rc4_40: | ||
130 | |||
131 | return NID_rc4; | ||
132 | |||
133 | default: | ||
134 | |||
135 | return nid; | ||
136 | } | ||
137 | } | ||
138 | |||
diff --git a/src/lib/libcrypto/evp/evp_pbe.c b/src/lib/libcrypto/evp/evp_pbe.c new file mode 100644 index 0000000000..353c3ad667 --- /dev/null +++ b/src/lib/libcrypto/evp/evp_pbe.c | |||
@@ -0,0 +1,134 @@ | |||
1 | /* evp_pbe.c */ | ||
2 | /* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL | ||
3 | * project 1999. | ||
4 | */ | ||
5 | /* ==================================================================== | ||
6 | * Copyright (c) 1999 The OpenSSL Project. All rights reserved. | ||
7 | * | ||
8 | * Redistribution and use in source and binary forms, with or without | ||
9 | * modification, are permitted provided that the following conditions | ||
10 | * are met: | ||
11 | * | ||
12 | * 1. Redistributions of source code must retain the above copyright | ||
13 | * notice, this list of conditions and the following disclaimer. | ||
14 | * | ||
15 | * 2. Redistributions in binary form must reproduce the above copyright | ||
16 | * notice, this list of conditions and the following disclaimer in | ||
17 | * the documentation and/or other materials provided with the | ||
18 | * distribution. | ||
19 | * | ||
20 | * 3. All advertising materials mentioning features or use of this | ||
21 | * software must display the following acknowledgment: | ||
22 | * "This product includes software developed by the OpenSSL Project | ||
23 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" | ||
24 | * | ||
25 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
26 | * endorse or promote products derived from this software without | ||
27 | * prior written permission. For written permission, please contact | ||
28 | * licensing@OpenSSL.org. | ||
29 | * | ||
30 | * 5. Products derived from this software may not be called "OpenSSL" | ||
31 | * nor may "OpenSSL" appear in their names without prior written | ||
32 | * permission of the OpenSSL Project. | ||
33 | * | ||
34 | * 6. Redistributions of any form whatsoever must retain the following | ||
35 | * acknowledgment: | ||
36 | * "This product includes software developed by the OpenSSL Project | ||
37 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" | ||
38 | * | ||
39 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
40 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
41 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
42 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
43 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
44 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
45 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
46 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
47 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
48 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
49 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
50 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
51 | * ==================================================================== | ||
52 | * | ||
53 | * This product includes cryptographic software written by Eric Young | ||
54 | * (eay@cryptsoft.com). This product includes software written by Tim | ||
55 | * Hudson (tjh@cryptsoft.com). | ||
56 | * | ||
57 | */ | ||
58 | |||
59 | #include <stdio.h> | ||
60 | #include <openssl/evp.h> | ||
61 | #include <openssl/x509.h> | ||
62 | #include "cryptlib.h" | ||
63 | |||
64 | /* Password based encryption (PBE) functions */ | ||
65 | |||
66 | static STACK *pbe_algs; | ||
67 | |||
68 | /* Setup a cipher context from a PBE algorithm */ | ||
69 | |||
70 | typedef struct { | ||
71 | int pbe_nid; | ||
72 | EVP_CIPHER *cipher; | ||
73 | EVP_MD *md; | ||
74 | EVP_PBE_KEYGEN *keygen; | ||
75 | } EVP_PBE_CTL; | ||
76 | |||
77 | int EVP_PBE_CipherInit (ASN1_OBJECT *pbe_obj, const char *pass, int passlen, | ||
78 | ASN1_TYPE *param, EVP_CIPHER_CTX *ctx, int en_de) | ||
79 | { | ||
80 | |||
81 | EVP_PBE_CTL *pbetmp, pbelu; | ||
82 | int i; | ||
83 | pbelu.pbe_nid = OBJ_obj2nid(pbe_obj); | ||
84 | if (pbelu.pbe_nid != NID_undef) i = sk_find(pbe_algs, (char *)&pbelu); | ||
85 | else i = -1; | ||
86 | |||
87 | if (i == -1) { | ||
88 | char obj_tmp[80]; | ||
89 | EVPerr(EVP_F_EVP_PBE_CIPHERINIT,EVP_R_UNKNOWN_PBE_ALGORITHM); | ||
90 | if (!pbe_obj) strcpy (obj_tmp, "NULL"); | ||
91 | else i2t_ASN1_OBJECT(obj_tmp, 80, pbe_obj); | ||
92 | ERR_add_error_data(2, "TYPE=", obj_tmp); | ||
93 | return 0; | ||
94 | } | ||
95 | if (passlen == -1) passlen = strlen(pass); | ||
96 | pbetmp = (EVP_PBE_CTL *)sk_value (pbe_algs, i); | ||
97 | i = (*pbetmp->keygen)(ctx, pass, passlen, param, pbetmp->cipher, | ||
98 | pbetmp->md, en_de); | ||
99 | if (!i) { | ||
100 | EVPerr(EVP_F_EVP_PBE_CIPHERINIT,EVP_R_KEYGEN_FAILURE); | ||
101 | return 0; | ||
102 | } | ||
103 | return 1; | ||
104 | } | ||
105 | |||
106 | static int pbe_cmp (EVP_PBE_CTL **pbe1, EVP_PBE_CTL **pbe2) | ||
107 | { | ||
108 | return ((*pbe1)->pbe_nid - (*pbe2)->pbe_nid); | ||
109 | } | ||
110 | |||
111 | /* Add a PBE algorithm */ | ||
112 | |||
113 | int EVP_PBE_alg_add (int nid, EVP_CIPHER *cipher, EVP_MD *md, | ||
114 | EVP_PBE_KEYGEN *keygen) | ||
115 | { | ||
116 | EVP_PBE_CTL *pbe_tmp; | ||
117 | if (!pbe_algs) pbe_algs = sk_new (pbe_cmp); | ||
118 | if (!(pbe_tmp = (EVP_PBE_CTL*) Malloc (sizeof(EVP_PBE_CTL)))) { | ||
119 | EVPerr(EVP_F_EVP_PBE_ALG_ADD,ERR_R_MALLOC_FAILURE); | ||
120 | return 0; | ||
121 | } | ||
122 | pbe_tmp->pbe_nid = nid; | ||
123 | pbe_tmp->cipher = cipher; | ||
124 | pbe_tmp->md = md; | ||
125 | pbe_tmp->keygen = keygen; | ||
126 | sk_push (pbe_algs, (char *)pbe_tmp); | ||
127 | return 1; | ||
128 | } | ||
129 | |||
130 | void EVP_PBE_cleanup(void) | ||
131 | { | ||
132 | sk_pop_free(pbe_algs, FreeFunc); | ||
133 | pbe_algs = NULL; | ||
134 | } | ||
diff --git a/src/lib/libcrypto/evp/evp_pkey.c b/src/lib/libcrypto/evp/evp_pkey.c new file mode 100644 index 0000000000..421e452db1 --- /dev/null +++ b/src/lib/libcrypto/evp/evp_pkey.c | |||
@@ -0,0 +1,298 @@ | |||
1 | /* evp_pkey.c */ | ||
2 | /* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL | ||
3 | * project 1999. | ||
4 | */ | ||
5 | /* ==================================================================== | ||
6 | * Copyright (c) 1999 The OpenSSL Project. All rights reserved. | ||
7 | * | ||
8 | * Redistribution and use in source and binary forms, with or without | ||
9 | * modification, are permitted provided that the following conditions | ||
10 | * are met: | ||
11 | * | ||
12 | * 1. Redistributions of source code must retain the above copyright | ||
13 | * notice, this list of conditions and the following disclaimer. | ||
14 | * | ||
15 | * 2. Redistributions in binary form must reproduce the above copyright | ||
16 | * notice, this list of conditions and the following disclaimer in | ||
17 | * the documentation and/or other materials provided with the | ||
18 | * distribution. | ||
19 | * | ||
20 | * 3. All advertising materials mentioning features or use of this | ||
21 | * software must display the following acknowledgment: | ||
22 | * "This product includes software developed by the OpenSSL Project | ||
23 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" | ||
24 | * | ||
25 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
26 | * endorse or promote products derived from this software without | ||
27 | * prior written permission. For written permission, please contact | ||
28 | * licensing@OpenSSL.org. | ||
29 | * | ||
30 | * 5. Products derived from this software may not be called "OpenSSL" | ||
31 | * nor may "OpenSSL" appear in their names without prior written | ||
32 | * permission of the OpenSSL Project. | ||
33 | * | ||
34 | * 6. Redistributions of any form whatsoever must retain the following | ||
35 | * acknowledgment: | ||
36 | * "This product includes software developed by the OpenSSL Project | ||
37 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" | ||
38 | * | ||
39 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
40 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
41 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
42 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
43 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
44 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
45 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
46 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
47 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
48 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
49 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
50 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
51 | * ==================================================================== | ||
52 | * | ||
53 | * This product includes cryptographic software written by Eric Young | ||
54 | * (eay@cryptsoft.com). This product includes software written by Tim | ||
55 | * Hudson (tjh@cryptsoft.com). | ||
56 | * | ||
57 | */ | ||
58 | |||
59 | #include <stdio.h> | ||
60 | #include <stdlib.h> | ||
61 | #include "cryptlib.h" | ||
62 | #include <openssl/x509.h> | ||
63 | #include <openssl/rand.h> | ||
64 | |||
65 | /* Extract a private key from a PKCS8 structure */ | ||
66 | |||
67 | EVP_PKEY *EVP_PKCS82PKEY (PKCS8_PRIV_KEY_INFO *p8) | ||
68 | { | ||
69 | EVP_PKEY *pkey; | ||
70 | #ifndef NO_RSA | ||
71 | RSA *rsa; | ||
72 | #endif | ||
73 | #ifndef NO_DSA | ||
74 | DSA *dsa; | ||
75 | ASN1_INTEGER *dsapriv; | ||
76 | STACK *ndsa; | ||
77 | BN_CTX *ctx; | ||
78 | int plen; | ||
79 | #endif | ||
80 | X509_ALGOR *a; | ||
81 | unsigned char *p; | ||
82 | int pkeylen; | ||
83 | char obj_tmp[80]; | ||
84 | |||
85 | switch (p8->broken) { | ||
86 | case PKCS8_OK: | ||
87 | p = p8->pkey->value.octet_string->data; | ||
88 | pkeylen = p8->pkey->value.octet_string->length; | ||
89 | break; | ||
90 | |||
91 | case PKCS8_NO_OCTET: | ||
92 | p = p8->pkey->value.sequence->data; | ||
93 | pkeylen = p8->pkey->value.sequence->length; | ||
94 | break; | ||
95 | |||
96 | default: | ||
97 | EVPerr(EVP_F_EVP_PKCS82PKEY,EVP_R_PKCS8_UNKNOWN_BROKEN_TYPE); | ||
98 | return NULL; | ||
99 | break; | ||
100 | } | ||
101 | if (!(pkey = EVP_PKEY_new())) { | ||
102 | EVPerr(EVP_F_EVP_PKCS82PKEY,ERR_R_MALLOC_FAILURE); | ||
103 | return NULL; | ||
104 | } | ||
105 | a = p8->pkeyalg; | ||
106 | switch (OBJ_obj2nid(a->algorithm)) | ||
107 | { | ||
108 | #ifndef NO_RSA | ||
109 | case NID_rsaEncryption: | ||
110 | if (!(rsa = d2i_RSAPrivateKey (NULL, &p, pkeylen))) { | ||
111 | EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR); | ||
112 | return NULL; | ||
113 | } | ||
114 | EVP_PKEY_assign_RSA (pkey, rsa); | ||
115 | break; | ||
116 | #endif | ||
117 | #ifndef NO_DSA | ||
118 | case NID_dsa: | ||
119 | /* PKCS#8 DSA is weird: you just get a private key integer | ||
120 | * and parameters in the AlgorithmIdentifier the pubkey must | ||
121 | * be recalculated. | ||
122 | */ | ||
123 | |||
124 | /* Check for broken Netscape Database DSA PKCS#8, UGH! */ | ||
125 | if(*p == (V_ASN1_SEQUENCE|V_ASN1_CONSTRUCTED)) { | ||
126 | if(!(ndsa = ASN1_seq_unpack(p, pkeylen, | ||
127 | (char *(*)())d2i_ASN1_INTEGER, | ||
128 | ASN1_STRING_free))) { | ||
129 | EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR); | ||
130 | return NULL; | ||
131 | } | ||
132 | if(sk_num(ndsa) != 2 ) { | ||
133 | EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR); | ||
134 | sk_pop_free(ndsa, ASN1_STRING_free); | ||
135 | return NULL; | ||
136 | } | ||
137 | dsapriv = (ASN1_INTEGER *) sk_pop(ndsa); | ||
138 | sk_pop_free(ndsa, ASN1_STRING_free); | ||
139 | } else if (!(dsapriv=d2i_ASN1_INTEGER (NULL, &p, pkeylen))) { | ||
140 | EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR); | ||
141 | return NULL; | ||
142 | } | ||
143 | /* Retrieve parameters */ | ||
144 | if (a->parameter->type != V_ASN1_SEQUENCE) { | ||
145 | EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_NO_DSA_PARAMETERS); | ||
146 | return NULL; | ||
147 | } | ||
148 | p = a->parameter->value.sequence->data; | ||
149 | plen = a->parameter->value.sequence->length; | ||
150 | if (!(dsa = d2i_DSAparams (NULL, &p, plen))) { | ||
151 | EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR); | ||
152 | return NULL; | ||
153 | } | ||
154 | /* We have parameters now set private key */ | ||
155 | if (!(dsa->priv_key = ASN1_INTEGER_to_BN(dsapriv, NULL))) { | ||
156 | EVPerr(EVP_F_EVP_PKCS82PKEY,EVP_R_BN_DECODE_ERROR); | ||
157 | DSA_free (dsa); | ||
158 | return NULL; | ||
159 | } | ||
160 | /* Calculate public key (ouch!) */ | ||
161 | if (!(dsa->pub_key = BN_new())) { | ||
162 | EVPerr(EVP_F_EVP_PKCS82PKEY,ERR_R_MALLOC_FAILURE); | ||
163 | DSA_free (dsa); | ||
164 | return NULL; | ||
165 | } | ||
166 | if (!(ctx = BN_CTX_new())) { | ||
167 | EVPerr(EVP_F_EVP_PKCS82PKEY,ERR_R_MALLOC_FAILURE); | ||
168 | DSA_free (dsa); | ||
169 | return NULL; | ||
170 | } | ||
171 | |||
172 | if (!BN_mod_exp(dsa->pub_key, dsa->g, | ||
173 | dsa->priv_key, dsa->p, ctx)) { | ||
174 | |||
175 | EVPerr(EVP_F_EVP_PKCS82PKEY,EVP_R_BN_PUBKEY_ERROR); | ||
176 | BN_CTX_free (ctx); | ||
177 | DSA_free (dsa); | ||
178 | return NULL; | ||
179 | } | ||
180 | |||
181 | EVP_PKEY_assign_DSA (pkey, dsa); | ||
182 | BN_CTX_free (ctx); | ||
183 | break; | ||
184 | #endif | ||
185 | default: | ||
186 | EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM); | ||
187 | if (!a->algorithm) strcpy (obj_tmp, "NULL"); | ||
188 | else i2t_ASN1_OBJECT(obj_tmp, 80, a->algorithm); | ||
189 | ERR_add_error_data(2, "TYPE=", obj_tmp); | ||
190 | EVP_PKEY_free (pkey); | ||
191 | return NULL; | ||
192 | } | ||
193 | return pkey; | ||
194 | } | ||
195 | |||
196 | /* Turn a private key into a PKCS8 structure */ | ||
197 | |||
198 | PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(EVP_PKEY *pkey) | ||
199 | { | ||
200 | PKCS8_PRIV_KEY_INFO *p8; | ||
201 | #ifndef NO_DSA | ||
202 | ASN1_INTEGER *dpkey; | ||
203 | unsigned char *p, *q; | ||
204 | int len; | ||
205 | #endif | ||
206 | if (!(p8 = PKCS8_PRIV_KEY_INFO_new())) { | ||
207 | EVPerr(EVP_F_EVP_PKEY2PKCS8,ERR_R_MALLOC_FAILURE); | ||
208 | return NULL; | ||
209 | } | ||
210 | ASN1_INTEGER_set (p8->version, 0); | ||
211 | if (!(p8->pkeyalg->parameter = ASN1_TYPE_new ())) { | ||
212 | EVPerr(EVP_F_EVP_PKEY2PKCS8,ERR_R_MALLOC_FAILURE); | ||
213 | PKCS8_PRIV_KEY_INFO_free (p8); | ||
214 | return NULL; | ||
215 | } | ||
216 | switch (EVP_PKEY_type(pkey->type)) { | ||
217 | #ifndef NO_RSA | ||
218 | case EVP_PKEY_RSA: | ||
219 | |||
220 | p8->pkeyalg->algorithm = OBJ_nid2obj(NID_rsaEncryption); | ||
221 | p8->pkeyalg->parameter->type = V_ASN1_NULL; | ||
222 | if (!ASN1_pack_string ((char *)pkey, i2d_PrivateKey, | ||
223 | &p8->pkey->value.octet_string)) { | ||
224 | EVPerr(EVP_F_EVP_PKEY2PKCS8,ERR_R_MALLOC_FAILURE); | ||
225 | PKCS8_PRIV_KEY_INFO_free (p8); | ||
226 | return NULL; | ||
227 | } | ||
228 | break; | ||
229 | #endif | ||
230 | #ifndef NO_DSA | ||
231 | case EVP_PKEY_DSA: | ||
232 | p8->pkeyalg->algorithm = OBJ_nid2obj(NID_dsa); | ||
233 | |||
234 | /* get paramaters and place in AlgorithmIdentifier */ | ||
235 | len = i2d_DSAparams (pkey->pkey.dsa, NULL); | ||
236 | if (!(p = Malloc(len))) { | ||
237 | EVPerr(EVP_F_EVP_PKEY2PKCS8,ERR_R_MALLOC_FAILURE); | ||
238 | PKCS8_PRIV_KEY_INFO_free (p8); | ||
239 | return NULL; | ||
240 | } | ||
241 | q = p; | ||
242 | i2d_DSAparams (pkey->pkey.dsa, &q); | ||
243 | p8->pkeyalg->parameter->type = V_ASN1_SEQUENCE; | ||
244 | p8->pkeyalg->parameter->value.sequence = ASN1_STRING_new(); | ||
245 | ASN1_STRING_set(p8->pkeyalg->parameter->value.sequence, p, len); | ||
246 | Free(p); | ||
247 | /* Get private key into an integer and pack */ | ||
248 | if (!(dpkey = BN_to_ASN1_INTEGER (pkey->pkey.dsa->priv_key, NULL))) { | ||
249 | EVPerr(EVP_F_EVP_PKEY2PKCS8,EVP_R_ENCODE_ERROR); | ||
250 | PKCS8_PRIV_KEY_INFO_free (p8); | ||
251 | return NULL; | ||
252 | } | ||
253 | |||
254 | if (!ASN1_pack_string((char *)dpkey, i2d_ASN1_INTEGER, | ||
255 | &p8->pkey->value.octet_string)) { | ||
256 | EVPerr(EVP_F_EVP_PKEY2PKCS8,ERR_R_MALLOC_FAILURE); | ||
257 | ASN1_INTEGER_free (dpkey); | ||
258 | PKCS8_PRIV_KEY_INFO_free (p8); | ||
259 | return NULL; | ||
260 | } | ||
261 | ASN1_INTEGER_free (dpkey); | ||
262 | break; | ||
263 | #endif | ||
264 | default: | ||
265 | EVPerr(EVP_F_EVP_PKEY2PKCS8, EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM); | ||
266 | PKCS8_PRIV_KEY_INFO_free (p8); | ||
267 | return NULL; | ||
268 | } | ||
269 | p8->pkey->type = V_ASN1_OCTET_STRING; | ||
270 | RAND_seed (p8->pkey->value.octet_string->data, | ||
271 | p8->pkey->value.octet_string->length); | ||
272 | return p8; | ||
273 | } | ||
274 | |||
275 | PKCS8_PRIV_KEY_INFO *PKCS8_set_broken(PKCS8_PRIV_KEY_INFO *p8, int broken) | ||
276 | { | ||
277 | switch (broken) { | ||
278 | |||
279 | case PKCS8_OK: | ||
280 | p8->broken = PKCS8_OK; | ||
281 | return p8; | ||
282 | break; | ||
283 | |||
284 | case PKCS8_NO_OCTET: | ||
285 | p8->broken = PKCS8_NO_OCTET; | ||
286 | p8->pkey->type = V_ASN1_SEQUENCE; | ||
287 | return p8; | ||
288 | break; | ||
289 | |||
290 | default: | ||
291 | EVPerr(EVP_F_EVP_PKCS8_SET_BROKEN,EVP_R_PKCS8_UNKNOWN_BROKEN_TYPE); | ||
292 | return NULL; | ||
293 | break; | ||
294 | |||
295 | } | ||
296 | } | ||
297 | |||
298 | |||
diff --git a/src/lib/libcrypto/evp/m_dss.c b/src/lib/libcrypto/evp/m_dss.c index 3549b1699c..8ea826868e 100644 --- a/src/lib/libcrypto/evp/m_dss.c +++ b/src/lib/libcrypto/evp/m_dss.c | |||
@@ -58,10 +58,11 @@ | |||
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include "evp.h" | 61 | #include <openssl/evp.h> |
62 | #include "objects.h" | 62 | #include <openssl/objects.h> |
63 | #include "x509.h" | 63 | #include <openssl/x509.h> |
64 | 64 | ||
65 | #ifndef NO_SHA | ||
65 | static EVP_MD dsa_md= | 66 | static EVP_MD dsa_md= |
66 | { | 67 | { |
67 | NID_dsaWithSHA, | 68 | NID_dsaWithSHA, |
@@ -75,8 +76,8 @@ static EVP_MD dsa_md= | |||
75 | sizeof(EVP_MD *)+sizeof(SHA_CTX), | 76 | sizeof(EVP_MD *)+sizeof(SHA_CTX), |
76 | }; | 77 | }; |
77 | 78 | ||
78 | EVP_MD *EVP_dss() | 79 | EVP_MD *EVP_dss(void) |
79 | { | 80 | { |
80 | return(&dsa_md); | 81 | return(&dsa_md); |
81 | } | 82 | } |
82 | 83 | #endif | |
diff --git a/src/lib/libcrypto/evp/m_dss1.c b/src/lib/libcrypto/evp/m_dss1.c index ff256b7b20..9d8d1ce23e 100644 --- a/src/lib/libcrypto/evp/m_dss1.c +++ b/src/lib/libcrypto/evp/m_dss1.c | |||
@@ -56,11 +56,12 @@ | |||
56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
57 | */ | 57 | */ |
58 | 58 | ||
59 | #ifndef NO_SHA | ||
59 | #include <stdio.h> | 60 | #include <stdio.h> |
60 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
61 | #include "evp.h" | 62 | #include <openssl/evp.h> |
62 | #include "objects.h" | 63 | #include <openssl/objects.h> |
63 | #include "x509.h" | 64 | #include <openssl/x509.h> |
64 | 65 | ||
65 | static EVP_MD dss1_md= | 66 | static EVP_MD dss1_md= |
66 | { | 67 | { |
@@ -75,7 +76,8 @@ static EVP_MD dss1_md= | |||
75 | sizeof(EVP_MD *)+sizeof(SHA_CTX), | 76 | sizeof(EVP_MD *)+sizeof(SHA_CTX), |
76 | }; | 77 | }; |
77 | 78 | ||
78 | EVP_MD *EVP_dss1() | 79 | EVP_MD *EVP_dss1(void) |
79 | { | 80 | { |
80 | return(&dss1_md); | 81 | return(&dss1_md); |
81 | } | 82 | } |
83 | #endif | ||
diff --git a/src/lib/libcrypto/evp/m_md2.c b/src/lib/libcrypto/evp/m_md2.c index 2209416142..3281e91809 100644 --- a/src/lib/libcrypto/evp/m_md2.c +++ b/src/lib/libcrypto/evp/m_md2.c | |||
@@ -56,11 +56,12 @@ | |||
56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
57 | */ | 57 | */ |
58 | 58 | ||
59 | #ifndef NO_MD2 | ||
59 | #include <stdio.h> | 60 | #include <stdio.h> |
60 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
61 | #include "evp.h" | 62 | #include <openssl/evp.h> |
62 | #include "objects.h" | 63 | #include <openssl/objects.h> |
63 | #include "x509.h" | 64 | #include <openssl/x509.h> |
64 | 65 | ||
65 | static EVP_MD md2_md= | 66 | static EVP_MD md2_md= |
66 | { | 67 | { |
@@ -75,8 +76,8 @@ static EVP_MD md2_md= | |||
75 | sizeof(EVP_MD *)+sizeof(MD2_CTX), | 76 | sizeof(EVP_MD *)+sizeof(MD2_CTX), |
76 | }; | 77 | }; |
77 | 78 | ||
78 | EVP_MD *EVP_md2() | 79 | EVP_MD *EVP_md2(void) |
79 | { | 80 | { |
80 | return(&md2_md); | 81 | return(&md2_md); |
81 | } | 82 | } |
82 | 83 | #endif | |
diff --git a/src/lib/libcrypto/evp/m_md5.c b/src/lib/libcrypto/evp/m_md5.c index d65db9aa1d..9fc9530127 100644 --- a/src/lib/libcrypto/evp/m_md5.c +++ b/src/lib/libcrypto/evp/m_md5.c | |||
@@ -56,11 +56,12 @@ | |||
56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
57 | */ | 57 | */ |
58 | 58 | ||
59 | #ifndef NO_MD5 | ||
59 | #include <stdio.h> | 60 | #include <stdio.h> |
60 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
61 | #include "evp.h" | 62 | #include <openssl/evp.h> |
62 | #include "objects.h" | 63 | #include <openssl/objects.h> |
63 | #include "x509.h" | 64 | #include <openssl/x509.h> |
64 | 65 | ||
65 | static EVP_MD md5_md= | 66 | static EVP_MD md5_md= |
66 | { | 67 | { |
@@ -75,7 +76,8 @@ static EVP_MD md5_md= | |||
75 | sizeof(EVP_MD *)+sizeof(MD5_CTX), | 76 | sizeof(EVP_MD *)+sizeof(MD5_CTX), |
76 | }; | 77 | }; |
77 | 78 | ||
78 | EVP_MD *EVP_md5() | 79 | EVP_MD *EVP_md5(void) |
79 | { | 80 | { |
80 | return(&md5_md); | 81 | return(&md5_md); |
81 | } | 82 | } |
83 | #endif | ||
diff --git a/src/lib/libcrypto/evp/m_mdc2.c b/src/lib/libcrypto/evp/m_mdc2.c index 64a853eb7f..2c7f1ae515 100644 --- a/src/lib/libcrypto/evp/m_mdc2.c +++ b/src/lib/libcrypto/evp/m_mdc2.c | |||
@@ -56,11 +56,12 @@ | |||
56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
57 | */ | 57 | */ |
58 | 58 | ||
59 | #ifndef NO_MDC2 | ||
59 | #include <stdio.h> | 60 | #include <stdio.h> |
60 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
61 | #include "evp.h" | 62 | #include <openssl/evp.h> |
62 | #include "objects.h" | 63 | #include <openssl/objects.h> |
63 | #include "x509.h" | 64 | #include <openssl/x509.h> |
64 | 65 | ||
65 | static EVP_MD mdc2_md= | 66 | static EVP_MD mdc2_md= |
66 | { | 67 | { |
@@ -75,7 +76,8 @@ static EVP_MD mdc2_md= | |||
75 | sizeof(EVP_MD *)+sizeof(MDC2_CTX), | 76 | sizeof(EVP_MD *)+sizeof(MDC2_CTX), |
76 | }; | 77 | }; |
77 | 78 | ||
78 | EVP_MD *EVP_mdc2() | 79 | EVP_MD *EVP_mdc2(void) |
79 | { | 80 | { |
80 | return(&mdc2_md); | 81 | return(&mdc2_md); |
81 | } | 82 | } |
83 | #endif | ||
diff --git a/src/lib/libcrypto/evp/m_null.c b/src/lib/libcrypto/evp/m_null.c index 6d80560df2..e2dadf3dab 100644 --- a/src/lib/libcrypto/evp/m_null.c +++ b/src/lib/libcrypto/evp/m_null.c | |||
@@ -58,11 +58,11 @@ | |||
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include "evp.h" | 61 | #include <openssl/evp.h> |
62 | #include "objects.h" | 62 | #include <openssl/objects.h> |
63 | #include "x509.h" | 63 | #include <openssl/x509.h> |
64 | 64 | ||
65 | static void function() | 65 | static void function(void) |
66 | { | 66 | { |
67 | } | 67 | } |
68 | 68 | ||
@@ -80,7 +80,7 @@ static EVP_MD null_md= | |||
80 | sizeof(EVP_MD *), | 80 | sizeof(EVP_MD *), |
81 | }; | 81 | }; |
82 | 82 | ||
83 | EVP_MD *EVP_md_null() | 83 | EVP_MD *EVP_md_null(void) |
84 | { | 84 | { |
85 | return(&null_md); | 85 | return(&null_md); |
86 | } | 86 | } |
diff --git a/src/lib/libcrypto/evp/m_ripemd.c b/src/lib/libcrypto/evp/m_ripemd.c index 04c5d8897b..3d781a4e8d 100644 --- a/src/lib/libcrypto/evp/m_ripemd.c +++ b/src/lib/libcrypto/evp/m_ripemd.c | |||
@@ -56,11 +56,13 @@ | |||
56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
57 | */ | 57 | */ |
58 | 58 | ||
59 | #ifndef NO_RIPEMD | ||
59 | #include <stdio.h> | 60 | #include <stdio.h> |
60 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
61 | #include "evp.h" | 62 | #include <openssl/ripemd.h> |
62 | #include "objects.h" | 63 | #include <openssl/evp.h> |
63 | #include "x509.h" | 64 | #include <openssl/objects.h> |
65 | #include <openssl/x509.h> | ||
64 | 66 | ||
65 | static EVP_MD ripemd160_md= | 67 | static EVP_MD ripemd160_md= |
66 | { | 68 | { |
@@ -75,7 +77,8 @@ static EVP_MD ripemd160_md= | |||
75 | sizeof(EVP_MD *)+sizeof(RIPEMD160_CTX), | 77 | sizeof(EVP_MD *)+sizeof(RIPEMD160_CTX), |
76 | }; | 78 | }; |
77 | 79 | ||
78 | EVP_MD *EVP_ripemd160() | 80 | EVP_MD *EVP_ripemd160(void) |
79 | { | 81 | { |
80 | return(&ripemd160_md); | 82 | return(&ripemd160_md); |
81 | } | 83 | } |
84 | #endif | ||
diff --git a/src/lib/libcrypto/evp/m_sha.c b/src/lib/libcrypto/evp/m_sha.c index af4e434a22..6d35b71b85 100644 --- a/src/lib/libcrypto/evp/m_sha.c +++ b/src/lib/libcrypto/evp/m_sha.c | |||
@@ -56,11 +56,12 @@ | |||
56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
57 | */ | 57 | */ |
58 | 58 | ||
59 | #ifndef NO_SHA | ||
59 | #include <stdio.h> | 60 | #include <stdio.h> |
60 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
61 | #include "evp.h" | 62 | #include <openssl/evp.h> |
62 | #include "objects.h" | 63 | #include <openssl/objects.h> |
63 | #include "x509.h" | 64 | #include <openssl/x509.h> |
64 | 65 | ||
65 | static EVP_MD sha_md= | 66 | static EVP_MD sha_md= |
66 | { | 67 | { |
@@ -75,8 +76,8 @@ static EVP_MD sha_md= | |||
75 | sizeof(EVP_MD *)+sizeof(SHA_CTX), | 76 | sizeof(EVP_MD *)+sizeof(SHA_CTX), |
76 | }; | 77 | }; |
77 | 78 | ||
78 | EVP_MD *EVP_sha() | 79 | EVP_MD *EVP_sha(void) |
79 | { | 80 | { |
80 | return(&sha_md); | 81 | return(&sha_md); |
81 | } | 82 | } |
82 | 83 | #endif | |
diff --git a/src/lib/libcrypto/evp/m_sha1.c b/src/lib/libcrypto/evp/m_sha1.c index 87135a9cf2..57a1ab0cce 100644 --- a/src/lib/libcrypto/evp/m_sha1.c +++ b/src/lib/libcrypto/evp/m_sha1.c | |||
@@ -56,11 +56,12 @@ | |||
56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
57 | */ | 57 | */ |
58 | 58 | ||
59 | #ifndef NO_SHA | ||
59 | #include <stdio.h> | 60 | #include <stdio.h> |
60 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
61 | #include "evp.h" | 62 | #include <openssl/evp.h> |
62 | #include "objects.h" | 63 | #include <openssl/objects.h> |
63 | #include "x509.h" | 64 | #include <openssl/x509.h> |
64 | 65 | ||
65 | static EVP_MD sha1_md= | 66 | static EVP_MD sha1_md= |
66 | { | 67 | { |
@@ -75,7 +76,8 @@ static EVP_MD sha1_md= | |||
75 | sizeof(EVP_MD *)+sizeof(SHA_CTX), | 76 | sizeof(EVP_MD *)+sizeof(SHA_CTX), |
76 | }; | 77 | }; |
77 | 78 | ||
78 | EVP_MD *EVP_sha1() | 79 | EVP_MD *EVP_sha1(void) |
79 | { | 80 | { |
80 | return(&sha1_md); | 81 | return(&sha1_md); |
81 | } | 82 | } |
83 | #endif | ||
diff --git a/src/lib/libcrypto/evp/names.c b/src/lib/libcrypto/evp/names.c index e0774da20d..3e8f460328 100644 --- a/src/lib/libcrypto/evp/names.c +++ b/src/lib/libcrypto/evp/names.c | |||
@@ -58,228 +58,61 @@ | |||
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include "evp.h" | 61 | #include <openssl/evp.h> |
62 | #include "objects.h" | 62 | #include <openssl/objects.h> |
63 | #include <openssl/x509.h> | ||
63 | 64 | ||
64 | typedef struct aliases_st { | 65 | int EVP_add_cipher(EVP_CIPHER *c) |
65 | char *alias; | ||
66 | /* This must be the last field becaue I will allocate things | ||
67 | * so they go off the end of it */ | ||
68 | char name[4]; | ||
69 | } ALIASES; | ||
70 | |||
71 | static STACK /* ALIASES */ *aliases=NULL; | ||
72 | static STACK /* EVP_CIPHERS */ *ciphers=NULL; | ||
73 | static STACK /* EVP_MD */ *digests=NULL; | ||
74 | |||
75 | static int cipher_nid_cmp(a,b) | ||
76 | EVP_CIPHER **a,**b; | ||
77 | { return((*a)->nid - (*b)->nid); } | ||
78 | |||
79 | static int digest_type_cmp(a,b) | ||
80 | EVP_MD **a,**b; | ||
81 | { return((*a)->pkey_type - (*b)->pkey_type); } | ||
82 | |||
83 | int EVP_add_cipher(c) | ||
84 | EVP_CIPHER *c; | ||
85 | { | ||
86 | int i; | ||
87 | |||
88 | if (ciphers == NULL) | ||
89 | { | ||
90 | ciphers=sk_new(cipher_nid_cmp); | ||
91 | if (ciphers == NULL) return(0); | ||
92 | } | ||
93 | if ((i=sk_find(ciphers,(char *)c)) >= 0) | ||
94 | { | ||
95 | if (sk_value(ciphers,i) == (char *)c) | ||
96 | return(1); | ||
97 | sk_delete(ciphers,i); | ||
98 | } | ||
99 | return(sk_push(ciphers,(char *)c)); | ||
100 | } | ||
101 | |||
102 | int EVP_add_digest(md) | ||
103 | EVP_MD *md; | ||
104 | { | 66 | { |
105 | int i; | 67 | int r; |
106 | char *n; | ||
107 | 68 | ||
108 | if (digests == NULL) | 69 | r=OBJ_NAME_add(OBJ_nid2sn(c->nid),OBJ_NAME_TYPE_CIPHER_METH,(char *)c); |
109 | { | 70 | if (r == 0) return(0); |
110 | digests=sk_new(digest_type_cmp); | 71 | r=OBJ_NAME_add(OBJ_nid2ln(c->nid),OBJ_NAME_TYPE_CIPHER_METH,(char *)c); |
111 | if (digests == NULL) return(0); | 72 | return(r); |
112 | } | ||
113 | if ((i=sk_find(digests,(char *)md)) >= 0) | ||
114 | { | ||
115 | if (sk_value(digests,i) == (char *)md) | ||
116 | return(1); | ||
117 | sk_delete(digests,i); | ||
118 | } | ||
119 | if (md->type != md->pkey_type) | ||
120 | { | ||
121 | n=OBJ_nid2sn(md->pkey_type); | ||
122 | EVP_add_alias(n,OBJ_nid2sn(md->type)); | ||
123 | EVP_add_alias(n,OBJ_nid2ln(md->type)); | ||
124 | } | ||
125 | sk_push(digests,(char *)md); | ||
126 | return(1); | ||
127 | } | ||
128 | |||
129 | static int alias_cmp(a,b) | ||
130 | ALIASES **a,**b; | ||
131 | { | ||
132 | return(strcmp((*a)->alias,(*b)->alias)); | ||
133 | } | 73 | } |
134 | 74 | ||
135 | int EVP_add_alias(name,aname) | 75 | int EVP_add_digest(EVP_MD *md) |
136 | char *name; | ||
137 | char *aname; | ||
138 | { | 76 | { |
139 | int l1,l2,i; | 77 | int r; |
140 | ALIASES *a; | 78 | const char *name; |
141 | char *p; | ||
142 | 79 | ||
143 | if ((name == NULL) || (aname == NULL)) return(0); | 80 | name=OBJ_nid2sn(md->type); |
144 | l1=strlen(name)+1; | 81 | r=OBJ_NAME_add(name,OBJ_NAME_TYPE_MD_METH,(char *)md); |
145 | l2=strlen(aname)+1; | 82 | if (r == 0) return(0); |
146 | i=sizeof(ALIASES)+l1+l2; | 83 | r=OBJ_NAME_add(OBJ_nid2ln(md->type),OBJ_NAME_TYPE_MD_METH,(char *)md); |
147 | if ((a=(ALIASES *)Malloc(i)) == NULL) | 84 | if (r == 0) return(0); |
148 | return(0); | ||
149 | strcpy(a->name,name); | ||
150 | p= &(a->name[l1]); | ||
151 | strcpy(p,aname); | ||
152 | a->alias=p; | ||
153 | 85 | ||
154 | if (aliases == NULL) | 86 | if (md->type != md->pkey_type) |
155 | { | ||
156 | aliases=sk_new(alias_cmp); | ||
157 | if (aliases == NULL) goto err; | ||
158 | } | ||
159 | |||
160 | if ((i=sk_find(aliases,(char *)a)) >= 0) | ||
161 | { | 87 | { |
162 | Free(sk_delete(aliases,i)); | 88 | r=OBJ_NAME_add(OBJ_nid2sn(md->pkey_type), |
89 | OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS,name); | ||
90 | if (r == 0) return(0); | ||
91 | r=OBJ_NAME_add(OBJ_nid2ln(md->pkey_type), | ||
92 | OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS,name); | ||
163 | } | 93 | } |
164 | if (!sk_push(aliases,(char *)a)) goto err; | 94 | return(r); |
165 | return(1); | ||
166 | err: | ||
167 | return(0); | ||
168 | } | 95 | } |
169 | 96 | ||
170 | int EVP_delete_alias(name) | 97 | const EVP_CIPHER *EVP_get_cipherbyname(const char *name) |
171 | char *name; | ||
172 | { | 98 | { |
173 | ALIASES a; | 99 | const EVP_CIPHER *cp; |
174 | int i; | ||
175 | 100 | ||
176 | if (aliases != NULL) | 101 | cp=(const EVP_CIPHER *)OBJ_NAME_get(name,OBJ_NAME_TYPE_CIPHER_METH); |
177 | { | 102 | return(cp); |
178 | a.alias=name; | ||
179 | if ((i=sk_find(aliases,(char *)&a)) >= 0) | ||
180 | { | ||
181 | Free(sk_delete(aliases,i)); | ||
182 | return(1); | ||
183 | } | ||
184 | } | ||
185 | return(0); | ||
186 | } | 103 | } |
187 | 104 | ||
188 | EVP_CIPHER *EVP_get_cipherbyname(name) | 105 | const EVP_MD *EVP_get_digestbyname(const char *name) |
189 | char *name; | ||
190 | { | 106 | { |
191 | int nid,num=6,i; | 107 | const EVP_MD *cp; |
192 | EVP_CIPHER c,*cp; | ||
193 | ALIASES a,*ap; | ||
194 | |||
195 | if (ciphers == NULL) return(NULL); | ||
196 | for (;;) | ||
197 | { | ||
198 | if (num-- <= 0) return(NULL); | ||
199 | if (aliases != NULL) | ||
200 | { | ||
201 | a.alias=name; | ||
202 | i=sk_find(aliases,(char *)&a); | ||
203 | if (i >= 0) | ||
204 | { | ||
205 | ap=(ALIASES *)sk_value(aliases,i); | ||
206 | name=ap->name; | ||
207 | continue; | ||
208 | } | ||
209 | } | ||
210 | 108 | ||
211 | nid=OBJ_txt2nid(name); | 109 | cp=(const EVP_MD *)OBJ_NAME_get(name,OBJ_NAME_TYPE_MD_METH); |
212 | if (nid == NID_undef) return(NULL); | 110 | return(cp); |
213 | c.nid=nid; | ||
214 | i=sk_find(ciphers,(char *)&c); | ||
215 | if (i >= 0) | ||
216 | { | ||
217 | cp=(EVP_CIPHER *)sk_value(ciphers,i); | ||
218 | return(cp); | ||
219 | } | ||
220 | else | ||
221 | return(NULL); | ||
222 | } | ||
223 | } | 111 | } |
224 | 112 | ||
225 | EVP_MD *EVP_get_digestbyname(name) | 113 | void EVP_cleanup(void) |
226 | char *name; | ||
227 | { | 114 | { |
228 | int nid,num=6,i; | 115 | OBJ_NAME_cleanup(OBJ_NAME_TYPE_CIPHER_METH); |
229 | EVP_MD c,*cp; | 116 | OBJ_NAME_cleanup(OBJ_NAME_TYPE_MD_METH); |
230 | ALIASES a,*ap; | 117 | EVP_PBE_cleanup(); |
231 | |||
232 | if (digests == NULL) return(NULL); | ||
233 | |||
234 | for (;;) | ||
235 | { | ||
236 | if (num-- <= 0) return(NULL); | ||
237 | |||
238 | if (aliases != NULL) | ||
239 | { | ||
240 | a.alias=name; | ||
241 | i=sk_find(aliases,(char *)&a); | ||
242 | if (i >= 0) | ||
243 | { | ||
244 | ap=(ALIASES *)sk_value(aliases,i); | ||
245 | name=ap->name; | ||
246 | continue; | ||
247 | } | ||
248 | } | ||
249 | |||
250 | nid=OBJ_txt2nid(name); | ||
251 | if (nid == NID_undef) return(NULL); | ||
252 | c.pkey_type=nid; | ||
253 | i=sk_find(digests,(char *)&c); | ||
254 | if (i >= 0) | ||
255 | { | ||
256 | cp=(EVP_MD *)sk_value(digests,i); | ||
257 | return(cp); | ||
258 | } | ||
259 | else | ||
260 | return(NULL); | ||
261 | } | ||
262 | } | ||
263 | |||
264 | void EVP_cleanup() | ||
265 | { | ||
266 | int i; | ||
267 | |||
268 | if (aliases != NULL) | ||
269 | { | ||
270 | for (i=0; i<sk_num(aliases); i++) | ||
271 | Free(sk_value(aliases,i)); | ||
272 | sk_free(aliases); | ||
273 | aliases=NULL; | ||
274 | } | ||
275 | if (ciphers != NULL) | ||
276 | { | ||
277 | sk_free(ciphers); | ||
278 | ciphers=NULL; | ||
279 | } | ||
280 | if (digests != NULL) | ||
281 | { | ||
282 | sk_free(digests); | ||
283 | digests=NULL; | ||
284 | } | ||
285 | } | 118 | } |
diff --git a/src/lib/libcrypto/evp/p5_crpt.c b/src/lib/libcrypto/evp/p5_crpt.c new file mode 100644 index 0000000000..e3dae52d4d --- /dev/null +++ b/src/lib/libcrypto/evp/p5_crpt.c | |||
@@ -0,0 +1,146 @@ | |||
1 | /* p5_crpt.c */ | ||
2 | /* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL | ||
3 | * project 1999. | ||
4 | */ | ||
5 | /* ==================================================================== | ||
6 | * Copyright (c) 1999 The OpenSSL Project. All rights reserved. | ||
7 | * | ||
8 | * Redistribution and use in source and binary forms, with or without | ||
9 | * modification, are permitted provided that the following conditions | ||
10 | * are met: | ||
11 | * | ||
12 | * 1. Redistributions of source code must retain the above copyright | ||
13 | * notice, this list of conditions and the following disclaimer. | ||
14 | * | ||
15 | * 2. Redistributions in binary form must reproduce the above copyright | ||
16 | * notice, this list of conditions and the following disclaimer in | ||
17 | * the documentation and/or other materials provided with the | ||
18 | * distribution. | ||
19 | * | ||
20 | * 3. All advertising materials mentioning features or use of this | ||
21 | * software must display the following acknowledgment: | ||
22 | * "This product includes software developed by the OpenSSL Project | ||
23 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" | ||
24 | * | ||
25 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
26 | * endorse or promote products derived from this software without | ||
27 | * prior written permission. For written permission, please contact | ||
28 | * licensing@OpenSSL.org. | ||
29 | * | ||
30 | * 5. Products derived from this software may not be called "OpenSSL" | ||
31 | * nor may "OpenSSL" appear in their names without prior written | ||
32 | * permission of the OpenSSL Project. | ||
33 | * | ||
34 | * 6. Redistributions of any form whatsoever must retain the following | ||
35 | * acknowledgment: | ||
36 | * "This product includes software developed by the OpenSSL Project | ||
37 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" | ||
38 | * | ||
39 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
40 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
41 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
42 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
43 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
44 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
45 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
46 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
47 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
48 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
49 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
50 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
51 | * ==================================================================== | ||
52 | * | ||
53 | * This product includes cryptographic software written by Eric Young | ||
54 | * (eay@cryptsoft.com). This product includes software written by Tim | ||
55 | * Hudson (tjh@cryptsoft.com). | ||
56 | * | ||
57 | */ | ||
58 | |||
59 | #include <stdio.h> | ||
60 | #include <stdlib.h> | ||
61 | #include <openssl/x509.h> | ||
62 | #include <openssl/evp.h> | ||
63 | #include "cryptlib.h" | ||
64 | |||
65 | /* PKCS#5 v1.5 compatible PBE functions: see PKCS#5 v2.0 for more info. | ||
66 | */ | ||
67 | |||
68 | void PKCS5_PBE_add(void) | ||
69 | { | ||
70 | #ifndef NO_DES | ||
71 | # ifndef NO_MD5 | ||
72 | EVP_PBE_alg_add(NID_pbeWithMD5AndDES_CBC, EVP_des_cbc(), EVP_md5(), | ||
73 | PKCS5_PBE_keyivgen); | ||
74 | # endif | ||
75 | # ifndef NO_MD2 | ||
76 | EVP_PBE_alg_add(NID_pbeWithMD2AndDES_CBC, EVP_des_cbc(), EVP_md2(), | ||
77 | PKCS5_PBE_keyivgen); | ||
78 | # endif | ||
79 | # ifndef NO_SHA | ||
80 | EVP_PBE_alg_add(NID_pbeWithSHA1AndDES_CBC, EVP_des_cbc(), EVP_sha1(), | ||
81 | PKCS5_PBE_keyivgen); | ||
82 | # endif | ||
83 | #endif | ||
84 | #ifndef NO_RC2 | ||
85 | # ifndef NO_MD5 | ||
86 | EVP_PBE_alg_add(NID_pbeWithMD5AndRC2_CBC, EVP_rc2_64_cbc(), EVP_md5(), | ||
87 | PKCS5_PBE_keyivgen); | ||
88 | # endif | ||
89 | # ifndef NO_MD2 | ||
90 | EVP_PBE_alg_add(NID_pbeWithMD2AndRC2_CBC, EVP_rc2_64_cbc(), EVP_md2(), | ||
91 | PKCS5_PBE_keyivgen); | ||
92 | # endif | ||
93 | # ifndef NO_SHA | ||
94 | EVP_PBE_alg_add(NID_pbeWithSHA1AndRC2_CBC, EVP_rc2_64_cbc(), EVP_sha1(), | ||
95 | PKCS5_PBE_keyivgen); | ||
96 | # endif | ||
97 | #endif | ||
98 | #ifndef NO_HMAC | ||
99 | EVP_PBE_alg_add(NID_pbes2, NULL, NULL, PKCS5_v2_PBE_keyivgen); | ||
100 | #endif | ||
101 | } | ||
102 | |||
103 | int PKCS5_PBE_keyivgen(EVP_CIPHER_CTX *cctx, const char *pass, int passlen, | ||
104 | ASN1_TYPE *param, EVP_CIPHER *cipher, EVP_MD *md, | ||
105 | int en_de) | ||
106 | { | ||
107 | EVP_MD_CTX ctx; | ||
108 | unsigned char md_tmp[EVP_MAX_MD_SIZE]; | ||
109 | unsigned char key[EVP_MAX_KEY_LENGTH], iv[EVP_MAX_IV_LENGTH]; | ||
110 | int i; | ||
111 | PBEPARAM *pbe; | ||
112 | int saltlen, iter; | ||
113 | unsigned char *salt, *pbuf; | ||
114 | |||
115 | /* Extract useful info from parameter */ | ||
116 | pbuf = param->value.sequence->data; | ||
117 | if (!param || (param->type != V_ASN1_SEQUENCE) || | ||
118 | !(pbe = d2i_PBEPARAM (NULL, &pbuf, param->value.sequence->length))) { | ||
119 | EVPerr(EVP_F_PKCS5_PBE_KEYIVGEN,EVP_R_DECODE_ERROR); | ||
120 | return 0; | ||
121 | } | ||
122 | |||
123 | if (!pbe->iter) iter = 1; | ||
124 | else iter = ASN1_INTEGER_get (pbe->iter); | ||
125 | salt = pbe->salt->data; | ||
126 | saltlen = pbe->salt->length; | ||
127 | |||
128 | EVP_DigestInit (&ctx, md); | ||
129 | EVP_DigestUpdate (&ctx, pass, passlen); | ||
130 | EVP_DigestUpdate (&ctx, salt, saltlen); | ||
131 | PBEPARAM_free(pbe); | ||
132 | EVP_DigestFinal (&ctx, md_tmp, NULL); | ||
133 | for (i = 1; i < iter; i++) { | ||
134 | EVP_DigestInit(&ctx, md); | ||
135 | EVP_DigestUpdate(&ctx, md_tmp, EVP_MD_size(md)); | ||
136 | EVP_DigestFinal (&ctx, md_tmp, NULL); | ||
137 | } | ||
138 | memcpy (key, md_tmp, EVP_CIPHER_key_length(cipher)); | ||
139 | memcpy (iv, md_tmp + (16 - EVP_CIPHER_iv_length(cipher)), | ||
140 | EVP_CIPHER_iv_length(cipher)); | ||
141 | EVP_CipherInit(cctx, cipher, key, iv, en_de); | ||
142 | memset(md_tmp, 0, EVP_MAX_MD_SIZE); | ||
143 | memset(key, 0, EVP_MAX_KEY_LENGTH); | ||
144 | memset(iv, 0, EVP_MAX_IV_LENGTH); | ||
145 | return 1; | ||
146 | } | ||
diff --git a/src/lib/libcrypto/evp/p5_crpt2.c b/src/lib/libcrypto/evp/p5_crpt2.c new file mode 100644 index 0000000000..27a2c518be --- /dev/null +++ b/src/lib/libcrypto/evp/p5_crpt2.c | |||
@@ -0,0 +1,247 @@ | |||
1 | /* p5_crpt2.c */ | ||
2 | /* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL | ||
3 | * project 1999. | ||
4 | */ | ||
5 | /* ==================================================================== | ||
6 | * Copyright (c) 1999 The OpenSSL Project. All rights reserved. | ||
7 | * | ||
8 | * Redistribution and use in source and binary forms, with or without | ||
9 | * modification, are permitted provided that the following conditions | ||
10 | * are met: | ||
11 | * | ||
12 | * 1. Redistributions of source code must retain the above copyright | ||
13 | * notice, this list of conditions and the following disclaimer. | ||
14 | * | ||
15 | * 2. Redistributions in binary form must reproduce the above copyright | ||
16 | * notice, this list of conditions and the following disclaimer in | ||
17 | * the documentation and/or other materials provided with the | ||
18 | * distribution. | ||
19 | * | ||
20 | * 3. All advertising materials mentioning features or use of this | ||
21 | * software must display the following acknowledgment: | ||
22 | * "This product includes software developed by the OpenSSL Project | ||
23 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" | ||
24 | * | ||
25 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
26 | * endorse or promote products derived from this software without | ||
27 | * prior written permission. For written permission, please contact | ||
28 | * licensing@OpenSSL.org. | ||
29 | * | ||
30 | * 5. Products derived from this software may not be called "OpenSSL" | ||
31 | * nor may "OpenSSL" appear in their names without prior written | ||
32 | * permission of the OpenSSL Project. | ||
33 | * | ||
34 | * 6. Redistributions of any form whatsoever must retain the following | ||
35 | * acknowledgment: | ||
36 | * "This product includes software developed by the OpenSSL Project | ||
37 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" | ||
38 | * | ||
39 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
40 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
41 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
42 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
43 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
44 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
45 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
46 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
47 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
48 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
49 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
50 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
51 | * ==================================================================== | ||
52 | * | ||
53 | * This product includes cryptographic software written by Eric Young | ||
54 | * (eay@cryptsoft.com). This product includes software written by Tim | ||
55 | * Hudson (tjh@cryptsoft.com). | ||
56 | * | ||
57 | */ | ||
58 | #if !defined(NO_HMAC) && !defined(NO_SHA) | ||
59 | #include <stdio.h> | ||
60 | #include <stdlib.h> | ||
61 | #include <openssl/x509.h> | ||
62 | #include <openssl/evp.h> | ||
63 | #include <openssl/hmac.h> | ||
64 | #include "cryptlib.h" | ||
65 | |||
66 | /* set this to print out info about the keygen algorithm */ | ||
67 | /* #define DEBUG_PKCS5V2 */ | ||
68 | |||
69 | #ifdef DEBUG_PKCS5V2 | ||
70 | static void h__dump (const unsigned char *p, int len); | ||
71 | #endif | ||
72 | |||
73 | /* This is an implementation of PKCS#5 v2.0 password based encryption key | ||
74 | * derivation function PBKDF2 using the only currently defined function HMAC | ||
75 | * with SHA1. Verified against test vectors posted by Peter Gutmann | ||
76 | * <pgut001@cs.auckland.ac.nz> to the PKCS-TNG <pkcs-tng@rsa.com> mailing list. | ||
77 | */ | ||
78 | |||
79 | int PKCS5_PBKDF2_HMAC_SHA1(const char *pass, int passlen, | ||
80 | unsigned char *salt, int saltlen, int iter, | ||
81 | int keylen, unsigned char *out) | ||
82 | { | ||
83 | unsigned char digtmp[SHA_DIGEST_LENGTH], *p, itmp[4]; | ||
84 | int cplen, j, k, tkeylen; | ||
85 | unsigned long i = 1; | ||
86 | HMAC_CTX hctx; | ||
87 | p = out; | ||
88 | tkeylen = keylen; | ||
89 | if(passlen == -1) passlen = strlen(pass); | ||
90 | while(tkeylen) { | ||
91 | if(tkeylen > SHA_DIGEST_LENGTH) cplen = SHA_DIGEST_LENGTH; | ||
92 | else cplen = tkeylen; | ||
93 | /* We are unlikely to ever use more than 256 blocks (5120 bits!) | ||
94 | * but just in case... | ||
95 | */ | ||
96 | itmp[0] = (unsigned char)((i >> 24) & 0xff); | ||
97 | itmp[1] = (unsigned char)((i >> 16) & 0xff); | ||
98 | itmp[2] = (unsigned char)((i >> 8) & 0xff); | ||
99 | itmp[3] = (unsigned char)(i & 0xff); | ||
100 | HMAC_Init(&hctx, pass, passlen, EVP_sha1()); | ||
101 | HMAC_Update(&hctx, salt, saltlen); | ||
102 | HMAC_Update(&hctx, itmp, 4); | ||
103 | HMAC_Final(&hctx, digtmp, NULL); | ||
104 | memcpy(p, digtmp, cplen); | ||
105 | for(j = 1; j < iter; j++) { | ||
106 | HMAC(EVP_sha1(), pass, passlen, | ||
107 | digtmp, SHA_DIGEST_LENGTH, digtmp, NULL); | ||
108 | for(k = 0; k < cplen; k++) p[k] ^= digtmp[k]; | ||
109 | } | ||
110 | tkeylen-= cplen; | ||
111 | i++; | ||
112 | p+= cplen; | ||
113 | } | ||
114 | HMAC_cleanup(&hctx); | ||
115 | #ifdef DEBUG_PKCS5V2 | ||
116 | fprintf(stderr, "Password:\n"); | ||
117 | h__dump (pass, passlen); | ||
118 | fprintf(stderr, "Salt:\n"); | ||
119 | h__dump (salt, saltlen); | ||
120 | fprintf(stderr, "Iteration count %d\n", iter); | ||
121 | fprintf(stderr, "Key:\n"); | ||
122 | h__dump (out, keylen); | ||
123 | #endif | ||
124 | return 1; | ||
125 | } | ||
126 | |||
127 | #ifdef DO_TEST | ||
128 | main() | ||
129 | { | ||
130 | unsigned char out[4]; | ||
131 | unsigned char salt[] = {0x12, 0x34, 0x56, 0x78}; | ||
132 | PKCS5_PBKDF2_HMAC_SHA1("password", -1, salt, 4, 5, 4, out); | ||
133 | fprintf(stderr, "Out %02X %02X %02X %02X\n", | ||
134 | out[0], out[1], out[2], out[3]); | ||
135 | } | ||
136 | |||
137 | #endif | ||
138 | |||
139 | /* Now the key derivation function itself. This is a bit evil because | ||
140 | * it has to check the ASN1 parameters are valid: and there are quite a | ||
141 | * few of them... | ||
142 | */ | ||
143 | |||
144 | int PKCS5_v2_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, | ||
145 | ASN1_TYPE *param, EVP_CIPHER *c, EVP_MD *md, | ||
146 | int en_de) | ||
147 | { | ||
148 | unsigned char *pbuf, *salt, key[EVP_MAX_KEY_LENGTH]; | ||
149 | int saltlen, keylen, iter, plen; | ||
150 | PBE2PARAM *pbe2 = NULL; | ||
151 | const EVP_CIPHER *cipher; | ||
152 | PBKDF2PARAM *kdf = NULL; | ||
153 | |||
154 | pbuf = param->value.sequence->data; | ||
155 | plen = param->value.sequence->length; | ||
156 | if(!param || (param->type != V_ASN1_SEQUENCE) || | ||
157 | !(pbe2 = d2i_PBE2PARAM(NULL, &pbuf, plen))) { | ||
158 | EVPerr(EVP_F_PKCS5_V2_PBE_KEYIVGEN,EVP_R_DECODE_ERROR); | ||
159 | return 0; | ||
160 | } | ||
161 | |||
162 | /* See if we recognise the key derivation function */ | ||
163 | |||
164 | if(OBJ_obj2nid(pbe2->keyfunc->algorithm) != NID_id_pbkdf2) { | ||
165 | EVPerr(EVP_F_PKCS5_V2_PBE_KEYIVGEN, | ||
166 | EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION); | ||
167 | goto err; | ||
168 | } | ||
169 | |||
170 | /* lets see if we recognise the encryption algorithm. | ||
171 | */ | ||
172 | |||
173 | cipher = EVP_get_cipherbyname( | ||
174 | OBJ_nid2sn(OBJ_obj2nid(pbe2->encryption->algorithm))); | ||
175 | |||
176 | if(!cipher) { | ||
177 | EVPerr(EVP_F_PKCS5_V2_PBE_KEYIVGEN, | ||
178 | EVP_R_UNSUPPORTED_CIPHER); | ||
179 | goto err; | ||
180 | } | ||
181 | |||
182 | /* Fixup cipher based on AlgorithmIdentifier */ | ||
183 | EVP_CipherInit(ctx, cipher, NULL, NULL, en_de); | ||
184 | if(EVP_CIPHER_asn1_to_param(ctx, pbe2->encryption->parameter) < 0) { | ||
185 | EVPerr(EVP_F_PKCS5_V2_PBE_KEYIVGEN, | ||
186 | EVP_R_CIPHER_PARAMETER_ERROR); | ||
187 | goto err; | ||
188 | } | ||
189 | keylen = EVP_CIPHER_CTX_key_length(ctx); | ||
190 | |||
191 | /* Now decode key derivation function */ | ||
192 | |||
193 | pbuf = pbe2->keyfunc->parameter->value.sequence->data; | ||
194 | plen = pbe2->keyfunc->parameter->value.sequence->length; | ||
195 | if(!pbe2->keyfunc->parameter || | ||
196 | (pbe2->keyfunc->parameter->type != V_ASN1_SEQUENCE) || | ||
197 | !(kdf = d2i_PBKDF2PARAM(NULL, &pbuf, plen)) ) { | ||
198 | EVPerr(EVP_F_PKCS5_V2_PBE_KEYIVGEN,EVP_R_DECODE_ERROR); | ||
199 | goto err; | ||
200 | } | ||
201 | |||
202 | PBE2PARAM_free(pbe2); | ||
203 | pbe2 = NULL; | ||
204 | |||
205 | /* Now check the parameters of the kdf */ | ||
206 | |||
207 | if(kdf->keylength && (ASN1_INTEGER_get(kdf->keylength) != keylen)){ | ||
208 | EVPerr(EVP_F_PKCS5_V2_PBE_KEYIVGEN, | ||
209 | EVP_R_UNSUPPORTED_KEYLENGTH); | ||
210 | goto err; | ||
211 | } | ||
212 | |||
213 | if(kdf->prf && (OBJ_obj2nid(kdf->prf->algorithm) != NID_hmacWithSHA1)) { | ||
214 | EVPerr(EVP_F_PKCS5_V2_PBE_KEYIVGEN, EVP_R_UNSUPPORTED_PRF); | ||
215 | goto err; | ||
216 | } | ||
217 | |||
218 | if(kdf->salt->type != V_ASN1_OCTET_STRING) { | ||
219 | EVPerr(EVP_F_PKCS5_V2_PBE_KEYIVGEN, | ||
220 | EVP_R_UNSUPPORTED_SALT_TYPE); | ||
221 | goto err; | ||
222 | } | ||
223 | |||
224 | /* it seems that its all OK */ | ||
225 | salt = kdf->salt->value.octet_string->data; | ||
226 | saltlen = kdf->salt->value.octet_string->length; | ||
227 | iter = ASN1_INTEGER_get(kdf->iter); | ||
228 | PKCS5_PBKDF2_HMAC_SHA1(pass, passlen, salt, saltlen, iter, keylen, key); | ||
229 | EVP_CipherInit(ctx, NULL, key, NULL, en_de); | ||
230 | memset(key, 0, keylen); | ||
231 | PBKDF2PARAM_free(kdf); | ||
232 | return 1; | ||
233 | |||
234 | err: | ||
235 | PBE2PARAM_free(pbe2); | ||
236 | PBKDF2PARAM_free(kdf); | ||
237 | return 0; | ||
238 | } | ||
239 | |||
240 | #ifdef DEBUG_PKCS5V2 | ||
241 | static void h__dump (const unsigned char *p, int len) | ||
242 | { | ||
243 | for (; len --; p++) fprintf(stderr, "%02X ", *p); | ||
244 | fprintf(stderr, "\n"); | ||
245 | } | ||
246 | #endif | ||
247 | #endif | ||
diff --git a/src/lib/libcrypto/evp/p_dec.c b/src/lib/libcrypto/evp/p_dec.c index e845ce70c7..57b5daa453 100644 --- a/src/lib/libcrypto/evp/p_dec.c +++ b/src/lib/libcrypto/evp/p_dec.c | |||
@@ -58,27 +58,30 @@ | |||
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include "rand.h" | 61 | #include <openssl/rand.h> |
62 | #include "rsa.h" | 62 | #ifndef NO_RSA |
63 | #include "evp.h" | 63 | #include <openssl/rsa.h> |
64 | #include "objects.h" | 64 | #endif |
65 | #include "x509.h" | 65 | #include <openssl/evp.h> |
66 | #include <openssl/objects.h> | ||
67 | #include <openssl/x509.h> | ||
66 | 68 | ||
67 | int EVP_PKEY_decrypt(key,ek,ekl,priv) | 69 | int EVP_PKEY_decrypt(unsigned char *key, unsigned char *ek, int ekl, |
68 | unsigned char *key; | 70 | EVP_PKEY *priv) |
69 | unsigned char *ek; | ||
70 | int ekl; | ||
71 | EVP_PKEY *priv; | ||
72 | { | 71 | { |
73 | int ret= -1; | 72 | int ret= -1; |
74 | 73 | ||
74 | #ifndef NO_RSA | ||
75 | if (priv->type != EVP_PKEY_RSA) | 75 | if (priv->type != EVP_PKEY_RSA) |
76 | { | 76 | { |
77 | #endif | ||
77 | EVPerr(EVP_F_EVP_PKEY_DECRYPT,EVP_R_PUBLIC_KEY_NOT_RSA); | 78 | EVPerr(EVP_F_EVP_PKEY_DECRYPT,EVP_R_PUBLIC_KEY_NOT_RSA); |
79 | #ifndef NO_RSA | ||
78 | goto err; | 80 | goto err; |
79 | } | 81 | } |
80 | 82 | ||
81 | ret=RSA_private_decrypt(ekl,ek,key,priv->pkey.rsa,RSA_PKCS1_PADDING); | 83 | ret=RSA_private_decrypt(ekl,ek,key,priv->pkey.rsa,RSA_PKCS1_PADDING); |
82 | err: | 84 | err: |
85 | #endif | ||
83 | return(ret); | 86 | return(ret); |
84 | } | 87 | } |
diff --git a/src/lib/libcrypto/evp/p_enc.c b/src/lib/libcrypto/evp/p_enc.c index a26bfad02a..4cf6acaf5d 100644 --- a/src/lib/libcrypto/evp/p_enc.c +++ b/src/lib/libcrypto/evp/p_enc.c | |||
@@ -58,26 +58,29 @@ | |||
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include "rand.h" | 61 | #include <openssl/rand.h> |
62 | #include "rsa.h" | 62 | #ifndef NO_RSA |
63 | #include "evp.h" | 63 | #include <openssl/rsa.h> |
64 | #include "objects.h" | 64 | #endif |
65 | #include "x509.h" | 65 | #include <openssl/evp.h> |
66 | #include <openssl/objects.h> | ||
67 | #include <openssl/x509.h> | ||
66 | 68 | ||
67 | int EVP_PKEY_encrypt(ek,key,key_len,pubk) | 69 | int EVP_PKEY_encrypt(unsigned char *ek, unsigned char *key, int key_len, |
68 | unsigned char *ek; | 70 | EVP_PKEY *pubk) |
69 | unsigned char *key; | ||
70 | int key_len; | ||
71 | EVP_PKEY *pubk; | ||
72 | { | 71 | { |
73 | int ret=0; | 72 | int ret=0; |
74 | 73 | ||
74 | #ifndef NO_RSA | ||
75 | if (pubk->type != EVP_PKEY_RSA) | 75 | if (pubk->type != EVP_PKEY_RSA) |
76 | { | 76 | { |
77 | #endif | ||
77 | EVPerr(EVP_F_EVP_PKEY_ENCRYPT,EVP_R_PUBLIC_KEY_NOT_RSA); | 78 | EVPerr(EVP_F_EVP_PKEY_ENCRYPT,EVP_R_PUBLIC_KEY_NOT_RSA); |
79 | #ifndef NO_RSA | ||
78 | goto err; | 80 | goto err; |
79 | } | 81 | } |
80 | ret=RSA_public_encrypt(key_len,key,ek,pubk->pkey.rsa,RSA_PKCS1_PADDING); | 82 | ret=RSA_public_encrypt(key_len,key,ek,pubk->pkey.rsa,RSA_PKCS1_PADDING); |
81 | err: | 83 | err: |
84 | #endif | ||
82 | return(ret); | 85 | return(ret); |
83 | } | 86 | } |
diff --git a/src/lib/libcrypto/evp/p_lib.c b/src/lib/libcrypto/evp/p_lib.c index 395351b373..3422b77de6 100644 --- a/src/lib/libcrypto/evp/p_lib.c +++ b/src/lib/libcrypto/evp/p_lib.c | |||
@@ -58,22 +58,13 @@ | |||
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include "objects.h" | 61 | #include <openssl/objects.h> |
62 | #include "evp.h" | 62 | #include <openssl/evp.h> |
63 | #include "asn1_mac.h" | 63 | #include <openssl/asn1_mac.h> |
64 | #include "x509.h" | 64 | #include <openssl/x509.h> |
65 | 65 | ||
66 | /* EVPerr(EVP_F_D2I_PKEY,EVP_R_UNSUPPORTED_CIPHER); */ | ||
67 | /* EVPerr(EVP_F_D2I_PKEY,EVP_R_IV_TOO_LARGE); */ | ||
68 | |||
69 | #ifndef NOPROTO | ||
70 | static void EVP_PKEY_free_it(EVP_PKEY *x); | 66 | static void EVP_PKEY_free_it(EVP_PKEY *x); |
71 | #else | 67 | int EVP_PKEY_bits(EVP_PKEY *pkey) |
72 | static void EVP_PKEY_free_it(); | ||
73 | #endif | ||
74 | |||
75 | int EVP_PKEY_bits(pkey) | ||
76 | EVP_PKEY *pkey; | ||
77 | { | 68 | { |
78 | #ifndef NO_RSA | 69 | #ifndef NO_RSA |
79 | if (pkey->type == EVP_PKEY_RSA) | 70 | if (pkey->type == EVP_PKEY_RSA) |
@@ -87,9 +78,10 @@ EVP_PKEY *pkey; | |||
87 | return(0); | 78 | return(0); |
88 | } | 79 | } |
89 | 80 | ||
90 | int EVP_PKEY_size(pkey) | 81 | int EVP_PKEY_size(EVP_PKEY *pkey) |
91 | EVP_PKEY *pkey; | ||
92 | { | 82 | { |
83 | if (pkey == NULL) | ||
84 | return(0); | ||
93 | #ifndef NO_RSA | 85 | #ifndef NO_RSA |
94 | if (pkey->type == EVP_PKEY_RSA) | 86 | if (pkey->type == EVP_PKEY_RSA) |
95 | return(RSA_size(pkey->pkey.rsa)); | 87 | return(RSA_size(pkey->pkey.rsa)); |
@@ -102,9 +94,7 @@ EVP_PKEY *pkey; | |||
102 | return(0); | 94 | return(0); |
103 | } | 95 | } |
104 | 96 | ||
105 | int EVP_PKEY_save_parameters(pkey,mode) | 97 | int EVP_PKEY_save_parameters(EVP_PKEY *pkey, int mode) |
106 | EVP_PKEY *pkey; | ||
107 | int mode; | ||
108 | { | 98 | { |
109 | #ifndef NO_DSA | 99 | #ifndef NO_DSA |
110 | if (pkey->type == EVP_PKEY_DSA) | 100 | if (pkey->type == EVP_PKEY_DSA) |
@@ -119,8 +109,7 @@ int mode; | |||
119 | return(0); | 109 | return(0); |
120 | } | 110 | } |
121 | 111 | ||
122 | int EVP_PKEY_copy_parameters(to,from) | 112 | int EVP_PKEY_copy_parameters(EVP_PKEY *to, EVP_PKEY *from) |
123 | EVP_PKEY *to,*from; | ||
124 | { | 113 | { |
125 | if (to->type != from->type) | 114 | if (to->type != from->type) |
126 | { | 115 | { |
@@ -156,8 +145,7 @@ err: | |||
156 | return(0); | 145 | return(0); |
157 | } | 146 | } |
158 | 147 | ||
159 | int EVP_PKEY_missing_parameters(pkey) | 148 | int EVP_PKEY_missing_parameters(EVP_PKEY *pkey) |
160 | EVP_PKEY *pkey; | ||
161 | { | 149 | { |
162 | #ifndef NO_DSA | 150 | #ifndef NO_DSA |
163 | if (pkey->type == EVP_PKEY_DSA) | 151 | if (pkey->type == EVP_PKEY_DSA) |
@@ -172,8 +160,7 @@ EVP_PKEY *pkey; | |||
172 | return(0); | 160 | return(0); |
173 | } | 161 | } |
174 | 162 | ||
175 | int EVP_PKEY_cmp_parameters(a,b) | 163 | int EVP_PKEY_cmp_parameters(EVP_PKEY *a, EVP_PKEY *b) |
176 | EVP_PKEY *a,*b; | ||
177 | { | 164 | { |
178 | #ifndef NO_DSA | 165 | #ifndef NO_DSA |
179 | if ((a->type == EVP_PKEY_DSA) && (b->type == EVP_PKEY_DSA)) | 166 | if ((a->type == EVP_PKEY_DSA) && (b->type == EVP_PKEY_DSA)) |
@@ -189,7 +176,7 @@ EVP_PKEY *a,*b; | |||
189 | return(-1); | 176 | return(-1); |
190 | } | 177 | } |
191 | 178 | ||
192 | EVP_PKEY *EVP_PKEY_new() | 179 | EVP_PKEY *EVP_PKEY_new(void) |
193 | { | 180 | { |
194 | EVP_PKEY *ret; | 181 | EVP_PKEY *ret; |
195 | 182 | ||
@@ -207,10 +194,7 @@ EVP_PKEY *EVP_PKEY_new() | |||
207 | return(ret); | 194 | return(ret); |
208 | } | 195 | } |
209 | 196 | ||
210 | int EVP_PKEY_assign(pkey,type,key) | 197 | int EVP_PKEY_assign(EVP_PKEY *pkey, int type, char *key) |
211 | EVP_PKEY *pkey; | ||
212 | int type; | ||
213 | char *key; | ||
214 | { | 198 | { |
215 | if (pkey == NULL) return(0); | 199 | if (pkey == NULL) return(0); |
216 | if (pkey->pkey.ptr != NULL) | 200 | if (pkey->pkey.ptr != NULL) |
@@ -221,8 +205,7 @@ char *key; | |||
221 | return(1); | 205 | return(1); |
222 | } | 206 | } |
223 | 207 | ||
224 | int EVP_PKEY_type(type) | 208 | int EVP_PKEY_type(int type) |
225 | int type; | ||
226 | { | 209 | { |
227 | switch (type) | 210 | switch (type) |
228 | { | 211 | { |
@@ -242,8 +225,7 @@ int type; | |||
242 | } | 225 | } |
243 | } | 226 | } |
244 | 227 | ||
245 | void EVP_PKEY_free(x) | 228 | void EVP_PKEY_free(EVP_PKEY *x) |
246 | EVP_PKEY *x; | ||
247 | { | 229 | { |
248 | int i; | 230 | int i; |
249 | 231 | ||
@@ -265,8 +247,7 @@ EVP_PKEY *x; | |||
265 | Free((char *)x); | 247 | Free((char *)x); |
266 | } | 248 | } |
267 | 249 | ||
268 | static void EVP_PKEY_free_it(x) | 250 | static void EVP_PKEY_free_it(EVP_PKEY *x) |
269 | EVP_PKEY *x; | ||
270 | { | 251 | { |
271 | switch (x->type) | 252 | switch (x->type) |
272 | { | 253 | { |
diff --git a/src/lib/libcrypto/evp/p_open.c b/src/lib/libcrypto/evp/p_open.c index 28a8e02252..ddb9fd6942 100644 --- a/src/lib/libcrypto/evp/p_open.c +++ b/src/lib/libcrypto/evp/p_open.c | |||
@@ -56,19 +56,15 @@ | |||
56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
57 | */ | 57 | */ |
58 | 58 | ||
59 | #ifndef NO_RSA | ||
59 | #include <stdio.h> | 60 | #include <stdio.h> |
60 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
61 | #include "evp.h" | 62 | #include <openssl/evp.h> |
62 | #include "objects.h" | 63 | #include <openssl/objects.h> |
63 | #include "x509.h" | 64 | #include <openssl/x509.h> |
64 | 65 | ||
65 | int EVP_OpenInit(ctx,type,ek,ekl,iv,priv) | 66 | int EVP_OpenInit(EVP_CIPHER_CTX *ctx, EVP_CIPHER *type, unsigned char *ek, |
66 | EVP_CIPHER_CTX *ctx; | 67 | int ekl, unsigned char *iv, EVP_PKEY *priv) |
67 | EVP_CIPHER *type; | ||
68 | unsigned char *ek; | ||
69 | int ekl; | ||
70 | unsigned char *iv; | ||
71 | EVP_PKEY *priv; | ||
72 | { | 68 | { |
73 | unsigned char *key=NULL; | 69 | unsigned char *key=NULL; |
74 | int i,size=0,ret=0; | 70 | int i,size=0,ret=0; |
@@ -106,10 +102,7 @@ err: | |||
106 | return(ret); | 102 | return(ret); |
107 | } | 103 | } |
108 | 104 | ||
109 | int EVP_OpenFinal(ctx,out,outl) | 105 | int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) |
110 | EVP_CIPHER_CTX *ctx; | ||
111 | unsigned char *out; | ||
112 | int *outl; | ||
113 | { | 106 | { |
114 | int i; | 107 | int i; |
115 | 108 | ||
@@ -117,3 +110,4 @@ int *outl; | |||
117 | EVP_DecryptInit(ctx,NULL,NULL,NULL); | 110 | EVP_DecryptInit(ctx,NULL,NULL,NULL); |
118 | return(i); | 111 | return(i); |
119 | } | 112 | } |
113 | #endif | ||
diff --git a/src/lib/libcrypto/evp/p_seal.c b/src/lib/libcrypto/evp/p_seal.c index 09a408de35..09b46f4b0e 100644 --- a/src/lib/libcrypto/evp/p_seal.c +++ b/src/lib/libcrypto/evp/p_seal.c | |||
@@ -58,20 +58,16 @@ | |||
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include "rand.h" | 61 | #include <openssl/rand.h> |
62 | #include "rsa.h" | 62 | #ifndef NO_RSA |
63 | #include "evp.h" | 63 | #include <openssl/rsa.h> |
64 | #include "objects.h" | 64 | #endif |
65 | #include "x509.h" | 65 | #include <openssl/evp.h> |
66 | #include <openssl/objects.h> | ||
67 | #include <openssl/x509.h> | ||
66 | 68 | ||
67 | int EVP_SealInit(ctx,type,ek,ekl,iv,pubk,npubk) | 69 | int EVP_SealInit(EVP_CIPHER_CTX *ctx, EVP_CIPHER *type, unsigned char **ek, |
68 | EVP_CIPHER_CTX *ctx; | 70 | int *ekl, unsigned char *iv, EVP_PKEY **pubk, int npubk) |
69 | EVP_CIPHER *type; | ||
70 | unsigned char **ek; | ||
71 | int *ekl; | ||
72 | unsigned char *iv; | ||
73 | EVP_PKEY **pubk; | ||
74 | int npubk; | ||
75 | { | 71 | { |
76 | unsigned char key[EVP_MAX_KEY_LENGTH]; | 72 | unsigned char key[EVP_MAX_KEY_LENGTH]; |
77 | int i; | 73 | int i; |
@@ -105,10 +101,7 @@ int inl; | |||
105 | } | 101 | } |
106 | */ | 102 | */ |
107 | 103 | ||
108 | void EVP_SealFinal(ctx,out,outl) | 104 | void EVP_SealFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) |
109 | EVP_CIPHER_CTX *ctx; | ||
110 | unsigned char *out; | ||
111 | int *outl; | ||
112 | { | 105 | { |
113 | EVP_EncryptFinal(ctx,out,outl); | 106 | EVP_EncryptFinal(ctx,out,outl); |
114 | EVP_EncryptInit(ctx,NULL,NULL,NULL); | 107 | EVP_EncryptInit(ctx,NULL,NULL,NULL); |
diff --git a/src/lib/libcrypto/evp/p_sign.c b/src/lib/libcrypto/evp/p_sign.c index 073270ce31..1fa32ac17e 100644 --- a/src/lib/libcrypto/evp/p_sign.c +++ b/src/lib/libcrypto/evp/p_sign.c | |||
@@ -58,32 +58,25 @@ | |||
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include "evp.h" | 61 | #include <openssl/evp.h> |
62 | #include "objects.h" | 62 | #include <openssl/objects.h> |
63 | #include "x509.h" | 63 | #include <openssl/x509.h> |
64 | 64 | ||
65 | #ifdef undef | 65 | #ifdef undef |
66 | void EVP_SignInit(ctx,type) | 66 | void EVP_SignInit(EVP_MD_CTX *ctx, EVP_MD *type) |
67 | EVP_MD_CTX *ctx; | ||
68 | EVP_MD *type; | ||
69 | { | 67 | { |
70 | EVP_DigestInit(ctx,type); | 68 | EVP_DigestInit(ctx,type); |
71 | } | 69 | } |
72 | 70 | ||
73 | void EVP_SignUpdate(ctx,data,count) | 71 | void EVP_SignUpdate(EVP_MD_CTX *ctx, unsigned char *data, |
74 | EVP_MD_CTX *ctx; | 72 | unsigned int count) |
75 | unsigned char *data; | ||
76 | unsigned int count; | ||
77 | { | 73 | { |
78 | EVP_DigestUpdate(ctx,data,count); | 74 | EVP_DigestUpdate(ctx,data,count); |
79 | } | 75 | } |
80 | #endif | 76 | #endif |
81 | 77 | ||
82 | int EVP_SignFinal(ctx,sigret,siglen,pkey) | 78 | int EVP_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, unsigned int *siglen, |
83 | EVP_MD_CTX *ctx; | 79 | EVP_PKEY *pkey) |
84 | unsigned char *sigret; | ||
85 | unsigned int *siglen; | ||
86 | EVP_PKEY *pkey; | ||
87 | { | 80 | { |
88 | unsigned char m[EVP_MAX_MD_SIZE]; | 81 | unsigned char m[EVP_MAX_MD_SIZE]; |
89 | unsigned int m_len; | 82 | unsigned int m_len; |
@@ -91,7 +84,7 @@ EVP_PKEY *pkey; | |||
91 | MS_STATIC EVP_MD_CTX tmp_ctx; | 84 | MS_STATIC EVP_MD_CTX tmp_ctx; |
92 | 85 | ||
93 | *siglen=0; | 86 | *siglen=0; |
94 | memcpy(&tmp_ctx,ctx,sizeof(EVP_MD_CTX)); | 87 | EVP_MD_CTX_copy(&tmp_ctx,ctx); |
95 | EVP_DigestFinal(&tmp_ctx,&(m[0]),&m_len); | 88 | EVP_DigestFinal(&tmp_ctx,&(m[0]),&m_len); |
96 | for (i=0; i<4; i++) | 89 | for (i=0; i<4; i++) |
97 | { | 90 | { |
diff --git a/src/lib/libcrypto/evp/p_verify.c b/src/lib/libcrypto/evp/p_verify.c index 8d727d8f02..dcb54f3abb 100644 --- a/src/lib/libcrypto/evp/p_verify.c +++ b/src/lib/libcrypto/evp/p_verify.c | |||
@@ -58,15 +58,12 @@ | |||
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include "evp.h" | 61 | #include <openssl/evp.h> |
62 | #include "objects.h" | 62 | #include <openssl/objects.h> |
63 | #include "x509.h" | 63 | #include <openssl/x509.h> |
64 | 64 | ||
65 | int EVP_VerifyFinal(ctx,sigbuf,siglen,pkey) | 65 | int EVP_VerifyFinal(EVP_MD_CTX *ctx, unsigned char *sigbuf, |
66 | EVP_MD_CTX *ctx; | 66 | unsigned int siglen, EVP_PKEY *pkey) |
67 | unsigned char *sigbuf; | ||
68 | unsigned int siglen; | ||
69 | EVP_PKEY *pkey; | ||
70 | { | 67 | { |
71 | unsigned char m[EVP_MAX_MD_SIZE]; | 68 | unsigned char m[EVP_MAX_MD_SIZE]; |
72 | unsigned int m_len; | 69 | unsigned int m_len; |
@@ -88,7 +85,7 @@ EVP_PKEY *pkey; | |||
88 | EVPerr(EVP_F_EVP_VERIFYFINAL,EVP_R_WRONG_PUBLIC_KEY_TYPE); | 85 | EVPerr(EVP_F_EVP_VERIFYFINAL,EVP_R_WRONG_PUBLIC_KEY_TYPE); |
89 | return(-1); | 86 | return(-1); |
90 | } | 87 | } |
91 | memcpy(&tmp_ctx,ctx,sizeof(EVP_MD_CTX)); | 88 | EVP_MD_CTX_copy(&tmp_ctx,ctx); |
92 | EVP_DigestFinal(&tmp_ctx,&(m[0]),&m_len); | 89 | EVP_DigestFinal(&tmp_ctx,&(m[0]),&m_len); |
93 | if (ctx->digest->verify == NULL) | 90 | if (ctx->digest->verify == NULL) |
94 | { | 91 | { |
diff --git a/src/lib/libcrypto/evp/pk_lib.c b/src/lib/libcrypto/evp/pk_lib.c deleted file mode 100644 index 08f9fabbae..0000000000 --- a/src/lib/libcrypto/evp/pk_lib.c +++ /dev/null | |||
@@ -1,82 +0,0 @@ | |||
1 | /* crypto/evp/pk_lib.c */ | ||
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | ||
3 | * All rights reserved. | ||
4 | * | ||
5 | * This package is an SSL implementation written | ||
6 | * by Eric Young (eay@cryptsoft.com). | ||
7 | * The implementation was written so as to conform with Netscapes SSL. | ||
8 | * | ||
9 | * This library is free for commercial and non-commercial use as long as | ||
10 | * the following conditions are aheared to. The following conditions | ||
11 | * apply to all code found in this distribution, be it the RC4, RSA, | ||
12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation | ||
13 | * included with this distribution is covered by the same copyright terms | ||
14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). | ||
15 | * | ||
16 | * Copyright remains Eric Young's, and as such any Copyright notices in | ||
17 | * the code are not to be removed. | ||
18 | * If this package is used in a product, Eric Young should be given attribution | ||
19 | * as the author of the parts of the library used. | ||
20 | * This can be in the form of a textual message at program startup or | ||
21 | * in documentation (online or textual) provided with the package. | ||
22 | * | ||
23 | * Redistribution and use in source and binary forms, with or without | ||
24 | * modification, are permitted provided that the following conditions | ||
25 | * are met: | ||
26 | * 1. Redistributions of source code must retain the copyright | ||
27 | * notice, this list of conditions and the following disclaimer. | ||
28 | * 2. Redistributions in binary form must reproduce the above copyright | ||
29 | * notice, this list of conditions and the following disclaimer in the | ||
30 | * documentation and/or other materials provided with the distribution. | ||
31 | * 3. All advertising materials mentioning features or use of this software | ||
32 | * must display the following acknowledgement: | ||
33 | * "This product includes cryptographic software written by | ||
34 | * Eric Young (eay@cryptsoft.com)" | ||
35 | * The word 'cryptographic' can be left out if the rouines from the library | ||
36 | * being used are not cryptographic related :-). | ||
37 | * 4. If you include any Windows specific code (or a derivative thereof) from | ||
38 | * the apps directory (application code) you must include an acknowledgement: | ||
39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" | ||
40 | * | ||
41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND | ||
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | ||
45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
51 | * SUCH DAMAGE. | ||
52 | * | ||
53 | * The licence and distribution terms for any publically available version or | ||
54 | * derivative of this code cannot be changed. i.e. this code cannot simply be | ||
55 | * copied and put under another distribution licence | ||
56 | * [including the GNU Public Licence.] | ||
57 | */ | ||
58 | |||
59 | #include <stdio.h> | ||
60 | #include "cryptlib.h" | ||
61 | #include "evp.h" | ||
62 | #include "objects.h" | ||
63 | |||
64 | static LHASH *pk_md=NULL; | ||
65 | |||
66 | static LHASH *pk_md=NULL; | ||
67 | |||
68 | int EVP_add_pkey_md(oid,pkm,md) | ||
69 | int oid; | ||
70 | EVP_PKEY_METHOD *pkm; | ||
71 | EVP_MD *md; | ||
72 | { | ||
73 | } | ||
74 | |||
75 | EVP_add_pkey(pkm) | ||
76 | EVP_PKEY_METHOD *pkm; | ||
77 | { | ||
78 | } | ||
79 | |||
80 | EVP_PKEY_METHOD:q | ||
81 | |||
82 | |||