summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/evp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/evp')
-rw-r--r--src/lib/libcrypto/evp/Makefile.ssl1034
-rw-r--r--src/lib/libcrypto/evp/bio_b64.c39
-rw-r--r--src/lib/libcrypto/evp/bio_enc.c58
-rw-r--r--src/lib/libcrypto/evp/bio_md.c48
-rw-r--r--src/lib/libcrypto/evp/bio_ok.c552
-rw-r--r--src/lib/libcrypto/evp/c_all.c77
-rw-r--r--src/lib/libcrypto/evp/digest.c29
-rw-r--r--src/lib/libcrypto/evp/e_cbc_3d.c64
-rw-r--r--src/lib/libcrypto/evp/e_cbc_bf.c31
-rw-r--r--src/lib/libcrypto/evp/e_cbc_c.c28
-rw-r--r--src/lib/libcrypto/evp/e_cbc_d.c40
-rw-r--r--src/lib/libcrypto/evp/e_cbc_i.c28
-rw-r--r--src/lib/libcrypto/evp/e_cbc_r2.c122
-rw-r--r--src/lib/libcrypto/evp/e_cbc_r5.c26
-rw-r--r--src/lib/libcrypto/evp/e_cfb_3d.c69
-rw-r--r--src/lib/libcrypto/evp/e_cfb_bf.c29
-rw-r--r--src/lib/libcrypto/evp/e_cfb_c.c26
-rw-r--r--src/lib/libcrypto/evp/e_cfb_d.c34
-rw-r--r--src/lib/libcrypto/evp/e_cfb_i.c26
-rw-r--r--src/lib/libcrypto/evp/e_cfb_r2.c30
-rw-r--r--src/lib/libcrypto/evp/e_cfb_r5.c26
-rw-r--r--src/lib/libcrypto/evp/e_dsa.c6
-rw-r--r--src/lib/libcrypto/evp/e_ecb_3d.c67
-rw-r--r--src/lib/libcrypto/evp/e_ecb_bf.c29
-rw-r--r--src/lib/libcrypto/evp/e_ecb_c.c26
-rw-r--r--src/lib/libcrypto/evp/e_ecb_d.c48
-rw-r--r--src/lib/libcrypto/evp/e_ecb_i.c26
-rw-r--r--src/lib/libcrypto/evp/e_ecb_r2.c30
-rw-r--r--src/lib/libcrypto/evp/e_ecb_r5.c26
-rw-r--r--src/lib/libcrypto/evp/e_null.c26
-rw-r--r--src/lib/libcrypto/evp/e_ofb_3d.c65
-rw-r--r--src/lib/libcrypto/evp/e_ofb_bf.c29
-rw-r--r--src/lib/libcrypto/evp/e_ofb_c.c26
-rw-r--r--src/lib/libcrypto/evp/e_ofb_d.c41
-rw-r--r--src/lib/libcrypto/evp/e_ofb_i.c26
-rw-r--r--src/lib/libcrypto/evp/e_ofb_r2.c30
-rw-r--r--src/lib/libcrypto/evp/e_ofb_r5.c26
-rw-r--r--src/lib/libcrypto/evp/e_rc4.c28
-rw-r--r--src/lib/libcrypto/evp/e_xcbc_d.c42
-rw-r--r--src/lib/libcrypto/evp/encode.c57
-rw-r--r--src/lib/libcrypto/evp/evp.err24
-rw-r--r--src/lib/libcrypto/evp/evp.h347
-rw-r--r--src/lib/libcrypto/evp/evp_enc.c71
-rw-r--r--src/lib/libcrypto/evp/evp_err.c144
-rw-r--r--src/lib/libcrypto/evp/evp_key.c31
-rw-r--r--src/lib/libcrypto/evp/evp_lib.c51
-rw-r--r--src/lib/libcrypto/evp/evp_pbe.c134
-rw-r--r--src/lib/libcrypto/evp/evp_pkey.c298
-rw-r--r--src/lib/libcrypto/evp/m_dss.c11
-rw-r--r--src/lib/libcrypto/evp/m_dss1.c10
-rw-r--r--src/lib/libcrypto/evp/m_md2.c11
-rw-r--r--src/lib/libcrypto/evp/m_md5.c10
-rw-r--r--src/lib/libcrypto/evp/m_mdc2.c10
-rw-r--r--src/lib/libcrypto/evp/m_null.c10
-rw-r--r--src/lib/libcrypto/evp/m_ripemd.c11
-rw-r--r--src/lib/libcrypto/evp/m_sha.c11
-rw-r--r--src/lib/libcrypto/evp/m_sha1.c10
-rw-r--r--src/lib/libcrypto/evp/names.c239
-rw-r--r--src/lib/libcrypto/evp/p5_crpt.c146
-rw-r--r--src/lib/libcrypto/evp/p5_crpt2.c247
-rw-r--r--src/lib/libcrypto/evp/p_dec.c23
-rw-r--r--src/lib/libcrypto/evp/p_enc.c23
-rw-r--r--src/lib/libcrypto/evp/p_lib.c53
-rw-r--r--src/lib/libcrypto/evp/p_open.c22
-rw-r--r--src/lib/libcrypto/evp/p_seal.c27
-rw-r--r--src/lib/libcrypto/evp/p_sign.c25
-rw-r--r--src/lib/libcrypto/evp/p_verify.c15
-rw-r--r--src/lib/libcrypto/evp/pk_lib.c82
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= ../..
7CC= cc 7CC= cc
8INCLUDES= -I.. -I../../include 8INCLUDES= -I.. -I../../include
9CFLAG=-g 9CFLAG=-g
10INSTALL_PREFIX=
11OPENSSLDIR= /usr/local/ssl
10INSTALLTOP=/usr/local/ssl 12INSTALLTOP=/usr/local/ssl
11MAKE= make -f Makefile.ssl 13MAKE= make -f Makefile.ssl
12MAKEDEPEND= makedepend -f Makefile.ssl 14MAKEDEPEND= $(TOP)/util/domd $(TOP)
13MAKEFILE= Makefile.ssl 15MAKEFILE= Makefile.ssl
14AR= ar r 16AR= ar r
15 17
16CFLAGS= $(INCLUDES) $(CFLAG) 18CFLAGS= $(INCLUDES) $(CFLAG)
17 19
18ERR=evp
19ERRC=evp_err
20GENERAL=Makefile 20GENERAL=Makefile
21TEST= 21TEST=
22APPS= 22APPS=
@@ -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
40LIBOBJ= encode.o digest.o evp_enc.o evp_key.o \ 40LIBOBJ= 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
55SRC= $(LIBSRC) 55SRC= $(LIBSRC)
56 56
@@ -66,24 +66,23 @@ all: lib
66 66
67lib: $(LIBOBJ) 67lib: $(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
72files: 72files:
73 perl $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO 73 $(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
74 74
75links: 75links:
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
82install: 81install:
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
89tags: 88tags:
@@ -95,17 +94,1006 @@ lint:
95 lint -DLINT $(INCLUDES) $(SRC)>fluff 94 lint -DLINT $(INCLUDES) $(SRC)>fluff
96 95
97depend: 96depend:
98 $(MAKEDEPEND) $(INCLUDES) $(LIBSRC) 97 $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(LIBSRC)
99 98
100dclean: 99dclean:
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
104clean: 103clean:
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
107errors:
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
108bio_b64.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
109bio_b64.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
110bio_b64.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
111bio_b64.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
112bio_b64.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
113bio_b64.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
114bio_b64.o: ../../include/openssl/err.h ../../include/openssl/evp.h
115bio_b64.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
116bio_b64.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
117bio_b64.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
118bio_b64.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
119bio_b64.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
120bio_b64.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
121bio_b64.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
122bio_b64.o: ../../include/openssl/stack.h ../cryptlib.h
123bio_enc.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
124bio_enc.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
125bio_enc.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
126bio_enc.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
127bio_enc.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
128bio_enc.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
129bio_enc.o: ../../include/openssl/err.h ../../include/openssl/evp.h
130bio_enc.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
131bio_enc.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
132bio_enc.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
133bio_enc.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
134bio_enc.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
135bio_enc.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
136bio_enc.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
137bio_enc.o: ../../include/openssl/stack.h ../cryptlib.h
138bio_md.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
139bio_md.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
140bio_md.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
141bio_md.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
142bio_md.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
143bio_md.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
144bio_md.o: ../../include/openssl/err.h ../../include/openssl/evp.h
145bio_md.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
146bio_md.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
147bio_md.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
148bio_md.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
149bio_md.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
150bio_md.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
151bio_md.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
152bio_md.o: ../../include/openssl/stack.h ../cryptlib.h
153bio_ok.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
154bio_ok.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
155bio_ok.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
156bio_ok.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
157bio_ok.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
158bio_ok.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
159bio_ok.o: ../../include/openssl/err.h ../../include/openssl/evp.h
160bio_ok.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
161bio_ok.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
162bio_ok.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
163bio_ok.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
164bio_ok.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
165bio_ok.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
166bio_ok.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
167bio_ok.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
168bio_ok.o: ../cryptlib.h
169c_all.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
170c_all.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
171c_all.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
172c_all.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
173c_all.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
174c_all.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
175c_all.o: ../../include/openssl/err.h ../../include/openssl/evp.h
176c_all.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
177c_all.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
178c_all.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
179c_all.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs12.h
180c_all.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
181c_all.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
182c_all.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
183c_all.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
184c_all.o: ../../include/openssl/stack.h ../../include/openssl/x509.h
185c_all.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
186digest.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
187digest.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
188digest.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
189digest.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
190digest.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
191digest.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
192digest.o: ../../include/openssl/err.h ../../include/openssl/evp.h
193digest.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
194digest.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
195digest.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
196digest.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
197digest.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
198digest.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
199digest.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
200digest.o: ../../include/openssl/stack.h ../cryptlib.h
201e_cbc_3d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
202e_cbc_3d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
203e_cbc_3d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
204e_cbc_3d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
205e_cbc_3d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
206e_cbc_3d.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
207e_cbc_3d.o: ../../include/openssl/err.h ../../include/openssl/evp.h
208e_cbc_3d.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
209e_cbc_3d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
210e_cbc_3d.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
211e_cbc_3d.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
212e_cbc_3d.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
213e_cbc_3d.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
214e_cbc_3d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
215e_cbc_3d.o: ../../include/openssl/stack.h ../cryptlib.h
216e_cbc_bf.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
217e_cbc_bf.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
218e_cbc_bf.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
219e_cbc_bf.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
220e_cbc_bf.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
221e_cbc_bf.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
222e_cbc_bf.o: ../../include/openssl/err.h ../../include/openssl/evp.h
223e_cbc_bf.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
224e_cbc_bf.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
225e_cbc_bf.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
226e_cbc_bf.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
227e_cbc_bf.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
228e_cbc_bf.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
229e_cbc_bf.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
230e_cbc_bf.o: ../../include/openssl/stack.h ../cryptlib.h
231e_cbc_c.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
232e_cbc_c.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
233e_cbc_c.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
234e_cbc_c.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
235e_cbc_c.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
236e_cbc_c.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
237e_cbc_c.o: ../../include/openssl/err.h ../../include/openssl/evp.h
238e_cbc_c.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
239e_cbc_c.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
240e_cbc_c.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
241e_cbc_c.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
242e_cbc_c.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
243e_cbc_c.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
244e_cbc_c.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
245e_cbc_c.o: ../../include/openssl/stack.h ../cryptlib.h
246e_cbc_d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
247e_cbc_d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
248e_cbc_d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
249e_cbc_d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
250e_cbc_d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
251e_cbc_d.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
252e_cbc_d.o: ../../include/openssl/err.h ../../include/openssl/evp.h
253e_cbc_d.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
254e_cbc_d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
255e_cbc_d.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
256e_cbc_d.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
257e_cbc_d.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
258e_cbc_d.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
259e_cbc_d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
260e_cbc_d.o: ../../include/openssl/stack.h ../cryptlib.h
261e_cbc_i.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
262e_cbc_i.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
263e_cbc_i.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
264e_cbc_i.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
265e_cbc_i.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
266e_cbc_i.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
267e_cbc_i.o: ../../include/openssl/err.h ../../include/openssl/evp.h
268e_cbc_i.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
269e_cbc_i.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
270e_cbc_i.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
271e_cbc_i.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
272e_cbc_i.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
273e_cbc_i.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
274e_cbc_i.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
275e_cbc_i.o: ../../include/openssl/stack.h ../cryptlib.h
276e_cbc_r2.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
277e_cbc_r2.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
278e_cbc_r2.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
279e_cbc_r2.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
280e_cbc_r2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
281e_cbc_r2.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
282e_cbc_r2.o: ../../include/openssl/err.h ../../include/openssl/evp.h
283e_cbc_r2.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
284e_cbc_r2.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
285e_cbc_r2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
286e_cbc_r2.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
287e_cbc_r2.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
288e_cbc_r2.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
289e_cbc_r2.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
290e_cbc_r2.o: ../../include/openssl/stack.h ../cryptlib.h
291e_cbc_r5.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
292e_cbc_r5.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
293e_cbc_r5.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
294e_cbc_r5.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
295e_cbc_r5.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
296e_cbc_r5.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
297e_cbc_r5.o: ../../include/openssl/err.h ../../include/openssl/evp.h
298e_cbc_r5.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
299e_cbc_r5.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
300e_cbc_r5.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
301e_cbc_r5.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
302e_cbc_r5.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
303e_cbc_r5.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
304e_cbc_r5.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
305e_cbc_r5.o: ../../include/openssl/stack.h ../cryptlib.h
306e_cfb_3d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
307e_cfb_3d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
308e_cfb_3d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
309e_cfb_3d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
310e_cfb_3d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
311e_cfb_3d.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
312e_cfb_3d.o: ../../include/openssl/err.h ../../include/openssl/evp.h
313e_cfb_3d.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
314e_cfb_3d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
315e_cfb_3d.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
316e_cfb_3d.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
317e_cfb_3d.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
318e_cfb_3d.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
319e_cfb_3d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
320e_cfb_3d.o: ../../include/openssl/stack.h ../cryptlib.h
321e_cfb_bf.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
322e_cfb_bf.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
323e_cfb_bf.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
324e_cfb_bf.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
325e_cfb_bf.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
326e_cfb_bf.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
327e_cfb_bf.o: ../../include/openssl/err.h ../../include/openssl/evp.h
328e_cfb_bf.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
329e_cfb_bf.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
330e_cfb_bf.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
331e_cfb_bf.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
332e_cfb_bf.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
333e_cfb_bf.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
334e_cfb_bf.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
335e_cfb_bf.o: ../../include/openssl/stack.h ../cryptlib.h
336e_cfb_c.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
337e_cfb_c.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
338e_cfb_c.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
339e_cfb_c.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
340e_cfb_c.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
341e_cfb_c.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
342e_cfb_c.o: ../../include/openssl/err.h ../../include/openssl/evp.h
343e_cfb_c.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
344e_cfb_c.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
345e_cfb_c.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
346e_cfb_c.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
347e_cfb_c.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
348e_cfb_c.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
349e_cfb_c.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
350e_cfb_c.o: ../../include/openssl/stack.h ../cryptlib.h
351e_cfb_d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
352e_cfb_d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
353e_cfb_d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
354e_cfb_d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
355e_cfb_d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
356e_cfb_d.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
357e_cfb_d.o: ../../include/openssl/err.h ../../include/openssl/evp.h
358e_cfb_d.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
359e_cfb_d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
360e_cfb_d.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
361e_cfb_d.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
362e_cfb_d.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
363e_cfb_d.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
364e_cfb_d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
365e_cfb_d.o: ../../include/openssl/stack.h ../cryptlib.h
366e_cfb_i.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
367e_cfb_i.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
368e_cfb_i.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
369e_cfb_i.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
370e_cfb_i.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
371e_cfb_i.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
372e_cfb_i.o: ../../include/openssl/err.h ../../include/openssl/evp.h
373e_cfb_i.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
374e_cfb_i.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
375e_cfb_i.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
376e_cfb_i.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
377e_cfb_i.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
378e_cfb_i.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
379e_cfb_i.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
380e_cfb_i.o: ../../include/openssl/stack.h ../cryptlib.h
381e_cfb_r2.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
382e_cfb_r2.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
383e_cfb_r2.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
384e_cfb_r2.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
385e_cfb_r2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
386e_cfb_r2.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
387e_cfb_r2.o: ../../include/openssl/err.h ../../include/openssl/evp.h
388e_cfb_r2.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
389e_cfb_r2.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
390e_cfb_r2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
391e_cfb_r2.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
392e_cfb_r2.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
393e_cfb_r2.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
394e_cfb_r2.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
395e_cfb_r2.o: ../../include/openssl/stack.h ../cryptlib.h
396e_cfb_r5.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
397e_cfb_r5.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
398e_cfb_r5.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
399e_cfb_r5.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
400e_cfb_r5.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
401e_cfb_r5.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
402e_cfb_r5.o: ../../include/openssl/err.h ../../include/openssl/evp.h
403e_cfb_r5.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
404e_cfb_r5.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
405e_cfb_r5.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
406e_cfb_r5.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
407e_cfb_r5.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
408e_cfb_r5.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
409e_cfb_r5.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
410e_cfb_r5.o: ../../include/openssl/stack.h ../cryptlib.h
411e_ecb_3d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
412e_ecb_3d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
413e_ecb_3d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
414e_ecb_3d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
415e_ecb_3d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
416e_ecb_3d.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
417e_ecb_3d.o: ../../include/openssl/err.h ../../include/openssl/evp.h
418e_ecb_3d.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
419e_ecb_3d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
420e_ecb_3d.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
421e_ecb_3d.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
422e_ecb_3d.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
423e_ecb_3d.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
424e_ecb_3d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
425e_ecb_3d.o: ../../include/openssl/stack.h ../cryptlib.h
426e_ecb_bf.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
427e_ecb_bf.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
428e_ecb_bf.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
429e_ecb_bf.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
430e_ecb_bf.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
431e_ecb_bf.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
432e_ecb_bf.o: ../../include/openssl/err.h ../../include/openssl/evp.h
433e_ecb_bf.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
434e_ecb_bf.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
435e_ecb_bf.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
436e_ecb_bf.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
437e_ecb_bf.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
438e_ecb_bf.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
439e_ecb_bf.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
440e_ecb_bf.o: ../../include/openssl/stack.h ../cryptlib.h
441e_ecb_c.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
442e_ecb_c.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
443e_ecb_c.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
444e_ecb_c.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
445e_ecb_c.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
446e_ecb_c.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
447e_ecb_c.o: ../../include/openssl/err.h ../../include/openssl/evp.h
448e_ecb_c.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
449e_ecb_c.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
450e_ecb_c.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
451e_ecb_c.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
452e_ecb_c.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
453e_ecb_c.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
454e_ecb_c.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
455e_ecb_c.o: ../../include/openssl/stack.h ../cryptlib.h
456e_ecb_d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
457e_ecb_d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
458e_ecb_d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
459e_ecb_d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
460e_ecb_d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
461e_ecb_d.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
462e_ecb_d.o: ../../include/openssl/err.h ../../include/openssl/evp.h
463e_ecb_d.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
464e_ecb_d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
465e_ecb_d.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
466e_ecb_d.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
467e_ecb_d.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
468e_ecb_d.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
469e_ecb_d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
470e_ecb_d.o: ../../include/openssl/stack.h ../cryptlib.h
471e_ecb_i.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
472e_ecb_i.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
473e_ecb_i.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
474e_ecb_i.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
475e_ecb_i.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
476e_ecb_i.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
477e_ecb_i.o: ../../include/openssl/err.h ../../include/openssl/evp.h
478e_ecb_i.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
479e_ecb_i.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
480e_ecb_i.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
481e_ecb_i.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
482e_ecb_i.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
483e_ecb_i.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
484e_ecb_i.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
485e_ecb_i.o: ../../include/openssl/stack.h ../cryptlib.h
486e_ecb_r2.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
487e_ecb_r2.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
488e_ecb_r2.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
489e_ecb_r2.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
490e_ecb_r2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
491e_ecb_r2.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
492e_ecb_r2.o: ../../include/openssl/err.h ../../include/openssl/evp.h
493e_ecb_r2.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
494e_ecb_r2.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
495e_ecb_r2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
496e_ecb_r2.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
497e_ecb_r2.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
498e_ecb_r2.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
499e_ecb_r2.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
500e_ecb_r2.o: ../../include/openssl/stack.h ../cryptlib.h
501e_ecb_r5.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
502e_ecb_r5.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
503e_ecb_r5.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
504e_ecb_r5.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
505e_ecb_r5.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
506e_ecb_r5.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
507e_ecb_r5.o: ../../include/openssl/err.h ../../include/openssl/evp.h
508e_ecb_r5.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
509e_ecb_r5.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
510e_ecb_r5.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
511e_ecb_r5.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
512e_ecb_r5.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
513e_ecb_r5.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
514e_ecb_r5.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
515e_ecb_r5.o: ../../include/openssl/stack.h ../cryptlib.h
516e_null.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
517e_null.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
518e_null.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
519e_null.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
520e_null.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
521e_null.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
522e_null.o: ../../include/openssl/err.h ../../include/openssl/evp.h
523e_null.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
524e_null.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
525e_null.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
526e_null.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
527e_null.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
528e_null.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
529e_null.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
530e_null.o: ../../include/openssl/stack.h ../cryptlib.h
531e_ofb_3d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
532e_ofb_3d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
533e_ofb_3d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
534e_ofb_3d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
535e_ofb_3d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
536e_ofb_3d.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
537e_ofb_3d.o: ../../include/openssl/err.h ../../include/openssl/evp.h
538e_ofb_3d.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
539e_ofb_3d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
540e_ofb_3d.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
541e_ofb_3d.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
542e_ofb_3d.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
543e_ofb_3d.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
544e_ofb_3d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
545e_ofb_3d.o: ../../include/openssl/stack.h ../cryptlib.h
546e_ofb_bf.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
547e_ofb_bf.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
548e_ofb_bf.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
549e_ofb_bf.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
550e_ofb_bf.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
551e_ofb_bf.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
552e_ofb_bf.o: ../../include/openssl/err.h ../../include/openssl/evp.h
553e_ofb_bf.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
554e_ofb_bf.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
555e_ofb_bf.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
556e_ofb_bf.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
557e_ofb_bf.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
558e_ofb_bf.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
559e_ofb_bf.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
560e_ofb_bf.o: ../../include/openssl/stack.h ../cryptlib.h
561e_ofb_c.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
562e_ofb_c.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
563e_ofb_c.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
564e_ofb_c.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
565e_ofb_c.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
566e_ofb_c.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
567e_ofb_c.o: ../../include/openssl/err.h ../../include/openssl/evp.h
568e_ofb_c.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
569e_ofb_c.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
570e_ofb_c.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
571e_ofb_c.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
572e_ofb_c.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
573e_ofb_c.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
574e_ofb_c.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
575e_ofb_c.o: ../../include/openssl/stack.h ../cryptlib.h
576e_ofb_d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
577e_ofb_d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
578e_ofb_d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
579e_ofb_d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
580e_ofb_d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
581e_ofb_d.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
582e_ofb_d.o: ../../include/openssl/err.h ../../include/openssl/evp.h
583e_ofb_d.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
584e_ofb_d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
585e_ofb_d.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
586e_ofb_d.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
587e_ofb_d.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
588e_ofb_d.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
589e_ofb_d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
590e_ofb_d.o: ../../include/openssl/stack.h ../cryptlib.h
591e_ofb_i.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
592e_ofb_i.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
593e_ofb_i.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
594e_ofb_i.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
595e_ofb_i.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
596e_ofb_i.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
597e_ofb_i.o: ../../include/openssl/err.h ../../include/openssl/evp.h
598e_ofb_i.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
599e_ofb_i.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
600e_ofb_i.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
601e_ofb_i.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
602e_ofb_i.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
603e_ofb_i.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
604e_ofb_i.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
605e_ofb_i.o: ../../include/openssl/stack.h ../cryptlib.h
606e_ofb_r2.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
607e_ofb_r2.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
608e_ofb_r2.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
609e_ofb_r2.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
610e_ofb_r2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
611e_ofb_r2.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
612e_ofb_r2.o: ../../include/openssl/err.h ../../include/openssl/evp.h
613e_ofb_r2.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
614e_ofb_r2.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
615e_ofb_r2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
616e_ofb_r2.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
617e_ofb_r2.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
618e_ofb_r2.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
619e_ofb_r2.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
620e_ofb_r2.o: ../../include/openssl/stack.h ../cryptlib.h
621e_ofb_r5.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
622e_ofb_r5.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
623e_ofb_r5.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
624e_ofb_r5.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
625e_ofb_r5.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
626e_ofb_r5.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
627e_ofb_r5.o: ../../include/openssl/err.h ../../include/openssl/evp.h
628e_ofb_r5.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
629e_ofb_r5.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
630e_ofb_r5.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
631e_ofb_r5.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
632e_ofb_r5.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
633e_ofb_r5.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
634e_ofb_r5.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
635e_ofb_r5.o: ../../include/openssl/stack.h ../cryptlib.h
636e_rc4.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
637e_rc4.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
638e_rc4.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
639e_rc4.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
640e_rc4.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
641e_rc4.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
642e_rc4.o: ../../include/openssl/err.h ../../include/openssl/evp.h
643e_rc4.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
644e_rc4.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
645e_rc4.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
646e_rc4.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
647e_rc4.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
648e_rc4.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
649e_rc4.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
650e_rc4.o: ../../include/openssl/stack.h ../cryptlib.h
651e_xcbc_d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
652e_xcbc_d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
653e_xcbc_d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
654e_xcbc_d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
655e_xcbc_d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
656e_xcbc_d.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
657e_xcbc_d.o: ../../include/openssl/err.h ../../include/openssl/evp.h
658e_xcbc_d.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
659e_xcbc_d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
660e_xcbc_d.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
661e_xcbc_d.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
662e_xcbc_d.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
663e_xcbc_d.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
664e_xcbc_d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
665e_xcbc_d.o: ../../include/openssl/stack.h ../cryptlib.h
666encode.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
667encode.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
668encode.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
669encode.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
670encode.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
671encode.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
672encode.o: ../../include/openssl/err.h ../../include/openssl/evp.h
673encode.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
674encode.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
675encode.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
676encode.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
677encode.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
678encode.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
679encode.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
680encode.o: ../../include/openssl/stack.h ../cryptlib.h
681evp_enc.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
682evp_enc.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
683evp_enc.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
684evp_enc.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
685evp_enc.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
686evp_enc.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
687evp_enc.o: ../../include/openssl/err.h ../../include/openssl/evp.h
688evp_enc.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
689evp_enc.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
690evp_enc.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
691evp_enc.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
692evp_enc.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
693evp_enc.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
694evp_enc.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
695evp_enc.o: ../../include/openssl/stack.h ../cryptlib.h
696evp_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
697evp_err.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
698evp_err.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
699evp_err.o: ../../include/openssl/des.h ../../include/openssl/dh.h
700evp_err.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
701evp_err.o: ../../include/openssl/err.h ../../include/openssl/evp.h
702evp_err.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
703evp_err.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
704evp_err.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
705evp_err.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
706evp_err.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
707evp_err.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
708evp_err.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
709evp_err.o: ../../include/openssl/stack.h
710evp_key.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
711evp_key.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
712evp_key.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
713evp_key.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
714evp_key.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
715evp_key.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
716evp_key.o: ../../include/openssl/err.h ../../include/openssl/evp.h
717evp_key.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
718evp_key.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
719evp_key.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
720evp_key.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
721evp_key.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
722evp_key.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
723evp_key.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
724evp_key.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
725evp_key.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
726evp_key.o: ../cryptlib.h
727evp_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
728evp_lib.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
729evp_lib.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
730evp_lib.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
731evp_lib.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
732evp_lib.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
733evp_lib.o: ../../include/openssl/err.h ../../include/openssl/evp.h
734evp_lib.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
735evp_lib.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
736evp_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
737evp_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
738evp_lib.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
739evp_lib.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
740evp_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
741evp_lib.o: ../../include/openssl/stack.h ../cryptlib.h
742evp_pbe.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
743evp_pbe.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
744evp_pbe.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
745evp_pbe.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
746evp_pbe.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
747evp_pbe.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
748evp_pbe.o: ../../include/openssl/err.h ../../include/openssl/evp.h
749evp_pbe.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
750evp_pbe.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
751evp_pbe.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
752evp_pbe.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
753evp_pbe.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
754evp_pbe.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
755evp_pbe.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
756evp_pbe.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
757evp_pbe.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
758evp_pbe.o: ../cryptlib.h
759evp_pkey.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
760evp_pkey.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
761evp_pkey.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
762evp_pkey.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
763evp_pkey.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
764evp_pkey.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
765evp_pkey.o: ../../include/openssl/err.h ../../include/openssl/evp.h
766evp_pkey.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
767evp_pkey.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
768evp_pkey.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
769evp_pkey.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
770evp_pkey.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h
771evp_pkey.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
772evp_pkey.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
773evp_pkey.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
774evp_pkey.o: ../../include/openssl/stack.h ../../include/openssl/x509.h
775evp_pkey.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
776m_dss.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
777m_dss.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
778m_dss.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
779m_dss.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
780m_dss.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
781m_dss.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
782m_dss.o: ../../include/openssl/err.h ../../include/openssl/evp.h
783m_dss.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
784m_dss.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
785m_dss.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
786m_dss.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
787m_dss.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
788m_dss.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
789m_dss.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
790m_dss.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
791m_dss.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
792m_dss.o: ../cryptlib.h
793m_dss1.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
794m_dss1.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
795m_dss1.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
796m_dss1.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
797m_dss1.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
798m_dss1.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
799m_dss1.o: ../../include/openssl/err.h ../../include/openssl/evp.h
800m_dss1.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
801m_dss1.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
802m_dss1.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
803m_dss1.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
804m_dss1.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
805m_dss1.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
806m_dss1.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
807m_dss1.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
808m_dss1.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
809m_dss1.o: ../cryptlib.h
810m_md2.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
811m_md2.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
812m_md2.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
813m_md2.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
814m_md2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
815m_md2.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
816m_md2.o: ../../include/openssl/err.h ../../include/openssl/evp.h
817m_md2.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
818m_md2.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
819m_md2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
820m_md2.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
821m_md2.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
822m_md2.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
823m_md2.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
824m_md2.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
825m_md2.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
826m_md2.o: ../cryptlib.h
827m_md5.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
828m_md5.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
829m_md5.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
830m_md5.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
831m_md5.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
832m_md5.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
833m_md5.o: ../../include/openssl/err.h ../../include/openssl/evp.h
834m_md5.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
835m_md5.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
836m_md5.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
837m_md5.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
838m_md5.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
839m_md5.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
840m_md5.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
841m_md5.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
842m_md5.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
843m_md5.o: ../cryptlib.h
844m_mdc2.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
845m_mdc2.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
846m_mdc2.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
847m_mdc2.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
848m_mdc2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
849m_mdc2.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
850m_mdc2.o: ../../include/openssl/err.h ../../include/openssl/evp.h
851m_mdc2.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
852m_mdc2.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
853m_mdc2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
854m_mdc2.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
855m_mdc2.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
856m_mdc2.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
857m_mdc2.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
858m_mdc2.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
859m_mdc2.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
860m_mdc2.o: ../cryptlib.h
861m_null.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
862m_null.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
863m_null.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
864m_null.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
865m_null.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
866m_null.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
867m_null.o: ../../include/openssl/err.h ../../include/openssl/evp.h
868m_null.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
869m_null.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
870m_null.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
871m_null.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
872m_null.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
873m_null.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
874m_null.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
875m_null.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
876m_null.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
877m_null.o: ../cryptlib.h
878m_ripemd.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
879m_ripemd.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
880m_ripemd.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
881m_ripemd.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
882m_ripemd.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
883m_ripemd.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
884m_ripemd.o: ../../include/openssl/err.h ../../include/openssl/evp.h
885m_ripemd.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
886m_ripemd.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
887m_ripemd.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
888m_ripemd.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
889m_ripemd.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
890m_ripemd.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
891m_ripemd.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
892m_ripemd.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
893m_ripemd.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
894m_ripemd.o: ../cryptlib.h
895m_sha.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
896m_sha.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
897m_sha.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
898m_sha.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
899m_sha.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
900m_sha.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
901m_sha.o: ../../include/openssl/err.h ../../include/openssl/evp.h
902m_sha.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
903m_sha.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
904m_sha.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
905m_sha.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
906m_sha.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
907m_sha.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
908m_sha.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
909m_sha.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
910m_sha.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
911m_sha.o: ../cryptlib.h
912m_sha1.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
913m_sha1.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
914m_sha1.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
915m_sha1.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
916m_sha1.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
917m_sha1.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
918m_sha1.o: ../../include/openssl/err.h ../../include/openssl/evp.h
919m_sha1.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
920m_sha1.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
921m_sha1.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
922m_sha1.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
923m_sha1.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
924m_sha1.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
925m_sha1.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
926m_sha1.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
927m_sha1.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
928m_sha1.o: ../cryptlib.h
929names.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
930names.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
931names.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
932names.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
933names.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
934names.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
935names.o: ../../include/openssl/err.h ../../include/openssl/evp.h
936names.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
937names.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
938names.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
939names.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
940names.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
941names.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
942names.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
943names.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
944names.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
945names.o: ../cryptlib.h
946p5_crpt.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
947p5_crpt.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
948p5_crpt.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
949p5_crpt.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
950p5_crpt.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
951p5_crpt.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
952p5_crpt.o: ../../include/openssl/err.h ../../include/openssl/evp.h
953p5_crpt.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
954p5_crpt.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
955p5_crpt.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
956p5_crpt.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
957p5_crpt.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
958p5_crpt.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
959p5_crpt.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
960p5_crpt.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
961p5_crpt.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
962p5_crpt.o: ../cryptlib.h
963p5_crpt2.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
964p5_crpt2.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
965p5_crpt2.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
966p5_crpt2.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
967p5_crpt2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
968p5_crpt2.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
969p5_crpt2.o: ../../include/openssl/err.h ../../include/openssl/evp.h
970p5_crpt2.o: ../../include/openssl/hmac.h ../../include/openssl/idea.h
971p5_crpt2.o: ../../include/openssl/md2.h ../../include/openssl/md5.h
972p5_crpt2.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h
973p5_crpt2.o: ../../include/openssl/opensslconf.h
974p5_crpt2.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
975p5_crpt2.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
976p5_crpt2.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
977p5_crpt2.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
978p5_crpt2.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
979p5_crpt2.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
980p5_crpt2.o: ../cryptlib.h
981p_dec.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
982p_dec.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
983p_dec.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
984p_dec.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
985p_dec.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
986p_dec.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
987p_dec.o: ../../include/openssl/err.h ../../include/openssl/evp.h
988p_dec.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
989p_dec.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
990p_dec.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
991p_dec.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
992p_dec.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h
993p_dec.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
994p_dec.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
995p_dec.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
996p_dec.o: ../../include/openssl/stack.h ../../include/openssl/x509.h
997p_dec.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
998p_enc.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
999p_enc.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
1000p_enc.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
1001p_enc.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
1002p_enc.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
1003p_enc.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
1004p_enc.o: ../../include/openssl/err.h ../../include/openssl/evp.h
1005p_enc.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
1006p_enc.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
1007p_enc.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
1008p_enc.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
1009p_enc.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h
1010p_enc.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
1011p_enc.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
1012p_enc.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
1013p_enc.o: ../../include/openssl/stack.h ../../include/openssl/x509.h
1014p_enc.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
1015p_lib.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
1016p_lib.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
1017p_lib.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
1018p_lib.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
1019p_lib.o: ../../include/openssl/des.h ../../include/openssl/dh.h
1020p_lib.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
1021p_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
1022p_lib.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
1023p_lib.o: ../../include/openssl/md2.h ../../include/openssl/md5.h
1024p_lib.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h
1025p_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
1026p_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
1027p_lib.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
1028p_lib.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
1029p_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
1030p_lib.o: ../../include/openssl/stack.h ../../include/openssl/x509.h
1031p_lib.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
1032p_open.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
1033p_open.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
1034p_open.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
1035p_open.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
1036p_open.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
1037p_open.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
1038p_open.o: ../../include/openssl/err.h ../../include/openssl/evp.h
1039p_open.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
1040p_open.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
1041p_open.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
1042p_open.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
1043p_open.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
1044p_open.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
1045p_open.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
1046p_open.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
1047p_open.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
1048p_open.o: ../cryptlib.h
1049p_seal.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
1050p_seal.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
1051p_seal.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
1052p_seal.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
1053p_seal.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
1054p_seal.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
1055p_seal.o: ../../include/openssl/err.h ../../include/openssl/evp.h
1056p_seal.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
1057p_seal.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
1058p_seal.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
1059p_seal.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
1060p_seal.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h
1061p_seal.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
1062p_seal.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
1063p_seal.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
1064p_seal.o: ../../include/openssl/stack.h ../../include/openssl/x509.h
1065p_seal.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
1066p_sign.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
1067p_sign.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
1068p_sign.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
1069p_sign.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
1070p_sign.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
1071p_sign.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
1072p_sign.o: ../../include/openssl/err.h ../../include/openssl/evp.h
1073p_sign.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
1074p_sign.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
1075p_sign.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
1076p_sign.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
1077p_sign.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
1078p_sign.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
1079p_sign.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
1080p_sign.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
1081p_sign.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
1082p_sign.o: ../cryptlib.h
1083p_verify.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
1084p_verify.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
1085p_verify.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
1086p_verify.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
1087p_verify.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
1088p_verify.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
1089p_verify.o: ../../include/openssl/err.h ../../include/openssl/evp.h
1090p_verify.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
1091p_verify.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
1092p_verify.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
1093p_verify.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
1094p_verify.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
1095p_verify.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
1096p_verify.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
1097p_verify.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
1098p_verify.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
1099p_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
66static int b64_write(BIO *h,char *buf,int num); 65static int b64_write(BIO *h,char *buf,int num);
67static int b64_read(BIO *h,char *buf,int size); 66static 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);
70static long b64_ctrl(BIO *h,int cmd,long arg1,char *arg2); 69static long b64_ctrl(BIO *h,int cmd,long arg1,char *arg2);
71static int b64_new(BIO *h); 70static int b64_new(BIO *h);
72static int b64_free(BIO *data); 71static int b64_free(BIO *data);
73#else
74static int b64_write();
75static int b64_read();
76/*static int b64_puts(); */
77/*static int b64_gets(); */
78static long b64_ctrl();
79static int b64_new();
80static 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
116BIO_METHOD *BIO_f_base64() 105BIO_METHOD *BIO_f_base64(void)
117 { 106 {
118 return(&methods_b64); 107 return(&methods_b64);
119 } 108 }
120 109
121static int b64_new(bi) 110static int b64_new(BIO *bi)
122BIO *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
143static int b64_free(a) 131static int b64_free(BIO *a)
144BIO *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
154static int b64_read(b,out,outl) 141static int b64_read(BIO *b, char *out, int outl)
155BIO *b;
156char *out;
157int 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
357static int b64_write(b,in,inl) 341static int b64_write(BIO *b, char *in, int inl)
358BIO *b;
359char *in;
360int 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
454static long b64_ctrl(b,cmd,num,ptr) 435static long b64_ctrl(BIO *b, int cmd, long num, char *ptr)
455BIO *b;
456int cmd;
457long num;
458char *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
66static int enc_write(BIO *h,char *buf,int num); 65static int enc_write(BIO *h,char *buf,int num);
67static int enc_read(BIO *h,char *buf,int size); 66static 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);
70static long enc_ctrl(BIO *h,int cmd,long arg1,char *arg2); 69static long enc_ctrl(BIO *h,int cmd,long arg1,char *arg2);
71static int enc_new(BIO *h); 70static int enc_new(BIO *h);
72static int enc_free(BIO *data); 71static int enc_free(BIO *data);
73#else
74static int enc_write();
75static int enc_read();
76/*static int enc_puts(); */
77/*static int enc_gets(); */
78static long enc_ctrl();
79static int enc_new();
80static int enc_free();
81#endif
82
83#define ENC_BLOCK_SIZE (1024*4) 72#define ENC_BLOCK_SIZE (1024*4)
84 73
85typedef struct enc_struct 74typedef struct enc_struct
@@ -105,13 +94,12 @@ static BIO_METHOD methods_enc=
105 enc_free, 94 enc_free,
106 }; 95 };
107 96
108BIO_METHOD *BIO_f_cipher() 97BIO_METHOD *BIO_f_cipher(void)
109 { 98 {
110 return(&methods_enc); 99 return(&methods_enc);
111 } 100 }
112 101
113static int enc_new(bi) 102static int enc_new(BIO *bi)
114BIO *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
134static int enc_free(a) 122static int enc_free(BIO *a)
135BIO *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
150static int enc_read(b,out,outl) 137static int enc_read(BIO *b, char *out, int outl)
151BIO *b;
152char *out;
153int 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
233static int enc_write(b,in,inl) 217static int enc_write(BIO *b, char *in, int inl)
234BIO *b;
235char *in;
236int 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
291static long enc_ctrl(b,cmd,num,ptr) 272static long enc_ctrl(BIO *b, int cmd, long num, char *ptr)
292BIO *b;
293int cmd;
294long num;
295char *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
401void BIO_set_cipher(b,c,k,i,e) 383void BIO_set_cipher(BIO *b, const EVP_CIPHER *c, unsigned char *k,
402BIO *b; 384 unsigned char *i, int e)
403EVP_CIPHER *c;
404unsigned char *k;
405unsigned char *i;
406int 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
69static int md_write(BIO *h,char *buf,int num); 68static int md_write(BIO *h,char *buf,int num);
70static int md_read(BIO *h,char *buf,int size); 69static 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);
73static long md_ctrl(BIO *h,int cmd,long arg1,char *arg2); 72static long md_ctrl(BIO *h,int cmd,long arg1,char *arg2);
74static int md_new(BIO *h); 73static int md_new(BIO *h);
75static int md_free(BIO *data); 74static int md_free(BIO *data);
76#else
77static int md_write();
78static int md_read();
79/*static int md_puts(); */
80static int md_gets();
81static long md_ctrl();
82static int md_new();
83static int md_free();
84#endif
85
86static BIO_METHOD methods_md= 75static 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
98BIO_METHOD *BIO_f_md() 87BIO_METHOD *BIO_f_md(void)
99 { 88 {
100 return(&methods_md); 89 return(&methods_md);
101 } 90 }
102 91
103static int md_new(bi) 92static int md_new(BIO *bi)
104BIO *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
117static int md_free(a) 105static int md_free(BIO *a)
118BIO *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
128static int md_read(b,out,outl) 115static int md_read(BIO *b, char *out, int outl)
129BIO *b;
130char *out;
131int 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
155static int md_write(b,in,inl) 139static int md_write(BIO *b, char *in, int inl)
156BIO *b;
157char *in;
158int 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
181static long md_ctrl(b,cmd,num,ptr) 162static long md_ctrl(BIO *b, int cmd, long num, char *ptr)
182BIO *b;
183int cmd;
184long num;
185char *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
246static int md_gets(bp,buf,size) 223static int md_gets(BIO *bp, char *buf, int size)
247BIO *bp;
248char *buf;
249int 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
128static int ok_write(BIO *h,char *buf,int num);
129static int ok_read(BIO *h,char *buf,int size);
130static long ok_ctrl(BIO *h,int cmd,long arg1,char *arg2);
131static int ok_new(BIO *h);
132static int ok_free(BIO *data);
133static void sig_out(BIO* b);
134static void sig_in(BIO* b);
135static void block_out(BIO* b);
136static 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
152typedef 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
166static 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
178BIO_METHOD *BIO_f_reliable(void)
179 {
180 return(&methods_ok);
181 }
182
183static 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
205static 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
216static 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
287static 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
345static 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
431static 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
443static 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
466static 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
503static 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
522static 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
64void SSLeay_add_all_algorithms() 65void 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
70void SSLeay_add_all_ciphers() 71void 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
156void SSLeay_add_all_digests() 156void 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
64void EVP_DigestInit(ctx,type) 64void EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type)
65EVP_MD_CTX *ctx;
66EVP_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
72void EVP_DigestUpdate(ctx,data,count) 70void EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *data,
73EVP_MD_CTX *ctx; 71 unsigned int count)
74unsigned char *data;
75unsigned 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
80void EVP_DigestFinal(ctx,md,size) 76void EVP_DigestFinal(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *size)
81EVP_MD_CTX *ctx;
82unsigned char *md;
83unsigned 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
84int 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
65static void des_cbc_ede_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, 65static 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);
67static void des_cbc_ede3_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, 67static 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);
69static void des_cbc_ede_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 69static 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
72static void des_cbc_ede_init_key();
73static void des_cbc_ede3_init_key();
74static void des_cbc_ede_cipher();
75#endif
76
77static EVP_CIPHER d_cbc_ede_cipher2= 71static 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
90static EVP_CIPHER d_cbc_ede_cipher3= 84static 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
103EVP_CIPHER *EVP_des_ede_cbc() 97EVP_CIPHER *EVP_des_ede_cbc(void)
104 { 98 {
105 return(&d_cbc_ede_cipher2); 99 return(&d_cbc_ede_cipher2);
106 } 100 }
107 101
108EVP_CIPHER *EVP_des_ede3_cbc() 102EVP_CIPHER *EVP_des_ede3_cbc(void)
109 { 103 {
110 return(&d_cbc_ede_cipher3); 104 return(&d_cbc_ede_cipher3);
111 } 105 }
112 106
113static void des_cbc_ede_init_key(ctx,key,iv,enc) 107static void des_cbc_ede_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
114EVP_CIPHER_CTX *ctx; 108 unsigned char *iv, int enc)
115unsigned char *key;
116unsigned char *iv;
117int 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
133static void des_cbc_ede3_init_key(ctx,key,iv,enc) 126static void des_cbc_ede3_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
134EVP_CIPHER_CTX *ctx; 127 unsigned char *iv, int enc)
135unsigned char *key;
136unsigned char *iv;
137int 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
151static void des_cbc_ede_cipher(ctx,out,in,inl) 143static void des_cbc_ede_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
152EVP_CIPHER_CTX *ctx; 144 unsigned char *in, unsigned int inl)
153unsigned char *out;
154unsigned char *in;
155unsigned 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
67static void bf_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, 65static void bf_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
68 unsigned char *iv,int enc); 66 unsigned char *iv,int enc);
69static void bf_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 67static 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
72static void bf_cbc_init_key();
73static void bf_cbc_cipher();
74#endif
75
76static EVP_CIPHER bfish_cbc_cipher= 69static 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
89EVP_CIPHER *EVP_bf_cbc() 82EVP_CIPHER *EVP_bf_cbc(void)
90 { 83 {
91 return(&bfish_cbc_cipher); 84 return(&bfish_cbc_cipher);
92 } 85 }
93 86
94static void bf_cbc_init_key(ctx,key,iv,enc) 87static void bf_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
95EVP_CIPHER_CTX *ctx; 88 unsigned char *iv, int enc)
96unsigned char *key;
97unsigned char *iv;
98int 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
107static void bf_cbc_cipher(ctx,out,in,inl) 97static void bf_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
108EVP_CIPHER_CTX *ctx; 98 unsigned char *in, unsigned int inl)
109unsigned char *out;
110unsigned char *in;
111unsigned 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
67static void cast_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, 66static void cast_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
68 unsigned char *iv,int enc); 67 unsigned char *iv,int enc);
69static void cast_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 68static 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
72static void cast_cbc_init_key();
73static void cast_cbc_cipher();
74#endif
75
76static EVP_CIPHER cast5_cbc_cipher= 70static 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
89EVP_CIPHER *EVP_cast5_cbc() 83EVP_CIPHER *EVP_cast5_cbc(void)
90 { 84 {
91 return(&cast5_cbc_cipher); 85 return(&cast5_cbc_cipher);
92 } 86 }
93 87
94static void cast_cbc_init_key(ctx,key,iv,enc) 88static void cast_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
95EVP_CIPHER_CTX *ctx; 89 unsigned char *iv, int enc)
96unsigned char *key;
97unsigned char *iv;
98int 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
107static void cast_cbc_cipher(ctx,out,in,inl) 98static void cast_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
108EVP_CIPHER_CTX *ctx; 99 unsigned char *in, unsigned int inl)
109unsigned char *out;
110unsigned char *in;
111unsigned 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
65static void des_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, 65static void des_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
66 unsigned char *iv,int enc); 66 unsigned char *iv,int enc);
67static void des_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 67static 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
70static void des_cbc_init_key();
71static void des_cbc_cipher();
72#endif
73
74static EVP_CIPHER d_cbc_cipher= 69static 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
87EVP_CIPHER *EVP_des_cbc() 82EVP_CIPHER *EVP_des_cbc(void)
88 { 83 {
89 return(&d_cbc_cipher); 84 return(&d_cbc_cipher);
90 } 85 }
91 86
92static void des_cbc_init_key(ctx,key,iv,enc) 87static void des_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
93EVP_CIPHER_CTX *ctx; 88 unsigned char *iv, int enc)
94unsigned char *key;
95unsigned char *iv;
96int 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
105static void des_cbc_cipher(ctx,out,in,inl) 99static void des_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
106EVP_CIPHER_CTX *ctx; 100 unsigned char *in, unsigned int inl)
107unsigned char *out;
108unsigned char *in;
109unsigned 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
67static void idea_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, 66static void idea_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
68 unsigned char *iv,int enc); 67 unsigned char *iv,int enc);
69static void idea_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 68static 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
72static void idea_cbc_init_key();
73static void idea_cbc_cipher();
74#endif
75
76static EVP_CIPHER i_cbc_cipher= 70static 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
89EVP_CIPHER *EVP_idea_cbc() 83EVP_CIPHER *EVP_idea_cbc(void)
90 { 84 {
91 return(&i_cbc_cipher); 85 return(&i_cbc_cipher);
92 } 86 }
93 87
94static void idea_cbc_init_key(ctx,key,iv,enc) 88static void idea_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
95EVP_CIPHER_CTX *ctx; 89 unsigned char *iv, int enc)
96unsigned char *key;
97unsigned char *iv;
98int 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
119static void idea_cbc_cipher(ctx,out,in,inl) 110static void idea_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
120EVP_CIPHER_CTX *ctx; 111 unsigned char *in, unsigned int inl)
121unsigned char *out;
122unsigned char *in;
123unsigned 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
67static void rc2_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, 66static void rc2_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
68 unsigned char *iv,int enc); 67 unsigned char *iv,int enc);
69static void rc2_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 68static 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 70static int rc2_meth_to_magic(const EVP_CIPHER *e);
72static void rc2_cbc_init_key(); 71static EVP_CIPHER *rc2_magic_to_meth(int i);
73static void rc2_cbc_cipher(); 72static int rc2_set_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type);
74#endif 73static 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
76static EVP_CIPHER r2_cbc_cipher= 79static 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
92static 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
89static EVP_CIPHER r2_40_cbc_cipher= 105static 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
100EVP_CIPHER *EVP_rc2_cbc() 118EVP_CIPHER *EVP_rc2_cbc(void)
101 { 119 {
102 return(&r2_cbc_cipher); 120 return(&r2_cbc_cipher);
103 } 121 }
104 122
105EVP_CIPHER *EVP_rc2_40_cbc() 123EVP_CIPHER *EVP_rc2_64_cbc(void)
124 {
125 return(&r2_64_cbc_cipher);
126 }
127
128EVP_CIPHER *EVP_rc2_40_cbc(void)
106 { 129 {
107 return(&r2_40_cbc_cipher); 130 return(&r2_40_cbc_cipher);
108 } 131 }
109 132
110static void rc2_cbc_init_key(ctx,key,iv,enc) 133static void rc2_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
111EVP_CIPHER_CTX *ctx; 134 unsigned char *iv, int enc)
112unsigned char *key;
113unsigned char *iv;
114int 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
124static void rc2_cbc_cipher(ctx,out,in,inl) 144static void rc2_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
125EVP_CIPHER_CTX *ctx; 145 unsigned char *in, unsigned int inl)
126unsigned char *out;
127unsigned char *in;
128unsigned 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
153static 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
164static 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
176static 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
202static 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
67static void r_32_12_16_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, 66static 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);
69static void r_32_12_16_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 68static 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
72static void r_32_12_16_cbc_init_key();
73static void r_32_12_16_cbc_cipher();
74#endif
75
76static EVP_CIPHER rc5_32_12_16_cbc_cipher= 70static 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
89EVP_CIPHER *EVP_rc5_32_12_16_cbc() 83EVP_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
94static void r_32_12_16_cbc_init_key(ctx,key,iv,enc) 88static void r_32_12_16_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
95EVP_CIPHER_CTX *ctx; 89 unsigned char *iv, int enc)
96unsigned char *key;
97unsigned char *iv;
98int 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
108static void r_32_12_16_cbc_cipher(ctx,out,in,inl) 99static void r_32_12_16_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
109EVP_CIPHER_CTX *ctx; 100 unsigned char *in, unsigned int inl)
110unsigned char *out;
111unsigned char *in;
112unsigned 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
65static void des_ede_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, 65static 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);
67static void des_ede3_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, 67static 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);
69static void des_ede_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 69static 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
72static void des_ede_cfb_init_key();
73static void des_ede3_cfb_init_key();
74static void des_ede_cfb_cipher();
75#endif
76
77static EVP_CIPHER d_ede_cfb_cipher2= 71static 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
103EVP_CIPHER *EVP_des_ede_cfb() 97EVP_CIPHER *EVP_des_ede_cfb(void)
104 { 98 {
105 return(&d_ede_cfb_cipher2); 99 return(&d_ede_cfb_cipher2);
106 } 100 }
107 101
108EVP_CIPHER *EVP_des_ede3_cfb() 102EVP_CIPHER *EVP_des_ede3_cfb(void)
109 { 103 {
110 return(&d_ede3_cfb_cipher3); 104 return(&d_ede3_cfb_cipher3);
111 } 105 }
112 106
113static void des_ede_cfb_init_key(ctx,key,iv,enc) 107static void des_ede_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
114EVP_CIPHER_CTX *ctx; 108 unsigned char *iv, int enc)
115unsigned char *key;
116unsigned char *iv;
117int 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
134static void des_ede3_cfb_init_key(ctx,key,iv,enc) 127static void des_ede3_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
135EVP_CIPHER_CTX *ctx; 128 unsigned char *iv, int enc)
136unsigned char *key;
137unsigned char *iv;
138int 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
153static void des_ede_cfb_cipher(ctx,out,in,inl) 145static void des_ede_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
154EVP_CIPHER_CTX *ctx; 146 unsigned char *in, unsigned int inl)
155unsigned char *out;
156unsigned char *in;
157unsigned 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
67static void bf_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, 65static void bf_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
68 unsigned char *iv,int enc); 66 unsigned char *iv,int enc);
69static void bf_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 67static 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
72static void bf_cfb_init_key();
73static void bf_cfb_cipher();
74#endif
75
76static EVP_CIPHER bfish_cfb_cipher= 69static 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
89EVP_CIPHER *EVP_bf_cfb() 82EVP_CIPHER *EVP_bf_cfb(void)
90 { 83 {
91 return(&bfish_cfb_cipher); 84 return(&bfish_cfb_cipher);
92 } 85 }
93 86
94static void bf_cfb_init_key(ctx,key,iv,enc) 87static void bf_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
95EVP_CIPHER_CTX *ctx; 88 unsigned char *iv, int enc)
96unsigned char *key;
97unsigned char *iv;
98int 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
109static void bf_cfb_cipher(ctx,out,in,inl) 99static void bf_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
110EVP_CIPHER_CTX *ctx; 100 unsigned char *in, unsigned int inl)
111unsigned char *out;
112unsigned char *in;
113unsigned 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
67static void cast_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, 66static void cast_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
68 unsigned char *iv,int enc); 67 unsigned char *iv,int enc);
69static void cast_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 68static 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
72static void cast_cfb_init_key();
73static void cast_cfb_cipher();
74#endif
75
76static EVP_CIPHER cast5_cfb_cipher= 70static 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
89EVP_CIPHER *EVP_cast5_cfb() 83EVP_CIPHER *EVP_cast5_cfb(void)
90 { 84 {
91 return(&cast5_cfb_cipher); 85 return(&cast5_cfb_cipher);
92 } 86 }
93 87
94static void cast_cfb_init_key(ctx,key,iv,enc) 88static void cast_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
95EVP_CIPHER_CTX *ctx; 89 unsigned char *iv, int enc)
96unsigned char *key;
97unsigned char *iv;
98int 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
109static void cast_cfb_cipher(ctx,out,in,inl) 100static void cast_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
110EVP_CIPHER_CTX *ctx; 101 unsigned char *in, unsigned int inl)
111unsigned char *out;
112unsigned char *in;
113unsigned 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
65static void des_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, 65static void des_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
66 unsigned char *iv,int enc); 66 unsigned char *iv,int enc);
67static void des_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 67static 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
70static void des_cfb_init_key();
71static void des_cfb_cipher();
72#endif
73
74static EVP_CIPHER d_cfb_cipher= 69static 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
87EVP_CIPHER *EVP_des_cfb() 82EVP_CIPHER *EVP_des_cfb(void)
88 { 83 {
89 return(&d_cfb_cipher); 84 return(&d_cfb_cipher);
90 } 85 }
91 86
92static void des_cfb_init_key(ctx,key,iv,enc) 87static void des_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
93EVP_CIPHER_CTX *ctx; 88 unsigned char *iv, int enc)
94unsigned char *key;
95unsigned char *iv;
96int 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
107static void des_cfb_cipher(ctx,out,in,inl) 101static void des_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
108EVP_CIPHER_CTX *ctx; 102 unsigned char *in, unsigned int inl)
109unsigned char *out;
110unsigned char *in;
111unsigned 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
67static void idea_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, 66static void idea_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
68 unsigned char *iv,int enc); 67 unsigned char *iv,int enc);
69static void idea_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 68static 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
72static void idea_cfb_init_key();
73static void idea_cfb_cipher();
74#endif
75
76static EVP_CIPHER i_cfb_cipher= 70static 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
89EVP_CIPHER *EVP_idea_cfb() 83EVP_CIPHER *EVP_idea_cfb(void)
90 { 84 {
91 return(&i_cfb_cipher); 85 return(&i_cfb_cipher);
92 } 86 }
93 87
94static void idea_cfb_init_key(ctx,key,iv,enc) 88static void idea_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
95EVP_CIPHER_CTX *ctx; 89 unsigned char *iv, int enc)
96unsigned char *key;
97unsigned char *iv;
98int 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
109static void idea_cfb_cipher(ctx,out,in,inl) 100static void idea_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
110EVP_CIPHER_CTX *ctx; 101 unsigned char *in, unsigned int inl)
111unsigned char *out;
112unsigned char *in;
113unsigned 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
67static void rc2_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, 66static void rc2_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
68 unsigned char *iv,int enc); 67 unsigned char *iv,int enc);
69static void rc2_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 68static 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
72static void rc2_cfb_init_key();
73static void rc2_cfb_cipher();
74#endif
75
76static EVP_CIPHER r2_cfb_cipher= 70static 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
89EVP_CIPHER *EVP_rc2_cfb() 83EVP_CIPHER *EVP_rc2_cfb(void)
90 { 84 {
91 return(&r2_cfb_cipher); 85 return(&r2_cfb_cipher);
92 } 86 }
93 87
94static void rc2_cfb_init_key(ctx,key,iv,enc) 88static void rc2_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
95EVP_CIPHER_CTX *ctx; 89 unsigned char *iv, int enc)
96unsigned char *key;
97unsigned char *iv;
98int 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
110static void rc2_cfb_cipher(ctx,out,in,inl) 101static void rc2_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
111EVP_CIPHER_CTX *ctx; 102 unsigned char *in, unsigned int inl)
112unsigned char *out;
113unsigned char *in;
114unsigned 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
67static void rc5_32_12_16_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, 66static 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);
69static void rc5_32_12_16_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 68static 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
72static void rc5_32_12_16_cfb_init_key();
73static void rc5_32_12_16_cfb_cipher();
74#endif
75
76static EVP_CIPHER rc5_cfb_cipher= 70static 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
89EVP_CIPHER *EVP_rc5_32_12_16_cfb() 83EVP_CIPHER *EVP_rc5_32_12_16_cfb(void)
90 { 84 {
91 return(&rc5_cfb_cipher); 85 return(&rc5_cfb_cipher);
92 } 86 }
93 87
94static void rc5_32_12_16_cfb_init_key(ctx,key,iv,enc) 88static void rc5_32_12_16_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
95EVP_CIPHER_CTX *ctx; 89 unsigned char *iv, int enc)
96unsigned char *key;
97unsigned char *iv;
98int 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
110static void rc5_32_12_16_cfb_cipher(ctx,out,in,inl) 101static void rc5_32_12_16_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
111EVP_CIPHER_CTX *ctx; 102 unsigned char *in, unsigned int inl)
112unsigned char *out;
113unsigned char *in;
114unsigned 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
65static EVP_PKEY_METHOD dss_method= 65static 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
65static void des_ede_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, 65static void des_ede_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
66 unsigned char *iv,int enc); 66 unsigned char *iv,int enc);
67static void des_ede3_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, 67static void des_ede3_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
68 unsigned char *iv,int enc); 68 unsigned char *iv,int enc);
69static void des_ede_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 69static 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
72static void des_ede_init_key();
73static void des_ede3_init_key();
74static void des_ede_cipher();
75#endif
76
77static EVP_CIPHER d_ede_cipher2= 71static 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
102EVP_CIPHER *EVP_des_ede() 96EVP_CIPHER *EVP_des_ede(void)
103 { 97 {
104 return(&d_ede_cipher2); 98 return(&d_ede_cipher2);
105 } 99 }
106 100
107EVP_CIPHER *EVP_des_ede3() 101EVP_CIPHER *EVP_des_ede3(void)
108 { 102 {
109 return(&d_ede3_cipher3); 103 return(&d_ede3_cipher3);
110 } 104 }
111 105
112static void des_ede_init_key(ctx,key,iv,enc) 106static void des_ede_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
113EVP_CIPHER_CTX *ctx; 107 unsigned char *iv, int enc)
114unsigned char *key;
115unsigned char *iv;
116int 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
128static void des_ede3_init_key(ctx,key,iv,enc) 121static void des_ede3_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
129EVP_CIPHER_CTX *ctx; 122 unsigned char *iv, int enc)
130unsigned char *key;
131unsigned char *iv;
132int 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
142static void des_ede_cipher(ctx,out,in,inl) 134static void des_ede_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
143EVP_CIPHER_CTX *ctx; 135 unsigned char *in, unsigned int inl)
144unsigned char *out;
145unsigned char *in;
146unsigned 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
67static void bf_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, 65static void bf_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
68 unsigned char *iv,int enc); 66 unsigned char *iv,int enc);
69static void bf_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 67static 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
72static void bf_ecb_init_key();
73static void bf_ecb_cipher();
74#endif
75
76static EVP_CIPHER bfish_ecb_cipher= 69static 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
89EVP_CIPHER *EVP_bf_ecb() 82EVP_CIPHER *EVP_bf_ecb(void)
90 { 83 {
91 return(&bfish_ecb_cipher); 84 return(&bfish_ecb_cipher);
92 } 85 }
93 86
94static void bf_ecb_init_key(ctx,key,iv,enc) 87static void bf_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
95EVP_CIPHER_CTX *ctx; 88 unsigned char *iv, int enc)
96unsigned char *key;
97unsigned char *iv;
98int 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
104static void bf_ecb_cipher(ctx,out,in,inl) 94static void bf_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
105EVP_CIPHER_CTX *ctx; 95 unsigned char *in, unsigned int inl)
106unsigned char *out;
107unsigned char *in;
108unsigned 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
67static void cast_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, 66static void cast_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
68 unsigned char *iv,int enc); 67 unsigned char *iv,int enc);
69static void cast_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 68static 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
72static void cast_ecb_init_key();
73static void cast_ecb_cipher();
74#endif
75
76static EVP_CIPHER cast5_ecb_cipher= 70static 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
89EVP_CIPHER *EVP_cast5_ecb() 83EVP_CIPHER *EVP_cast5_ecb(void)
90 { 84 {
91 return(&cast5_ecb_cipher); 85 return(&cast5_ecb_cipher);
92 } 86 }
93 87
94static void cast_ecb_init_key(ctx,key,iv,enc) 88static void cast_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
95EVP_CIPHER_CTX *ctx; 89 unsigned char *iv, int enc)
96unsigned char *key;
97unsigned char *iv;
98int 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
104static void cast_ecb_cipher(ctx,out,in,inl) 95static void cast_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
105EVP_CIPHER_CTX *ctx; 96 unsigned char *in, unsigned int inl)
106unsigned char *out;
107unsigned char *in;
108unsigned 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
65static void des_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, 65static void des_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
66 unsigned char *iv,int enc); 66 unsigned char *iv,int enc);
67static void des_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 67static 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
70static void des_ecb_init_key();
71static void des_ecb_cipher();
72#endif
73
74static EVP_CIPHER d_ecb_cipher= 69static 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
87EVP_CIPHER *EVP_des_ecb() 82EVP_CIPHER *EVP_des_ecb(void)
88 { 83 {
89 return(&d_ecb_cipher); 84 return(&d_ecb_cipher);
90 } 85 }
91 86
92static void des_ecb_init_key(ctx,key,iv,enc) 87static void des_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
93EVP_CIPHER_CTX *ctx; 88 unsigned char *iv, int enc)
94unsigned char *key;
95unsigned char *iv;
96int 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
102static void des_ecb_cipher(ctx,out,in,inl) 96static void des_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
103EVP_CIPHER_CTX *ctx; 97 unsigned char *in, unsigned int inl)
104unsigned char *out;
105unsigned char *in;
106unsigned 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
67static void idea_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, 66static void idea_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
68 unsigned char *iv,int enc); 67 unsigned char *iv,int enc);
69static void idea_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 68static 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
72static void idea_ecb_init_key();
73static void idea_ecb_cipher();
74#endif
75
76static EVP_CIPHER i_ecb_cipher= 70static 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
89EVP_CIPHER *EVP_idea_ecb() 83EVP_CIPHER *EVP_idea_ecb(void)
90 { 84 {
91 return(&i_ecb_cipher); 85 return(&i_ecb_cipher);
92 } 86 }
93 87
94static void idea_ecb_init_key(ctx,key,iv,enc) 88static void idea_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
95EVP_CIPHER_CTX *ctx; 89 unsigned char *iv, int enc)
96unsigned char *key;
97unsigned char *iv;
98int 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
116static void idea_ecb_cipher(ctx,out,in,inl) 107static void idea_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
117EVP_CIPHER_CTX *ctx; 108 unsigned char *in, unsigned int inl)
118unsigned char *out;
119unsigned char *in;
120unsigned 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
67static void rc2_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, 66static void rc2_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
68 unsigned char *iv,int enc); 67 unsigned char *iv,int enc);
69static void rc2_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 68static 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
72static void rc2_ecb_init_key();
73static void rc2_ecb_cipher();
74#endif
75
76static EVP_CIPHER r2_ecb_cipher= 70static 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
89EVP_CIPHER *EVP_rc2_ecb() 83EVP_CIPHER *EVP_rc2_ecb(void)
90 { 84 {
91 return(&r2_ecb_cipher); 85 return(&r2_ecb_cipher);
92 } 86 }
93 87
94static void rc2_ecb_init_key(ctx,key,iv,enc) 88static void rc2_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
95EVP_CIPHER_CTX *ctx; 89 unsigned char *iv, int enc)
96unsigned char *key;
97unsigned char *iv;
98int 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
105static void rc2_ecb_cipher(ctx,out,in,inl) 96static void rc2_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
106EVP_CIPHER_CTX *ctx; 97 unsigned char *in, unsigned int inl)
107unsigned char *out;
108unsigned char *in;
109unsigned 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
67static void rc5_32_12_16_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, 66static 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);
69static void rc5_32_12_16_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 68static 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
72static void rc5_32_12_16_ecb_init_key();
73static void rc5_32_12_16_ecb_cipher();
74#endif
75
76static EVP_CIPHER rc5_ecb_cipher= 70static 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
89EVP_CIPHER *EVP_rc5_32_12_16_ecb() 83EVP_CIPHER *EVP_rc5_32_12_16_ecb(void)
90 { 84 {
91 return(&rc5_ecb_cipher); 85 return(&rc5_ecb_cipher);
92 } 86 }
93 87
94static void rc5_32_12_16_ecb_init_key(ctx,key,iv,enc) 88static void rc5_32_12_16_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
95EVP_CIPHER_CTX *ctx; 89 unsigned char *iv, int enc)
96unsigned char *key;
97unsigned char *iv;
98int 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
105static void rc5_32_12_16_ecb_cipher(ctx,out,in,inl) 96static void rc5_32_12_16_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
106EVP_CIPHER_CTX *ctx; 97 unsigned char *in, unsigned int inl)
107unsigned char *out;
108unsigned char *in;
109unsigned 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
65static void null_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, 64static void null_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
66 unsigned char *iv,int enc); 65 unsigned char *iv,int enc);
67static void null_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 66static 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
70static void null_init_key();
71static void null_cipher();
72#endif
73
74static EVP_CIPHER n_cipher= 68static 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
86EVP_CIPHER *EVP_enc_null() 80EVP_CIPHER *EVP_enc_null(void)
87 { 81 {
88 return(&n_cipher); 82 return(&n_cipher);
89 } 83 }
90 84
91static void null_init_key(ctx,key,iv,enc) 85static void null_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
92EVP_CIPHER_CTX *ctx; 86 unsigned char *iv, int enc)
93unsigned char *key;
94unsigned char *iv;
95int enc;
96 { 87 {
97 memset(&(ctx->c),0,sizeof(ctx->c)); 88 memset(&(ctx->c),0,sizeof(ctx->c));
98 } 89 }
99 90
100static void null_cipher(ctx,out,in,inl) 91static void null_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
101EVP_CIPHER_CTX *ctx; 92 unsigned char *in, unsigned int inl)
102unsigned char *out;
103unsigned char *in;
104unsigned 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
65static void des_ede_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, 65static 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);
67static void des_ede3_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, 67static 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);
69static void des_ede_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 69static 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
72static void des_ede_ofb_init_key();
73static void des_ede3_ofb_init_key();
74static void des_ede_ofb_cipher();
75#endif
76
77static EVP_CIPHER d_ede_ofb_cipher2= 71static 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
103EVP_CIPHER *EVP_des_ede_ofb() 97EVP_CIPHER *EVP_des_ede_ofb(void)
104 { 98 {
105 return(&d_ede_ofb_cipher2); 99 return(&d_ede_ofb_cipher2);
106 } 100 }
107 101
108EVP_CIPHER *EVP_des_ede3_ofb() 102EVP_CIPHER *EVP_des_ede3_ofb(void)
109 { 103 {
110 return(&d_ede3_ofb_cipher3); 104 return(&d_ede3_ofb_cipher3);
111 } 105 }
112 106
113static void des_ede_ofb_init_key(ctx,key,iv,enc) 107static void des_ede_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
114EVP_CIPHER_CTX *ctx; 108 unsigned char *iv, int enc)
115unsigned char *key;
116unsigned char *iv;
117int 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
134static void des_ede3_ofb_init_key(ctx,key,iv,enc) 127static void des_ede3_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
135EVP_CIPHER_CTX *ctx; 128 unsigned char *iv, int enc)
136unsigned char *key;
137unsigned char *iv;
138int 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
153static void des_ede_ofb_cipher(ctx,out,in,inl) 145static void des_ede_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
154EVP_CIPHER_CTX *ctx; 146 unsigned char *in, unsigned int inl)
155unsigned char *out;
156unsigned char *in;
157unsigned 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
67static void bf_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, 65static void bf_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
68 unsigned char *iv,int enc); 66 unsigned char *iv,int enc);
69static void bf_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 67static 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
72static void bf_ofb_init_key();
73static void bf_ofb_cipher();
74#endif
75
76static EVP_CIPHER bfish_ofb_cipher= 69static 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
89EVP_CIPHER *EVP_bf_ofb() 82EVP_CIPHER *EVP_bf_ofb(void)
90 { 83 {
91 return(&bfish_ofb_cipher); 84 return(&bfish_ofb_cipher);
92 } 85 }
93 86
94static void bf_ofb_init_key(ctx,key,iv,enc) 87static void bf_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
95EVP_CIPHER_CTX *ctx; 88 unsigned char *iv, int enc)
96unsigned char *key;
97unsigned char *iv;
98int 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
109static void bf_ofb_cipher(ctx,out,in,inl) 99static void bf_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
110EVP_CIPHER_CTX *ctx; 100 unsigned char *in, unsigned int inl)
111unsigned char *out;
112unsigned char *in;
113unsigned 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
67static void cast_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, 66static void cast_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
68 unsigned char *iv,int enc); 67 unsigned char *iv,int enc);
69static void cast_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 68static 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
72static void cast_ofb_init_key();
73static void cast_ofb_cipher();
74#endif
75
76static EVP_CIPHER cast5_ofb_cipher= 70static 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
89EVP_CIPHER *EVP_cast5_ofb() 83EVP_CIPHER *EVP_cast5_ofb(void)
90 { 84 {
91 return(&cast5_ofb_cipher); 85 return(&cast5_ofb_cipher);
92 } 86 }
93 87
94static void cast_ofb_init_key(ctx,key,iv,enc) 88static void cast_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
95EVP_CIPHER_CTX *ctx; 89 unsigned char *iv, int enc)
96unsigned char *key;
97unsigned char *iv;
98int 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
109static void cast_ofb_cipher(ctx,out,in,inl) 100static void cast_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
110EVP_CIPHER_CTX *ctx; 101 unsigned char *in, unsigned int inl)
111unsigned char *out;
112unsigned char *in;
113unsigned 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
65static void des_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, 65static void des_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
66 unsigned char *iv,int enc); 66 unsigned char *iv,int enc);
67static void des_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 67static 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
70static void des_ofb_init_key();
71static void des_ofb_cipher();
72#endif
73
74static EVP_CIPHER d_ofb_cipher= 69static 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
87EVP_CIPHER *EVP_des_ofb() 82EVP_CIPHER *EVP_des_ofb(void)
88 { 83 {
89 return(&d_ofb_cipher); 84 return(&d_ofb_cipher);
90 } 85 }
91 86
92static void des_ofb_init_key(ctx,key,iv,enc) 87static void des_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
93EVP_CIPHER_CTX *ctx; 88 unsigned char *iv, int enc)
94unsigned char *key;
95unsigned char *iv;
96int 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
107static void des_ofb_cipher(ctx,out,in,inl) 101static void des_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
108EVP_CIPHER_CTX *ctx; 102 unsigned char *in, unsigned int inl)
109unsigned char *out;
110unsigned char *in;
111unsigned 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
67static void idea_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, 66static void idea_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
68 unsigned char *iv,int enc); 67 unsigned char *iv,int enc);
69static void idea_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 68static 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
72static void idea_ofb_init_key();
73static void idea_ofb_cipher();
74#endif
75
76static EVP_CIPHER i_ofb_cipher= 70static 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
89EVP_CIPHER *EVP_idea_ofb() 83EVP_CIPHER *EVP_idea_ofb(void)
90 { 84 {
91 return(&i_ofb_cipher); 85 return(&i_ofb_cipher);
92 } 86 }
93 87
94static void idea_ofb_init_key(ctx,key,iv,enc) 88static void idea_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
95EVP_CIPHER_CTX *ctx; 89 unsigned char *iv, int enc)
96unsigned char *key;
97unsigned char *iv;
98int 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
109static void idea_ofb_cipher(ctx,out,in,inl) 100static void idea_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
110EVP_CIPHER_CTX *ctx; 101 unsigned char *in, unsigned int inl)
111unsigned char *out;
112unsigned char *in;
113unsigned 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
67static void rc2_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, 66static void rc2_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
68 unsigned char *iv,int enc); 67 unsigned char *iv,int enc);
69static void rc2_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 68static 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
72static void rc2_ofb_init_key();
73static void rc2_ofb_cipher();
74#endif
75
76static EVP_CIPHER r2_ofb_cipher= 70static 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
89EVP_CIPHER *EVP_rc2_ofb() 83EVP_CIPHER *EVP_rc2_ofb(void)
90 { 84 {
91 return(&r2_ofb_cipher); 85 return(&r2_ofb_cipher);
92 } 86 }
93 87
94static void rc2_ofb_init_key(ctx,key,iv,enc) 88static void rc2_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
95EVP_CIPHER_CTX *ctx; 89 unsigned char *iv, int enc)
96unsigned char *key;
97unsigned char *iv;
98int 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
110static void rc2_ofb_cipher(ctx,out,in,inl) 101static void rc2_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
111EVP_CIPHER_CTX *ctx; 102 unsigned char *in, unsigned int inl)
112unsigned char *out;
113unsigned char *in;
114unsigned 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
67static void rc5_32_12_16_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, 66static 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);
69static void rc5_32_12_16_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 68static 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
72static void rc5_32_12_16_ofb_init_key();
73static void rc5_32_12_16_ofb_cipher();
74#endif
75
76static EVP_CIPHER rc5_ofb_cipher= 70static 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
89EVP_CIPHER *EVP_rc5_32_12_16_ofb() 83EVP_CIPHER *EVP_rc5_32_12_16_ofb(void)
90 { 84 {
91 return(&rc5_ofb_cipher); 85 return(&rc5_ofb_cipher);
92 } 86 }
93 87
94static void rc5_32_12_16_ofb_init_key(ctx,key,iv,enc) 88static void rc5_32_12_16_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
95EVP_CIPHER_CTX *ctx; 89 unsigned char *iv, int enc)
96unsigned char *key;
97unsigned char *iv;
98int 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
110static void rc5_32_12_16_ofb_cipher(ctx,out,in,inl) 101static void rc5_32_12_16_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
111EVP_CIPHER_CTX *ctx; 102 unsigned char *in, unsigned int inl)
112unsigned char *out;
113unsigned char *in;
114unsigned 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
67static void rc4_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, 66static void rc4_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
68 unsigned char *iv,int enc); 67 unsigned char *iv,int enc);
69static void rc4_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 68static 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
72static void rc4_init_key();
73static void rc4_cipher();
74#endif
75
76static EVP_CIPHER r4_cipher= 70static 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
97EVP_CIPHER *EVP_rc4() 91EVP_CIPHER *EVP_rc4(void)
98 { 92 {
99 return(&r4_cipher); 93 return(&r4_cipher);
100 } 94 }
101 95
102EVP_CIPHER *EVP_rc4_40() 96EVP_CIPHER *EVP_rc4_40(void)
103 { 97 {
104 return(&r4_40_cipher); 98 return(&r4_40_cipher);
105 } 99 }
106 100
107static void rc4_init_key(ctx,key,iv,enc) 101static void rc4_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
108EVP_CIPHER_CTX *ctx; 102 unsigned char *iv, int enc)
109unsigned char *key;
110unsigned char *iv;
111int 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
119static void rc4_cipher(ctx,out,in,inl) 110static void rc4_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
120EVP_CIPHER_CTX *ctx; 111 unsigned char *in, unsigned int inl)
121unsigned char *out;
122unsigned char *in;
123unsigned 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
65static void desx_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, 65static void desx_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
66 unsigned char *iv,int enc); 66 unsigned char *iv,int enc);
67static void desx_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 67static 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
70static void desx_cbc_init_key();
71static void desx_cbc_cipher();
72#endif
73
74static EVP_CIPHER d_xcbc_cipher= 69static 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
87EVP_CIPHER *EVP_desx_cbc() 82EVP_CIPHER *EVP_desx_cbc(void)
88 { 83 {
89 return(&d_xcbc_cipher); 84 return(&d_xcbc_cipher);
90 } 85 }
91 86
92static void desx_cbc_init_key(ctx,key,iv,enc) 87static void desx_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
93EVP_CIPHER_CTX *ctx; 88 unsigned char *iv, int enc)
94unsigned char *key;
95unsigned char *iv;
96int 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
109static void desx_cbc_cipher(ctx,out,in,inl) 103static void desx_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
110EVP_CIPHER_CTX *ctx; 104 unsigned char *in, unsigned int inl)
111unsigned char *out;
112unsigned char *in;
113unsigned 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
113void EVP_EncodeInit(ctx) 124void EVP_EncodeInit(EVP_ENCODE_CTX *ctx)
114EVP_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
121void EVP_EncodeUpdate(ctx,out,outl,in,inl) 131void EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,
122EVP_ENCODE_CTX *ctx; 132 unsigned char *in, int inl)
123unsigned char *out;
124int *outl;
125unsigned char *in;
126int 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
168void EVP_EncodeFinal(ctx,out,outl) 174void EVP_EncodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl)
169EVP_ENCODE_CTX *ctx;
170unsigned char *out;
171int *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
185int EVP_EncodeBlock(t,f,dlen) 188int EVP_EncodeBlock(unsigned char *t, unsigned char *f, int dlen)
186unsigned char *t,*f;
187int 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
221void EVP_DecodeInit(ctx) 222void EVP_DecodeInit(EVP_ENCODE_CTX *ctx)
222EVP_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 */
234int EVP_DecodeUpdate(ctx,out,outl,in,inl) 234int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,
235EVP_ENCODE_CTX *ctx; 235 unsigned char *in, int inl)
236unsigned char *out;
237int *outl;
238unsigned char *in;
239int 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
344int EVP_DecodeBlock(t,f,n) 340int EVP_DecodeBlock(unsigned char *t, unsigned char *f, int n)
345unsigned char *t,*f;
346int 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
386int EVP_DecodeFinal(ctx,out,outl) 380int EVP_DecodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl)
387EVP_ENCODE_CTX *ctx;
388unsigned char *out;
389int *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
407int EVP_DecodeValid(buf,len) 398int EVP_DecodeValid(unsigned char *buf, int len)
408unsigned char *buf;
409int 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
288typedef struct env_md_ctx_st 290typedef 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
327typedef struct evp_cipher_info_st 329typedef 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
333typedef struct evp_cipher_ctx_st 335typedef 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 */
402typedef 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
453void 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
453void EVP_DigestInit(EVP_MD_CTX *ctx, EVP_MD *type); 473
454void EVP_DigestUpdate(EVP_MD_CTX *ctx,unsigned char *d,unsigned int cnt); 474int EVP_MD_CTX_copy(EVP_MD_CTX *out,EVP_MD_CTX *in);
475void EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type);
476void EVP_DigestUpdate(EVP_MD_CTX *ctx,const void *d,
477 unsigned int cnt);
455void EVP_DigestFinal(EVP_MD_CTX *ctx,unsigned char *md,unsigned int *s); 478void EVP_DigestFinal(EVP_MD_CTX *ctx,unsigned char *md,unsigned int *s);
456 479
457int EVP_read_pw_string(char *buf,int length,char *prompt,int verify); 480int EVP_read_pw_string(char *buf,int length,const char *prompt,int verify);
458void EVP_set_pw_prompt(char *prompt); 481void EVP_set_pw_prompt(char *prompt);
459char * EVP_get_pw_prompt(void); 482char * EVP_get_pw_prompt(void);
460 483
461int EVP_BytesToKey(EVP_CIPHER *type,EVP_MD *md,unsigned char *salt, 484int 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
465EVP_CIPHER *EVP_get_cipherbyname(char *name); 488void EVP_EncryptInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *type,
466
467void EVP_EncryptInit(EVP_CIPHER_CTX *ctx,EVP_CIPHER *type,
468 unsigned char *key, unsigned char *iv); 489 unsigned char *key, unsigned char *iv);
469void EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, 490void 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);
471void EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); 492void EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl);
472 493
473void EVP_DecryptInit(EVP_CIPHER_CTX *ctx,EVP_CIPHER *type, 494void EVP_DecryptInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *type,
474 unsigned char *key, unsigned char *iv); 495 unsigned char *key, unsigned char *iv);
475void EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, 496void 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);
477int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); 498int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl);
478 499
479void EVP_CipherInit(EVP_CIPHER_CTX *ctx,EVP_CIPHER *type, unsigned char *key, 500void 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);
481void EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, 502void 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);
483int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); 504int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl);
@@ -519,7 +540,8 @@ void EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *a);
519BIO_METHOD *BIO_f_md(void); 540BIO_METHOD *BIO_f_md(void);
520BIO_METHOD *BIO_f_base64(void); 541BIO_METHOD *BIO_f_base64(void);
521BIO_METHOD *BIO_f_cipher(void); 542BIO_METHOD *BIO_f_cipher(void);
522void BIO_set_cipher(BIO *b,EVP_CIPHER *c,unsigned char *k, 543BIO_METHOD *BIO_f_reliable(void);
544void 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);
556EVP_CIPHER *EVP_rc2_ecb(void); 578EVP_CIPHER *EVP_rc2_ecb(void);
557EVP_CIPHER *EVP_rc2_cbc(void); 579EVP_CIPHER *EVP_rc2_cbc(void);
558EVP_CIPHER *EVP_rc2_40_cbc(void); 580EVP_CIPHER *EVP_rc2_40_cbc(void);
581EVP_CIPHER *EVP_rc2_64_cbc(void);
559EVP_CIPHER *EVP_rc2_cfb(void); 582EVP_CIPHER *EVP_rc2_cfb(void);
560EVP_CIPHER *EVP_rc2_ofb(void); 583EVP_CIPHER *EVP_rc2_ofb(void);
561EVP_CIPHER *EVP_bf_ecb(void); 584EVP_CIPHER *EVP_bf_ecb(void);
@@ -577,11 +600,9 @@ void SSLeay_add_all_digests(void);
577 600
578int EVP_add_cipher(EVP_CIPHER *cipher); 601int EVP_add_cipher(EVP_CIPHER *cipher);
579int EVP_add_digest(EVP_MD *digest); 602int EVP_add_digest(EVP_MD *digest);
580int EVP_add_alias(char *name,char *alias);
581int EVP_delete_alias(char *name);
582 603
583EVP_CIPHER *EVP_get_cipherbyname(char *name); 604const EVP_CIPHER *EVP_get_cipherbyname(const char *name);
584EVP_MD *EVP_get_digestbyname(char *name); 605const EVP_MD *EVP_get_digestbyname(const char *name);
585void EVP_cleanup(void); 606void EVP_cleanup(void);
586 607
587int EVP_PKEY_decrypt(unsigned char *dec_key,unsigned char *enc_key, 608int EVP_PKEY_decrypt(unsigned char *dec_key,unsigned char *enc_key,
@@ -607,6 +628,8 @@ int EVP_PKEY_missing_parameters(EVP_PKEY *pkey);
607int EVP_PKEY_save_parameters(EVP_PKEY *pkey,int mode); 628int EVP_PKEY_save_parameters(EVP_PKEY *pkey,int mode);
608int EVP_PKEY_cmp_parameters(EVP_PKEY *a,EVP_PKEY *b); 629int EVP_PKEY_cmp_parameters(EVP_PKEY *a,EVP_PKEY *b);
609 630
631int EVP_CIPHER_type(const EVP_CIPHER *ctx);
632
610/* calls methods */ 633/* calls methods */
611int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type); 634int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type);
612int EVP_CIPHER_asn1_to_param(EVP_CIPHER_CTX *c, ASN1_TYPE *type); 635int 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);
615int EVP_CIPHER_set_asn1_iv(EVP_CIPHER_CTX *c,ASN1_TYPE *type); 638int EVP_CIPHER_set_asn1_iv(EVP_CIPHER_CTX *c,ASN1_TYPE *type);
616int EVP_CIPHER_get_asn1_iv(EVP_CIPHER_CTX *c,ASN1_TYPE *type); 639int EVP_CIPHER_get_asn1_iv(EVP_CIPHER_CTX *c,ASN1_TYPE *type);
617 640
618#else 641/* PKCS5 password based encryption */
619 642int PKCS5_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
620void EVP_DigestInit(); 643 ASN1_TYPE *param, EVP_CIPHER *cipher, EVP_MD *md,
621void EVP_DigestUpdate(); 644 int en_de);
622void EVP_DigestFinal(); 645int PKCS5_PBKDF2_HMAC_SHA1(const char *pass, int passlen,
623 646 unsigned char *salt, int saltlen, int iter,
624int EVP_read_pw_string(); 647 int keylen, unsigned char *out);
625void EVP_set_pw_prompt(); 648int PKCS5_v2_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
626char * EVP_get_pw_prompt(); 649 ASN1_TYPE *param, EVP_CIPHER *cipher, EVP_MD *md,
627 650 int en_de);
628int EVP_BytesToKey(); 651
629 652void PKCS5_PBE_add(void);
630EVP_CIPHER *EVP_get_cipherbyname(); 653
631 654int EVP_PBE_CipherInit (ASN1_OBJECT *pbe_obj, const char *pass, int passlen,
632void EVP_EncryptInit(); 655 ASN1_TYPE *param, EVP_CIPHER_CTX *ctx, int en_de);
633void EVP_EncryptUpdate(); 656int EVP_PBE_alg_add(int nid, EVP_CIPHER *cipher, EVP_MD *md,
634void EVP_EncryptFinal(); 657 EVP_PBE_KEYGEN *keygen);
635 658void EVP_PBE_cleanup(void);
636void EVP_DecryptInit();
637void EVP_DecryptUpdate();
638int EVP_DecryptFinal();
639
640void EVP_CipherInit();
641void EVP_CipherUpdate();
642int EVP_CipherFinal();
643
644int EVP_SignFinal();
645
646int EVP_VerifyFinal();
647
648int EVP_OpenInit();
649int EVP_OpenFinal();
650
651int EVP_SealInit();
652void EVP_SealFinal();
653
654void EVP_EncodeInit();
655void EVP_EncodeUpdate();
656void EVP_EncodeFinal();
657int EVP_EncodeBlock();
658
659void EVP_DecodeInit();
660int EVP_DecodeUpdate();
661int EVP_DecodeFinal();
662int EVP_DecodeBlock();
663
664void ERR_load_EVP_strings();
665
666void EVP_CIPHER_CTX_init();
667void EVP_CIPHER_CTX_cleanup();
668
669#ifdef HEADER_BIO_H
670BIO_METHOD *BIO_f_md();
671BIO_METHOD *BIO_f_base64();
672BIO_METHOD *BIO_f_cipher();
673void BIO_set_cipher();
674#endif
675
676EVP_MD *EVP_md_null();
677EVP_MD *EVP_md2();
678EVP_MD *EVP_md5();
679EVP_MD *EVP_sha();
680EVP_MD *EVP_sha1();
681EVP_MD *EVP_dss();
682EVP_MD *EVP_dss1();
683EVP_MD *EVP_mdc2();
684
685EVP_CIPHER *EVP_enc_null();
686EVP_CIPHER *EVP_des_ecb();
687EVP_CIPHER *EVP_des_ede();
688EVP_CIPHER *EVP_des_ede3();
689EVP_CIPHER *EVP_des_cfb();
690EVP_CIPHER *EVP_des_ede_cfb();
691EVP_CIPHER *EVP_des_ede3_cfb();
692EVP_CIPHER *EVP_des_ofb();
693EVP_CIPHER *EVP_des_ede_ofb();
694EVP_CIPHER *EVP_des_ede3_ofb();
695EVP_CIPHER *EVP_des_cbc();
696EVP_CIPHER *EVP_des_ede_cbc();
697EVP_CIPHER *EVP_des_ede3_cbc();
698EVP_CIPHER *EVP_desx_cbc();
699EVP_CIPHER *EVP_rc4();
700EVP_CIPHER *EVP_rc4_40();
701EVP_CIPHER *EVP_idea_ecb();
702EVP_CIPHER *EVP_idea_cfb();
703EVP_CIPHER *EVP_idea_ofb();
704EVP_CIPHER *EVP_idea_cbc();
705EVP_CIPHER *EVP_rc2_ecb();
706EVP_CIPHER *EVP_rc2_cbc();
707EVP_CIPHER *EVP_rc2_40_cbc();
708EVP_CIPHER *EVP_rc2_cfb();
709EVP_CIPHER *EVP_rc2_ofb();
710EVP_CIPHER *EVP_bf_ecb();
711EVP_CIPHER *EVP_bf_cbc();
712EVP_CIPHER *EVP_bf_cfb();
713EVP_CIPHER *EVP_bf_ofb();
714EVP_CIPHER *EVP_cast5_ecb();
715EVP_CIPHER *EVP_cast5_cbc();
716EVP_CIPHER *EVP_cast5_cfb();
717EVP_CIPHER *EVP_cast5_ofb();
718EVP_CIPHER *EVP_rc5_32_12_16_cbc();
719EVP_CIPHER *EVP_rc5_32_12_16_ecb();
720EVP_CIPHER *EVP_rc5_32_12_16_cfb();
721EVP_CIPHER *EVP_rc5_32_12_16_ofb();
722
723void SSLeay_add_all_algorithms();
724void SSLeay_add_all_ciphers();
725void SSLeay_add_all_digests();
726
727int EVP_add_cipher();
728int EVP_add_digest();
729int EVP_add_alias();
730int EVP_delete_alias();
731
732EVP_CIPHER *EVP_get_cipherbyname();
733EVP_MD *EVP_get_digestbyname();
734void EVP_cleanup();
735
736int EVP_PKEY_decrypt();
737int EVP_PKEY_encrypt();
738int EVP_PKEY_type();
739int EVP_PKEY_bits();
740int EVP_PKEY_size();
741int EVP_PKEY_assign();
742EVP_PKEY * EVP_PKEY_new();
743void EVP_PKEY_free();
744EVP_PKEY * d2i_PublicKey();
745int i2d_PublicKey();
746
747EVP_PKEY * d2i_PrivateKey();
748int i2d_PrivateKey();
749
750int EVP_PKEY_copy_parameters();
751int EVP_PKEY_missing_parameters();
752int EVP_PKEY_save_parameters();
753int EVP_PKEY_cmp_parameters();
754
755int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type);
756int EVP_CIPHER_asn1_to_param(EVP_CIPHER_CTX *c, ASN1_TYPE *type);
757
758int EVP_CIPHER_set_asn1_iv();
759int 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
63char *EVP_version="EVP part of SSLeay 0.9.0b 29-Jun-1998"; 63const char *EVP_version="EVP" OPENSSL_VERSION_PTEXT;
64 64
65void EVP_CIPHER_CTX_init(ctx) 65void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *ctx)
66EVP_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
72void EVP_CipherInit(ctx,data,key,iv,enc) 71void EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *data,
73EVP_CIPHER_CTX *ctx; 72 unsigned char *key, unsigned char *iv, int enc)
74EVP_CIPHER *data;
75unsigned char *key;
76unsigned char *iv;
77int 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
85void EVP_CipherUpdate(ctx,out,outl,in,inl) 80void EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
86EVP_CIPHER_CTX *ctx; 81 unsigned char *in, int inl)
87unsigned char *out;
88int *outl;
89unsigned char *in;
90int 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
97int EVP_CipherFinal(ctx,out,outl) 88int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl)
98EVP_CIPHER_CTX *ctx;
99unsigned char *out;
100int *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
110void EVP_EncryptInit(ctx,cipher,key,iv) 98void EVP_EncryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
111EVP_CIPHER_CTX *ctx; 99 unsigned char *key, unsigned char *iv)
112EVP_CIPHER *cipher;
113unsigned char *key;
114unsigned 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
123void EVP_DecryptInit(ctx,cipher,key,iv) 108void EVP_DecryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
124EVP_CIPHER_CTX *ctx; 109 unsigned char *key, unsigned char *iv)
125EVP_CIPHER *cipher;
126unsigned char *key;
127unsigned 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
137void EVP_EncryptUpdate(ctx,out,outl,in,inl) 119void EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
138EVP_CIPHER_CTX *ctx; 120 unsigned char *in, int inl)
139unsigned char *out;
140int *outl;
141unsigned char *in;
142int 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
182void EVP_EncryptFinal(ctx,out,outl) 160void EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl)
183EVP_CIPHER_CTX *ctx;
184unsigned char *out;
185int *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
203void EVP_DecryptUpdate(ctx,out,outl,in,inl) 178void EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
204EVP_CIPHER_CTX *ctx; 179 unsigned char *in, int inl)
205unsigned char *out;
206int *outl;
207unsigned char *in;
208int 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
252int EVP_DecryptFinal(ctx,out,outl) 223int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl)
253EVP_CIPHER_CTX *ctx;
254unsigned char *out;
255int *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
296void EVP_CIPHER_CTX_cleanup(c) 264void EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *c)
297EVP_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
78static ERR_STRING_DATA EVP_str_reasons[]= 89static 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
95void ERR_load_EVP_strings() 123void 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. */
66static char prompt_string[80]; 66static char prompt_string[80];
67 67
68void EVP_set_pw_prompt(prompt) 68void EVP_set_pw_prompt(char *prompt)
69char *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
77char *EVP_get_pw_prompt() 76char *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
86int des_read_pw_string(char *buf,int len,char *prompt,int verify); 85int des_read_pw_string(char *buf,int len,const char *prompt,int verify);
87#endif 86#endif
88 87
89int EVP_read_pw_string(buf,len,prompt,verify) 88int EVP_read_pw_string(char *buf, int len, const char *prompt, int verify)
90char *buf;
91int len;
92char *prompt;
93int 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
100int EVP_BytesToKey(type,md,salt,data,datal,count,key,iv) 95int EVP_BytesToKey(const EVP_CIPHER *type, EVP_MD *md, unsigned char *salt,
101EVP_CIPHER *type; 96 unsigned char *data, int datal, int count, unsigned char *key,
102EVP_MD *md; 97 unsigned char *iv)
103unsigned char *salt;
104unsigned char *data;
105int datal;
106int count;
107unsigned char *key;
108unsigned 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
64int EVP_CIPHER_param_to_asn1(c,type) 64int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type)
65EVP_CIPHER_CTX *c;
66ASN1_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
77int EVP_CIPHER_asn1_to_param(c,type) 75int EVP_CIPHER_asn1_to_param(EVP_CIPHER_CTX *c, ASN1_TYPE *type)
78EVP_CIPHER_CTX *c;
79ASN1_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
90int EVP_CIPHER_get_asn1_iv(c,type) 86int EVP_CIPHER_get_asn1_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type)
91EVP_CIPHER_CTX *c;
92ASN1_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
105int EVP_CIPHER_set_asn1_iv(c,type) 102int EVP_CIPHER_set_asn1_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type)
106EVP_CIPHER_CTX *c;
107ASN1_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 */
115int 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
66static STACK *pbe_algs;
67
68/* Setup a cipher context from a PBE algorithm */
69
70typedef struct {
71int pbe_nid;
72EVP_CIPHER *cipher;
73EVP_MD *md;
74EVP_PBE_KEYGEN *keygen;
75} EVP_PBE_CTL;
76
77int 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
106static 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
113int 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
130void 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
67EVP_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
198PKCS8_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
275PKCS8_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
65static EVP_MD dsa_md= 66static 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
78EVP_MD *EVP_dss() 79EVP_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
65static EVP_MD dss1_md= 66static 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
78EVP_MD *EVP_dss1() 79EVP_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
65static EVP_MD md2_md= 66static 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
78EVP_MD *EVP_md2() 79EVP_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
65static EVP_MD md5_md= 66static 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
78EVP_MD *EVP_md5() 79EVP_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
65static EVP_MD mdc2_md= 66static 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
78EVP_MD *EVP_mdc2() 79EVP_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
65static void function() 65static 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
83EVP_MD *EVP_md_null() 83EVP_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
65static EVP_MD ripemd160_md= 67static 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
78EVP_MD *EVP_ripemd160() 80EVP_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
65static EVP_MD sha_md= 66static 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
78EVP_MD *EVP_sha() 79EVP_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
65static EVP_MD sha1_md= 66static 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
78EVP_MD *EVP_sha1() 79EVP_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
64typedef struct aliases_st { 65int 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
71static STACK /* ALIASES */ *aliases=NULL;
72static STACK /* EVP_CIPHERS */ *ciphers=NULL;
73static STACK /* EVP_MD */ *digests=NULL;
74
75static int cipher_nid_cmp(a,b)
76EVP_CIPHER **a,**b;
77 { return((*a)->nid - (*b)->nid); }
78
79static int digest_type_cmp(a,b)
80EVP_MD **a,**b;
81 { return((*a)->pkey_type - (*b)->pkey_type); }
82
83int EVP_add_cipher(c)
84EVP_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
102int EVP_add_digest(md)
103EVP_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
129static int alias_cmp(a,b)
130ALIASES **a,**b;
131 {
132 return(strcmp((*a)->alias,(*b)->alias));
133 } 73 }
134 74
135int EVP_add_alias(name,aname) 75int EVP_add_digest(EVP_MD *md)
136char *name;
137char *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);
166err:
167 return(0);
168 } 95 }
169 96
170int EVP_delete_alias(name) 97const EVP_CIPHER *EVP_get_cipherbyname(const char *name)
171char *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
188EVP_CIPHER *EVP_get_cipherbyname(name) 105const EVP_MD *EVP_get_digestbyname(const char *name)
189char *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
225EVP_MD *EVP_get_digestbyname(name) 113void EVP_cleanup(void)
226char *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
264void 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
68void PKCS5_PBE_add(void)
69{
70#ifndef NO_DES
71# ifndef NO_MD5
72EVP_PBE_alg_add(NID_pbeWithMD5AndDES_CBC, EVP_des_cbc(), EVP_md5(),
73 PKCS5_PBE_keyivgen);
74# endif
75# ifndef NO_MD2
76EVP_PBE_alg_add(NID_pbeWithMD2AndDES_CBC, EVP_des_cbc(), EVP_md2(),
77 PKCS5_PBE_keyivgen);
78# endif
79# ifndef NO_SHA
80EVP_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
86EVP_PBE_alg_add(NID_pbeWithMD5AndRC2_CBC, EVP_rc2_64_cbc(), EVP_md5(),
87 PKCS5_PBE_keyivgen);
88# endif
89# ifndef NO_MD2
90EVP_PBE_alg_add(NID_pbeWithMD2AndRC2_CBC, EVP_rc2_64_cbc(), EVP_md2(),
91 PKCS5_PBE_keyivgen);
92# endif
93# ifndef NO_SHA
94EVP_PBE_alg_add(NID_pbeWithSHA1AndRC2_CBC, EVP_rc2_64_cbc(), EVP_sha1(),
95 PKCS5_PBE_keyivgen);
96# endif
97#endif
98#ifndef NO_HMAC
99EVP_PBE_alg_add(NID_pbes2, NULL, NULL, PKCS5_v2_PBE_keyivgen);
100#endif
101}
102
103int 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
79int 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
128main()
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
144int 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
241static 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
67int EVP_PKEY_decrypt(key,ek,ekl,priv) 69int EVP_PKEY_decrypt(unsigned char *key, unsigned char *ek, int ekl,
68unsigned char *key; 70 EVP_PKEY *priv)
69unsigned char *ek;
70int ekl;
71EVP_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);
82err: 84err:
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
67int EVP_PKEY_encrypt(ek,key,key_len,pubk) 69int EVP_PKEY_encrypt(unsigned char *ek, unsigned char *key, int key_len,
68unsigned char *ek; 70 EVP_PKEY *pubk)
69unsigned char *key;
70int key_len;
71EVP_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);
81err: 83err:
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
70static void EVP_PKEY_free_it(EVP_PKEY *x); 66static void EVP_PKEY_free_it(EVP_PKEY *x);
71#else 67int EVP_PKEY_bits(EVP_PKEY *pkey)
72static void EVP_PKEY_free_it();
73#endif
74
75int EVP_PKEY_bits(pkey)
76EVP_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
90int EVP_PKEY_size(pkey) 81int EVP_PKEY_size(EVP_PKEY *pkey)
91EVP_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
105int EVP_PKEY_save_parameters(pkey,mode) 97int EVP_PKEY_save_parameters(EVP_PKEY *pkey, int mode)
106EVP_PKEY *pkey;
107int 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
122int EVP_PKEY_copy_parameters(to,from) 112int EVP_PKEY_copy_parameters(EVP_PKEY *to, EVP_PKEY *from)
123EVP_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
159int EVP_PKEY_missing_parameters(pkey) 148int EVP_PKEY_missing_parameters(EVP_PKEY *pkey)
160EVP_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
175int EVP_PKEY_cmp_parameters(a,b) 163int EVP_PKEY_cmp_parameters(EVP_PKEY *a, EVP_PKEY *b)
176EVP_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
192EVP_PKEY *EVP_PKEY_new() 179EVP_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
210int EVP_PKEY_assign(pkey,type,key) 197int EVP_PKEY_assign(EVP_PKEY *pkey, int type, char *key)
211EVP_PKEY *pkey;
212int type;
213char *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
224int EVP_PKEY_type(type) 208int EVP_PKEY_type(int type)
225int type;
226 { 209 {
227 switch (type) 210 switch (type)
228 { 211 {
@@ -242,8 +225,7 @@ int type;
242 } 225 }
243 } 226 }
244 227
245void EVP_PKEY_free(x) 228void EVP_PKEY_free(EVP_PKEY *x)
246EVP_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
268static void EVP_PKEY_free_it(x) 250static void EVP_PKEY_free_it(EVP_PKEY *x)
269EVP_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
65int EVP_OpenInit(ctx,type,ek,ekl,iv,priv) 66int EVP_OpenInit(EVP_CIPHER_CTX *ctx, EVP_CIPHER *type, unsigned char *ek,
66EVP_CIPHER_CTX *ctx; 67 int ekl, unsigned char *iv, EVP_PKEY *priv)
67EVP_CIPHER *type;
68unsigned char *ek;
69int ekl;
70unsigned char *iv;
71EVP_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
109int EVP_OpenFinal(ctx,out,outl) 105int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl)
110EVP_CIPHER_CTX *ctx;
111unsigned char *out;
112int *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
67int EVP_SealInit(ctx,type,ek,ekl,iv,pubk,npubk) 69int EVP_SealInit(EVP_CIPHER_CTX *ctx, EVP_CIPHER *type, unsigned char **ek,
68EVP_CIPHER_CTX *ctx; 70 int *ekl, unsigned char *iv, EVP_PKEY **pubk, int npubk)
69EVP_CIPHER *type;
70unsigned char **ek;
71int *ekl;
72unsigned char *iv;
73EVP_PKEY **pubk;
74int 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
108void EVP_SealFinal(ctx,out,outl) 104void EVP_SealFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl)
109EVP_CIPHER_CTX *ctx;
110unsigned char *out;
111int *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
66void EVP_SignInit(ctx,type) 66void EVP_SignInit(EVP_MD_CTX *ctx, EVP_MD *type)
67EVP_MD_CTX *ctx;
68EVP_MD *type;
69 { 67 {
70 EVP_DigestInit(ctx,type); 68 EVP_DigestInit(ctx,type);
71 } 69 }
72 70
73void EVP_SignUpdate(ctx,data,count) 71void EVP_SignUpdate(EVP_MD_CTX *ctx, unsigned char *data,
74EVP_MD_CTX *ctx; 72 unsigned int count)
75unsigned char *data;
76unsigned int count;
77 { 73 {
78 EVP_DigestUpdate(ctx,data,count); 74 EVP_DigestUpdate(ctx,data,count);
79 } 75 }
80#endif 76#endif
81 77
82int EVP_SignFinal(ctx,sigret,siglen,pkey) 78int EVP_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, unsigned int *siglen,
83EVP_MD_CTX *ctx; 79 EVP_PKEY *pkey)
84unsigned char *sigret;
85unsigned int *siglen;
86EVP_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
65int EVP_VerifyFinal(ctx,sigbuf,siglen,pkey) 65int EVP_VerifyFinal(EVP_MD_CTX *ctx, unsigned char *sigbuf,
66EVP_MD_CTX *ctx; 66 unsigned int siglen, EVP_PKEY *pkey)
67unsigned char *sigbuf;
68unsigned int siglen;
69EVP_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
64static LHASH *pk_md=NULL;
65
66static LHASH *pk_md=NULL;
67
68int EVP_add_pkey_md(oid,pkm,md)
69int oid;
70EVP_PKEY_METHOD *pkm;
71EVP_MD *md;
72 {
73 }
74
75EVP_add_pkey(pkm)
76EVP_PKEY_METHOD *pkm;
77 {
78 }
79
80EVP_PKEY_METHOD:q
81
82