summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/evp
diff options
context:
space:
mode:
authordjm <>2010-10-01 22:59:01 +0000
committerdjm <>2010-10-01 22:59:01 +0000
commitfe047d8b632246cb2db3234a0a4f32e5c318857b (patch)
tree939b752540947d33507b3acc48d76a8bfb7c3dc3 /src/lib/libcrypto/evp
parent2ea67f4aa254b09ded62e6e14fc893bbe6381579 (diff)
downloadopenbsd-fe047d8b632246cb2db3234a0a4f32e5c318857b.tar.gz
openbsd-fe047d8b632246cb2db3234a0a4f32e5c318857b.tar.bz2
openbsd-fe047d8b632246cb2db3234a0a4f32e5c318857b.zip
resolve conflicts, fix local changes
Diffstat (limited to 'src/lib/libcrypto/evp')
-rw-r--r--src/lib/libcrypto/evp/Makefile782
-rw-r--r--src/lib/libcrypto/evp/Makefile.ssl1059
-rw-r--r--src/lib/libcrypto/evp/bio_b64.c77
-rw-r--r--src/lib/libcrypto/evp/bio_enc.c6
-rw-r--r--src/lib/libcrypto/evp/bio_md.c16
-rw-r--r--src/lib/libcrypto/evp/c_all.c2
-rw-r--r--src/lib/libcrypto/evp/c_allc.c5
-rw-r--r--src/lib/libcrypto/evp/c_alld.c8
-rw-r--r--src/lib/libcrypto/evp/dig_eng.c180
-rw-r--r--src/lib/libcrypto/evp/digest.c211
-rw-r--r--src/lib/libcrypto/evp/e_aes.c35
-rw-r--r--src/lib/libcrypto/evp/e_des.c91
-rw-r--r--src/lib/libcrypto/evp/e_des3.c95
-rw-r--r--src/lib/libcrypto/evp/e_idea.c2
-rw-r--r--src/lib/libcrypto/evp/e_null.c8
-rw-r--r--src/lib/libcrypto/evp/e_rc2.c5
-rw-r--r--src/lib/libcrypto/evp/e_rc4.c5
-rw-r--r--src/lib/libcrypto/evp/e_xcbc_d.c19
-rw-r--r--src/lib/libcrypto/evp/enc_min.c390
-rw-r--r--src/lib/libcrypto/evp/encode.c4
-rw-r--r--src/lib/libcrypto/evp/evp.h539
-rw-r--r--src/lib/libcrypto/evp/evp_cnf.c125
-rw-r--r--src/lib/libcrypto/evp/evp_enc.c267
-rw-r--r--src/lib/libcrypto/evp/evp_err.c60
-rw-r--r--src/lib/libcrypto/evp/evp_key.c9
-rw-r--r--src/lib/libcrypto/evp/evp_lib.c44
-rw-r--r--src/lib/libcrypto/evp/evp_locl.h155
-rw-r--r--src/lib/libcrypto/evp/evp_pbe.c266
-rw-r--r--src/lib/libcrypto/evp/evp_pkey.c646
-rw-r--r--src/lib/libcrypto/evp/evp_test.c6
-rw-r--r--src/lib/libcrypto/evp/m_dss.c2
-rw-r--r--src/lib/libcrypto/evp/m_dss1.c5
-rw-r--r--src/lib/libcrypto/evp/m_md2.c1
-rw-r--r--src/lib/libcrypto/evp/m_md4.c1
-rw-r--r--src/lib/libcrypto/evp/m_md5.c1
-rw-r--r--src/lib/libcrypto/evp/m_mdc2.c3
-rw-r--r--src/lib/libcrypto/evp/m_sha.c1
-rw-r--r--src/lib/libcrypto/evp/m_sha1.c17
-rw-r--r--src/lib/libcrypto/evp/names.c87
-rw-r--r--src/lib/libcrypto/evp/p5_crpt.c39
-rw-r--r--src/lib/libcrypto/evp/p5_crpt2.c86
-rw-r--r--src/lib/libcrypto/evp/p_dec.c4
-rw-r--r--src/lib/libcrypto/evp/p_enc.c4
-rw-r--r--src/lib/libcrypto/evp/p_lib.c394
-rw-r--r--src/lib/libcrypto/evp/p_open.c2
-rw-r--r--src/lib/libcrypto/evp/p_seal.c2
-rw-r--r--src/lib/libcrypto/evp/p_sign.c47
-rw-r--r--src/lib/libcrypto/evp/p_verify.c44
48 files changed, 2227 insertions, 3630 deletions
diff --git a/src/lib/libcrypto/evp/Makefile b/src/lib/libcrypto/evp/Makefile
index c204f84c1d..82825e5299 100644
--- a/src/lib/libcrypto/evp/Makefile
+++ b/src/lib/libcrypto/evp/Makefile
@@ -18,34 +18,34 @@ TESTDATA=evptests.txt
18APPS= 18APPS=
19 19
20LIB=$(TOP)/libcrypto.a 20LIB=$(TOP)/libcrypto.a
21LIBSRC= encode.c digest.c dig_eng.c evp_enc.c evp_key.c evp_acnf.c evp_cnf.c \ 21LIBSRC= encode.c digest.c evp_enc.c evp_key.c evp_acnf.c \
22 e_des.c e_bf.c e_idea.c e_des3.c e_camellia.c\ 22 e_des.c e_bf.c e_idea.c e_des3.c e_camellia.c\
23 e_rc4.c e_aes.c names.c e_seed.c \ 23 e_rc4.c e_aes.c names.c e_seed.c \
24 e_xcbc_d.c e_rc2.c e_cast.c e_rc5.c enc_min.c \ 24 e_xcbc_d.c e_rc2.c e_cast.c e_rc5.c \
25 m_null.c m_md2.c m_md4.c m_md5.c m_sha.c m_sha1.c \ 25 m_null.c m_md2.c m_md4.c m_md5.c m_sha.c m_sha1.c m_wp.c \
26 m_dss.c m_dss1.c m_mdc2.c m_ripemd.c m_ecdsa.c\ 26 m_dss.c m_dss1.c m_mdc2.c m_ripemd.c m_ecdsa.c\
27 p_open.c p_seal.c p_sign.c p_verify.c p_lib.c p_enc.c p_dec.c \ 27 p_open.c p_seal.c p_sign.c p_verify.c p_lib.c p_enc.c p_dec.c \
28 bio_md.c bio_b64.c bio_enc.c evp_err.c e_null.c \ 28 bio_md.c bio_b64.c bio_enc.c evp_err.c e_null.c \
29 c_all.c c_allc.c c_alld.c evp_lib.c bio_ok.c \ 29 c_all.c c_allc.c c_alld.c evp_lib.c bio_ok.c \
30 evp_pkey.c evp_pbe.c p5_crpt.c p5_crpt2.c \ 30 evp_pkey.c evp_pbe.c p5_crpt.c p5_crpt2.c \
31 e_old.c 31 e_old.c pmeth_lib.c pmeth_fn.c pmeth_gn.c m_sigver.c
32 32
33LIBOBJ= encode.o digest.o dig_eng.o evp_enc.o evp_key.o evp_acnf.o evp_cnf.o \ 33LIBOBJ= encode.o digest.o evp_enc.o evp_key.o evp_acnf.o \
34 e_des.o e_bf.o e_idea.o e_des3.o e_camellia.o\ 34 e_des.o e_bf.o e_idea.o e_des3.o e_camellia.o\
35 e_rc4.o e_aes.o names.o e_seed.o \ 35 e_rc4.o e_aes.o names.o e_seed.o \
36 e_xcbc_d.o e_rc2.o e_cast.o e_rc5.o enc_min.o \ 36 e_xcbc_d.o e_rc2.o e_cast.o e_rc5.o \
37 m_null.o m_md2.o m_md4.o m_md5.o m_sha.o m_sha1.o \ 37 m_null.o m_md2.o m_md4.o m_md5.o m_sha.o m_sha1.o m_wp.o \
38 m_dss.o m_dss1.o m_mdc2.o m_ripemd.o m_ecdsa.o\ 38 m_dss.o m_dss1.o m_mdc2.o m_ripemd.o m_ecdsa.o\
39 p_open.o p_seal.o p_sign.o p_verify.o p_lib.o p_enc.o p_dec.o \ 39 p_open.o p_seal.o p_sign.o p_verify.o p_lib.o p_enc.o p_dec.o \
40 bio_md.o bio_b64.o bio_enc.o evp_err.o e_null.o \ 40 bio_md.o bio_b64.o bio_enc.o evp_err.o e_null.o \
41 c_all.o c_allc.o c_alld.o evp_lib.o bio_ok.o \ 41 c_all.o c_allc.o c_alld.o evp_lib.o bio_ok.o \
42 evp_pkey.o evp_pbe.o p5_crpt.o p5_crpt2.o \ 42 evp_pkey.o evp_pbe.o p5_crpt.o p5_crpt2.o \
43 e_old.o 43 e_old.o pmeth_lib.o pmeth_fn.o pmeth_gn.o m_sigver.o
44 44
45SRC= $(LIBSRC) 45SRC= $(LIBSRC)
46 46
47EXHEADER= evp.h 47EXHEADER= evp.h
48HEADER= $(EXHEADER) 48HEADER= evp_locl.h $(EXHEADER)
49 49
50ALL= $(GENERAL) $(SRC) $(HEADER) 50ALL= $(GENERAL) $(SRC) $(HEADER)
51 51
@@ -55,7 +55,7 @@ top:
55all: lib 55all: lib
56 56
57lib: $(LIBOBJ) 57lib: $(LIBOBJ)
58 $(ARX) $(LIB) $(LIBOBJ) 58 $(AR) $(LIB) $(LIBOBJ)
59 $(RANLIB) $(LIB) || echo Never mind. 59 $(RANLIB) $(LIB) || echo Never mind.
60 @touch lib 60 @touch lib
61 61
@@ -101,201 +101,185 @@ bio_b64.o: ../../e_os.h ../../include/openssl/asn1.h
101bio_b64.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h 101bio_b64.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
102bio_b64.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h 102bio_b64.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
103bio_b64.o: ../../include/openssl/err.h ../../include/openssl/evp.h 103bio_b64.o: ../../include/openssl/err.h ../../include/openssl/evp.h
104bio_b64.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h 104bio_b64.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
105bio_b64.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 105bio_b64.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
106bio_b64.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 106bio_b64.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
107bio_b64.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h 107bio_b64.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
108bio_b64.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 108bio_b64.o: ../../include/openssl/symhacks.h ../cryptlib.h bio_b64.c
109bio_b64.o: ../cryptlib.h bio_b64.c
110bio_enc.o: ../../e_os.h ../../include/openssl/asn1.h 109bio_enc.o: ../../e_os.h ../../include/openssl/asn1.h
111bio_enc.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h 110bio_enc.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
112bio_enc.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h 111bio_enc.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
113bio_enc.o: ../../include/openssl/err.h ../../include/openssl/evp.h 112bio_enc.o: ../../include/openssl/err.h ../../include/openssl/evp.h
114bio_enc.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h 113bio_enc.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
115bio_enc.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 114bio_enc.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
116bio_enc.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 115bio_enc.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
117bio_enc.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h 116bio_enc.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
118bio_enc.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 117bio_enc.o: ../../include/openssl/symhacks.h ../cryptlib.h bio_enc.c
119bio_enc.o: ../cryptlib.h bio_enc.c
120bio_md.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h 118bio_md.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
121bio_md.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 119bio_md.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
122bio_md.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 120bio_md.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
123bio_md.o: ../../include/openssl/evp.h ../../include/openssl/fips.h 121bio_md.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
124bio_md.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h 122bio_md.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
125bio_md.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 123bio_md.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
126bio_md.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 124bio_md.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
127bio_md.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 125bio_md.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
128bio_md.o: ../../include/openssl/symhacks.h ../cryptlib.h bio_md.c 126bio_md.o: ../cryptlib.h bio_md.c
129bio_ok.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h 127bio_ok.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
130bio_ok.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 128bio_ok.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
131bio_ok.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 129bio_ok.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
132bio_ok.o: ../../include/openssl/evp.h ../../include/openssl/fips.h 130bio_ok.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
133bio_ok.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h 131bio_ok.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
134bio_ok.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 132bio_ok.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
135bio_ok.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 133bio_ok.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rand.h
136bio_ok.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h 134bio_ok.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
137bio_ok.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 135bio_ok.o: ../../include/openssl/symhacks.h ../cryptlib.h bio_ok.c
138bio_ok.o: ../cryptlib.h bio_ok.c
139c_all.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h 136c_all.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
140c_all.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 137c_all.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
141c_all.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h 138c_all.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
142c_all.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h 139c_all.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
143c_all.o: ../../include/openssl/engine.h ../../include/openssl/err.h 140c_all.o: ../../include/openssl/engine.h ../../include/openssl/err.h
144c_all.o: ../../include/openssl/evp.h ../../include/openssl/fips.h 141c_all.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
145c_all.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h 142c_all.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
146c_all.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 143c_all.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
147c_all.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 144c_all.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
148c_all.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h 145c_all.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
149c_all.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 146c_all.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
150c_all.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h 147c_all.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
151c_all.o: ../../include/openssl/x509_vfy.h ../cryptlib.h c_all.c 148c_all.o: ../cryptlib.h c_all.c
152c_allc.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h 149c_allc.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
153c_allc.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 150c_allc.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
154c_allc.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h 151c_allc.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
155c_allc.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h 152c_allc.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
156c_allc.o: ../../include/openssl/err.h ../../include/openssl/evp.h 153c_allc.o: ../../include/openssl/err.h ../../include/openssl/evp.h
157c_allc.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h 154c_allc.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
158c_allc.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 155c_allc.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
159c_allc.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 156c_allc.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
160c_allc.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs12.h 157c_allc.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h
161c_allc.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h 158c_allc.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
162c_allc.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 159c_allc.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
163c_allc.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h 160c_allc.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
164c_allc.o: ../../include/openssl/x509_vfy.h ../cryptlib.h c_allc.c 161c_allc.o: ../cryptlib.h c_allc.c
165c_alld.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h 162c_alld.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
166c_alld.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 163c_alld.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
167c_alld.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h 164c_alld.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
168c_alld.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h 165c_alld.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
169c_alld.o: ../../include/openssl/err.h ../../include/openssl/evp.h 166c_alld.o: ../../include/openssl/err.h ../../include/openssl/evp.h
170c_alld.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h 167c_alld.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
171c_alld.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 168c_alld.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
172c_alld.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 169c_alld.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
173c_alld.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs12.h 170c_alld.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h
174c_alld.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h 171c_alld.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
175c_alld.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 172c_alld.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
176c_alld.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h 173c_alld.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
177c_alld.o: ../../include/openssl/x509_vfy.h ../cryptlib.h c_alld.c 174c_alld.o: ../cryptlib.h c_alld.c
178dig_eng.o: ../../e_os.h ../../include/openssl/asn1.h
179dig_eng.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
180dig_eng.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
181dig_eng.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
182dig_eng.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
183dig_eng.o: ../../include/openssl/err.h ../../include/openssl/evp.h
184dig_eng.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
185dig_eng.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
186dig_eng.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
187dig_eng.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
188dig_eng.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
189dig_eng.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
190dig_eng.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
191dig_eng.o: ../cryptlib.h dig_eng.c evp_locl.h
192digest.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h 175digest.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
193digest.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 176digest.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
194digest.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h 177digest.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
195digest.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h 178digest.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
196digest.o: ../../include/openssl/engine.h ../../include/openssl/err.h 179digest.o: ../../include/openssl/engine.h ../../include/openssl/err.h
197digest.o: ../../include/openssl/evp.h ../../include/openssl/fips.h 180digest.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
198digest.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h 181digest.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
199digest.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 182digest.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
200digest.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 183digest.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
201digest.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h 184digest.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
202digest.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 185digest.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
203digest.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h 186digest.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
204digest.o: ../../include/openssl/x509_vfy.h ../cryptlib.h digest.c evp_locl.h 187digest.o: ../cryptlib.h digest.c
205e_aes.o: ../../include/openssl/aes.h ../../include/openssl/asn1.h 188e_aes.o: ../../include/openssl/aes.h ../../include/openssl/asn1.h
206e_aes.o: ../../include/openssl/bio.h ../../include/openssl/crypto.h 189e_aes.o: ../../include/openssl/bio.h ../../include/openssl/crypto.h
207e_aes.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 190e_aes.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
208e_aes.o: ../../include/openssl/evp.h ../../include/openssl/fips.h 191e_aes.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
209e_aes.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h 192e_aes.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
210e_aes.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 193e_aes.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
211e_aes.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 194e_aes.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
212e_aes.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 195e_aes.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h e_aes.c
213e_aes.o: ../../include/openssl/symhacks.h e_aes.c evp_locl.h 196e_aes.o: evp_locl.h
214e_bf.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h 197e_bf.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
215e_bf.o: ../../include/openssl/blowfish.h ../../include/openssl/buffer.h 198e_bf.o: ../../include/openssl/blowfish.h ../../include/openssl/buffer.h
216e_bf.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h 199e_bf.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
217e_bf.o: ../../include/openssl/err.h ../../include/openssl/evp.h 200e_bf.o: ../../include/openssl/err.h ../../include/openssl/evp.h
218e_bf.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h 201e_bf.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
219e_bf.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 202e_bf.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
220e_bf.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 203e_bf.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
221e_bf.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h 204e_bf.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
222e_bf.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 205e_bf.o: ../../include/openssl/symhacks.h ../cryptlib.h e_bf.c evp_locl.h
223e_bf.o: ../cryptlib.h e_bf.c evp_locl.h 206e_camellia.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
224e_camellia.o: ../../include/openssl/opensslconf.h e_camellia.c 207e_camellia.o: ../../include/openssl/camellia.h ../../include/openssl/crypto.h
208e_camellia.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
209e_camellia.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
210e_camellia.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
211e_camellia.o: ../../include/openssl/opensslconf.h
212e_camellia.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
213e_camellia.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
214e_camellia.o: ../../include/openssl/symhacks.h e_camellia.c evp_locl.h
225e_cast.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h 215e_cast.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
226e_cast.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 216e_cast.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
227e_cast.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h 217e_cast.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
228e_cast.o: ../../include/openssl/err.h ../../include/openssl/evp.h 218e_cast.o: ../../include/openssl/err.h ../../include/openssl/evp.h
229e_cast.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h 219e_cast.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
230e_cast.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 220e_cast.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
231e_cast.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 221e_cast.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
232e_cast.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h 222e_cast.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
233e_cast.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 223e_cast.o: ../../include/openssl/symhacks.h ../cryptlib.h e_cast.c evp_locl.h
234e_cast.o: ../cryptlib.h e_cast.c evp_locl.h
235e_des.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h 224e_des.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
236e_des.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 225e_des.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
237e_des.o: ../../include/openssl/des.h ../../include/openssl/des_old.h 226e_des.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
238e_des.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 227e_des.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
239e_des.o: ../../include/openssl/evp.h ../../include/openssl/fips.h 228e_des.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
240e_des.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h 229e_des.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
241e_des.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 230e_des.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
242e_des.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 231e_des.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rand.h
243e_des.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h 232e_des.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
244e_des.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 233e_des.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
245e_des.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h 234e_des.o: ../../include/openssl/ui_compat.h ../cryptlib.h e_des.c evp_locl.h
246e_des.o: ../cryptlib.h e_des.c evp_locl.h
247e_des3.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h 235e_des3.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
248e_des3.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 236e_des3.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
249e_des3.o: ../../include/openssl/des.h ../../include/openssl/des_old.h 237e_des3.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
250e_des3.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 238e_des3.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
251e_des3.o: ../../include/openssl/evp.h ../../include/openssl/fips.h 239e_des3.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
252e_des3.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h 240e_des3.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
253e_des3.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 241e_des3.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
254e_des3.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 242e_des3.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rand.h
255e_des3.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h 243e_des3.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
256e_des3.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 244e_des3.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
257e_des3.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h 245e_des3.o: ../../include/openssl/ui_compat.h ../cryptlib.h e_des3.c evp_locl.h
258e_des3.o: ../cryptlib.h e_des3.c evp_locl.h
259e_idea.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h 246e_idea.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
260e_idea.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 247e_idea.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
261e_idea.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 248e_idea.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
262e_idea.o: ../../include/openssl/evp.h ../../include/openssl/fips.h 249e_idea.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
263e_idea.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h 250e_idea.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
264e_idea.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 251e_idea.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
265e_idea.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 252e_idea.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
266e_idea.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h 253e_idea.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
267e_idea.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 254e_idea.o: ../../include/openssl/symhacks.h ../cryptlib.h e_idea.c evp_locl.h
268e_idea.o: ../cryptlib.h e_idea.c evp_locl.h
269e_null.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h 255e_null.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
270e_null.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 256e_null.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
271e_null.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 257e_null.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
272e_null.o: ../../include/openssl/evp.h ../../include/openssl/fips.h 258e_null.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
273e_null.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h 259e_null.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
274e_null.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 260e_null.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
275e_null.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 261e_null.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
276e_null.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 262e_null.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
277e_null.o: ../../include/openssl/symhacks.h ../cryptlib.h e_null.c 263e_null.o: ../cryptlib.h e_null.c
278e_old.o: e_old.c 264e_old.o: e_old.c
279e_rc2.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h 265e_rc2.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
280e_rc2.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 266e_rc2.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
281e_rc2.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 267e_rc2.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
282e_rc2.o: ../../include/openssl/evp.h ../../include/openssl/fips.h 268e_rc2.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
283e_rc2.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h 269e_rc2.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
284e_rc2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 270e_rc2.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
285e_rc2.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 271e_rc2.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rc2.h
286e_rc2.o: ../../include/openssl/rc2.h ../../include/openssl/safestack.h 272e_rc2.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
287e_rc2.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 273e_rc2.o: ../../include/openssl/symhacks.h ../cryptlib.h e_rc2.c evp_locl.h
288e_rc2.o: ../cryptlib.h e_rc2.c evp_locl.h
289e_rc4.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h 274e_rc4.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
290e_rc4.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 275e_rc4.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
291e_rc4.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 276e_rc4.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
292e_rc4.o: ../../include/openssl/evp.h ../../include/openssl/fips.h 277e_rc4.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
293e_rc4.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h 278e_rc4.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
294e_rc4.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 279e_rc4.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
295e_rc4.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 280e_rc4.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rc4.h
296e_rc4.o: ../../include/openssl/rc4.h ../../include/openssl/safestack.h 281e_rc4.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
297e_rc4.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 282e_rc4.o: ../../include/openssl/symhacks.h ../cryptlib.h e_rc4.c
298e_rc4.o: ../cryptlib.h e_rc4.c evp_locl.h
299e_rc5.o: ../../e_os.h ../../include/openssl/bio.h 283e_rc5.o: ../../e_os.h ../../include/openssl/bio.h
300e_rc5.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 284e_rc5.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
301e_rc5.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 285e_rc5.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
@@ -306,256 +290,221 @@ e_rc5.o: ../../include/openssl/symhacks.h ../cryptlib.h e_rc5.c
306e_seed.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 290e_seed.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
307e_seed.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h 291e_seed.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
308e_seed.o: ../../include/openssl/err.h ../../include/openssl/evp.h 292e_seed.o: ../../include/openssl/err.h ../../include/openssl/evp.h
309e_seed.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h 293e_seed.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
310e_seed.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 294e_seed.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
311e_seed.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 295e_seed.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
312e_seed.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h 296e_seed.o: ../../include/openssl/safestack.h ../../include/openssl/seed.h
313e_seed.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 297e_seed.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
314e_seed.o: e_seed.c 298e_seed.o: e_seed.c evp_locl.h
315e_xcbc_d.o: ../../e_os.h ../../include/openssl/asn1.h 299e_xcbc_d.o: ../../e_os.h ../../include/openssl/asn1.h
316e_xcbc_d.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h 300e_xcbc_d.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
317e_xcbc_d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h 301e_xcbc_d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
318e_xcbc_d.o: ../../include/openssl/des_old.h ../../include/openssl/e_os2.h 302e_xcbc_d.o: ../../include/openssl/des_old.h ../../include/openssl/e_os2.h
319e_xcbc_d.o: ../../include/openssl/err.h ../../include/openssl/evp.h 303e_xcbc_d.o: ../../include/openssl/err.h ../../include/openssl/evp.h
320e_xcbc_d.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h 304e_xcbc_d.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
321e_xcbc_d.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 305e_xcbc_d.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
322e_xcbc_d.o: ../../include/openssl/opensslconf.h
323e_xcbc_d.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 306e_xcbc_d.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
324e_xcbc_d.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 307e_xcbc_d.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
325e_xcbc_d.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h 308e_xcbc_d.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
326e_xcbc_d.o: ../../include/openssl/ui_compat.h ../cryptlib.h e_xcbc_d.c 309e_xcbc_d.o: ../../include/openssl/ui_compat.h ../cryptlib.h e_xcbc_d.c
327enc_min.o: ../../e_os.h ../../include/openssl/asn1.h 310e_xcbc_d.o: evp_locl.h
328enc_min.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
329enc_min.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
330enc_min.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
331enc_min.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
332enc_min.o: ../../include/openssl/err.h ../../include/openssl/evp.h
333enc_min.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
334enc_min.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
335enc_min.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
336enc_min.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
337enc_min.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h
338enc_min.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
339enc_min.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
340enc_min.o: ../../include/openssl/x509_vfy.h ../cryptlib.h enc_min.c evp_locl.h
341encode.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h 311encode.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
342encode.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 312encode.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
343encode.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 313encode.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
344encode.o: ../../include/openssl/evp.h ../../include/openssl/fips.h 314encode.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
345encode.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h 315encode.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
346encode.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 316encode.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
347encode.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 317encode.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
348encode.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 318encode.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
349encode.o: ../../include/openssl/symhacks.h ../cryptlib.h encode.c 319encode.o: ../cryptlib.h encode.c
350evp_acnf.o: ../../e_os.h ../../include/openssl/asn1.h 320evp_acnf.o: ../../e_os.h ../../include/openssl/asn1.h
351evp_acnf.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h 321evp_acnf.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
352evp_acnf.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h 322evp_acnf.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
353evp_acnf.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 323evp_acnf.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
354evp_acnf.o: ../../include/openssl/evp.h ../../include/openssl/fips.h 324evp_acnf.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
355evp_acnf.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h 325evp_acnf.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
356evp_acnf.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 326evp_acnf.o: ../../include/openssl/opensslconf.h
357evp_acnf.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 327evp_acnf.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
358evp_acnf.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 328evp_acnf.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
359evp_acnf.o: ../../include/openssl/symhacks.h ../cryptlib.h evp_acnf.c 329evp_acnf.o: ../../include/openssl/symhacks.h ../cryptlib.h evp_acnf.c
360evp_cnf.o: ../../e_os.h ../../include/openssl/asn1.h
361evp_cnf.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
362evp_cnf.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
363evp_cnf.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h
364evp_cnf.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
365evp_cnf.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
366evp_cnf.o: ../../include/openssl/evp.h ../../include/openssl/fips.h
367evp_cnf.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
368evp_cnf.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
369evp_cnf.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
370evp_cnf.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
371evp_cnf.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
372evp_cnf.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
373evp_cnf.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
374evp_cnf.o: ../cryptlib.h evp_cnf.c
375evp_enc.o: ../../e_os.h ../../include/openssl/asn1.h 330evp_enc.o: ../../e_os.h ../../include/openssl/asn1.h
376evp_enc.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h 331evp_enc.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
377evp_enc.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h 332evp_enc.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
378evp_enc.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h 333evp_enc.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
379evp_enc.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h 334evp_enc.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
380evp_enc.o: ../../include/openssl/err.h ../../include/openssl/evp.h 335evp_enc.o: ../../include/openssl/err.h ../../include/openssl/evp.h
381evp_enc.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h 336evp_enc.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
382evp_enc.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 337evp_enc.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
383evp_enc.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 338evp_enc.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
384evp_enc.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h 339evp_enc.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
385evp_enc.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h 340evp_enc.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
386evp_enc.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 341evp_enc.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
387evp_enc.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h 342evp_enc.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
388evp_enc.o: ../../include/openssl/x509_vfy.h ../cryptlib.h evp_enc.c evp_locl.h 343evp_enc.o: ../cryptlib.h evp_enc.c evp_locl.h
389evp_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 344evp_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
390evp_err.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h 345evp_err.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
391evp_err.o: ../../include/openssl/err.h ../../include/openssl/evp.h 346evp_err.o: ../../include/openssl/err.h ../../include/openssl/evp.h
392evp_err.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h 347evp_err.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
393evp_err.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 348evp_err.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
394evp_err.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 349evp_err.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
395evp_err.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h 350evp_err.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
396evp_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 351evp_err.o: ../../include/openssl/symhacks.h evp_err.c
397evp_err.o: evp_err.c
398evp_key.o: ../../e_os.h ../../include/openssl/asn1.h 352evp_key.o: ../../e_os.h ../../include/openssl/asn1.h
399evp_key.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h 353evp_key.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
400evp_key.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h 354evp_key.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
401evp_key.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h 355evp_key.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
402evp_key.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h 356evp_key.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
403evp_key.o: ../../include/openssl/evp.h ../../include/openssl/fips.h 357evp_key.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
404evp_key.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h 358evp_key.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
405evp_key.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 359evp_key.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
406evp_key.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 360evp_key.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
407evp_key.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h 361evp_key.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
408evp_key.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 362evp_key.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
409evp_key.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h 363evp_key.o: ../../include/openssl/ui.h ../../include/openssl/x509.h
410evp_key.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 364evp_key.o: ../../include/openssl/x509_vfy.h ../cryptlib.h evp_key.c
411evp_key.o: ../cryptlib.h evp_key.c
412evp_lib.o: ../../e_os.h ../../include/openssl/asn1.h 365evp_lib.o: ../../e_os.h ../../include/openssl/asn1.h
413evp_lib.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h 366evp_lib.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
414evp_lib.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h 367evp_lib.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
415evp_lib.o: ../../include/openssl/err.h ../../include/openssl/evp.h 368evp_lib.o: ../../include/openssl/err.h ../../include/openssl/evp.h
416evp_lib.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h 369evp_lib.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
417evp_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 370evp_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
418evp_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 371evp_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
419evp_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h 372evp_lib.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
420evp_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 373evp_lib.o: ../../include/openssl/symhacks.h ../cryptlib.h evp_lib.c
421evp_lib.o: ../cryptlib.h evp_lib.c
422evp_pbe.o: ../../e_os.h ../../include/openssl/asn1.h 374evp_pbe.o: ../../e_os.h ../../include/openssl/asn1.h
423evp_pbe.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h 375evp_pbe.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
424evp_pbe.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h 376evp_pbe.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
425evp_pbe.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h 377evp_pbe.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
426evp_pbe.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h 378evp_pbe.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
427evp_pbe.o: ../../include/openssl/evp.h ../../include/openssl/fips.h 379evp_pbe.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
428evp_pbe.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h 380evp_pbe.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
429evp_pbe.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 381evp_pbe.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
430evp_pbe.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 382evp_pbe.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs12.h
431evp_pbe.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h 383evp_pbe.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
432evp_pbe.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 384evp_pbe.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
433evp_pbe.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h 385evp_pbe.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
434evp_pbe.o: ../../include/openssl/x509_vfy.h ../cryptlib.h evp_pbe.c 386evp_pbe.o: ../../include/openssl/x509_vfy.h ../cryptlib.h evp_pbe.c
435evp_pkey.o: ../../e_os.h ../../include/openssl/asn1.h 387evp_pkey.o: ../../e_os.h ../../include/openssl/asn1.h
436evp_pkey.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 388evp_pkey.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
437evp_pkey.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 389evp_pkey.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
438evp_pkey.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
439evp_pkey.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h 390evp_pkey.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
440evp_pkey.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h 391evp_pkey.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
441evp_pkey.o: ../../include/openssl/evp.h ../../include/openssl/fips.h 392evp_pkey.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
442evp_pkey.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h 393evp_pkey.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
443evp_pkey.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 394evp_pkey.o: ../../include/openssl/opensslconf.h
444evp_pkey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 395evp_pkey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
445evp_pkey.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h 396evp_pkey.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
446evp_pkey.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 397evp_pkey.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
447evp_pkey.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 398evp_pkey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
448evp_pkey.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h 399evp_pkey.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
449evp_pkey.o: ../../include/openssl/x509_vfy.h ../cryptlib.h evp_pkey.c 400evp_pkey.o: ../asn1/asn1_locl.h ../cryptlib.h evp_pkey.c
450m_dss.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h 401m_dss.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
451m_dss.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 402m_dss.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
452m_dss.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h 403m_dss.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
453m_dss.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h 404m_dss.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
454m_dss.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h 405m_dss.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
455m_dss.o: ../../include/openssl/evp.h ../../include/openssl/fips.h 406m_dss.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
456m_dss.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h 407m_dss.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
457m_dss.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 408m_dss.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
458m_dss.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 409m_dss.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
459m_dss.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h 410m_dss.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
460m_dss.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 411m_dss.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
461m_dss.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h 412m_dss.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
462m_dss.o: ../../include/openssl/x509_vfy.h ../cryptlib.h m_dss.c 413m_dss.o: ../cryptlib.h m_dss.c
463m_dss1.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h 414m_dss1.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
464m_dss1.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 415m_dss1.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
465m_dss1.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h 416m_dss1.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
466m_dss1.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h 417m_dss1.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
467m_dss1.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h 418m_dss1.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
468m_dss1.o: ../../include/openssl/evp.h ../../include/openssl/fips.h 419m_dss1.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
469m_dss1.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h 420m_dss1.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
470m_dss1.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 421m_dss1.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
471m_dss1.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 422m_dss1.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
472m_dss1.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h 423m_dss1.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
473m_dss1.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 424m_dss1.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
474m_dss1.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h 425m_dss1.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
475m_dss1.o: ../../include/openssl/x509_vfy.h ../cryptlib.h m_dss1.c 426m_dss1.o: ../cryptlib.h m_dss1.c
476m_ecdsa.o: ../../e_os.h ../../include/openssl/asn1.h 427m_ecdsa.o: ../../e_os.h ../../include/openssl/asn1.h
477m_ecdsa.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h 428m_ecdsa.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
478m_ecdsa.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h 429m_ecdsa.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
479m_ecdsa.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h 430m_ecdsa.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
480m_ecdsa.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h 431m_ecdsa.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
481m_ecdsa.o: ../../include/openssl/evp.h ../../include/openssl/fips.h 432m_ecdsa.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
482m_ecdsa.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h 433m_ecdsa.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
483m_ecdsa.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 434m_ecdsa.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
484m_ecdsa.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 435m_ecdsa.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
485m_ecdsa.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h 436m_ecdsa.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
486m_ecdsa.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 437m_ecdsa.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
487m_ecdsa.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h 438m_ecdsa.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
488m_ecdsa.o: ../../include/openssl/x509_vfy.h ../cryptlib.h m_ecdsa.c 439m_ecdsa.o: ../cryptlib.h m_ecdsa.c
489m_md2.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h 440m_md2.o: ../../e_os.h ../../include/openssl/bio.h
490m_md2.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 441m_md2.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
491m_md2.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h 442m_md2.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
492m_md2.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h 443m_md2.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
493m_md2.o: ../../include/openssl/err.h ../../include/openssl/evp.h
494m_md2.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
495m_md2.o: ../../include/openssl/md2.h ../../include/openssl/obj_mac.h
496m_md2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
497m_md2.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 444m_md2.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
498m_md2.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h 445m_md2.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
499m_md2.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 446m_md2.o: ../../include/openssl/symhacks.h ../cryptlib.h m_md2.c
500m_md2.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
501m_md2.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
502m_md2.o: ../cryptlib.h evp_locl.h m_md2.c
503m_md4.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h 447m_md4.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
504m_md4.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 448m_md4.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
505m_md4.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h 449m_md4.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
506m_md4.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h 450m_md4.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
507m_md4.o: ../../include/openssl/err.h ../../include/openssl/evp.h 451m_md4.o: ../../include/openssl/err.h ../../include/openssl/evp.h
508m_md4.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h 452m_md4.o: ../../include/openssl/lhash.h ../../include/openssl/md4.h
509m_md4.o: ../../include/openssl/md4.h ../../include/openssl/obj_mac.h 453m_md4.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
510m_md4.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 454m_md4.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
511m_md4.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 455m_md4.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
512m_md4.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h 456m_md4.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
513m_md4.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 457m_md4.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
514m_md4.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 458m_md4.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
515m_md4.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 459m_md4.o: ../../include/openssl/x509_vfy.h ../cryptlib.h m_md4.c
516m_md4.o: ../cryptlib.h evp_locl.h m_md4.c
517m_md5.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h 460m_md5.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
518m_md5.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 461m_md5.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
519m_md5.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h 462m_md5.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
520m_md5.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h 463m_md5.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
521m_md5.o: ../../include/openssl/err.h ../../include/openssl/evp.h 464m_md5.o: ../../include/openssl/err.h ../../include/openssl/evp.h
522m_md5.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h 465m_md5.o: ../../include/openssl/lhash.h ../../include/openssl/md5.h
523m_md5.o: ../../include/openssl/md5.h ../../include/openssl/obj_mac.h 466m_md5.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
524m_md5.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 467m_md5.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
525m_md5.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 468m_md5.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
526m_md5.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h 469m_md5.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
527m_md5.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 470m_md5.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
528m_md5.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 471m_md5.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
529m_md5.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 472m_md5.o: ../../include/openssl/x509_vfy.h ../cryptlib.h m_md5.c
530m_md5.o: ../cryptlib.h evp_locl.h m_md5.c 473m_mdc2.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
531m_mdc2.o: ../../e_os.h ../../include/openssl/bio.h
532m_mdc2.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 474m_mdc2.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
533m_mdc2.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 475m_mdc2.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
534m_mdc2.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h 476m_mdc2.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
535m_mdc2.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 477m_mdc2.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
536m_mdc2.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 478m_mdc2.o: ../../include/openssl/err.h ../../include/openssl/evp.h
537m_mdc2.o: ../../include/openssl/symhacks.h ../cryptlib.h evp_locl.h m_mdc2.c 479m_mdc2.o: ../../include/openssl/lhash.h ../../include/openssl/mdc2.h
480m_mdc2.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
481m_mdc2.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
482m_mdc2.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
483m_mdc2.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
484m_mdc2.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
485m_mdc2.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
486m_mdc2.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
487m_mdc2.o: ../../include/openssl/x509_vfy.h ../cryptlib.h m_mdc2.c
538m_null.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h 488m_null.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
539m_null.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 489m_null.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
540m_null.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h 490m_null.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
541m_null.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h 491m_null.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
542m_null.o: ../../include/openssl/err.h ../../include/openssl/evp.h 492m_null.o: ../../include/openssl/err.h ../../include/openssl/evp.h
543m_null.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h 493m_null.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
544m_null.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 494m_null.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
545m_null.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 495m_null.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
546m_null.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h 496m_null.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
547m_null.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 497m_null.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
548m_null.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 498m_null.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
549m_null.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 499m_null.o: ../../include/openssl/x509_vfy.h ../cryptlib.h m_null.c
550m_null.o: ../cryptlib.h m_null.c
551m_ripemd.o: ../../e_os.h ../../include/openssl/asn1.h 500m_ripemd.o: ../../e_os.h ../../include/openssl/asn1.h
552m_ripemd.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h 501m_ripemd.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
553m_ripemd.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h 502m_ripemd.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
554m_ripemd.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h 503m_ripemd.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
555m_ripemd.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h 504m_ripemd.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
556m_ripemd.o: ../../include/openssl/evp.h ../../include/openssl/fips.h 505m_ripemd.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
557m_ripemd.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h 506m_ripemd.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
558m_ripemd.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 507m_ripemd.o: ../../include/openssl/opensslconf.h
559m_ripemd.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 508m_ripemd.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
560m_ripemd.o: ../../include/openssl/pkcs7.h ../../include/openssl/ripemd.h 509m_ripemd.o: ../../include/openssl/pkcs7.h ../../include/openssl/ripemd.h
561m_ripemd.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 510m_ripemd.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
@@ -567,62 +516,87 @@ m_sha.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
567m_sha.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h 516m_sha.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
568m_sha.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h 517m_sha.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
569m_sha.o: ../../include/openssl/err.h ../../include/openssl/evp.h 518m_sha.o: ../../include/openssl/err.h ../../include/openssl/evp.h
570m_sha.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h 519m_sha.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
571m_sha.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 520m_sha.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
572m_sha.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 521m_sha.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
573m_sha.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h 522m_sha.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
574m_sha.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 523m_sha.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
575m_sha.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 524m_sha.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
576m_sha.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h 525m_sha.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
577m_sha.o: ../../include/openssl/x509_vfy.h ../cryptlib.h evp_locl.h m_sha.c 526m_sha.o: ../cryptlib.h m_sha.c
578m_sha1.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h 527m_sha1.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
579m_sha1.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 528m_sha1.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
580m_sha1.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h 529m_sha1.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
581m_sha1.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h 530m_sha1.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
582m_sha1.o: ../../include/openssl/err.h ../../include/openssl/evp.h 531m_sha1.o: ../../include/openssl/err.h ../../include/openssl/evp.h
583m_sha1.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h 532m_sha1.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
584m_sha1.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 533m_sha1.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
585m_sha1.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 534m_sha1.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
586m_sha1.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h 535m_sha1.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
587m_sha1.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 536m_sha1.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
588m_sha1.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 537m_sha1.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
589m_sha1.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h 538m_sha1.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
590m_sha1.o: ../../include/openssl/x509_vfy.h ../cryptlib.h m_sha1.c 539m_sha1.o: ../cryptlib.h m_sha1.c
540m_sigver.o: ../../e_os.h ../../include/openssl/asn1.h
541m_sigver.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
542m_sigver.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
543m_sigver.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
544m_sigver.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
545m_sigver.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
546m_sigver.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
547m_sigver.o: ../../include/openssl/opensslconf.h
548m_sigver.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
549m_sigver.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
550m_sigver.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
551m_sigver.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
552m_sigver.o: ../../include/openssl/x509_vfy.h ../cryptlib.h evp_locl.h
553m_sigver.o: m_sigver.c
554m_wp.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
555m_wp.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
556m_wp.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
557m_wp.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
558m_wp.o: ../../include/openssl/err.h ../../include/openssl/evp.h
559m_wp.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
560m_wp.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
561m_wp.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
562m_wp.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
563m_wp.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
564m_wp.o: ../../include/openssl/symhacks.h ../../include/openssl/whrlpool.h
565m_wp.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
566m_wp.o: ../cryptlib.h m_wp.c
591names.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h 567names.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
592names.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 568names.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
593names.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h 569names.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
594names.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h 570names.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
595names.o: ../../include/openssl/err.h ../../include/openssl/evp.h 571names.o: ../../include/openssl/err.h ../../include/openssl/evp.h
596names.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h 572names.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
597names.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 573names.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
598names.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 574names.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
599names.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h 575names.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
600names.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 576names.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
601names.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 577names.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
602names.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 578names.o: ../../include/openssl/x509_vfy.h ../cryptlib.h names.c
603names.o: ../cryptlib.h names.c
604p5_crpt.o: ../../e_os.h ../../include/openssl/asn1.h 579p5_crpt.o: ../../e_os.h ../../include/openssl/asn1.h
605p5_crpt.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h 580p5_crpt.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
606p5_crpt.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h 581p5_crpt.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
607p5_crpt.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h 582p5_crpt.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
608p5_crpt.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h 583p5_crpt.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
609p5_crpt.o: ../../include/openssl/evp.h ../../include/openssl/fips.h 584p5_crpt.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
610p5_crpt.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h 585p5_crpt.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
611p5_crpt.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 586p5_crpt.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
612p5_crpt.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 587p5_crpt.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
613p5_crpt.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h 588p5_crpt.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
614p5_crpt.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 589p5_crpt.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
615p5_crpt.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h 590p5_crpt.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
616p5_crpt.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p5_crpt.c 591p5_crpt.o: ../cryptlib.h p5_crpt.c
617p5_crpt2.o: ../../e_os.h ../../include/openssl/asn1.h 592p5_crpt2.o: ../../e_os.h ../../include/openssl/asn1.h
618p5_crpt2.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h 593p5_crpt2.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
619p5_crpt2.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h 594p5_crpt2.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
620p5_crpt2.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h 595p5_crpt2.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
621p5_crpt2.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h 596p5_crpt2.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
622p5_crpt2.o: ../../include/openssl/evp.h ../../include/openssl/fips.h 597p5_crpt2.o: ../../include/openssl/evp.h ../../include/openssl/hmac.h
623p5_crpt2.o: ../../include/openssl/hmac.h ../../include/openssl/lhash.h 598p5_crpt2.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
624p5_crpt2.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 599p5_crpt2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
625p5_crpt2.o: ../../include/openssl/opensslconf.h
626p5_crpt2.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 600p5_crpt2.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
627p5_crpt2.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h 601p5_crpt2.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
628p5_crpt2.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 602p5_crpt2.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
@@ -633,37 +607,35 @@ p_dec.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
633p_dec.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h 607p_dec.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
634p_dec.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h 608p_dec.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
635p_dec.o: ../../include/openssl/err.h ../../include/openssl/evp.h 609p_dec.o: ../../include/openssl/err.h ../../include/openssl/evp.h
636p_dec.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h 610p_dec.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
637p_dec.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 611p_dec.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
638p_dec.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 612p_dec.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
639p_dec.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h 613p_dec.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
640p_dec.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h 614p_dec.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
641p_dec.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 615p_dec.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
642p_dec.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 616p_dec.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
643p_dec.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 617p_dec.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p_dec.c
644p_dec.o: ../cryptlib.h p_dec.c
645p_enc.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h 618p_enc.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
646p_enc.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 619p_enc.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
647p_enc.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h 620p_enc.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
648p_enc.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h 621p_enc.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
649p_enc.o: ../../include/openssl/err.h ../../include/openssl/evp.h 622p_enc.o: ../../include/openssl/err.h ../../include/openssl/evp.h
650p_enc.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h 623p_enc.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
651p_enc.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 624p_enc.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
652p_enc.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 625p_enc.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
653p_enc.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h 626p_enc.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
654p_enc.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h 627p_enc.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
655p_enc.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 628p_enc.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
656p_enc.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 629p_enc.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
657p_enc.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 630p_enc.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p_enc.c
658p_enc.o: ../cryptlib.h p_enc.c
659p_lib.o: ../../e_os.h ../../include/openssl/asn1.h 631p_lib.o: ../../e_os.h ../../include/openssl/asn1.h
660p_lib.o: ../../include/openssl/asn1_mac.h ../../include/openssl/bio.h 632p_lib.o: ../../include/openssl/asn1_mac.h ../../include/openssl/bio.h
661p_lib.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 633p_lib.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
662p_lib.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h 634p_lib.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
663p_lib.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h 635p_lib.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
664p_lib.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h 636p_lib.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
665p_lib.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h 637p_lib.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
666p_lib.o: ../../include/openssl/evp.h ../../include/openssl/fips.h 638p_lib.o: ../../include/openssl/err.h ../../include/openssl/evp.h
667p_lib.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h 639p_lib.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
668p_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 640p_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
669p_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 641p_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
@@ -671,57 +643,91 @@ p_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
671p_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 643p_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
672p_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 644p_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
673p_lib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 645p_lib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
674p_lib.o: ../cryptlib.h p_lib.c 646p_lib.o: ../asn1/asn1_locl.h ../cryptlib.h p_lib.c
675p_open.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h 647p_open.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
676p_open.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 648p_open.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
677p_open.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h 649p_open.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
678p_open.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h 650p_open.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
679p_open.o: ../../include/openssl/err.h ../../include/openssl/evp.h 651p_open.o: ../../include/openssl/err.h ../../include/openssl/evp.h
680p_open.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h 652p_open.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
681p_open.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 653p_open.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
682p_open.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 654p_open.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
683p_open.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h 655p_open.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
684p_open.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 656p_open.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
685p_open.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 657p_open.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
686p_open.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h 658p_open.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
687p_open.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p_open.c 659p_open.o: ../cryptlib.h p_open.c
688p_seal.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h 660p_seal.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
689p_seal.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 661p_seal.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
690p_seal.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h 662p_seal.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
691p_seal.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h 663p_seal.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
692p_seal.o: ../../include/openssl/err.h ../../include/openssl/evp.h 664p_seal.o: ../../include/openssl/err.h ../../include/openssl/evp.h
693p_seal.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h 665p_seal.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
694p_seal.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 666p_seal.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
695p_seal.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 667p_seal.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
696p_seal.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h 668p_seal.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
697p_seal.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h 669p_seal.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
698p_seal.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 670p_seal.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
699p_seal.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 671p_seal.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
700p_seal.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 672p_seal.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p_seal.c
701p_seal.o: ../cryptlib.h p_seal.c
702p_sign.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h 673p_sign.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
703p_sign.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 674p_sign.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
704p_sign.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h 675p_sign.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
705p_sign.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h 676p_sign.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
706p_sign.o: ../../include/openssl/err.h ../../include/openssl/evp.h 677p_sign.o: ../../include/openssl/err.h ../../include/openssl/evp.h
707p_sign.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h 678p_sign.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
708p_sign.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 679p_sign.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
709p_sign.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 680p_sign.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
710p_sign.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h 681p_sign.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
711p_sign.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 682p_sign.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
712p_sign.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 683p_sign.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
713p_sign.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 684p_sign.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p_sign.c
714p_sign.o: ../cryptlib.h p_sign.c
715p_verify.o: ../../e_os.h ../../include/openssl/asn1.h 685p_verify.o: ../../e_os.h ../../include/openssl/asn1.h
716p_verify.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h 686p_verify.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
717p_verify.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h 687p_verify.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
718p_verify.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h 688p_verify.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
719p_verify.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h 689p_verify.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
720p_verify.o: ../../include/openssl/evp.h ../../include/openssl/fips.h 690p_verify.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
721p_verify.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h 691p_verify.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
722p_verify.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 692p_verify.o: ../../include/openssl/opensslconf.h
723p_verify.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 693p_verify.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
724p_verify.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h 694p_verify.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
725p_verify.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 695p_verify.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
726p_verify.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h 696p_verify.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
727p_verify.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p_verify.c 697p_verify.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p_verify.c
698pmeth_fn.o: ../../e_os.h ../../include/openssl/asn1.h
699pmeth_fn.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
700pmeth_fn.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
701pmeth_fn.o: ../../include/openssl/err.h ../../include/openssl/evp.h
702pmeth_fn.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
703pmeth_fn.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
704pmeth_fn.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
705pmeth_fn.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
706pmeth_fn.o: ../../include/openssl/symhacks.h ../cryptlib.h evp_locl.h
707pmeth_fn.o: pmeth_fn.c
708pmeth_gn.o: ../../e_os.h ../../include/openssl/asn1.h
709pmeth_gn.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
710pmeth_gn.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
711pmeth_gn.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
712pmeth_gn.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
713pmeth_gn.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
714pmeth_gn.o: ../../include/openssl/opensslconf.h
715pmeth_gn.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
716pmeth_gn.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
717pmeth_gn.o: ../../include/openssl/symhacks.h ../cryptlib.h evp_locl.h
718pmeth_gn.o: pmeth_gn.c
719pmeth_lib.o: ../../e_os.h ../../include/openssl/asn1.h
720pmeth_lib.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
721pmeth_lib.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
722pmeth_lib.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
723pmeth_lib.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
724pmeth_lib.o: ../../include/openssl/err.h ../../include/openssl/evp.h
725pmeth_lib.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
726pmeth_lib.o: ../../include/openssl/objects.h
727pmeth_lib.o: ../../include/openssl/opensslconf.h
728pmeth_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
729pmeth_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
730pmeth_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
731pmeth_lib.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
732pmeth_lib.o: ../../include/openssl/x509_vfy.h ../asn1/asn1_locl.h ../cryptlib.h
733pmeth_lib.o: evp_locl.h pmeth_lib.c
diff --git a/src/lib/libcrypto/evp/Makefile.ssl b/src/lib/libcrypto/evp/Makefile.ssl
deleted file mode 100644
index f33aebd33a..0000000000
--- a/src/lib/libcrypto/evp/Makefile.ssl
+++ /dev/null
@@ -1,1059 +0,0 @@
1#
2# SSLeay/crypto/evp/Makefile
3#
4
5DIR= evp
6TOP= ../..
7CC= cc
8INCLUDES= -I.. -I$(TOP) -I../../include
9CFLAG=-g
10INSTALL_PREFIX=
11OPENSSLDIR= /usr/local/ssl
12INSTALLTOP=/usr/local/ssl
13MAKE= make -f Makefile.ssl
14MAKEDEPPROG= makedepend
15MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
16MAKEFILE= Makefile.ssl
17AR= ar r
18
19CFLAGS= $(INCLUDES) $(CFLAG)
20
21GENERAL=Makefile
22TEST=evp_test.c
23TESTDATA=evptests.txt
24APPS=
25
26LIB=$(TOP)/libcrypto.a
27LIBSRC= encode.c digest.c evp_enc.c evp_key.c evp_acnf.c \
28 e_des.c e_bf.c e_idea.c e_des3.c \
29 e_rc4.c e_aes.c names.c \
30 e_xcbc_d.c e_rc2.c e_cast.c e_rc5.c \
31 m_null.c m_md2.c m_md4.c m_md5.c m_sha.c m_sha1.c \
32 m_dss.c m_dss1.c m_mdc2.c m_ripemd.c \
33 p_open.c p_seal.c p_sign.c p_verify.c p_lib.c p_enc.c p_dec.c \
34 bio_md.c bio_b64.c bio_enc.c evp_err.c e_null.c \
35 c_all.c c_allc.c c_alld.c evp_lib.c bio_ok.c \
36 evp_pkey.c evp_pbe.c p5_crpt.c p5_crpt2.c
37
38LIBOBJ= encode.o digest.o evp_enc.o evp_key.o evp_acnf.o \
39 e_des.o e_bf.o e_idea.o e_des3.o \
40 e_rc4.o e_aes.o names.o \
41 e_xcbc_d.o e_rc2.o e_cast.o e_rc5.o \
42 m_null.o m_md2.o m_md4.o m_md5.o m_sha.o m_sha1.o \
43 m_dss.o m_dss1.o m_mdc2.o m_ripemd.o \
44 p_open.o p_seal.o p_sign.o p_verify.o p_lib.o p_enc.o p_dec.o \
45 bio_md.o bio_b64.o bio_enc.o evp_err.o e_null.o \
46 c_all.o c_allc.o c_alld.o evp_lib.o bio_ok.o \
47 evp_pkey.o evp_pbe.o p5_crpt.o p5_crpt2.o
48
49SRC= $(LIBSRC)
50
51EXHEADER= evp.h
52HEADER= $(EXHEADER)
53
54ALL= $(GENERAL) $(SRC) $(HEADER)
55
56top:
57 (cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all)
58
59all: lib
60
61lib: $(LIBOBJ)
62 $(AR) $(LIB) $(LIBOBJ)
63 $(RANLIB) $(LIB) || echo Never mind.
64 @touch lib
65
66files:
67 $(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
68
69links:
70 @sh $(TOP)/util/point.sh Makefile.ssl Makefile
71 @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
72 @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
73 cp $(TESTDATA) ../../test
74 @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
75
76install:
77 @for i in $(EXHEADER) ; \
78 do \
79 (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
80 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
81 done;
82
83tags:
84 ctags $(SRC)
85
86tests:
87
88lint:
89 lint -DLINT $(INCLUDES) $(SRC)>fluff
90
91depend:
92 $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(LIBSRC)
93
94dclean:
95 $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
96 mv -f Makefile.new $(MAKEFILE)
97
98clean:
99 rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
100
101# DO NOT DELETE THIS LINE -- make depend depends on it.
102
103bio_b64.o: ../../e_os.h ../../include/openssl/aes.h
104bio_b64.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
105bio_b64.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
106bio_b64.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
107bio_b64.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
108bio_b64.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
109bio_b64.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
110bio_b64.o: ../../include/openssl/err.h ../../include/openssl/evp.h
111bio_b64.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
112bio_b64.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
113bio_b64.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
114bio_b64.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
115bio_b64.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
116bio_b64.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rc2.h
117bio_b64.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
118bio_b64.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
119bio_b64.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
120bio_b64.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
121bio_b64.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
122bio_b64.o: ../cryptlib.h bio_b64.c
123bio_enc.o: ../../e_os.h ../../include/openssl/aes.h
124bio_enc.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
125bio_enc.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
126bio_enc.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
127bio_enc.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
128bio_enc.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
129bio_enc.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
130bio_enc.o: ../../include/openssl/err.h ../../include/openssl/evp.h
131bio_enc.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
132bio_enc.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
133bio_enc.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
134bio_enc.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
135bio_enc.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
136bio_enc.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rc2.h
137bio_enc.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
138bio_enc.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
139bio_enc.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
140bio_enc.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
141bio_enc.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
142bio_enc.o: ../cryptlib.h bio_enc.c
143bio_md.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
144bio_md.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
145bio_md.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
146bio_md.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
147bio_md.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
148bio_md.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
149bio_md.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
150bio_md.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
151bio_md.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
152bio_md.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
153bio_md.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
154bio_md.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
155bio_md.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
156bio_md.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
157bio_md.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
158bio_md.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
159bio_md.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
160bio_md.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
161bio_md.o: ../../include/openssl/ui_compat.h ../cryptlib.h bio_md.c
162bio_ok.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
163bio_ok.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
164bio_ok.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
165bio_ok.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
166bio_ok.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
167bio_ok.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
168bio_ok.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
169bio_ok.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
170bio_ok.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
171bio_ok.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
172bio_ok.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
173bio_ok.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
174bio_ok.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
175bio_ok.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h
176bio_ok.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
177bio_ok.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
178bio_ok.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
179bio_ok.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
180bio_ok.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
181bio_ok.o: ../cryptlib.h bio_ok.c
182c_all.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
183c_all.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
184c_all.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
185c_all.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
186c_all.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
187c_all.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
188c_all.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h
189c_all.o: ../../include/openssl/err.h ../../include/openssl/evp.h
190c_all.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
191c_all.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
192c_all.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
193c_all.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
194c_all.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
195c_all.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rand.h
196c_all.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
197c_all.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
198c_all.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
199c_all.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
200c_all.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
201c_all.o: ../../include/openssl/ui_compat.h ../cryptlib.h c_all.c
202c_allc.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
203c_allc.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
204c_allc.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
205c_allc.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
206c_allc.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
207c_allc.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
208c_allc.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
209c_allc.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
210c_allc.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
211c_allc.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
212c_allc.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
213c_allc.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
214c_allc.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
215c_allc.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h
216c_allc.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
217c_allc.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
218c_allc.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
219c_allc.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
220c_allc.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
221c_allc.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
222c_allc.o: ../../include/openssl/x509_vfy.h ../cryptlib.h c_allc.c
223c_alld.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
224c_alld.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
225c_alld.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
226c_alld.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
227c_alld.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
228c_alld.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
229c_alld.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
230c_alld.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
231c_alld.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
232c_alld.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
233c_alld.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
234c_alld.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
235c_alld.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
236c_alld.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h
237c_alld.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
238c_alld.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
239c_alld.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
240c_alld.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
241c_alld.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
242c_alld.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
243c_alld.o: ../../include/openssl/x509_vfy.h ../cryptlib.h c_alld.c
244digest.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
245digest.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
246digest.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
247digest.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
248digest.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
249digest.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
250digest.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h
251digest.o: ../../include/openssl/err.h ../../include/openssl/evp.h
252digest.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
253digest.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
254digest.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
255digest.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
256digest.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
257digest.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rand.h
258digest.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
259digest.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
260digest.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
261digest.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
262digest.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
263digest.o: ../../include/openssl/ui_compat.h ../cryptlib.h digest.c
264e_aes.o: ../../include/openssl/aes.h ../../include/openssl/asn1.h
265e_aes.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
266e_aes.o: ../../include/openssl/bn.h ../../include/openssl/cast.h
267e_aes.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
268e_aes.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
269e_aes.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
270e_aes.o: ../../include/openssl/err.h ../../include/openssl/evp.h
271e_aes.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
272e_aes.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
273e_aes.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
274e_aes.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
275e_aes.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
276e_aes.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rc2.h
277e_aes.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
278e_aes.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
279e_aes.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
280e_aes.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
281e_aes.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h e_aes.c
282e_aes.o: evp_locl.h
283e_bf.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
284e_bf.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
285e_bf.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
286e_bf.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
287e_bf.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
288e_bf.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
289e_bf.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
290e_bf.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
291e_bf.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
292e_bf.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
293e_bf.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
294e_bf.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
295e_bf.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
296e_bf.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
297e_bf.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
298e_bf.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
299e_bf.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
300e_bf.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
301e_bf.o: ../../include/openssl/ui_compat.h ../cryptlib.h e_bf.c evp_locl.h
302e_cast.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
303e_cast.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
304e_cast.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
305e_cast.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
306e_cast.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
307e_cast.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
308e_cast.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
309e_cast.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
310e_cast.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
311e_cast.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
312e_cast.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
313e_cast.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
314e_cast.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
315e_cast.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
316e_cast.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
317e_cast.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
318e_cast.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
319e_cast.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
320e_cast.o: ../../include/openssl/ui_compat.h ../cryptlib.h e_cast.c evp_locl.h
321e_des.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
322e_des.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
323e_des.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
324e_des.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
325e_des.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
326e_des.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
327e_des.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
328e_des.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
329e_des.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
330e_des.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
331e_des.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
332e_des.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
333e_des.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
334e_des.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
335e_des.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
336e_des.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
337e_des.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
338e_des.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
339e_des.o: ../../include/openssl/ui_compat.h ../cryptlib.h e_des.c evp_locl.h
340e_des3.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
341e_des3.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
342e_des3.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
343e_des3.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
344e_des3.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
345e_des3.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
346e_des3.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
347e_des3.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
348e_des3.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
349e_des3.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
350e_des3.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
351e_des3.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
352e_des3.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
353e_des3.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
354e_des3.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
355e_des3.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
356e_des3.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
357e_des3.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
358e_des3.o: ../../include/openssl/ui_compat.h ../cryptlib.h e_des3.c evp_locl.h
359e_idea.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
360e_idea.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
361e_idea.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
362e_idea.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
363e_idea.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
364e_idea.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
365e_idea.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
366e_idea.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
367e_idea.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
368e_idea.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
369e_idea.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
370e_idea.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
371e_idea.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
372e_idea.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
373e_idea.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
374e_idea.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
375e_idea.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
376e_idea.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
377e_idea.o: ../../include/openssl/ui_compat.h ../cryptlib.h e_idea.c evp_locl.h
378e_null.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
379e_null.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
380e_null.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
381e_null.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
382e_null.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
383e_null.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
384e_null.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
385e_null.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
386e_null.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
387e_null.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
388e_null.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
389e_null.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
390e_null.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
391e_null.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
392e_null.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
393e_null.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
394e_null.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
395e_null.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
396e_null.o: ../../include/openssl/ui_compat.h ../cryptlib.h e_null.c
397e_rc2.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
398e_rc2.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
399e_rc2.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
400e_rc2.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
401e_rc2.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
402e_rc2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
403e_rc2.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
404e_rc2.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
405e_rc2.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
406e_rc2.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
407e_rc2.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
408e_rc2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
409e_rc2.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
410e_rc2.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
411e_rc2.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
412e_rc2.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
413e_rc2.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
414e_rc2.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
415e_rc2.o: ../../include/openssl/ui_compat.h ../cryptlib.h e_rc2.c evp_locl.h
416e_rc4.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
417e_rc4.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
418e_rc4.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
419e_rc4.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
420e_rc4.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
421e_rc4.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
422e_rc4.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
423e_rc4.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
424e_rc4.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
425e_rc4.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
426e_rc4.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
427e_rc4.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
428e_rc4.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
429e_rc4.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
430e_rc4.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
431e_rc4.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
432e_rc4.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
433e_rc4.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
434e_rc4.o: ../../include/openssl/ui_compat.h ../cryptlib.h e_rc4.c
435e_rc5.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
436e_rc5.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
437e_rc5.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
438e_rc5.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
439e_rc5.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
440e_rc5.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
441e_rc5.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
442e_rc5.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
443e_rc5.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
444e_rc5.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
445e_rc5.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
446e_rc5.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
447e_rc5.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
448e_rc5.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
449e_rc5.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
450e_rc5.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
451e_rc5.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
452e_rc5.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
453e_rc5.o: ../../include/openssl/ui_compat.h ../cryptlib.h e_rc5.c evp_locl.h
454e_xcbc_d.o: ../../e_os.h ../../include/openssl/aes.h
455e_xcbc_d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
456e_xcbc_d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
457e_xcbc_d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
458e_xcbc_d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
459e_xcbc_d.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
460e_xcbc_d.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
461e_xcbc_d.o: ../../include/openssl/err.h ../../include/openssl/evp.h
462e_xcbc_d.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
463e_xcbc_d.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
464e_xcbc_d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
465e_xcbc_d.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
466e_xcbc_d.o: ../../include/openssl/opensslconf.h
467e_xcbc_d.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
468e_xcbc_d.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
469e_xcbc_d.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
470e_xcbc_d.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
471e_xcbc_d.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
472e_xcbc_d.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
473e_xcbc_d.o: ../../include/openssl/ui_compat.h ../cryptlib.h e_xcbc_d.c
474encode.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
475encode.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
476encode.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
477encode.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
478encode.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
479encode.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
480encode.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
481encode.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
482encode.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
483encode.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
484encode.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
485encode.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
486encode.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
487encode.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
488encode.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
489encode.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
490encode.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
491encode.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
492encode.o: ../../include/openssl/ui_compat.h ../cryptlib.h encode.c
493evp_acnf.o: ../../e_os.h ../../include/openssl/aes.h
494evp_acnf.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
495evp_acnf.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
496evp_acnf.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
497evp_acnf.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
498evp_acnf.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
499evp_acnf.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
500evp_acnf.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
501evp_acnf.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
502evp_acnf.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
503evp_acnf.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
504evp_acnf.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
505evp_acnf.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
506evp_acnf.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
507evp_acnf.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
508evp_acnf.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
509evp_acnf.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
510evp_acnf.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
511evp_acnf.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
512evp_acnf.o: ../../include/openssl/ui_compat.h ../cryptlib.h evp_acnf.c
513evp_enc.o: ../../e_os.h ../../include/openssl/aes.h
514evp_enc.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
515evp_enc.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
516evp_enc.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
517evp_enc.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
518evp_enc.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
519evp_enc.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
520evp_enc.o: ../../include/openssl/engine.h ../../include/openssl/err.h
521evp_enc.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
522evp_enc.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
523evp_enc.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
524evp_enc.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
525evp_enc.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
526evp_enc.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
527evp_enc.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h
528evp_enc.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
529evp_enc.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
530evp_enc.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
531evp_enc.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
532evp_enc.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
533evp_enc.o: ../cryptlib.h evp_enc.c evp_locl.h
534evp_err.o: ../../include/openssl/aes.h ../../include/openssl/asn1.h
535evp_err.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
536evp_err.o: ../../include/openssl/bn.h ../../include/openssl/cast.h
537evp_err.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
538evp_err.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
539evp_err.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
540evp_err.o: ../../include/openssl/err.h ../../include/openssl/evp.h
541evp_err.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
542evp_err.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
543evp_err.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
544evp_err.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
545evp_err.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
546evp_err.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rc2.h
547evp_err.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
548evp_err.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
549evp_err.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
550evp_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
551evp_err.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
552evp_err.o: evp_err.c
553evp_key.o: ../../e_os.h ../../include/openssl/aes.h
554evp_key.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
555evp_key.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
556evp_key.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
557evp_key.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
558evp_key.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
559evp_key.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
560evp_key.o: ../../include/openssl/err.h ../../include/openssl/evp.h
561evp_key.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
562evp_key.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
563evp_key.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
564evp_key.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
565evp_key.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
566evp_key.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
567evp_key.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
568evp_key.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
569evp_key.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
570evp_key.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
571evp_key.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
572evp_key.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
573evp_key.o: ../../include/openssl/x509_vfy.h ../cryptlib.h evp_key.c
574evp_lib.o: ../../e_os.h ../../include/openssl/aes.h
575evp_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
576evp_lib.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
577evp_lib.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
578evp_lib.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
579evp_lib.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
580evp_lib.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
581evp_lib.o: ../../include/openssl/err.h ../../include/openssl/evp.h
582evp_lib.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
583evp_lib.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
584evp_lib.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
585evp_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
586evp_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
587evp_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rc2.h
588evp_lib.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
589evp_lib.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
590evp_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
591evp_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
592evp_lib.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
593evp_lib.o: ../cryptlib.h evp_lib.c
594evp_pbe.o: ../../e_os.h ../../include/openssl/aes.h
595evp_pbe.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
596evp_pbe.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
597evp_pbe.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
598evp_pbe.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
599evp_pbe.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
600evp_pbe.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
601evp_pbe.o: ../../include/openssl/err.h ../../include/openssl/evp.h
602evp_pbe.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
603evp_pbe.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
604evp_pbe.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
605evp_pbe.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
606evp_pbe.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
607evp_pbe.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
608evp_pbe.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
609evp_pbe.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
610evp_pbe.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
611evp_pbe.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
612evp_pbe.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
613evp_pbe.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
614evp_pbe.o: ../../include/openssl/x509_vfy.h ../cryptlib.h evp_pbe.c
615evp_pkey.o: ../../e_os.h ../../include/openssl/aes.h
616evp_pkey.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
617evp_pkey.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
618evp_pkey.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
619evp_pkey.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
620evp_pkey.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
621evp_pkey.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
622evp_pkey.o: ../../include/openssl/err.h ../../include/openssl/evp.h
623evp_pkey.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
624evp_pkey.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
625evp_pkey.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
626evp_pkey.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
627evp_pkey.o: ../../include/openssl/opensslconf.h
628evp_pkey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
629evp_pkey.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
630evp_pkey.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
631evp_pkey.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
632evp_pkey.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
633evp_pkey.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
634evp_pkey.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
635evp_pkey.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
636evp_pkey.o: ../../include/openssl/x509_vfy.h ../cryptlib.h evp_pkey.c
637m_dss.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
638m_dss.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
639m_dss.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
640m_dss.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
641m_dss.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
642m_dss.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
643m_dss.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
644m_dss.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
645m_dss.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
646m_dss.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
647m_dss.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
648m_dss.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
649m_dss.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
650m_dss.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
651m_dss.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
652m_dss.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
653m_dss.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
654m_dss.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
655m_dss.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
656m_dss.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
657m_dss.o: ../cryptlib.h m_dss.c
658m_dss1.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
659m_dss1.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
660m_dss1.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
661m_dss1.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
662m_dss1.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
663m_dss1.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
664m_dss1.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
665m_dss1.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
666m_dss1.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
667m_dss1.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
668m_dss1.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
669m_dss1.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
670m_dss1.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
671m_dss1.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
672m_dss1.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
673m_dss1.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
674m_dss1.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
675m_dss1.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
676m_dss1.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
677m_dss1.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
678m_dss1.o: ../cryptlib.h m_dss1.c
679m_md2.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
680m_md2.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
681m_md2.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
682m_md2.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
683m_md2.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
684m_md2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
685m_md2.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
686m_md2.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
687m_md2.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
688m_md2.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
689m_md2.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
690m_md2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
691m_md2.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
692m_md2.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
693m_md2.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
694m_md2.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
695m_md2.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
696m_md2.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
697m_md2.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
698m_md2.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
699m_md2.o: ../cryptlib.h m_md2.c
700m_md4.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
701m_md4.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
702m_md4.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
703m_md4.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
704m_md4.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
705m_md4.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
706m_md4.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
707m_md4.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
708m_md4.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
709m_md4.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
710m_md4.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
711m_md4.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
712m_md4.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
713m_md4.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
714m_md4.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
715m_md4.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
716m_md4.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
717m_md4.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
718m_md4.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
719m_md4.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
720m_md4.o: ../cryptlib.h m_md4.c
721m_md5.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
722m_md5.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
723m_md5.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
724m_md5.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
725m_md5.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
726m_md5.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
727m_md5.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
728m_md5.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
729m_md5.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
730m_md5.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
731m_md5.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
732m_md5.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
733m_md5.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
734m_md5.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
735m_md5.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
736m_md5.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
737m_md5.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
738m_md5.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
739m_md5.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
740m_md5.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
741m_md5.o: ../cryptlib.h m_md5.c
742m_mdc2.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
743m_mdc2.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
744m_mdc2.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
745m_mdc2.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
746m_mdc2.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
747m_mdc2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
748m_mdc2.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
749m_mdc2.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
750m_mdc2.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
751m_mdc2.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
752m_mdc2.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
753m_mdc2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
754m_mdc2.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
755m_mdc2.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
756m_mdc2.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
757m_mdc2.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
758m_mdc2.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
759m_mdc2.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
760m_mdc2.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
761m_mdc2.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
762m_mdc2.o: ../cryptlib.h m_mdc2.c
763m_null.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
764m_null.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
765m_null.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
766m_null.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
767m_null.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
768m_null.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
769m_null.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
770m_null.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
771m_null.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
772m_null.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
773m_null.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
774m_null.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
775m_null.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
776m_null.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
777m_null.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
778m_null.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
779m_null.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
780m_null.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
781m_null.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
782m_null.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
783m_null.o: ../cryptlib.h m_null.c
784m_ripemd.o: ../../e_os.h ../../include/openssl/aes.h
785m_ripemd.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
786m_ripemd.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
787m_ripemd.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
788m_ripemd.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
789m_ripemd.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
790m_ripemd.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
791m_ripemd.o: ../../include/openssl/err.h ../../include/openssl/evp.h
792m_ripemd.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
793m_ripemd.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
794m_ripemd.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
795m_ripemd.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
796m_ripemd.o: ../../include/openssl/opensslconf.h
797m_ripemd.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
798m_ripemd.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
799m_ripemd.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
800m_ripemd.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
801m_ripemd.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
802m_ripemd.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
803m_ripemd.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
804m_ripemd.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
805m_ripemd.o: ../cryptlib.h m_ripemd.c
806m_sha.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
807m_sha.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
808m_sha.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
809m_sha.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
810m_sha.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
811m_sha.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
812m_sha.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
813m_sha.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
814m_sha.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
815m_sha.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
816m_sha.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
817m_sha.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
818m_sha.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
819m_sha.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
820m_sha.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
821m_sha.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
822m_sha.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
823m_sha.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
824m_sha.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
825m_sha.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
826m_sha.o: ../cryptlib.h m_sha.c
827m_sha1.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
828m_sha1.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
829m_sha1.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
830m_sha1.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
831m_sha1.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
832m_sha1.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
833m_sha1.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
834m_sha1.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
835m_sha1.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
836m_sha1.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
837m_sha1.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
838m_sha1.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
839m_sha1.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
840m_sha1.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
841m_sha1.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
842m_sha1.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
843m_sha1.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
844m_sha1.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
845m_sha1.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
846m_sha1.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
847m_sha1.o: ../cryptlib.h m_sha1.c
848names.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
849names.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
850names.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
851names.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
852names.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
853names.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
854names.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
855names.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
856names.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
857names.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
858names.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
859names.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
860names.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
861names.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
862names.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
863names.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
864names.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
865names.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
866names.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
867names.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
868names.o: ../cryptlib.h names.c
869p5_crpt.o: ../../e_os.h ../../include/openssl/aes.h
870p5_crpt.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
871p5_crpt.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
872p5_crpt.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
873p5_crpt.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
874p5_crpt.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
875p5_crpt.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
876p5_crpt.o: ../../include/openssl/err.h ../../include/openssl/evp.h
877p5_crpt.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
878p5_crpt.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
879p5_crpt.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
880p5_crpt.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
881p5_crpt.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
882p5_crpt.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
883p5_crpt.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
884p5_crpt.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
885p5_crpt.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
886p5_crpt.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
887p5_crpt.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
888p5_crpt.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
889p5_crpt.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p5_crpt.c
890p5_crpt2.o: ../../e_os.h ../../include/openssl/aes.h
891p5_crpt2.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
892p5_crpt2.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
893p5_crpt2.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
894p5_crpt2.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
895p5_crpt2.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
896p5_crpt2.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
897p5_crpt2.o: ../../include/openssl/err.h ../../include/openssl/evp.h
898p5_crpt2.o: ../../include/openssl/hmac.h ../../include/openssl/idea.h
899p5_crpt2.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
900p5_crpt2.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
901p5_crpt2.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
902p5_crpt2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
903p5_crpt2.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
904p5_crpt2.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
905p5_crpt2.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
906p5_crpt2.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
907p5_crpt2.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
908p5_crpt2.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
909p5_crpt2.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
910p5_crpt2.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
911p5_crpt2.o: ../cryptlib.h p5_crpt2.c
912p_dec.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
913p_dec.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
914p_dec.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
915p_dec.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
916p_dec.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
917p_dec.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
918p_dec.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
919p_dec.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
920p_dec.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
921p_dec.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
922p_dec.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
923p_dec.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
924p_dec.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
925p_dec.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
926p_dec.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
927p_dec.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
928p_dec.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
929p_dec.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
930p_dec.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
931p_dec.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
932p_dec.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p_dec.c
933p_enc.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
934p_enc.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
935p_enc.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
936p_enc.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
937p_enc.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
938p_enc.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
939p_enc.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
940p_enc.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
941p_enc.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
942p_enc.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
943p_enc.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
944p_enc.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
945p_enc.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
946p_enc.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
947p_enc.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
948p_enc.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
949p_enc.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
950p_enc.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
951p_enc.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
952p_enc.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
953p_enc.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p_enc.c
954p_lib.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
955p_lib.o: ../../include/openssl/asn1_mac.h ../../include/openssl/bio.h
956p_lib.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
957p_lib.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
958p_lib.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
959p_lib.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
960p_lib.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
961p_lib.o: ../../include/openssl/err.h ../../include/openssl/evp.h
962p_lib.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
963p_lib.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
964p_lib.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
965p_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
966p_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
967p_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
968p_lib.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
969p_lib.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
970p_lib.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
971p_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
972p_lib.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
973p_lib.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
974p_lib.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p_lib.c
975p_open.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
976p_open.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
977p_open.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
978p_open.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
979p_open.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
980p_open.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
981p_open.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
982p_open.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
983p_open.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
984p_open.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
985p_open.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
986p_open.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
987p_open.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
988p_open.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
989p_open.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
990p_open.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
991p_open.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
992p_open.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
993p_open.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
994p_open.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
995p_open.o: ../cryptlib.h p_open.c
996p_seal.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
997p_seal.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
998p_seal.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
999p_seal.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
1000p_seal.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
1001p_seal.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
1002p_seal.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
1003p_seal.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
1004p_seal.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
1005p_seal.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
1006p_seal.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
1007p_seal.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
1008p_seal.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
1009p_seal.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
1010p_seal.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
1011p_seal.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
1012p_seal.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
1013p_seal.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
1014p_seal.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
1015p_seal.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
1016p_seal.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p_seal.c
1017p_sign.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
1018p_sign.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
1019p_sign.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
1020p_sign.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
1021p_sign.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
1022p_sign.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
1023p_sign.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
1024p_sign.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
1025p_sign.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
1026p_sign.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
1027p_sign.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
1028p_sign.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
1029p_sign.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
1030p_sign.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
1031p_sign.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
1032p_sign.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
1033p_sign.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
1034p_sign.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
1035p_sign.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
1036p_sign.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
1037p_sign.o: ../cryptlib.h p_sign.c
1038p_verify.o: ../../e_os.h ../../include/openssl/aes.h
1039p_verify.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
1040p_verify.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
1041p_verify.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
1042p_verify.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
1043p_verify.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
1044p_verify.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
1045p_verify.o: ../../include/openssl/err.h ../../include/openssl/evp.h
1046p_verify.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
1047p_verify.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
1048p_verify.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
1049p_verify.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
1050p_verify.o: ../../include/openssl/opensslconf.h
1051p_verify.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
1052p_verify.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
1053p_verify.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
1054p_verify.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
1055p_verify.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
1056p_verify.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
1057p_verify.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
1058p_verify.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
1059p_verify.o: ../cryptlib.h p_verify.c
diff --git a/src/lib/libcrypto/evp/bio_b64.c b/src/lib/libcrypto/evp/bio_b64.c
index fa5cbc7eb1..72a2a67277 100644
--- a/src/lib/libcrypto/evp/bio_b64.c
+++ b/src/lib/libcrypto/evp/bio_b64.c
@@ -64,7 +64,7 @@
64 64
65static int b64_write(BIO *h, const char *buf, int num); 65static int b64_write(BIO *h, const char *buf, int num);
66static int b64_read(BIO *h, char *buf, int size); 66static int b64_read(BIO *h, char *buf, int size);
67/*static int b64_puts(BIO *h, const char *str); */ 67static int b64_puts(BIO *h, const char *str);
68/*static int b64_gets(BIO *h, char *str, int size); */ 68/*static int b64_gets(BIO *h, char *str, int size); */
69static long b64_ctrl(BIO *h, int cmd, long arg1, void *arg2); 69static long b64_ctrl(BIO *h, int cmd, long arg1, void *arg2);
70static int b64_new(BIO *h); 70static int b64_new(BIO *h);
@@ -96,7 +96,7 @@ static BIO_METHOD methods_b64=
96 BIO_TYPE_BASE64,"base64 encoding", 96 BIO_TYPE_BASE64,"base64 encoding",
97 b64_write, 97 b64_write,
98 b64_read, 98 b64_read,
99 NULL, /* b64_puts, */ 99 b64_puts,
100 NULL, /* b64_gets, */ 100 NULL, /* b64_gets, */
101 b64_ctrl, 101 b64_ctrl,
102 b64_new, 102 b64_new,
@@ -127,6 +127,7 @@ static int b64_new(BIO *bi)
127 bi->init=1; 127 bi->init=1;
128 bi->ptr=(char *)ctx; 128 bi->ptr=(char *)ctx;
129 bi->flags=0; 129 bi->flags=0;
130 bi->num = 0;
130 return(1); 131 return(1);
131 } 132 }
132 133
@@ -151,6 +152,8 @@ static int b64_read(BIO *b, char *out, int outl)
151 152
152 if ((ctx == NULL) || (b->next_bio == NULL)) return(0); 153 if ((ctx == NULL) || (b->next_bio == NULL)) return(0);
153 154
155 BIO_clear_retry_flags(b);
156
154 if (ctx->encode != B64_DECODE) 157 if (ctx->encode != B64_DECODE)
155 { 158 {
156 ctx->encode=B64_DECODE; 159 ctx->encode=B64_DECODE;
@@ -163,6 +166,7 @@ static int b64_read(BIO *b, char *out, int outl)
163 /* First check if there are bytes decoded/encoded */ 166 /* First check if there are bytes decoded/encoded */
164 if (ctx->buf_len > 0) 167 if (ctx->buf_len > 0)
165 { 168 {
169 OPENSSL_assert(ctx->buf_len >= ctx->buf_off);
166 i=ctx->buf_len-ctx->buf_off; 170 i=ctx->buf_len-ctx->buf_off;
167 if (i > outl) i=outl; 171 if (i > outl) i=outl;
168 OPENSSL_assert(ctx->buf_off+i < (int)sizeof(ctx->buf)); 172 OPENSSL_assert(ctx->buf_off+i < (int)sizeof(ctx->buf));
@@ -184,7 +188,6 @@ static int b64_read(BIO *b, char *out, int outl)
184 ret_code=0; 188 ret_code=0;
185 while (outl > 0) 189 while (outl > 0)
186 { 190 {
187
188 if (ctx->cont <= 0) 191 if (ctx->cont <= 0)
189 break; 192 break;
190 193
@@ -195,7 +198,7 @@ static int b64_read(BIO *b, char *out, int outl)
195 { 198 {
196 ret_code=i; 199 ret_code=i;
197 200
198 /* Should be continue next time we are called? */ 201 /* Should we continue next time we are called? */
199 if (!BIO_should_retry(b->next_bio)) 202 if (!BIO_should_retry(b->next_bio))
200 { 203 {
201 ctx->cont=i; 204 ctx->cont=i;
@@ -285,19 +288,27 @@ static int b64_read(BIO *b, char *out, int outl)
285 continue; 288 continue;
286 } 289 }
287 else 290 else
291 {
288 ctx->tmp_len=0; 292 ctx->tmp_len=0;
289 } 293 }
290 /* If buffer isn't full and we can retry then 294 }
291 * restart to read in more data.
292 */
293 else if ((i < B64_BLOCK_SIZE) && (ctx->cont > 0)) 295 else if ((i < B64_BLOCK_SIZE) && (ctx->cont > 0))
296 {
297 /* If buffer isn't full and we can retry then
298 * restart to read in more data.
299 */
294 continue; 300 continue;
301 }
295 302
296 if (BIO_get_flags(b) & BIO_FLAGS_BASE64_NO_NL) 303 if (BIO_get_flags(b) & BIO_FLAGS_BASE64_NO_NL)
297 { 304 {
298 int z,jj; 305 int z,jj;
299 306
307#if 0
300 jj=(i>>2)<<2; 308 jj=(i>>2)<<2;
309#else
310 jj = i & ~3; /* process per 4 */
311#endif
301 z=EVP_DecodeBlock((unsigned char *)ctx->buf, 312 z=EVP_DecodeBlock((unsigned char *)ctx->buf,
302 (unsigned char *)ctx->tmp,jj); 313 (unsigned char *)ctx->tmp,jj);
303 if (jj > 2) 314 if (jj > 2)
@@ -313,18 +324,15 @@ static int b64_read(BIO *b, char *out, int outl)
313 * number consumed */ 324 * number consumed */
314 if (jj != i) 325 if (jj != i)
315 { 326 {
316 memcpy((unsigned char *)ctx->tmp, 327 memmove(ctx->tmp, &ctx->tmp[jj], i-jj);
317 (unsigned char *)&(ctx->tmp[jj]),i-jj);
318 ctx->tmp_len=i-jj; 328 ctx->tmp_len=i-jj;
319 } 329 }
320 ctx->buf_len=0; 330 ctx->buf_len=0;
321 if (z > 0) 331 if (z > 0)
322 { 332 {
323 ctx->buf_len=z; 333 ctx->buf_len=z;
324 i=1;
325 } 334 }
326 else 335 i=z;
327 i=z;
328 } 336 }
329 else 337 else
330 { 338 {
@@ -357,14 +365,16 @@ static int b64_read(BIO *b, char *out, int outl)
357 outl-=i; 365 outl-=i;
358 out+=i; 366 out+=i;
359 } 367 }
360 BIO_clear_retry_flags(b); 368 /* BIO_clear_retry_flags(b); */
361 BIO_copy_next_retry(b); 369 BIO_copy_next_retry(b);
362 return((ret == 0)?ret_code:ret); 370 return((ret == 0)?ret_code:ret);
363 } 371 }
364 372
365static int b64_write(BIO *b, const char *in, int inl) 373static int b64_write(BIO *b, const char *in, int inl)
366 { 374 {
367 int ret=inl,n,i; 375 int ret=0;
376 int n;
377 int i;
368 BIO_B64_CTX *ctx; 378 BIO_B64_CTX *ctx;
369 379
370 ctx=(BIO_B64_CTX *)b->ptr; 380 ctx=(BIO_B64_CTX *)b->ptr;
@@ -379,6 +389,9 @@ static int b64_write(BIO *b, const char *in, int inl)
379 EVP_EncodeInit(&(ctx->base64)); 389 EVP_EncodeInit(&(ctx->base64));
380 } 390 }
381 391
392 OPENSSL_assert(ctx->buf_off < (int)sizeof(ctx->buf));
393 OPENSSL_assert(ctx->buf_len <= (int)sizeof(ctx->buf));
394 OPENSSL_assert(ctx->buf_len >= ctx->buf_off);
382 n=ctx->buf_len-ctx->buf_off; 395 n=ctx->buf_len-ctx->buf_off;
383 while (n > 0) 396 while (n > 0)
384 { 397 {
@@ -388,7 +401,10 @@ static int b64_write(BIO *b, const char *in, int inl)
388 BIO_copy_next_retry(b); 401 BIO_copy_next_retry(b);
389 return(i); 402 return(i);
390 } 403 }
404 OPENSSL_assert(i <= n);
391 ctx->buf_off+=i; 405 ctx->buf_off+=i;
406 OPENSSL_assert(ctx->buf_off <= (int)sizeof(ctx->buf));
407 OPENSSL_assert(ctx->buf_len >= ctx->buf_off);
392 n-=i; 408 n-=i;
393 } 409 }
394 /* at this point all pending data has been written */ 410 /* at this point all pending data has been written */
@@ -405,18 +421,19 @@ static int b64_write(BIO *b, const char *in, int inl)
405 { 421 {
406 if (ctx->tmp_len > 0) 422 if (ctx->tmp_len > 0)
407 { 423 {
424 OPENSSL_assert(ctx->tmp_len <= 3);
408 n=3-ctx->tmp_len; 425 n=3-ctx->tmp_len;
409 /* There's a teoretical possibility for this */ 426 /* There's a theoretical possibility for this */
410 if (n > inl) 427 if (n > inl)
411 n=inl; 428 n=inl;
412 memcpy(&(ctx->tmp[ctx->tmp_len]),in,n); 429 memcpy(&(ctx->tmp[ctx->tmp_len]),in,n);
413 ctx->tmp_len+=n; 430 ctx->tmp_len+=n;
431 ret += n;
414 if (ctx->tmp_len < 3) 432 if (ctx->tmp_len < 3)
415 break; 433 break;
416 ctx->buf_len=EVP_EncodeBlock( 434 ctx->buf_len=EVP_EncodeBlock((unsigned char *)ctx->buf,(unsigned char *)ctx->tmp,ctx->tmp_len);
417 (unsigned char *)ctx->buf, 435 OPENSSL_assert(ctx->buf_len <= (int)sizeof(ctx->buf));
418 (unsigned char *)ctx->tmp, 436 OPENSSL_assert(ctx->buf_len >= ctx->buf_off);
419 ctx->tmp_len);
420 /* Since we're now done using the temporary 437 /* Since we're now done using the temporary
421 buffer, the length should be 0'd */ 438 buffer, the length should be 0'd */
422 ctx->tmp_len=0; 439 ctx->tmp_len=0;
@@ -425,14 +442,16 @@ static int b64_write(BIO *b, const char *in, int inl)
425 { 442 {
426 if (n < 3) 443 if (n < 3)
427 { 444 {
428 memcpy(&(ctx->tmp[0]),in,n); 445 memcpy(ctx->tmp,in,n);
429 ctx->tmp_len=n; 446 ctx->tmp_len=n;
447 ret += n;
430 break; 448 break;
431 } 449 }
432 n-=n%3; 450 n-=n%3;
433 ctx->buf_len=EVP_EncodeBlock( 451 ctx->buf_len=EVP_EncodeBlock((unsigned char *)ctx->buf,(const unsigned char *)in,n);
434 (unsigned char *)ctx->buf, 452 OPENSSL_assert(ctx->buf_len <= (int)sizeof(ctx->buf));
435 (unsigned char *)in,n); 453 OPENSSL_assert(ctx->buf_len >= ctx->buf_off);
454 ret += n;
436 } 455 }
437 } 456 }
438 else 457 else
@@ -440,6 +459,9 @@ static int b64_write(BIO *b, const char *in, int inl)
440 EVP_EncodeUpdate(&(ctx->base64), 459 EVP_EncodeUpdate(&(ctx->base64),
441 (unsigned char *)ctx->buf,&ctx->buf_len, 460 (unsigned char *)ctx->buf,&ctx->buf_len,
442 (unsigned char *)in,n); 461 (unsigned char *)in,n);
462 OPENSSL_assert(ctx->buf_len <= (int)sizeof(ctx->buf));
463 OPENSSL_assert(ctx->buf_len >= ctx->buf_off);
464 ret += n;
443 } 465 }
444 inl-=n; 466 inl-=n;
445 in+=n; 467 in+=n;
@@ -454,8 +476,11 @@ static int b64_write(BIO *b, const char *in, int inl)
454 BIO_copy_next_retry(b); 476 BIO_copy_next_retry(b);
455 return((ret == 0)?i:ret); 477 return((ret == 0)?i:ret);
456 } 478 }
479 OPENSSL_assert(i <= n);
457 n-=i; 480 n-=i;
458 ctx->buf_off+=i; 481 ctx->buf_off+=i;
482 OPENSSL_assert(ctx->buf_off <= (int)sizeof(ctx->buf));
483 OPENSSL_assert(ctx->buf_len >= ctx->buf_off);
459 } 484 }
460 ctx->buf_len=0; 485 ctx->buf_len=0;
461 ctx->buf_off=0; 486 ctx->buf_off=0;
@@ -486,6 +511,7 @@ static long b64_ctrl(BIO *b, int cmd, long num, void *ptr)
486 ret=BIO_ctrl(b->next_bio,cmd,num,ptr); 511 ret=BIO_ctrl(b->next_bio,cmd,num,ptr);
487 break; 512 break;
488 case BIO_CTRL_WPENDING: /* More to write in buffer */ 513 case BIO_CTRL_WPENDING: /* More to write in buffer */
514 OPENSSL_assert(ctx->buf_len >= ctx->buf_off);
489 ret=ctx->buf_len-ctx->buf_off; 515 ret=ctx->buf_len-ctx->buf_off;
490 if ((ret == 0) && (ctx->encode != B64_NONE) 516 if ((ret == 0) && (ctx->encode != B64_NONE)
491 && (ctx->base64.num != 0)) 517 && (ctx->base64.num != 0))
@@ -494,6 +520,7 @@ static long b64_ctrl(BIO *b, int cmd, long num, void *ptr)
494 ret=BIO_ctrl(b->next_bio,cmd,num,ptr); 520 ret=BIO_ctrl(b->next_bio,cmd,num,ptr);
495 break; 521 break;
496 case BIO_CTRL_PENDING: /* More to read in buffer */ 522 case BIO_CTRL_PENDING: /* More to read in buffer */
523 OPENSSL_assert(ctx->buf_len >= ctx->buf_off);
497 ret=ctx->buf_len-ctx->buf_off; 524 ret=ctx->buf_len-ctx->buf_off;
498 if (ret <= 0) 525 if (ret <= 0)
499 ret=BIO_ctrl(b->next_bio,cmd,num,ptr); 526 ret=BIO_ctrl(b->next_bio,cmd,num,ptr);
@@ -565,3 +592,7 @@ static long b64_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp)
565 return(ret); 592 return(ret);
566 } 593 }
567 594
595static int b64_puts(BIO *b, const char *str)
596 {
597 return b64_write(b,str,strlen(str));
598 }
diff --git a/src/lib/libcrypto/evp/bio_enc.c b/src/lib/libcrypto/evp/bio_enc.c
index f6ac94c6e1..b6efb5fbc4 100644
--- a/src/lib/libcrypto/evp/bio_enc.c
+++ b/src/lib/libcrypto/evp/bio_enc.c
@@ -361,8 +361,10 @@ again:
361 case BIO_CTRL_DUP: 361 case BIO_CTRL_DUP:
362 dbio=(BIO *)ptr; 362 dbio=(BIO *)ptr;
363 dctx=(BIO_ENC_CTX *)dbio->ptr; 363 dctx=(BIO_ENC_CTX *)dbio->ptr;
364 memcpy(&(dctx->cipher),&(ctx->cipher),sizeof(ctx->cipher)); 364 EVP_CIPHER_CTX_init(&dctx->cipher);
365 dbio->init=1; 365 ret = EVP_CIPHER_CTX_copy(&dctx->cipher,&ctx->cipher);
366 if (ret)
367 dbio->init=1;
366 break; 368 break;
367 default: 369 default:
368 ret=BIO_ctrl(b->next_bio,cmd,num,ptr); 370 ret=BIO_ctrl(b->next_bio,cmd,num,ptr);
diff --git a/src/lib/libcrypto/evp/bio_md.c b/src/lib/libcrypto/evp/bio_md.c
index ed5c1135fd..9841e32e1a 100644
--- a/src/lib/libcrypto/evp/bio_md.c
+++ b/src/lib/libcrypto/evp/bio_md.c
@@ -130,8 +130,8 @@ static int md_read(BIO *b, char *out, int outl)
130 { 130 {
131 if (ret > 0) 131 if (ret > 0)
132 { 132 {
133 EVP_DigestUpdate(ctx,(unsigned char *)out, 133 if (EVP_DigestUpdate(ctx,(unsigned char *)out,
134 (unsigned int)ret); 134 (unsigned int)ret)<=0) return (-1);
135 } 135 }
136 } 136 }
137 BIO_clear_retry_flags(b); 137 BIO_clear_retry_flags(b);
@@ -157,8 +157,11 @@ static int md_write(BIO *b, const char *in, int inl)
157 (unsigned int)ret); 157 (unsigned int)ret);
158 } 158 }
159 } 159 }
160 BIO_clear_retry_flags(b); 160 if(b->next_bio != NULL)
161 BIO_copy_next_retry(b); 161 {
162 BIO_clear_retry_flags(b);
163 BIO_copy_next_retry(b);
164 }
162 return(ret); 165 return(ret);
163 } 166 }
164 167
@@ -194,6 +197,7 @@ static long md_ctrl(BIO *b, int cmd, long num, void *ptr)
194 case BIO_C_GET_MD_CTX: 197 case BIO_C_GET_MD_CTX:
195 pctx=ptr; 198 pctx=ptr;
196 *pctx=ctx; 199 *pctx=ctx;
200 b->init = 1;
197 break; 201 break;
198 case BIO_C_SET_MD_CTX: 202 case BIO_C_SET_MD_CTX:
199 if (b->init) 203 if (b->init)
@@ -249,7 +253,9 @@ static int md_gets(BIO *bp, char *buf, int size)
249 ctx=bp->ptr; 253 ctx=bp->ptr;
250 if (size < ctx->digest->md_size) 254 if (size < ctx->digest->md_size)
251 return(0); 255 return(0);
252 EVP_DigestFinal_ex(ctx,(unsigned char *)buf,&ret); 256 if (EVP_DigestFinal_ex(ctx,(unsigned char *)buf,&ret)<=0)
257 return -1;
258
253 return((int)ret); 259 return((int)ret);
254 } 260 }
255 261
diff --git a/src/lib/libcrypto/evp/c_all.c b/src/lib/libcrypto/evp/c_all.c
index a5da52e62d..766c4cecdf 100644
--- a/src/lib/libcrypto/evp/c_all.c
+++ b/src/lib/libcrypto/evp/c_all.c
@@ -83,7 +83,7 @@ void OPENSSL_add_all_algorithms_noconf(void)
83 OpenSSL_add_all_ciphers(); 83 OpenSSL_add_all_ciphers();
84 OpenSSL_add_all_digests(); 84 OpenSSL_add_all_digests();
85#ifndef OPENSSL_NO_ENGINE 85#ifndef OPENSSL_NO_ENGINE
86# if defined(__OpenBSD__) || defined(__FreeBSD__) 86# if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(HAVE_CRYPTODEV)
87 ENGINE_setup_bsd_cryptodev(); 87 ENGINE_setup_bsd_cryptodev();
88# endif 88# endif
89#endif 89#endif
diff --git a/src/lib/libcrypto/evp/c_allc.c b/src/lib/libcrypto/evp/c_allc.c
index 7054d8125d..c5f9268378 100644
--- a/src/lib/libcrypto/evp/c_allc.c
+++ b/src/lib/libcrypto/evp/c_allc.c
@@ -71,6 +71,8 @@ void OpenSSL_add_all_ciphers(void)
71 EVP_add_cipher(EVP_des_cfb8()); 71 EVP_add_cipher(EVP_des_cfb8());
72 EVP_add_cipher(EVP_des_ede_cfb()); 72 EVP_add_cipher(EVP_des_ede_cfb());
73 EVP_add_cipher(EVP_des_ede3_cfb()); 73 EVP_add_cipher(EVP_des_ede3_cfb());
74 EVP_add_cipher(EVP_des_ede3_cfb1());
75 EVP_add_cipher(EVP_des_ede3_cfb8());
74 76
75 EVP_add_cipher(EVP_des_ofb()); 77 EVP_add_cipher(EVP_des_ofb());
76 EVP_add_cipher(EVP_des_ede_ofb()); 78 EVP_add_cipher(EVP_des_ede_ofb());
@@ -219,7 +221,4 @@ void OpenSSL_add_all_ciphers(void)
219 EVP_add_cipher_alias(SN_camellia_256_cbc,"CAMELLIA256"); 221 EVP_add_cipher_alias(SN_camellia_256_cbc,"CAMELLIA256");
220 EVP_add_cipher_alias(SN_camellia_256_cbc,"camellia256"); 222 EVP_add_cipher_alias(SN_camellia_256_cbc,"camellia256");
221#endif 223#endif
222
223 PKCS12_PBE_add();
224 PKCS5_PBE_add();
225 } 224 }
diff --git a/src/lib/libcrypto/evp/c_alld.c b/src/lib/libcrypto/evp/c_alld.c
index d270b0ee03..311e1fe2f8 100644
--- a/src/lib/libcrypto/evp/c_alld.c
+++ b/src/lib/libcrypto/evp/c_alld.c
@@ -64,9 +64,6 @@
64 64
65void OpenSSL_add_all_digests(void) 65void OpenSSL_add_all_digests(void)
66 { 66 {
67#ifndef OPENSSL_NO_MD2
68 EVP_add_digest(EVP_md2());
69#endif
70#ifndef OPENSSL_NO_MD4 67#ifndef OPENSSL_NO_MD4
71 EVP_add_digest(EVP_md4()); 68 EVP_add_digest(EVP_md4());
72#endif 69#endif
@@ -81,7 +78,7 @@ void OpenSSL_add_all_digests(void)
81 EVP_add_digest(EVP_dss()); 78 EVP_add_digest(EVP_dss());
82#endif 79#endif
83#endif 80#endif
84#ifndef OPENSSL_NO_SHA 81#if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA1)
85 EVP_add_digest(EVP_sha1()); 82 EVP_add_digest(EVP_sha1());
86 EVP_add_digest_alias(SN_sha1,"ssl3-sha1"); 83 EVP_add_digest_alias(SN_sha1,"ssl3-sha1");
87 EVP_add_digest_alias(SN_sha1WithRSAEncryption,SN_sha1WithRSA); 84 EVP_add_digest_alias(SN_sha1WithRSAEncryption,SN_sha1WithRSA);
@@ -111,4 +108,7 @@ void OpenSSL_add_all_digests(void)
111 EVP_add_digest(EVP_sha384()); 108 EVP_add_digest(EVP_sha384());
112 EVP_add_digest(EVP_sha512()); 109 EVP_add_digest(EVP_sha512());
113#endif 110#endif
111#ifndef OPENSSL_NO_WHIRLPOOL
112 EVP_add_digest(EVP_whirlpool());
113#endif
114 } 114 }
diff --git a/src/lib/libcrypto/evp/dig_eng.c b/src/lib/libcrypto/evp/dig_eng.c
deleted file mode 100644
index 64cdf9366c..0000000000
--- a/src/lib/libcrypto/evp/dig_eng.c
+++ /dev/null
@@ -1,180 +0,0 @@
1/* crypto/evp/digest.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 * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved.
60 *
61 * Redistribution and use in source and binary forms, with or without
62 * modification, are permitted provided that the following conditions
63 * are met:
64 *
65 * 1. Redistributions of source code must retain the above copyright
66 * notice, this list of conditions and the following disclaimer.
67 *
68 * 2. Redistributions in binary form must reproduce the above copyright
69 * notice, this list of conditions and the following disclaimer in
70 * the documentation and/or other materials provided with the
71 * distribution.
72 *
73 * 3. All advertising materials mentioning features or use of this
74 * software must display the following acknowledgment:
75 * "This product includes software developed by the OpenSSL Project
76 * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
77 *
78 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
79 * endorse or promote products derived from this software without
80 * prior written permission. For written permission, please contact
81 * openssl-core@openssl.org.
82 *
83 * 5. Products derived from this software may not be called "OpenSSL"
84 * nor may "OpenSSL" appear in their names without prior written
85 * permission of the OpenSSL Project.
86 *
87 * 6. Redistributions of any form whatsoever must retain the following
88 * acknowledgment:
89 * "This product includes software developed by the OpenSSL Project
90 * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
91 *
92 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
93 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
94 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
95 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
96 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
97 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
98 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
99 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
100 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
101 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
102 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
103 * OF THE POSSIBILITY OF SUCH DAMAGE.
104 * ====================================================================
105 *
106 * This product includes cryptographic software written by Eric Young
107 * (eay@cryptsoft.com). This product includes software written by Tim
108 * Hudson (tjh@cryptsoft.com).
109 *
110 */
111
112#include <stdio.h>
113#include "cryptlib.h"
114#include <openssl/objects.h>
115#include <openssl/evp.h>
116#ifndef OPENSSL_NO_ENGINE
117#include <openssl/engine.h>
118#endif
119#include "evp_locl.h"
120
121#ifndef OPENSSL_NO_ENGINE
122
123#ifdef OPENSSL_FIPS
124
125static int do_evp_md_engine_full(EVP_MD_CTX *ctx, const EVP_MD **ptype, ENGINE *impl)
126 {
127 if (*ptype)
128 {
129 /* Ensure an ENGINE left lying around from last time is cleared
130 * (the previous check attempted to avoid this if the same
131 * ENGINE and EVP_MD could be used). */
132 if(ctx->engine)
133 ENGINE_finish(ctx->engine);
134 if(impl)
135 {
136 if (!ENGINE_init(impl))
137 {
138 EVPerr(EVP_F_DO_EVP_MD_ENGINE_FULL,EVP_R_INITIALIZATION_ERROR);
139 return 0;
140 }
141 }
142 else
143 /* Ask if an ENGINE is reserved for this job */
144 impl = ENGINE_get_digest_engine((*ptype)->type);
145 if(impl)
146 {
147 /* There's an ENGINE for this job ... (apparently) */
148 const EVP_MD *d = ENGINE_get_digest(impl, (*ptype)->type);
149 if(!d)
150 {
151 /* Same comment from evp_enc.c */
152 EVPerr(EVP_F_DO_EVP_MD_ENGINE_FULL,EVP_R_INITIALIZATION_ERROR);
153 return 0;
154 }
155 /* We'll use the ENGINE's private digest definition */
156 *ptype = d;
157 /* Store the ENGINE functional reference so we know
158 * 'type' came from an ENGINE and we need to release
159 * it when done. */
160 ctx->engine = impl;
161 }
162 else
163 ctx->engine = NULL;
164 }
165 else
166 if(!ctx->digest)
167 {
168 EVPerr(EVP_F_DO_EVP_MD_ENGINE_FULL,EVP_R_NO_DIGEST_SET);
169 return 0;
170 }
171 return 1;
172 }
173
174void int_EVP_MD_init_engine_callbacks(void)
175 {
176 int_EVP_MD_set_engine_callbacks(
177 ENGINE_init, ENGINE_finish, do_evp_md_engine_full);
178 }
179#endif
180#endif
diff --git a/src/lib/libcrypto/evp/digest.c b/src/lib/libcrypto/evp/digest.c
index 3bc2d1295c..982ba2b136 100644
--- a/src/lib/libcrypto/evp/digest.c
+++ b/src/lib/libcrypto/evp/digest.c
@@ -116,7 +116,6 @@
116#ifndef OPENSSL_NO_ENGINE 116#ifndef OPENSSL_NO_ENGINE
117#include <openssl/engine.h> 117#include <openssl/engine.h>
118#endif 118#endif
119#include "evp_locl.h"
120 119
121void EVP_MD_CTX_init(EVP_MD_CTX *ctx) 120void EVP_MD_CTX_init(EVP_MD_CTX *ctx)
122 { 121 {
@@ -127,7 +126,8 @@ EVP_MD_CTX *EVP_MD_CTX_create(void)
127 { 126 {
128 EVP_MD_CTX *ctx=OPENSSL_malloc(sizeof *ctx); 127 EVP_MD_CTX *ctx=OPENSSL_malloc(sizeof *ctx);
129 128
130 EVP_MD_CTX_init(ctx); 129 if (ctx)
130 EVP_MD_CTX_init(ctx);
131 131
132 return ctx; 132 return ctx;
133 } 133 }
@@ -138,77 +138,18 @@ int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type)
138 return EVP_DigestInit_ex(ctx, type, NULL); 138 return EVP_DigestInit_ex(ctx, type, NULL);
139 } 139 }
140 140
141#ifdef OPENSSL_FIPS 141int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl)
142
143/* The purpose of these is to trap programs that attempt to use non FIPS
144 * algorithms in FIPS mode and ignore the errors.
145 */
146
147static int bad_init(EVP_MD_CTX *ctx)
148 { FIPS_ERROR_IGNORED("Digest init"); return 0;}
149
150static int bad_update(EVP_MD_CTX *ctx,const void *data,size_t count)
151 { FIPS_ERROR_IGNORED("Digest update"); return 0;}
152
153static int bad_final(EVP_MD_CTX *ctx,unsigned char *md)
154 { FIPS_ERROR_IGNORED("Digest Final"); return 0;}
155
156static const EVP_MD bad_md =
157 { 142 {
158 0, 143 EVP_MD_CTX_clear_flags(ctx,EVP_MD_CTX_FLAG_CLEANED);
159 0,
160 0,
161 0,
162 bad_init,
163 bad_update,
164 bad_final,
165 NULL,
166 NULL,
167 NULL,
168 0,
169 {0,0,0,0},
170 };
171
172#endif
173
174#ifndef OPENSSL_NO_ENGINE 144#ifndef OPENSSL_NO_ENGINE
175 145 /* Whether it's nice or not, "Inits" can be used on "Final"'d contexts
176#ifdef OPENSSL_FIPS 146 * so this context may already have an ENGINE! Try to avoid releasing
177 147 * the previous handle, re-querying for an ENGINE, and having a
178static int do_engine_null(ENGINE *impl) { return 0;} 148 * reinitialisation, when it may all be unecessary. */
179static int do_evp_md_engine_null(EVP_MD_CTX *ctx, 149 if (ctx->engine && ctx->digest && (!type ||
180 const EVP_MD **ptype, ENGINE *impl) 150 (type && (type->type == ctx->digest->type))))
181 { return 1; } 151 goto skip_to_init;
182 152 if (type)
183static int (*do_engine_init)(ENGINE *impl)
184 = do_engine_null;
185
186static int (*do_engine_finish)(ENGINE *impl)
187 = do_engine_null;
188
189static int (*do_evp_md_engine)
190 (EVP_MD_CTX *ctx, const EVP_MD **ptype, ENGINE *impl)
191 = do_evp_md_engine_null;
192
193void int_EVP_MD_set_engine_callbacks(
194 int (*eng_md_init)(ENGINE *impl),
195 int (*eng_md_fin)(ENGINE *impl),
196 int (*eng_md_evp)
197 (EVP_MD_CTX *ctx, const EVP_MD **ptype, ENGINE *impl))
198 {
199 do_engine_init = eng_md_init;
200 do_engine_finish = eng_md_fin;
201 do_evp_md_engine = eng_md_evp;
202 }
203
204#else
205
206#define do_engine_init ENGINE_init
207#define do_engine_finish ENGINE_finish
208
209static int do_evp_md_engine(EVP_MD_CTX *ctx, const EVP_MD **ptype, ENGINE *impl)
210 {
211 if (*ptype)
212 { 153 {
213 /* Ensure an ENGINE left lying around from last time is cleared 154 /* Ensure an ENGINE left lying around from last time is cleared
214 * (the previous check attempted to avoid this if the same 155 * (the previous check attempted to avoid this if the same
@@ -219,25 +160,26 @@ static int do_evp_md_engine(EVP_MD_CTX *ctx, const EVP_MD **ptype, ENGINE *impl)
219 { 160 {
220 if (!ENGINE_init(impl)) 161 if (!ENGINE_init(impl))
221 { 162 {
222 EVPerr(EVP_F_DO_EVP_MD_ENGINE,EVP_R_INITIALIZATION_ERROR); 163 EVPerr(EVP_F_EVP_DIGESTINIT_EX,EVP_R_INITIALIZATION_ERROR);
223 return 0; 164 return 0;
224 } 165 }
225 } 166 }
226 else 167 else
227 /* Ask if an ENGINE is reserved for this job */ 168 /* Ask if an ENGINE is reserved for this job */
228 impl = ENGINE_get_digest_engine((*ptype)->type); 169 impl = ENGINE_get_digest_engine(type->type);
229 if(impl) 170 if(impl)
230 { 171 {
231 /* There's an ENGINE for this job ... (apparently) */ 172 /* There's an ENGINE for this job ... (apparently) */
232 const EVP_MD *d = ENGINE_get_digest(impl, (*ptype)->type); 173 const EVP_MD *d = ENGINE_get_digest(impl, type->type);
233 if(!d) 174 if(!d)
234 { 175 {
235 /* Same comment from evp_enc.c */ 176 /* Same comment from evp_enc.c */
236 EVPerr(EVP_F_DO_EVP_MD_ENGINE,EVP_R_INITIALIZATION_ERROR); 177 EVPerr(EVP_F_EVP_DIGESTINIT_EX,EVP_R_INITIALIZATION_ERROR);
178 ENGINE_finish(impl);
237 return 0; 179 return 0;
238 } 180 }
239 /* We'll use the ENGINE's private digest definition */ 181 /* We'll use the ENGINE's private digest definition */
240 *ptype = d; 182 type = d;
241 /* Store the ENGINE functional reference so we know 183 /* Store the ENGINE functional reference so we know
242 * 'type' came from an ENGINE and we need to release 184 * 'type' came from an ENGINE and we need to release
243 * it when done. */ 185 * it when done. */
@@ -249,71 +191,46 @@ static int do_evp_md_engine(EVP_MD_CTX *ctx, const EVP_MD **ptype, ENGINE *impl)
249 else 191 else
250 if(!ctx->digest) 192 if(!ctx->digest)
251 { 193 {
252 EVPerr(EVP_F_DO_EVP_MD_ENGINE,EVP_R_NO_DIGEST_SET); 194 EVPerr(EVP_F_EVP_DIGESTINIT_EX,EVP_R_NO_DIGEST_SET);
253 return 0; 195 return 0;
254 } 196 }
255 return 1;
256 }
257
258#endif
259
260#endif
261
262int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl)
263 {
264 M_EVP_MD_CTX_clear_flags(ctx,EVP_MD_CTX_FLAG_CLEANED);
265#ifdef OPENSSL_FIPS
266 if(FIPS_selftest_failed())
267 {
268 FIPSerr(FIPS_F_EVP_DIGESTINIT_EX,FIPS_R_FIPS_SELFTEST_FAILED);
269 ctx->digest = &bad_md;
270 return 0;
271 }
272#endif
273#ifndef OPENSSL_NO_ENGINE
274 /* Whether it's nice or not, "Inits" can be used on "Final"'d contexts
275 * so this context may already have an ENGINE! Try to avoid releasing
276 * the previous handle, re-querying for an ENGINE, and having a
277 * reinitialisation, when it may all be unecessary. */
278 if (ctx->engine && ctx->digest && (!type ||
279 (type && (type->type == ctx->digest->type))))
280 goto skip_to_init;
281 if (!do_evp_md_engine(ctx, &type, impl))
282 return 0;
283#endif 197#endif
284 if (ctx->digest != type) 198 if (ctx->digest != type)
285 { 199 {
286#ifdef OPENSSL_FIPS 200 if (ctx->digest && ctx->digest->ctx_size)
287 if (FIPS_mode()) 201 OPENSSL_free(ctx->md_data);
202 ctx->digest=type;
203 if (!(ctx->flags & EVP_MD_CTX_FLAG_NO_INIT) && type->ctx_size)
288 { 204 {
289 if (!(type->flags & EVP_MD_FLAG_FIPS) 205 ctx->update = type->update;
290 && !(ctx->flags & EVP_MD_CTX_FLAG_NON_FIPS_ALLOW)) 206 ctx->md_data=OPENSSL_malloc(type->ctx_size);
207 if (ctx->md_data == NULL)
291 { 208 {
292 EVPerr(EVP_F_EVP_DIGESTINIT_EX, EVP_R_DISABLED_FOR_FIPS); 209 EVPerr(EVP_F_EVP_DIGESTINIT_EX,
293 ctx->digest = &bad_md; 210 ERR_R_MALLOC_FAILURE);
294 return 0; 211 return 0;
295 } 212 }
296 } 213 }
297#endif
298 if (ctx->digest && ctx->digest->ctx_size)
299 OPENSSL_free(ctx->md_data);
300 ctx->digest=type;
301 if (type->ctx_size)
302 ctx->md_data=OPENSSL_malloc(type->ctx_size);
303 } 214 }
304#ifndef OPENSSL_NO_ENGINE 215#ifndef OPENSSL_NO_ENGINE
305 skip_to_init: 216skip_to_init:
306#endif 217#endif
218 if (ctx->pctx)
219 {
220 int r;
221 r = EVP_PKEY_CTX_ctrl(ctx->pctx, -1, EVP_PKEY_OP_TYPE_SIG,
222 EVP_PKEY_CTRL_DIGESTINIT, 0, ctx);
223 if (r <= 0 && (r != -2))
224 return 0;
225 }
226 if (ctx->flags & EVP_MD_CTX_FLAG_NO_INIT)
227 return 1;
307 return ctx->digest->init(ctx); 228 return ctx->digest->init(ctx);
308 } 229 }
309 230
310int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *data, 231int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *data, size_t count)
311 size_t count)
312 { 232 {
313#ifdef OPENSSL_FIPS 233 return ctx->update(ctx,data,count);
314 FIPS_selftest_check();
315#endif
316 return ctx->digest->update(ctx,data,count);
317 } 234 }
318 235
319/* The caller can assume that this removes any secret data from the context */ 236/* The caller can assume that this removes any secret data from the context */
@@ -329,9 +246,6 @@ int EVP_DigestFinal(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *size)
329int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *size) 246int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *size)
330 { 247 {
331 int ret; 248 int ret;
332#ifdef OPENSSL_FIPS
333 FIPS_selftest_check();
334#endif
335 249
336 OPENSSL_assert(ctx->digest->md_size <= EVP_MAX_MD_SIZE); 250 OPENSSL_assert(ctx->digest->md_size <= EVP_MAX_MD_SIZE);
337 ret=ctx->digest->final(ctx,md); 251 ret=ctx->digest->final(ctx,md);
@@ -340,7 +254,7 @@ int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *size)
340 if (ctx->digest->cleanup) 254 if (ctx->digest->cleanup)
341 { 255 {
342 ctx->digest->cleanup(ctx); 256 ctx->digest->cleanup(ctx);
343 M_EVP_MD_CTX_set_flags(ctx,EVP_MD_CTX_FLAG_CLEANED); 257 EVP_MD_CTX_set_flags(ctx,EVP_MD_CTX_FLAG_CLEANED);
344 } 258 }
345 memset(ctx->md_data,0,ctx->digest->ctx_size); 259 memset(ctx->md_data,0,ctx->digest->ctx_size);
346 return ret; 260 return ret;
@@ -362,7 +276,7 @@ int EVP_MD_CTX_copy_ex(EVP_MD_CTX *out, const EVP_MD_CTX *in)
362 } 276 }
363#ifndef OPENSSL_NO_ENGINE 277#ifndef OPENSSL_NO_ENGINE
364 /* Make sure it's safe to copy a digest context using an ENGINE */ 278 /* Make sure it's safe to copy a digest context using an ENGINE */
365 if (in->engine && !do_engine_init(in->engine)) 279 if (in->engine && !ENGINE_init(in->engine))
366 { 280 {
367 EVPerr(EVP_F_EVP_MD_CTX_COPY_EX,ERR_R_ENGINE_LIB); 281 EVPerr(EVP_F_EVP_MD_CTX_COPY_EX,ERR_R_ENGINE_LIB);
368 return 0; 282 return 0;
@@ -372,19 +286,40 @@ int EVP_MD_CTX_copy_ex(EVP_MD_CTX *out, const EVP_MD_CTX *in)
372 if (out->digest == in->digest) 286 if (out->digest == in->digest)
373 { 287 {
374 tmp_buf = out->md_data; 288 tmp_buf = out->md_data;
375 M_EVP_MD_CTX_set_flags(out,EVP_MD_CTX_FLAG_REUSE); 289 EVP_MD_CTX_set_flags(out,EVP_MD_CTX_FLAG_REUSE);
376 } 290 }
377 else tmp_buf = NULL; 291 else tmp_buf = NULL;
378 EVP_MD_CTX_cleanup(out); 292 EVP_MD_CTX_cleanup(out);
379 memcpy(out,in,sizeof *out); 293 memcpy(out,in,sizeof *out);
380 294
381 if (out->digest->ctx_size) 295 if (in->md_data && out->digest->ctx_size)
382 { 296 {
383 if (tmp_buf) out->md_data = tmp_buf; 297 if (tmp_buf)
384 else out->md_data=OPENSSL_malloc(out->digest->ctx_size); 298 out->md_data = tmp_buf;
299 else
300 {
301 out->md_data=OPENSSL_malloc(out->digest->ctx_size);
302 if (!out->md_data)
303 {
304 EVPerr(EVP_F_EVP_MD_CTX_COPY_EX,ERR_R_MALLOC_FAILURE);
305 return 0;
306 }
307 }
385 memcpy(out->md_data,in->md_data,out->digest->ctx_size); 308 memcpy(out->md_data,in->md_data,out->digest->ctx_size);
386 } 309 }
387 310
311 out->update = in->update;
312
313 if (in->pctx)
314 {
315 out->pctx = EVP_PKEY_CTX_dup(in->pctx);
316 if (!out->pctx)
317 {
318 EVP_MD_CTX_cleanup(out);
319 return 0;
320 }
321 }
322
388 if (out->digest->copy) 323 if (out->digest->copy)
389 return out->digest->copy(out,in); 324 return out->digest->copy(out,in);
390 325
@@ -398,7 +333,7 @@ int EVP_Digest(const void *data, size_t count,
398 int ret; 333 int ret;
399 334
400 EVP_MD_CTX_init(&ctx); 335 EVP_MD_CTX_init(&ctx);
401 M_EVP_MD_CTX_set_flags(&ctx,EVP_MD_CTX_FLAG_ONESHOT); 336 EVP_MD_CTX_set_flags(&ctx,EVP_MD_CTX_FLAG_ONESHOT);
402 ret=EVP_DigestInit_ex(&ctx, type, impl) 337 ret=EVP_DigestInit_ex(&ctx, type, impl)
403 && EVP_DigestUpdate(&ctx, data, count) 338 && EVP_DigestUpdate(&ctx, data, count)
404 && EVP_DigestFinal_ex(&ctx, md, size); 339 && EVP_DigestFinal_ex(&ctx, md, size);
@@ -420,19 +355,21 @@ int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx)
420 * because sometimes only copies of the context are ever finalised. 355 * because sometimes only copies of the context are ever finalised.
421 */ 356 */
422 if (ctx->digest && ctx->digest->cleanup 357 if (ctx->digest && ctx->digest->cleanup
423 && !M_EVP_MD_CTX_test_flags(ctx,EVP_MD_CTX_FLAG_CLEANED)) 358 && !EVP_MD_CTX_test_flags(ctx,EVP_MD_CTX_FLAG_CLEANED))
424 ctx->digest->cleanup(ctx); 359 ctx->digest->cleanup(ctx);
425 if (ctx->digest && ctx->digest->ctx_size && ctx->md_data 360 if (ctx->digest && ctx->digest->ctx_size && ctx->md_data
426 && !M_EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_REUSE)) 361 && !EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_REUSE))
427 { 362 {
428 OPENSSL_cleanse(ctx->md_data,ctx->digest->ctx_size); 363 OPENSSL_cleanse(ctx->md_data,ctx->digest->ctx_size);
429 OPENSSL_free(ctx->md_data); 364 OPENSSL_free(ctx->md_data);
430 } 365 }
366 if (ctx->pctx)
367 EVP_PKEY_CTX_free(ctx->pctx);
431#ifndef OPENSSL_NO_ENGINE 368#ifndef OPENSSL_NO_ENGINE
432 if(ctx->engine) 369 if(ctx->engine)
433 /* The EVP_MD we used belongs to an ENGINE, release the 370 /* The EVP_MD we used belongs to an ENGINE, release the
434 * functional reference we held for this reason. */ 371 * functional reference we held for this reason. */
435 do_engine_finish(ctx->engine); 372 ENGINE_finish(ctx->engine);
436#endif 373#endif
437 memset(ctx,'\0',sizeof *ctx); 374 memset(ctx,'\0',sizeof *ctx);
438 375
diff --git a/src/lib/libcrypto/evp/e_aes.c b/src/lib/libcrypto/evp/e_aes.c
index c9a5ee8d75..bd6c0a3a62 100644
--- a/src/lib/libcrypto/evp/e_aes.c
+++ b/src/lib/libcrypto/evp/e_aes.c
@@ -69,29 +69,32 @@ typedef struct
69 69
70IMPLEMENT_BLOCK_CIPHER(aes_128, ks, AES, EVP_AES_KEY, 70IMPLEMENT_BLOCK_CIPHER(aes_128, ks, AES, EVP_AES_KEY,
71 NID_aes_128, 16, 16, 16, 128, 71 NID_aes_128, 16, 16, 16, 128,
72 EVP_CIPH_FLAG_FIPS|EVP_CIPH_FLAG_DEFAULT_ASN1, 72 0, aes_init_key, NULL,
73 aes_init_key, 73 EVP_CIPHER_set_asn1_iv,
74 NULL, NULL, NULL, NULL) 74 EVP_CIPHER_get_asn1_iv,
75 NULL)
75IMPLEMENT_BLOCK_CIPHER(aes_192, ks, AES, EVP_AES_KEY, 76IMPLEMENT_BLOCK_CIPHER(aes_192, ks, AES, EVP_AES_KEY,
76 NID_aes_192, 16, 24, 16, 128, 77 NID_aes_192, 16, 24, 16, 128,
77 EVP_CIPH_FLAG_FIPS|EVP_CIPH_FLAG_DEFAULT_ASN1, 78 0, aes_init_key, NULL,
78 aes_init_key, 79 EVP_CIPHER_set_asn1_iv,
79 NULL, NULL, NULL, NULL) 80 EVP_CIPHER_get_asn1_iv,
81 NULL)
80IMPLEMENT_BLOCK_CIPHER(aes_256, ks, AES, EVP_AES_KEY, 82IMPLEMENT_BLOCK_CIPHER(aes_256, ks, AES, EVP_AES_KEY,
81 NID_aes_256, 16, 32, 16, 128, 83 NID_aes_256, 16, 32, 16, 128,
82 EVP_CIPH_FLAG_FIPS|EVP_CIPH_FLAG_DEFAULT_ASN1, 84 0, aes_init_key, NULL,
83 aes_init_key, 85 EVP_CIPHER_set_asn1_iv,
84 NULL, NULL, NULL, NULL) 86 EVP_CIPHER_get_asn1_iv,
87 NULL)
85 88
86#define IMPLEMENT_AES_CFBR(ksize,cbits,flags) IMPLEMENT_CFBR(aes,AES,EVP_AES_KEY,ks,ksize,cbits,16,flags) 89#define IMPLEMENT_AES_CFBR(ksize,cbits) IMPLEMENT_CFBR(aes,AES,EVP_AES_KEY,ks,ksize,cbits,16)
87 90
88IMPLEMENT_AES_CFBR(128,1,EVP_CIPH_FLAG_FIPS) 91IMPLEMENT_AES_CFBR(128,1)
89IMPLEMENT_AES_CFBR(192,1,EVP_CIPH_FLAG_FIPS) 92IMPLEMENT_AES_CFBR(192,1)
90IMPLEMENT_AES_CFBR(256,1,EVP_CIPH_FLAG_FIPS) 93IMPLEMENT_AES_CFBR(256,1)
91 94
92IMPLEMENT_AES_CFBR(128,8,EVP_CIPH_FLAG_FIPS) 95IMPLEMENT_AES_CFBR(128,8)
93IMPLEMENT_AES_CFBR(192,8,EVP_CIPH_FLAG_FIPS) 96IMPLEMENT_AES_CFBR(192,8)
94IMPLEMENT_AES_CFBR(256,8,EVP_CIPH_FLAG_FIPS) 97IMPLEMENT_AES_CFBR(256,8)
95 98
96static int aes_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, 99static int aes_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
97 const unsigned char *iv, int enc) 100 const unsigned char *iv, int enc)
diff --git a/src/lib/libcrypto/evp/e_des.c b/src/lib/libcrypto/evp/e_des.c
index 04376df232..ca009f2c52 100644
--- a/src/lib/libcrypto/evp/e_des.c
+++ b/src/lib/libcrypto/evp/e_des.c
@@ -72,7 +72,7 @@ static int des_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr);
72/* Because of various casts and different names can't use IMPLEMENT_BLOCK_CIPHER */ 72/* Because of various casts and different names can't use IMPLEMENT_BLOCK_CIPHER */
73 73
74static int des_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 74static int des_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
75 const unsigned char *in, unsigned int inl) 75 const unsigned char *in, size_t inl)
76{ 76{
77 BLOCK_CIPHER_ecb_loop() 77 BLOCK_CIPHER_ecb_loop()
78 DES_ecb_encrypt((DES_cblock *)(in + i), (DES_cblock *)(out + i), ctx->cipher_data, ctx->encrypt); 78 DES_ecb_encrypt((DES_cblock *)(in + i), (DES_cblock *)(out + i), ctx->cipher_data, ctx->encrypt);
@@ -80,24 +80,52 @@ static int des_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
80} 80}
81 81
82static int des_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 82static int des_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
83 const unsigned char *in, unsigned int inl) 83 const unsigned char *in, size_t inl)
84{ 84{
85 DES_ofb64_encrypt(in, out, (long)inl, ctx->cipher_data, (DES_cblock *)ctx->iv, &ctx->num); 85 while(inl>=EVP_MAXCHUNK)
86 {
87 DES_ofb64_encrypt(in, out, (long)EVP_MAXCHUNK, ctx->cipher_data,
88 (DES_cblock *)ctx->iv, &ctx->num);
89 inl-=EVP_MAXCHUNK;
90 in +=EVP_MAXCHUNK;
91 out+=EVP_MAXCHUNK;
92 }
93 if (inl)
94 DES_ofb64_encrypt(in, out, (long)inl, ctx->cipher_data,
95 (DES_cblock *)ctx->iv, &ctx->num);
86 return 1; 96 return 1;
87} 97}
88 98
89static int des_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 99static int des_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
90 const unsigned char *in, unsigned int inl) 100 const unsigned char *in, size_t inl)
91{ 101{
92 DES_ncbc_encrypt(in, out, (long)inl, ctx->cipher_data, 102 while(inl>=EVP_MAXCHUNK)
93 (DES_cblock *)ctx->iv, ctx->encrypt); 103 {
104 DES_ncbc_encrypt(in, out, (long)EVP_MAXCHUNK, ctx->cipher_data,
105 (DES_cblock *)ctx->iv, ctx->encrypt);
106 inl-=EVP_MAXCHUNK;
107 in +=EVP_MAXCHUNK;
108 out+=EVP_MAXCHUNK;
109 }
110 if (inl)
111 DES_ncbc_encrypt(in, out, (long)inl, ctx->cipher_data,
112 (DES_cblock *)ctx->iv, ctx->encrypt);
94 return 1; 113 return 1;
95} 114}
96 115
97static int des_cfb64_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 116static int des_cfb64_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
98 const unsigned char *in, unsigned int inl) 117 const unsigned char *in, size_t inl)
99{ 118{
100 DES_cfb64_encrypt(in, out, (long)inl, ctx->cipher_data, 119 while(inl>=EVP_MAXCHUNK)
120 {
121 DES_cfb64_encrypt(in,out, (long)EVP_MAXCHUNK, ctx->cipher_data,
122 (DES_cblock *)ctx->iv, &ctx->num, ctx->encrypt);
123 inl-=EVP_MAXCHUNK;
124 in +=EVP_MAXCHUNK;
125 out+=EVP_MAXCHUNK;
126 }
127 if (inl)
128 DES_cfb64_encrypt(in, out, (long)inl, ctx->cipher_data,
101 (DES_cblock *)ctx->iv, &ctx->num, ctx->encrypt); 129 (DES_cblock *)ctx->iv, &ctx->num, ctx->encrypt);
102 return 1; 130 return 1;
103} 131}
@@ -105,45 +133,62 @@ static int des_cfb64_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
105/* Although we have a CFB-r implementation for DES, it doesn't pack the right 133/* Although we have a CFB-r implementation for DES, it doesn't pack the right
106 way, so wrap it here */ 134 way, so wrap it here */
107static int des_cfb1_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 135static int des_cfb1_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
108 const unsigned char *in, unsigned int inl) 136 const unsigned char *in, size_t inl)
109 { 137 {
110 unsigned int n; 138 size_t n,chunk=EVP_MAXCHUNK/8;
111 unsigned char c[1],d[1]; 139 unsigned char c[1],d[1];
112 140
113 for(n=0 ; n < inl ; ++n) 141 if (inl<chunk) chunk=inl;
142
143 while (inl && inl>=chunk)
114 { 144 {
115 c[0]=(in[n/8]&(1 << (7-n%8))) ? 0x80 : 0; 145 for(n=0 ; n < chunk*8; ++n)
116 DES_cfb_encrypt(c,d,1,1,ctx->cipher_data,(DES_cblock *)ctx->iv, 146 {
147 c[0]=(in[n/8]&(1 << (7-n%8))) ? 0x80 : 0;
148 DES_cfb_encrypt(c,d,1,1,ctx->cipher_data,(DES_cblock *)ctx->iv,
117 ctx->encrypt); 149 ctx->encrypt);
118 out[n/8]=(out[n/8]&~(0x80 >> (n%8)))|((d[0]&0x80) >> (n%8)); 150 out[n/8]=(out[n/8]&~(0x80 >> (unsigned int)(n%8))) |
151 ((d[0]&0x80) >> (unsigned int)(n%8));
152 }
153 inl-=chunk;
154 in +=chunk;
155 out+=chunk;
156 if (inl<chunk) chunk=inl;
119 } 157 }
158
120 return 1; 159 return 1;
121 } 160 }
122 161
123static int des_cfb8_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 162static int des_cfb8_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
124 const unsigned char *in, unsigned int inl) 163 const unsigned char *in, size_t inl)
125 { 164 {
126 DES_cfb_encrypt(in,out,8,inl,ctx->cipher_data,(DES_cblock *)ctx->iv, 165 while (inl>=EVP_MAXCHUNK)
127 ctx->encrypt); 166 {
167 DES_cfb_encrypt(in,out,8,(long)EVP_MAXCHUNK,ctx->cipher_data,
168 (DES_cblock *)ctx->iv,ctx->encrypt);
169 inl-=EVP_MAXCHUNK;
170 in +=EVP_MAXCHUNK;
171 out+=EVP_MAXCHUNK;
172 }
173 if (inl)
174 DES_cfb_encrypt(in,out,8,(long)inl,ctx->cipher_data,
175 (DES_cblock *)ctx->iv,ctx->encrypt);
128 return 1; 176 return 1;
129 } 177 }
130 178
131BLOCK_CIPHER_defs(des, DES_key_schedule, NID_des, 8, 8, 8, 64, 179BLOCK_CIPHER_defs(des, DES_key_schedule, NID_des, 8, 8, 8, 64,
132 EVP_CIPH_RAND_KEY, 180 EVP_CIPH_RAND_KEY, des_init_key, NULL,
133 des_init_key, NULL,
134 EVP_CIPHER_set_asn1_iv, 181 EVP_CIPHER_set_asn1_iv,
135 EVP_CIPHER_get_asn1_iv, 182 EVP_CIPHER_get_asn1_iv,
136 des_ctrl) 183 des_ctrl)
137 184
138BLOCK_CIPHER_def_cfb(des,DES_key_schedule,NID_des,8,8,1, 185BLOCK_CIPHER_def_cfb(des,DES_key_schedule,NID_des,8,8,1,
139 EVP_CIPH_RAND_KEY, 186 EVP_CIPH_RAND_KEY, des_init_key,NULL,
140 des_init_key, NULL,
141 EVP_CIPHER_set_asn1_iv, 187 EVP_CIPHER_set_asn1_iv,
142 EVP_CIPHER_get_asn1_iv,des_ctrl) 188 EVP_CIPHER_get_asn1_iv,des_ctrl)
143 189
144BLOCK_CIPHER_def_cfb(des,DES_key_schedule,NID_des,8,8,8, 190BLOCK_CIPHER_def_cfb(des,DES_key_schedule,NID_des,8,8,8,
145 EVP_CIPH_RAND_KEY, 191 EVP_CIPH_RAND_KEY,des_init_key,NULL,
146 des_init_key,NULL,
147 EVP_CIPHER_set_asn1_iv, 192 EVP_CIPHER_set_asn1_iv,
148 EVP_CIPHER_get_asn1_iv,des_ctrl) 193 EVP_CIPHER_get_asn1_iv,des_ctrl)
149 194
diff --git a/src/lib/libcrypto/evp/e_des3.c b/src/lib/libcrypto/evp/e_des3.c
index f910af19b1..3232cfe024 100644
--- a/src/lib/libcrypto/evp/e_des3.c
+++ b/src/lib/libcrypto/evp/e_des3.c
@@ -85,7 +85,7 @@ typedef struct
85/* Because of various casts and different args can't use IMPLEMENT_BLOCK_CIPHER */ 85/* Because of various casts and different args can't use IMPLEMENT_BLOCK_CIPHER */
86 86
87static int des_ede_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 87static int des_ede_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
88 const unsigned char *in, unsigned int inl) 88 const unsigned char *in, size_t inl)
89{ 89{
90 BLOCK_CIPHER_ecb_loop() 90 BLOCK_CIPHER_ecb_loop()
91 DES_ecb3_encrypt((const_DES_cblock *)(in + i), 91 DES_ecb3_encrypt((const_DES_cblock *)(in + i),
@@ -97,48 +97,80 @@ static int des_ede_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
97} 97}
98 98
99static int des_ede_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 99static int des_ede_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
100 const unsigned char *in, unsigned int inl) 100 const unsigned char *in, size_t inl)
101{ 101{
102 DES_ede3_ofb64_encrypt(in, out, (long)inl, 102 if (inl>=EVP_MAXCHUNK)
103 {
104 DES_ede3_ofb64_encrypt(in, out, (long)EVP_MAXCHUNK,
103 &data(ctx)->ks1, &data(ctx)->ks2, &data(ctx)->ks3, 105 &data(ctx)->ks1, &data(ctx)->ks2, &data(ctx)->ks3,
104 (DES_cblock *)ctx->iv, &ctx->num); 106 (DES_cblock *)ctx->iv, &ctx->num);
107 inl-=EVP_MAXCHUNK;
108 in +=EVP_MAXCHUNK;
109 out+=EVP_MAXCHUNK;
110 }
111 if (inl)
112 DES_ede3_ofb64_encrypt(in, out, (long)inl,
113 &data(ctx)->ks1, &data(ctx)->ks2, &data(ctx)->ks3,
114 (DES_cblock *)ctx->iv, &ctx->num);
115
105 return 1; 116 return 1;
106} 117}
107 118
108static int des_ede_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 119static int des_ede_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
109 const unsigned char *in, unsigned int inl) 120 const unsigned char *in, size_t inl)
110{ 121{
111#ifdef KSSL_DEBUG 122#ifdef KSSL_DEBUG
112 { 123 {
113 int i; 124 int i;
114 printf("des_ede_cbc_cipher(ctx=%lx, buflen=%d)\n", (unsigned long)ctx, ctx->buf_len); 125 char *cp;
126 printf("des_ede_cbc_cipher(ctx=%lx, buflen=%d)\n", ctx, ctx->buf_len);
115 printf("\t iv= "); 127 printf("\t iv= ");
116 for(i=0;i<8;i++) 128 for(i=0;i<8;i++)
117 printf("%02X",ctx->iv[i]); 129 printf("%02X",ctx->iv[i]);
118 printf("\n"); 130 printf("\n");
119 } 131 }
120#endif /* KSSL_DEBUG */ 132#endif /* KSSL_DEBUG */
121 DES_ede3_cbc_encrypt(in, out, (long)inl, 133 if (inl>=EVP_MAXCHUNK)
134 {
135 DES_ede3_cbc_encrypt(in, out, (long)EVP_MAXCHUNK,
122 &data(ctx)->ks1, &data(ctx)->ks2, &data(ctx)->ks3, 136 &data(ctx)->ks1, &data(ctx)->ks2, &data(ctx)->ks3,
123 (DES_cblock *)ctx->iv, ctx->encrypt); 137 (DES_cblock *)ctx->iv, ctx->encrypt);
138 inl-=EVP_MAXCHUNK;
139 in +=EVP_MAXCHUNK;
140 out+=EVP_MAXCHUNK;
141 }
142 if (inl)
143 DES_ede3_cbc_encrypt(in, out, (long)inl,
144 &data(ctx)->ks1, &data(ctx)->ks2, &data(ctx)->ks3,
145 (DES_cblock *)ctx->iv, ctx->encrypt);
124 return 1; 146 return 1;
125} 147}
126 148
127static int des_ede_cfb64_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 149static int des_ede_cfb64_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
128 const unsigned char *in, unsigned int inl) 150 const unsigned char *in, size_t inl)
129{ 151{
130 DES_ede3_cfb64_encrypt(in, out, (long)inl, 152 if (inl>=EVP_MAXCHUNK)
153 {
154 DES_ede3_cfb64_encrypt(in, out, (long)EVP_MAXCHUNK,
131 &data(ctx)->ks1, &data(ctx)->ks2, &data(ctx)->ks3, 155 &data(ctx)->ks1, &data(ctx)->ks2, &data(ctx)->ks3,
132 (DES_cblock *)ctx->iv, &ctx->num, ctx->encrypt); 156 (DES_cblock *)ctx->iv, &ctx->num, ctx->encrypt);
157 inl-=EVP_MAXCHUNK;
158 in +=EVP_MAXCHUNK;
159 out+=EVP_MAXCHUNK;
160 }
161 if (inl)
162 DES_ede3_cfb64_encrypt(in, out, (long)inl,
163 &data(ctx)->ks1, &data(ctx)->ks2, &data(ctx)->ks3,
164 (DES_cblock *)ctx->iv, &ctx->num, ctx->encrypt);
133 return 1; 165 return 1;
134} 166}
135 167
136/* Although we have a CFB-r implementation for 3-DES, it doesn't pack the right 168/* Although we have a CFB-r implementation for 3-DES, it doesn't pack the right
137 way, so wrap it here */ 169 way, so wrap it here */
138static int des_ede3_cfb1_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 170static int des_ede3_cfb1_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
139 const unsigned char *in, unsigned int inl) 171 const unsigned char *in, size_t inl)
140 { 172 {
141 unsigned int n; 173 size_t n;
142 unsigned char c[1],d[1]; 174 unsigned char c[1],d[1];
143 175
144 for(n=0 ; n < inl ; ++n) 176 for(n=0 ; n < inl ; ++n)
@@ -147,25 +179,36 @@ static int des_ede3_cfb1_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
147 DES_ede3_cfb_encrypt(c,d,1,1, 179 DES_ede3_cfb_encrypt(c,d,1,1,
148 &data(ctx)->ks1,&data(ctx)->ks2,&data(ctx)->ks3, 180 &data(ctx)->ks1,&data(ctx)->ks2,&data(ctx)->ks3,
149 (DES_cblock *)ctx->iv,ctx->encrypt); 181 (DES_cblock *)ctx->iv,ctx->encrypt);
150 out[n/8]=(out[n/8]&~(0x80 >> (n%8)))|((d[0]&0x80) >> (n%8)); 182 out[n/8]=(out[n/8]&~(0x80 >> (unsigned int)(n%8))) |
183 ((d[0]&0x80) >> (unsigned int)(n%8));
151 } 184 }
152 185
153 return 1; 186 return 1;
154 } 187 }
155 188
156static int des_ede3_cfb8_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 189static int des_ede3_cfb8_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
157 const unsigned char *in, unsigned int inl) 190 const unsigned char *in, size_t inl)
158 { 191 {
159 DES_ede3_cfb_encrypt(in,out,8,inl, 192 while (inl>=EVP_MAXCHUNK)
193 {
194 DES_ede3_cfb_encrypt(in,out,8,(long)EVP_MAXCHUNK,
160 &data(ctx)->ks1,&data(ctx)->ks2,&data(ctx)->ks3, 195 &data(ctx)->ks1,&data(ctx)->ks2,&data(ctx)->ks3,
161 (DES_cblock *)ctx->iv,ctx->encrypt); 196 (DES_cblock *)ctx->iv,ctx->encrypt);
197 inl-=EVP_MAXCHUNK;
198 in +=EVP_MAXCHUNK;
199 out+=EVP_MAXCHUNK;
200 }
201 if (inl)
202 DES_ede3_cfb_encrypt(in,out,8,(long)inl,
203 &data(ctx)->ks1,&data(ctx)->ks2,&data(ctx)->ks3,
204 (DES_cblock *)ctx->iv,ctx->encrypt);
162 return 1; 205 return 1;
163 } 206 }
164 207
165BLOCK_CIPHER_defs(des_ede, DES_EDE_KEY, NID_des_ede, 8, 16, 8, 64, 208BLOCK_CIPHER_defs(des_ede, DES_EDE_KEY, NID_des_ede, 8, 16, 8, 64,
166 EVP_CIPH_RAND_KEY|EVP_CIPH_FLAG_FIPS|EVP_CIPH_FLAG_DEFAULT_ASN1, 209 EVP_CIPH_RAND_KEY, des_ede_init_key, NULL,
167 des_ede_init_key, 210 EVP_CIPHER_set_asn1_iv,
168 NULL, NULL, NULL, 211 EVP_CIPHER_get_asn1_iv,
169 des3_ctrl) 212 des3_ctrl)
170 213
171#define des_ede3_cfb64_cipher des_ede_cfb64_cipher 214#define des_ede3_cfb64_cipher des_ede_cfb64_cipher
@@ -174,21 +217,21 @@ BLOCK_CIPHER_defs(des_ede, DES_EDE_KEY, NID_des_ede, 8, 16, 8, 64,
174#define des_ede3_ecb_cipher des_ede_ecb_cipher 217#define des_ede3_ecb_cipher des_ede_ecb_cipher
175 218
176BLOCK_CIPHER_defs(des_ede3, DES_EDE_KEY, NID_des_ede3, 8, 24, 8, 64, 219BLOCK_CIPHER_defs(des_ede3, DES_EDE_KEY, NID_des_ede3, 8, 24, 8, 64,
177 EVP_CIPH_RAND_KEY|EVP_CIPH_FLAG_FIPS|EVP_CIPH_FLAG_DEFAULT_ASN1, 220 EVP_CIPH_RAND_KEY, des_ede3_init_key, NULL,
178 des_ede3_init_key, 221 EVP_CIPHER_set_asn1_iv,
179 NULL, NULL, NULL, 222 EVP_CIPHER_get_asn1_iv,
180 des3_ctrl) 223 des3_ctrl)
181 224
182BLOCK_CIPHER_def_cfb(des_ede3,DES_EDE_KEY,NID_des_ede3,24,8,1, 225BLOCK_CIPHER_def_cfb(des_ede3,DES_EDE_KEY,NID_des_ede3,24,8,1,
183 EVP_CIPH_RAND_KEY|EVP_CIPH_FLAG_FIPS|EVP_CIPH_FLAG_DEFAULT_ASN1, 226 EVP_CIPH_RAND_KEY, des_ede3_init_key,NULL,
184 des_ede3_init_key, 227 EVP_CIPHER_set_asn1_iv,
185 NULL, NULL, NULL, 228 EVP_CIPHER_get_asn1_iv,
186 des3_ctrl) 229 des3_ctrl)
187 230
188BLOCK_CIPHER_def_cfb(des_ede3,DES_EDE_KEY,NID_des_ede3,24,8,8, 231BLOCK_CIPHER_def_cfb(des_ede3,DES_EDE_KEY,NID_des_ede3,24,8,8,
189 EVP_CIPH_RAND_KEY|EVP_CIPH_FLAG_FIPS|EVP_CIPH_FLAG_DEFAULT_ASN1, 232 EVP_CIPH_RAND_KEY, des_ede3_init_key,NULL,
190 des_ede3_init_key, 233 EVP_CIPHER_set_asn1_iv,
191 NULL, NULL, NULL, 234 EVP_CIPHER_get_asn1_iv,
192 des3_ctrl) 235 des3_ctrl)
193 236
194static int des_ede_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, 237static int des_ede_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
@@ -215,7 +258,7 @@ static int des_ede3_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
215#ifdef KSSL_DEBUG 258#ifdef KSSL_DEBUG
216 { 259 {
217 int i; 260 int i;
218 printf("des_ede3_init_key(ctx=%lx)\n", (unsigned long)ctx); 261 printf("des_ede3_init_key(ctx=%lx)\n", ctx);
219 printf("\tKEY= "); 262 printf("\tKEY= ");
220 for(i=0;i<24;i++) printf("%02X",key[i]); printf("\n"); 263 for(i=0;i<24;i++) printf("%02X",key[i]); printf("\n");
221 printf("\t IV= "); 264 printf("\t IV= ");
diff --git a/src/lib/libcrypto/evp/e_idea.c b/src/lib/libcrypto/evp/e_idea.c
index 48c33a774a..806b080360 100644
--- a/src/lib/libcrypto/evp/e_idea.c
+++ b/src/lib/libcrypto/evp/e_idea.c
@@ -73,7 +73,7 @@ static int idea_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
73 */ 73 */
74 74
75static int idea_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 75static int idea_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
76 const unsigned char *in, unsigned int inl) 76 const unsigned char *in, size_t inl)
77{ 77{
78 BLOCK_CIPHER_ecb_loop() 78 BLOCK_CIPHER_ecb_loop()
79 idea_ecb_encrypt(in + i, out + i, ctx->cipher_data); 79 idea_ecb_encrypt(in + i, out + i, ctx->cipher_data);
diff --git a/src/lib/libcrypto/evp/e_null.c b/src/lib/libcrypto/evp/e_null.c
index 0872d733e4..7cf50e1416 100644
--- a/src/lib/libcrypto/evp/e_null.c
+++ b/src/lib/libcrypto/evp/e_null.c
@@ -64,12 +64,12 @@
64static int null_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, 64static int null_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
65 const unsigned char *iv,int enc); 65 const unsigned char *iv,int enc);
66static int null_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 66static int null_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
67 const unsigned char *in, unsigned int inl); 67 const unsigned char *in, size_t inl);
68static const EVP_CIPHER n_cipher= 68static const EVP_CIPHER n_cipher=
69 { 69 {
70 NID_undef, 70 NID_undef,
71 1,0,0, 71 1,0,0,
72 EVP_CIPH_FLAG_FIPS, 72 0,
73 null_init_key, 73 null_init_key,
74 null_cipher, 74 null_cipher,
75 NULL, 75 NULL,
@@ -93,10 +93,10 @@ static int null_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
93 } 93 }
94 94
95static int null_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 95static int null_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
96 const unsigned char *in, unsigned int inl) 96 const unsigned char *in, size_t inl)
97 { 97 {
98 if (in != out) 98 if (in != out)
99 memcpy((char *)out,(const char *)in,(size_t)inl); 99 memcpy((char *)out,(const char *)in,inl);
100 return 1; 100 return 1;
101 } 101 }
102 102
diff --git a/src/lib/libcrypto/evp/e_rc2.c b/src/lib/libcrypto/evp/e_rc2.c
index d37726ffae..f78d781129 100644
--- a/src/lib/libcrypto/evp/e_rc2.c
+++ b/src/lib/libcrypto/evp/e_rc2.c
@@ -223,6 +223,11 @@ static int rc2_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr)
223 return 1; 223 return 1;
224 } 224 }
225 return 0; 225 return 0;
226#ifdef PBE_PRF_TEST
227 case EVP_CTRL_PBE_PRF_NID:
228 *(int *)ptr = NID_hmacWithMD5;
229 return 1;
230#endif
226 231
227 default: 232 default:
228 return -1; 233 return -1;
diff --git a/src/lib/libcrypto/evp/e_rc4.c b/src/lib/libcrypto/evp/e_rc4.c
index 55baad7446..8b5175e0fd 100644
--- a/src/lib/libcrypto/evp/e_rc4.c
+++ b/src/lib/libcrypto/evp/e_rc4.c
@@ -64,7 +64,6 @@
64#include <openssl/evp.h> 64#include <openssl/evp.h>
65#include <openssl/objects.h> 65#include <openssl/objects.h>
66#include <openssl/rc4.h> 66#include <openssl/rc4.h>
67#include "evp_locl.h"
68 67
69/* FIXME: surely this is available elsewhere? */ 68/* FIXME: surely this is available elsewhere? */
70#define EVP_RC4_KEY_SIZE 16 69#define EVP_RC4_KEY_SIZE 16
@@ -79,7 +78,7 @@ typedef struct
79static int rc4_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, 78static int rc4_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
80 const unsigned char *iv,int enc); 79 const unsigned char *iv,int enc);
81static int rc4_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 80static int rc4_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
82 const unsigned char *in, unsigned int inl); 81 const unsigned char *in, size_t inl);
83static const EVP_CIPHER r4_cipher= 82static const EVP_CIPHER r4_cipher=
84 { 83 {
85 NID_rc4, 84 NID_rc4,
@@ -129,7 +128,7 @@ static int rc4_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
129 } 128 }
130 129
131static int rc4_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 130static int rc4_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
132 const unsigned char *in, unsigned int inl) 131 const unsigned char *in, size_t inl)
133 { 132 {
134 RC4(&data(ctx)->ks,inl,in,out); 133 RC4(&data(ctx)->ks,inl,in,out);
135 return 1; 134 return 1;
diff --git a/src/lib/libcrypto/evp/e_xcbc_d.c b/src/lib/libcrypto/evp/e_xcbc_d.c
index 8832da2433..250e88c8c5 100644
--- a/src/lib/libcrypto/evp/e_xcbc_d.c
+++ b/src/lib/libcrypto/evp/e_xcbc_d.c
@@ -63,12 +63,13 @@
63 63
64#include <openssl/evp.h> 64#include <openssl/evp.h>
65#include <openssl/objects.h> 65#include <openssl/objects.h>
66#include "evp_locl.h"
66#include <openssl/des.h> 67#include <openssl/des.h>
67 68
68static int desx_cbc_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, 69static int desx_cbc_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
69 const unsigned char *iv,int enc); 70 const unsigned char *iv,int enc);
70static int desx_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 71static int desx_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
71 const unsigned char *in, unsigned int inl); 72 const unsigned char *in, size_t inl);
72 73
73 74
74typedef struct 75typedef struct
@@ -113,13 +114,25 @@ static int desx_cbc_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
113 } 114 }
114 115
115static int desx_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 116static int desx_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
116 const unsigned char *in, unsigned int inl) 117 const unsigned char *in, size_t inl)
117 { 118 {
118 DES_xcbc_encrypt(in,out,inl,&data(ctx)->ks, 119 while (inl>=EVP_MAXCHUNK)
120 {
121 DES_xcbc_encrypt(in,out,(long)EVP_MAXCHUNK,&data(ctx)->ks,
119 (DES_cblock *)&(ctx->iv[0]), 122 (DES_cblock *)&(ctx->iv[0]),
120 &data(ctx)->inw, 123 &data(ctx)->inw,
121 &data(ctx)->outw, 124 &data(ctx)->outw,
122 ctx->encrypt); 125 ctx->encrypt);
126 inl-=EVP_MAXCHUNK;
127 in +=EVP_MAXCHUNK;
128 out+=EVP_MAXCHUNK;
129 }
130 if (inl)
131 DES_xcbc_encrypt(in,out,(long)inl,&data(ctx)->ks,
132 (DES_cblock *)&(ctx->iv[0]),
133 &data(ctx)->inw,
134 &data(ctx)->outw,
135 ctx->encrypt);
123 return 1; 136 return 1;
124 } 137 }
125#endif 138#endif
diff --git a/src/lib/libcrypto/evp/enc_min.c b/src/lib/libcrypto/evp/enc_min.c
deleted file mode 100644
index 7fba38ee24..0000000000
--- a/src/lib/libcrypto/evp/enc_min.c
+++ /dev/null
@@ -1,390 +0,0 @@
1/* crypto/evp/enc_min.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 <openssl/evp.h>
62#include <openssl/err.h>
63#include <openssl/rand.h>
64#ifndef OPENSSL_NO_ENGINE
65#include <openssl/engine.h>
66#endif
67#include "evp_locl.h"
68
69void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *ctx)
70 {
71#ifdef OPENSSL_FIPS
72 FIPS_selftest_check();
73#endif
74 memset(ctx,0,sizeof(EVP_CIPHER_CTX));
75 /* ctx->cipher=NULL; */
76 }
77
78#ifdef OPENSSL_FIPS
79
80/* The purpose of these is to trap programs that attempt to use non FIPS
81 * algorithms in FIPS mode and ignore the errors.
82 */
83
84static int bad_init(EVP_CIPHER_CTX *ctx, const unsigned char *key,
85 const unsigned char *iv, int enc)
86 { FIPS_ERROR_IGNORED("Cipher init"); return 0;}
87
88static int bad_do_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
89 const unsigned char *in, unsigned int inl)
90 { FIPS_ERROR_IGNORED("Cipher update"); return 0;}
91
92/* NB: no cleanup because it is allowed after failed init */
93
94static int bad_set_asn1(EVP_CIPHER_CTX *ctx, ASN1_TYPE *typ)
95 { FIPS_ERROR_IGNORED("Cipher set_asn1"); return 0;}
96static int bad_get_asn1(EVP_CIPHER_CTX *ctx, ASN1_TYPE *typ)
97 { FIPS_ERROR_IGNORED("Cipher get_asn1"); return 0;}
98static int bad_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr)
99 { FIPS_ERROR_IGNORED("Cipher ctrl"); return 0;}
100
101static const EVP_CIPHER bad_cipher =
102 {
103 0,
104 0,
105 0,
106 0,
107 0,
108 bad_init,
109 bad_do_cipher,
110 NULL,
111 0,
112 bad_set_asn1,
113 bad_get_asn1,
114 bad_ctrl,
115 NULL
116 };
117
118#endif
119
120#ifndef OPENSSL_NO_ENGINE
121
122#ifdef OPENSSL_FIPS
123
124static int do_engine_null(ENGINE *impl) { return 0;}
125static int do_evp_enc_engine_null(EVP_CIPHER_CTX *ctx,
126 const EVP_CIPHER **pciph, ENGINE *impl)
127 { return 1; }
128
129static int (*do_engine_finish)(ENGINE *impl)
130 = do_engine_null;
131
132static int (*do_evp_enc_engine)
133 (EVP_CIPHER_CTX *ctx, const EVP_CIPHER **pciph, ENGINE *impl)
134 = do_evp_enc_engine_null;
135
136void int_EVP_CIPHER_set_engine_callbacks(
137 int (*eng_ciph_fin)(ENGINE *impl),
138 int (*eng_ciph_evp)
139 (EVP_CIPHER_CTX *ctx, const EVP_CIPHER **pciph, ENGINE *impl))
140 {
141 do_engine_finish = eng_ciph_fin;
142 do_evp_enc_engine = eng_ciph_evp;
143 }
144
145#else
146
147#define do_engine_finish ENGINE_finish
148
149static int do_evp_enc_engine(EVP_CIPHER_CTX *ctx, const EVP_CIPHER **pcipher, ENGINE *impl)
150 {
151 if(impl)
152 {
153 if (!ENGINE_init(impl))
154 {
155 EVPerr(EVP_F_DO_EVP_ENC_ENGINE, EVP_R_INITIALIZATION_ERROR);
156 return 0;
157 }
158 }
159 else
160 /* Ask if an ENGINE is reserved for this job */
161 impl = ENGINE_get_cipher_engine((*pcipher)->nid);
162 if(impl)
163 {
164 /* There's an ENGINE for this job ... (apparently) */
165 const EVP_CIPHER *c = ENGINE_get_cipher(impl, (*pcipher)->nid);
166 if(!c)
167 {
168 /* One positive side-effect of US's export
169 * control history, is that we should at least
170 * be able to avoid using US mispellings of
171 * "initialisation"? */
172 EVPerr(EVP_F_DO_EVP_ENC_ENGINE, EVP_R_INITIALIZATION_ERROR);
173 return 0;
174 }
175 /* We'll use the ENGINE's private cipher definition */
176 *pcipher = c;
177 /* Store the ENGINE functional reference so we know
178 * 'cipher' came from an ENGINE and we need to release
179 * it when done. */
180 ctx->engine = impl;
181 }
182 else
183 ctx->engine = NULL;
184 return 1;
185 }
186
187#endif
188
189#endif
190
191int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, ENGINE *impl,
192 const unsigned char *key, const unsigned char *iv, int enc)
193 {
194 if (enc == -1)
195 enc = ctx->encrypt;
196 else
197 {
198 if (enc)
199 enc = 1;
200 ctx->encrypt = enc;
201 }
202#ifdef OPENSSL_FIPS
203 if(FIPS_selftest_failed())
204 {
205 FIPSerr(FIPS_F_EVP_CIPHERINIT_EX,FIPS_R_FIPS_SELFTEST_FAILED);
206 ctx->cipher = &bad_cipher;
207 return 0;
208 }
209#endif
210#ifndef OPENSSL_NO_ENGINE
211 /* Whether it's nice or not, "Inits" can be used on "Final"'d contexts
212 * so this context may already have an ENGINE! Try to avoid releasing
213 * the previous handle, re-querying for an ENGINE, and having a
214 * reinitialisation, when it may all be unecessary. */
215 if (ctx->engine && ctx->cipher && (!cipher ||
216 (cipher && (cipher->nid == ctx->cipher->nid))))
217 goto skip_to_init;
218#endif
219 if (cipher)
220 {
221 /* Ensure a context left lying around from last time is cleared
222 * (the previous check attempted to avoid this if the same
223 * ENGINE and EVP_CIPHER could be used). */
224 EVP_CIPHER_CTX_cleanup(ctx);
225
226 /* Restore encrypt field: it is zeroed by cleanup */
227 ctx->encrypt = enc;
228#ifndef OPENSSL_NO_ENGINE
229 if (!do_evp_enc_engine(ctx, &cipher, impl))
230 return 0;
231#endif
232
233 ctx->cipher=cipher;
234 if (ctx->cipher->ctx_size)
235 {
236 ctx->cipher_data=OPENSSL_malloc(ctx->cipher->ctx_size);
237 if (!ctx->cipher_data)
238 {
239 EVPerr(EVP_F_EVP_CIPHERINIT_EX, ERR_R_MALLOC_FAILURE);
240 return 0;
241 }
242 }
243 else
244 {
245 ctx->cipher_data = NULL;
246 }
247 ctx->key_len = cipher->key_len;
248 ctx->flags = 0;
249 if(ctx->cipher->flags & EVP_CIPH_CTRL_INIT)
250 {
251 if(!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_INIT, 0, NULL))
252 {
253 EVPerr(EVP_F_EVP_CIPHERINIT_EX, EVP_R_INITIALIZATION_ERROR);
254 return 0;
255 }
256 }
257 }
258 else if(!ctx->cipher)
259 {
260 EVPerr(EVP_F_EVP_CIPHERINIT_EX, EVP_R_NO_CIPHER_SET);
261 return 0;
262 }
263#ifndef OPENSSL_NO_ENGINE
264skip_to_init:
265#endif
266 /* we assume block size is a power of 2 in *cryptUpdate */
267 OPENSSL_assert(ctx->cipher->block_size == 1
268 || ctx->cipher->block_size == 8
269 || ctx->cipher->block_size == 16);
270
271 if(!(EVP_CIPHER_CTX_flags(ctx) & EVP_CIPH_CUSTOM_IV)) {
272 switch(EVP_CIPHER_CTX_mode(ctx)) {
273
274 case EVP_CIPH_STREAM_CIPHER:
275 case EVP_CIPH_ECB_MODE:
276 break;
277
278 case EVP_CIPH_CFB_MODE:
279 case EVP_CIPH_OFB_MODE:
280
281 ctx->num = 0;
282
283 case EVP_CIPH_CBC_MODE:
284
285 OPENSSL_assert(EVP_CIPHER_CTX_iv_length(ctx) <=
286 (int)sizeof(ctx->iv));
287 if(iv) memcpy(ctx->oiv, iv, EVP_CIPHER_CTX_iv_length(ctx));
288 memcpy(ctx->iv, ctx->oiv, EVP_CIPHER_CTX_iv_length(ctx));
289 break;
290
291 default:
292 return 0;
293 break;
294 }
295 }
296
297#ifdef OPENSSL_FIPS
298 /* After 'key' is set no further parameters changes are permissible.
299 * So only check for non FIPS enabling at this point.
300 */
301 if (key && FIPS_mode())
302 {
303 if (!(ctx->cipher->flags & EVP_CIPH_FLAG_FIPS)
304 & !(ctx->flags & EVP_CIPH_FLAG_NON_FIPS_ALLOW))
305 {
306 EVPerr(EVP_F_EVP_CIPHERINIT_EX, EVP_R_DISABLED_FOR_FIPS);
307#if 0
308 ERR_add_error_data(2, "cipher=",
309 EVP_CIPHER_name(ctx->cipher));
310#endif
311 ctx->cipher = &bad_cipher;
312 return 0;
313 }
314 }
315#endif
316
317 if(key || (ctx->cipher->flags & EVP_CIPH_ALWAYS_CALL_INIT)) {
318 if(!ctx->cipher->init(ctx,key,iv,enc)) return 0;
319 }
320 ctx->buf_len=0;
321 ctx->final_used=0;
322 ctx->block_mask=ctx->cipher->block_size-1;
323 return 1;
324 }
325
326int EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *c)
327 {
328 if (c->cipher != NULL)
329 {
330 if(c->cipher->cleanup && !c->cipher->cleanup(c))
331 return 0;
332 /* Cleanse cipher context data */
333 if (c->cipher_data)
334 OPENSSL_cleanse(c->cipher_data, c->cipher->ctx_size);
335 }
336 if (c->cipher_data)
337 OPENSSL_free(c->cipher_data);
338#ifndef OPENSSL_NO_ENGINE
339 if (c->engine)
340 /* The EVP_CIPHER we used belongs to an ENGINE, release the
341 * functional reference we held for this reason. */
342 do_engine_finish(c->engine);
343#endif
344 memset(c,0,sizeof(EVP_CIPHER_CTX));
345 return 1;
346 }
347
348int EVP_Cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, unsigned int inl)
349 {
350#ifdef OPENSSL_FIPS
351 FIPS_selftest_check();
352#endif
353 return ctx->cipher->do_cipher(ctx,out,in,inl);
354 }
355
356int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr)
357{
358 int ret;
359 if(!ctx->cipher) {
360 EVPerr(EVP_F_EVP_CIPHER_CTX_CTRL, EVP_R_NO_CIPHER_SET);
361 return 0;
362 }
363
364 if(!ctx->cipher->ctrl) {
365 EVPerr(EVP_F_EVP_CIPHER_CTX_CTRL, EVP_R_CTRL_NOT_IMPLEMENTED);
366 return 0;
367 }
368
369 ret = ctx->cipher->ctrl(ctx, type, arg, ptr);
370 if(ret == -1) {
371 EVPerr(EVP_F_EVP_CIPHER_CTX_CTRL, EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED);
372 return 0;
373 }
374 return ret;
375}
376
377unsigned long EVP_CIPHER_CTX_flags(const EVP_CIPHER_CTX *ctx)
378 {
379 return ctx->cipher->flags;
380 }
381
382int EVP_CIPHER_CTX_iv_length(const EVP_CIPHER_CTX *ctx)
383 {
384 return ctx->cipher->iv_len;
385 }
386
387int EVP_CIPHER_nid(const EVP_CIPHER *cipher)
388 {
389 return cipher->nid;
390 }
diff --git a/src/lib/libcrypto/evp/encode.c b/src/lib/libcrypto/evp/encode.c
index 5921f0d710..b42c747249 100644
--- a/src/lib/libcrypto/evp/encode.c
+++ b/src/lib/libcrypto/evp/encode.c
@@ -85,7 +85,7 @@
85#define CHUNKS_PER_LINE (64/4) 85#define CHUNKS_PER_LINE (64/4)
86#define CHAR_PER_LINE (64+1) 86#define CHAR_PER_LINE (64+1)
87 87
88static unsigned char data_bin2ascii[65]="ABCDEFGHIJKLMNOPQRSTUVWXYZ\ 88static const unsigned char data_bin2ascii[65]="ABCDEFGHIJKLMNOPQRSTUVWXYZ\
89abcdefghijklmnopqrstuvwxyz0123456789+/"; 89abcdefghijklmnopqrstuvwxyz0123456789+/";
90 90
91/* 0xF0 is a EOLN 91/* 0xF0 is a EOLN
@@ -102,7 +102,7 @@ abcdefghijklmnopqrstuvwxyz0123456789+/";
102#define B64_ERROR 0xFF 102#define B64_ERROR 0xFF
103#define B64_NOT_BASE64(a) (((a)|0x13) == 0xF3) 103#define B64_NOT_BASE64(a) (((a)|0x13) == 0xF3)
104 104
105static unsigned char data_ascii2bin[128]={ 105static const unsigned char data_ascii2bin[128]={
106 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 106 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
107 0xFF,0xE0,0xF0,0xFF,0xFF,0xF1,0xFF,0xFF, 107 0xFF,0xE0,0xF0,0xFF,0xFF,0xF1,0xFF,0xFF,
108 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 108 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
diff --git a/src/lib/libcrypto/evp/evp.h b/src/lib/libcrypto/evp/evp.h
index 82b5862ce7..da93e945f5 100644
--- a/src/lib/libcrypto/evp/evp.h
+++ b/src/lib/libcrypto/evp/evp.h
@@ -75,10 +75,6 @@
75#include <openssl/bio.h> 75#include <openssl/bio.h>
76#endif 76#endif
77 77
78#ifdef OPENSSL_FIPS
79#include <openssl/fips.h>
80#endif
81
82/* 78/*
83#define EVP_RC2_KEY_SIZE 16 79#define EVP_RC2_KEY_SIZE 16
84#define EVP_RC4_KEY_SIZE 16 80#define EVP_RC4_KEY_SIZE 16
@@ -119,6 +115,7 @@
119#define EVP_PKEY_DSA4 NID_dsaWithSHA1_2 115#define EVP_PKEY_DSA4 NID_dsaWithSHA1_2
120#define EVP_PKEY_DH NID_dhKeyAgreement 116#define EVP_PKEY_DH NID_dhKeyAgreement
121#define EVP_PKEY_EC NID_X9_62_id_ecPublicKey 117#define EVP_PKEY_EC NID_X9_62_id_ecPublicKey
118#define EVP_PKEY_HMAC NID_hmac
122 119
123#ifdef __cplusplus 120#ifdef __cplusplus
124extern "C" { 121extern "C" {
@@ -132,6 +129,8 @@ struct evp_pkey_st
132 int type; 129 int type;
133 int save_type; 130 int save_type;
134 int references; 131 int references;
132 const EVP_PKEY_ASN1_METHOD *ameth;
133 ENGINE *engine;
135 union { 134 union {
136 char *ptr; 135 char *ptr;
137#ifndef OPENSSL_NO_RSA 136#ifndef OPENSSL_NO_RSA
@@ -156,73 +155,6 @@ struct evp_pkey_st
156#define EVP_PKEY_MO_ENCRYPT 0x0004 155#define EVP_PKEY_MO_ENCRYPT 0x0004
157#define EVP_PKEY_MO_DECRYPT 0x0008 156#define EVP_PKEY_MO_DECRYPT 0x0008
158 157
159#if 0
160/* This structure is required to tie the message digest and signing together.
161 * The lookup can be done by md/pkey_method, oid, oid/pkey_method, or
162 * oid, md and pkey.
163 * This is required because for various smart-card perform the digest and
164 * signing/verification on-board. To handle this case, the specific
165 * EVP_MD and EVP_PKEY_METHODs need to be closely associated.
166 * When a PKEY is created, it will have a EVP_PKEY_METHOD associated with it.
167 * This can either be software or a token to provide the required low level
168 * routines.
169 */
170typedef struct evp_pkey_md_st
171 {
172 int oid;
173 EVP_MD *md;
174 EVP_PKEY_METHOD *pkey;
175 } EVP_PKEY_MD;
176
177#define EVP_rsa_md2() \
178 EVP_PKEY_MD_add(NID_md2WithRSAEncryption,\
179 EVP_rsa_pkcs1(),EVP_md2())
180#define EVP_rsa_md5() \
181 EVP_PKEY_MD_add(NID_md5WithRSAEncryption,\
182 EVP_rsa_pkcs1(),EVP_md5())
183#define EVP_rsa_sha0() \
184 EVP_PKEY_MD_add(NID_shaWithRSAEncryption,\
185 EVP_rsa_pkcs1(),EVP_sha())
186#define EVP_rsa_sha1() \
187 EVP_PKEY_MD_add(NID_sha1WithRSAEncryption,\
188 EVP_rsa_pkcs1(),EVP_sha1())
189#define EVP_rsa_ripemd160() \
190 EVP_PKEY_MD_add(NID_ripemd160WithRSA,\
191 EVP_rsa_pkcs1(),EVP_ripemd160())
192#define EVP_rsa_mdc2() \
193 EVP_PKEY_MD_add(NID_mdc2WithRSA,\
194 EVP_rsa_octet_string(),EVP_mdc2())
195#define EVP_dsa_sha() \
196 EVP_PKEY_MD_add(NID_dsaWithSHA,\
197 EVP_dsa(),EVP_sha())
198#define EVP_dsa_sha1() \
199 EVP_PKEY_MD_add(NID_dsaWithSHA1,\
200 EVP_dsa(),EVP_sha1())
201
202typedef struct evp_pkey_method_st
203 {
204 char *name;
205 int flags;
206 int type; /* RSA, DSA, an SSLeay specific constant */
207 int oid; /* For the pub-key type */
208 int encrypt_oid; /* pub/priv key encryption */
209
210 int (*sign)();
211 int (*verify)();
212 struct {
213 int (*set)(); /* get and/or set the underlying type */
214 int (*get)();
215 int (*encrypt)();
216 int (*decrypt)();
217 int (*i2d)();
218 int (*d2i)();
219 int (*dup)();
220 } pub,priv;
221 int (*set_asn1_parameters)();
222 int (*get_asn1_parameters)();
223 } EVP_PKEY_METHOD;
224#endif
225
226#ifndef EVP_MD 158#ifndef EVP_MD
227struct env_md_st 159struct env_md_st
228 { 160 {
@@ -245,6 +177,8 @@ struct env_md_st
245 int required_pkey_type[5]; /*EVP_PKEY_xxx */ 177 int required_pkey_type[5]; /*EVP_PKEY_xxx */
246 int block_size; 178 int block_size;
247 int ctx_size; /* how big does the ctx->md_data need to be */ 179 int ctx_size; /* how big does the ctx->md_data need to be */
180 /* control function */
181 int (*md_ctrl)(EVP_MD_CTX *ctx, int cmd, int p1, void *p2);
248 } /* EVP_MD */; 182 } /* EVP_MD */;
249 183
250typedef int evp_sign_method(int type,const unsigned char *m, 184typedef int evp_sign_method(int type,const unsigned char *m,
@@ -254,18 +188,42 @@ typedef int evp_verify_method(int type,const unsigned char *m,
254 unsigned int m_length,const unsigned char *sigbuf, 188 unsigned int m_length,const unsigned char *sigbuf,
255 unsigned int siglen, void *key); 189 unsigned int siglen, void *key);
256 190
257typedef struct
258 {
259 EVP_MD_CTX *mctx;
260 void *key;
261 } EVP_MD_SVCTX;
262
263#define EVP_MD_FLAG_ONESHOT 0x0001 /* digest can only handle a single 191#define EVP_MD_FLAG_ONESHOT 0x0001 /* digest can only handle a single
264 * block */ 192 * block */
265 193
266#define EVP_MD_FLAG_FIPS 0x0400 /* Note if suitable for use in FIPS mode */ 194#define EVP_MD_FLAG_PKEY_DIGEST 0x0002 /* digest is a "clone" digest used
195 * which is a copy of an existing
196 * one for a specific public key type.
197 * EVP_dss1() etc */
198
199/* Digest uses EVP_PKEY_METHOD for signing instead of MD specific signing */
200
201#define EVP_MD_FLAG_PKEY_METHOD_SIGNATURE 0x0004
202
203/* DigestAlgorithmIdentifier flags... */
204
205#define EVP_MD_FLAG_DIGALGID_MASK 0x0018
267 206
268#define EVP_MD_FLAG_SVCTX 0x0800 /* pass EVP_MD_SVCTX to sign/verify */ 207/* NULL or absent parameter accepted. Use NULL */
208
209#define EVP_MD_FLAG_DIGALGID_NULL 0x0000
210
211/* NULL or absent parameter accepted. Use NULL for PKCS#1 otherwise absent */
212
213#define EVP_MD_FLAG_DIGALGID_ABSENT 0x0008
214
215/* Custom handling via ctrl */
216
217#define EVP_MD_FLAG_DIGALGID_CUSTOM 0x0018
218
219/* Digest ctrls */
220
221#define EVP_MD_CTRL_DIGALGID 0x1
222#define EVP_MD_CTRL_MICALG 0x2
223
224/* Minimum Algorithm specific ctrl value */
225
226#define EVP_MD_CTRL_ALG_CTRL 0x1000
269 227
270#define EVP_PKEY_NULL_method NULL,NULL,{0,0,0,0} 228#define EVP_PKEY_NULL_method NULL,NULL,{0,0,0,0}
271 229
@@ -307,6 +265,10 @@ struct env_md_ctx_st
307 ENGINE *engine; /* functional reference if 'digest' is ENGINE-provided */ 265 ENGINE *engine; /* functional reference if 'digest' is ENGINE-provided */
308 unsigned long flags; 266 unsigned long flags;
309 void *md_data; 267 void *md_data;
268 /* Public key context for sign/verify */
269 EVP_PKEY_CTX *pctx;
270 /* Update function: usually copied from EVP_MD */
271 int (*update)(EVP_MD_CTX *ctx,const void *data,size_t count);
310 } /* EVP_MD_CTX */; 272 } /* EVP_MD_CTX */;
311 273
312/* values for EVP_MD_CTX flags */ 274/* values for EVP_MD_CTX flags */
@@ -317,17 +279,23 @@ struct env_md_ctx_st
317 * cleaned */ 279 * cleaned */
318#define EVP_MD_CTX_FLAG_REUSE 0x0004 /* Don't free up ctx->md_data 280#define EVP_MD_CTX_FLAG_REUSE 0x0004 /* Don't free up ctx->md_data
319 * in EVP_MD_CTX_cleanup */ 281 * in EVP_MD_CTX_cleanup */
282/* FIPS and pad options are ignored in 1.0.0, definitions are here
283 * so we don't accidentally reuse the values for other purposes.
284 */
285
320#define EVP_MD_CTX_FLAG_NON_FIPS_ALLOW 0x0008 /* Allow use of non FIPS digest 286#define EVP_MD_CTX_FLAG_NON_FIPS_ALLOW 0x0008 /* Allow use of non FIPS digest
321 * in FIPS mode */ 287 * in FIPS mode */
322 288
289/* The following PAD options are also currently ignored in 1.0.0, digest
290 * parameters are handled through EVP_DigestSign*() and EVP_DigestVerify*()
291 * instead.
292 */
323#define EVP_MD_CTX_FLAG_PAD_MASK 0xF0 /* RSA mode to use */ 293#define EVP_MD_CTX_FLAG_PAD_MASK 0xF0 /* RSA mode to use */
324#define EVP_MD_CTX_FLAG_PAD_PKCS1 0x00 /* PKCS#1 v1.5 mode */ 294#define EVP_MD_CTX_FLAG_PAD_PKCS1 0x00 /* PKCS#1 v1.5 mode */
325#define EVP_MD_CTX_FLAG_PAD_X931 0x10 /* X9.31 mode */ 295#define EVP_MD_CTX_FLAG_PAD_X931 0x10 /* X9.31 mode */
326#define EVP_MD_CTX_FLAG_PAD_PSS 0x20 /* PSS mode */ 296#define EVP_MD_CTX_FLAG_PAD_PSS 0x20 /* PSS mode */
327#define M_EVP_MD_CTX_FLAG_PSS_SALT(ctx) \ 297
328 ((ctx->flags>>16) &0xFFFF) /* seed length */ 298#define EVP_MD_CTX_FLAG_NO_INIT 0x0100 /* Don't initialize md_data */
329#define EVP_MD_CTX_FLAG_PSS_MDLEN 0xFFFF /* salt len same as digest */
330#define EVP_MD_CTX_FLAG_PSS_MREC 0xFFFE /* salt max or auto recovered */
331 299
332struct evp_cipher_st 300struct evp_cipher_st
333 { 301 {
@@ -339,7 +307,7 @@ struct evp_cipher_st
339 int (*init)(EVP_CIPHER_CTX *ctx, const unsigned char *key, 307 int (*init)(EVP_CIPHER_CTX *ctx, const unsigned char *key,
340 const unsigned char *iv, int enc); /* init key */ 308 const unsigned char *iv, int enc); /* init key */
341 int (*do_cipher)(EVP_CIPHER_CTX *ctx, unsigned char *out, 309 int (*do_cipher)(EVP_CIPHER_CTX *ctx, unsigned char *out,
342 const unsigned char *in, unsigned int inl);/* encrypt/decrypt data */ 310 const unsigned char *in, size_t inl);/* encrypt/decrypt data */
343 int (*cleanup)(EVP_CIPHER_CTX *); /* cleanup ctx */ 311 int (*cleanup)(EVP_CIPHER_CTX *); /* cleanup ctx */
344 int ctx_size; /* how big ctx->cipher_data needs to be */ 312 int ctx_size; /* how big ctx->cipher_data needs to be */
345 int (*set_asn1_parameters)(EVP_CIPHER_CTX *, ASN1_TYPE *); /* Populate a ASN1_TYPE with parameters */ 313 int (*set_asn1_parameters)(EVP_CIPHER_CTX *, ASN1_TYPE *); /* Populate a ASN1_TYPE with parameters */
@@ -357,7 +325,7 @@ struct evp_cipher_st
357#define EVP_CIPH_CBC_MODE 0x2 325#define EVP_CIPH_CBC_MODE 0x2
358#define EVP_CIPH_CFB_MODE 0x3 326#define EVP_CIPH_CFB_MODE 0x3
359#define EVP_CIPH_OFB_MODE 0x4 327#define EVP_CIPH_OFB_MODE 0x4
360#define EVP_CIPH_MODE 0x7 328#define EVP_CIPH_MODE 0xF0007
361/* Set if variable length cipher */ 329/* Set if variable length cipher */
362#define EVP_CIPH_VARIABLE_LENGTH 0x8 330#define EVP_CIPH_VARIABLE_LENGTH 0x8
363/* Set if the iv handling should be done by the cipher itself */ 331/* Set if the iv handling should be done by the cipher itself */
@@ -372,10 +340,8 @@ struct evp_cipher_st
372#define EVP_CIPH_NO_PADDING 0x100 340#define EVP_CIPH_NO_PADDING 0x100
373/* cipher handles random key generation */ 341/* cipher handles random key generation */
374#define EVP_CIPH_RAND_KEY 0x200 342#define EVP_CIPH_RAND_KEY 0x200
375/* Note if suitable for use in FIPS mode */ 343/* cipher has its own additional copying logic */
376#define EVP_CIPH_FLAG_FIPS 0x400 344#define EVP_CIPH_CUSTOM_COPY 0x400
377/* Allow non FIPS cipher in FIPS mode */
378#define EVP_CIPH_FLAG_NON_FIPS_ALLOW 0x800
379/* Allow use default ASN1 get/set iv */ 345/* Allow use default ASN1 get/set iv */
380#define EVP_CIPH_FLAG_DEFAULT_ASN1 0x1000 346#define EVP_CIPH_FLAG_DEFAULT_ASN1 0x1000
381/* Buffer length in bits not bytes: CFB1 mode only */ 347/* Buffer length in bits not bytes: CFB1 mode only */
@@ -389,8 +355,10 @@ struct evp_cipher_st
389#define EVP_CTRL_SET_RC2_KEY_BITS 0x3 355#define EVP_CTRL_SET_RC2_KEY_BITS 0x3
390#define EVP_CTRL_GET_RC5_ROUNDS 0x4 356#define EVP_CTRL_GET_RC5_ROUNDS 0x4
391#define EVP_CTRL_SET_RC5_ROUNDS 0x5 357#define EVP_CTRL_SET_RC5_ROUNDS 0x5
392#define EVP_CTRL_SET_ACSS_MODE 0x6 358#define EVP_CTRL_RAND_KEY 0x6
393#define EVP_CTRL_RAND_KEY 0x7 359#define EVP_CTRL_PBE_PRF_NID 0x7
360#define EVP_CTRL_COPY 0x8
361#define EVP_CTRL_SET_ACSS_MODE 0x9
394 362
395typedef struct evp_cipher_info_st 363typedef struct evp_cipher_info_st
396 { 364 {
@@ -463,26 +431,15 @@ typedef int (EVP_PBE_KEYGEN)(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
463#define EVP_get_cipherbynid(a) EVP_get_cipherbyname(OBJ_nid2sn(a)) 431#define EVP_get_cipherbynid(a) EVP_get_cipherbyname(OBJ_nid2sn(a))
464#define EVP_get_cipherbyobj(a) EVP_get_cipherbynid(OBJ_obj2nid(a)) 432#define EVP_get_cipherbyobj(a) EVP_get_cipherbynid(OBJ_obj2nid(a))
465 433
466/* Macros to reduce FIPS dependencies: do NOT use in applications */
467#define M_EVP_MD_size(e) ((e)->md_size)
468#define M_EVP_MD_block_size(e) ((e)->block_size)
469#define M_EVP_MD_CTX_set_flags(ctx,flgs) ((ctx)->flags|=(flgs))
470#define M_EVP_MD_CTX_clear_flags(ctx,flgs) ((ctx)->flags&=~(flgs))
471#define M_EVP_MD_CTX_test_flags(ctx,flgs) ((ctx)->flags&(flgs))
472#define M_EVP_MD_type(e) ((e)->type)
473#define M_EVP_MD_CTX_type(e) M_EVP_MD_type(M_EVP_MD_CTX_md(e))
474#define M_EVP_MD_CTX_md(e) ((e)->digest)
475
476#define M_EVP_CIPHER_CTX_set_flags(ctx,flgs) ((ctx)->flags|=(flgs))
477
478int EVP_MD_type(const EVP_MD *md); 434int EVP_MD_type(const EVP_MD *md);
479#define EVP_MD_nid(e) EVP_MD_type(e) 435#define EVP_MD_nid(e) EVP_MD_type(e)
480#define EVP_MD_name(e) OBJ_nid2sn(EVP_MD_nid(e)) 436#define EVP_MD_name(e) OBJ_nid2sn(EVP_MD_nid(e))
481int EVP_MD_pkey_type(const EVP_MD *md); 437int EVP_MD_pkey_type(const EVP_MD *md);
482int EVP_MD_size(const EVP_MD *md); 438int EVP_MD_size(const EVP_MD *md);
483int EVP_MD_block_size(const EVP_MD *md); 439int EVP_MD_block_size(const EVP_MD *md);
440unsigned long EVP_MD_flags(const EVP_MD *md);
484 441
485const EVP_MD * EVP_MD_CTX_md(const EVP_MD_CTX *ctx); 442const EVP_MD *EVP_MD_CTX_md(const EVP_MD_CTX *ctx);
486#define EVP_MD_CTX_size(e) EVP_MD_size(EVP_MD_CTX_md(e)) 443#define EVP_MD_CTX_size(e) EVP_MD_size(EVP_MD_CTX_md(e))
487#define EVP_MD_CTX_block_size(e) EVP_MD_block_size(EVP_MD_CTX_md(e)) 444#define EVP_MD_CTX_block_size(e) EVP_MD_block_size(EVP_MD_CTX_md(e))
488#define EVP_MD_CTX_type(e) EVP_MD_type(EVP_MD_CTX_md(e)) 445#define EVP_MD_CTX_type(e) EVP_MD_type(EVP_MD_CTX_md(e))
@@ -500,6 +457,7 @@ int EVP_CIPHER_CTX_nid(const EVP_CIPHER_CTX *ctx);
500int EVP_CIPHER_CTX_block_size(const EVP_CIPHER_CTX *ctx); 457int EVP_CIPHER_CTX_block_size(const EVP_CIPHER_CTX *ctx);
501int EVP_CIPHER_CTX_key_length(const EVP_CIPHER_CTX *ctx); 458int EVP_CIPHER_CTX_key_length(const EVP_CIPHER_CTX *ctx);
502int EVP_CIPHER_CTX_iv_length(const EVP_CIPHER_CTX *ctx); 459int EVP_CIPHER_CTX_iv_length(const EVP_CIPHER_CTX *ctx);
460int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, const EVP_CIPHER_CTX *in);
503void * EVP_CIPHER_CTX_get_app_data(const EVP_CIPHER_CTX *ctx); 461void * EVP_CIPHER_CTX_get_app_data(const EVP_CIPHER_CTX *ctx);
504void EVP_CIPHER_CTX_set_app_data(EVP_CIPHER_CTX *ctx, void *data); 462void EVP_CIPHER_CTX_set_app_data(EVP_CIPHER_CTX *ctx, void *data);
505#define EVP_CIPHER_CTX_type(c) EVP_CIPHER_type(EVP_CIPHER_CTX_cipher(c)) 463#define EVP_CIPHER_CTX_type(c) EVP_CIPHER_type(EVP_CIPHER_CTX_cipher(c))
@@ -517,6 +475,8 @@ unsigned long EVP_CIPHER_CTX_flags(const EVP_CIPHER_CTX *ctx);
517#define EVP_VerifyUpdate(a,b,c) EVP_DigestUpdate(a,b,c) 475#define EVP_VerifyUpdate(a,b,c) EVP_DigestUpdate(a,b,c)
518#define EVP_OpenUpdate(a,b,c,d,e) EVP_DecryptUpdate(a,b,c,d,e) 476#define EVP_OpenUpdate(a,b,c,d,e) EVP_DecryptUpdate(a,b,c,d,e)
519#define EVP_SealUpdate(a,b,c,d,e) EVP_EncryptUpdate(a,b,c,d,e) 477#define EVP_SealUpdate(a,b,c,d,e) EVP_EncryptUpdate(a,b,c,d,e)
478#define EVP_DigestSignUpdate(a,b,c) EVP_DigestUpdate(a,b,c)
479#define EVP_DigestVerifyUpdate(a,b,c) EVP_DigestUpdate(a,b,c)
520 480
521#ifdef CONST_STRICT 481#ifdef CONST_STRICT
522void BIO_set_md(BIO *,const EVP_MD *md); 482void BIO_set_md(BIO *,const EVP_MD *md);
@@ -563,6 +523,7 @@ int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type);
563int EVP_DigestFinal(EVP_MD_CTX *ctx,unsigned char *md,unsigned int *s); 523int EVP_DigestFinal(EVP_MD_CTX *ctx,unsigned char *md,unsigned int *s);
564 524
565int EVP_read_pw_string(char *buf,int length,const char *prompt,int verify); 525int EVP_read_pw_string(char *buf,int length,const char *prompt,int verify);
526int EVP_read_pw_string_min(char *buf,int minlen,int maxlen,const char *prompt,int verify);
566void EVP_set_pw_prompt(const char *prompt); 527void EVP_set_pw_prompt(const char *prompt);
567char * EVP_get_pw_prompt(void); 528char * EVP_get_pw_prompt(void);
568 529
@@ -609,6 +570,16 @@ int EVP_SignFinal(EVP_MD_CTX *ctx,unsigned char *md,unsigned int *s,
609int EVP_VerifyFinal(EVP_MD_CTX *ctx,const unsigned char *sigbuf, 570int EVP_VerifyFinal(EVP_MD_CTX *ctx,const unsigned char *sigbuf,
610 unsigned int siglen,EVP_PKEY *pkey); 571 unsigned int siglen,EVP_PKEY *pkey);
611 572
573int EVP_DigestSignInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
574 const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey);
575int EVP_DigestSignFinal(EVP_MD_CTX *ctx,
576 unsigned char *sigret, size_t *siglen);
577
578int EVP_DigestVerifyInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
579 const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey);
580int EVP_DigestVerifyFinal(EVP_MD_CTX *ctx,
581 unsigned char *sig, size_t siglen);
582
612int EVP_OpenInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *type, 583int EVP_OpenInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *type,
613 const unsigned char *ek, int ekl, const unsigned char *iv, 584 const unsigned char *ek, int ekl, const unsigned char *iv,
614 EVP_PKEY *priv); 585 EVP_PKEY *priv);
@@ -681,6 +652,9 @@ const EVP_MD *EVP_mdc2(void);
681#ifndef OPENSSL_NO_RIPEMD 652#ifndef OPENSSL_NO_RIPEMD
682const EVP_MD *EVP_ripemd160(void); 653const EVP_MD *EVP_ripemd160(void);
683#endif 654#endif
655#ifndef OPENSSL_NO_WHIRLPOOL
656const EVP_MD *EVP_whirlpool(void);
657#endif
684const EVP_CIPHER *EVP_enc_null(void); /* does nothing :-) */ 658const EVP_CIPHER *EVP_enc_null(void); /* does nothing :-) */
685#ifndef OPENSSL_NO_DES 659#ifndef OPENSSL_NO_DES
686const EVP_CIPHER *EVP_des_ecb(void); 660const EVP_CIPHER *EVP_des_ecb(void);
@@ -851,16 +825,31 @@ const EVP_CIPHER *EVP_get_cipherbyname(const char *name);
851const EVP_MD *EVP_get_digestbyname(const char *name); 825const EVP_MD *EVP_get_digestbyname(const char *name);
852void EVP_cleanup(void); 826void EVP_cleanup(void);
853 827
854int EVP_PKEY_decrypt(unsigned char *dec_key, 828void EVP_CIPHER_do_all(void (*fn)(const EVP_CIPHER *ciph,
829 const char *from, const char *to, void *x), void *arg);
830void EVP_CIPHER_do_all_sorted(void (*fn)(const EVP_CIPHER *ciph,
831 const char *from, const char *to, void *x), void *arg);
832
833void EVP_MD_do_all(void (*fn)(const EVP_MD *ciph,
834 const char *from, const char *to, void *x), void *arg);
835void EVP_MD_do_all_sorted(void (*fn)(const EVP_MD *ciph,
836 const char *from, const char *to, void *x), void *arg);
837
838int EVP_PKEY_decrypt_old(unsigned char *dec_key,
855 const unsigned char *enc_key,int enc_key_len, 839 const unsigned char *enc_key,int enc_key_len,
856 EVP_PKEY *private_key); 840 EVP_PKEY *private_key);
857int EVP_PKEY_encrypt(unsigned char *enc_key, 841int EVP_PKEY_encrypt_old(unsigned char *enc_key,
858 const unsigned char *key,int key_len, 842 const unsigned char *key,int key_len,
859 EVP_PKEY *pub_key); 843 EVP_PKEY *pub_key);
860int EVP_PKEY_type(int type); 844int EVP_PKEY_type(int type);
845int EVP_PKEY_id(const EVP_PKEY *pkey);
846int EVP_PKEY_base_id(const EVP_PKEY *pkey);
861int EVP_PKEY_bits(EVP_PKEY *pkey); 847int EVP_PKEY_bits(EVP_PKEY *pkey);
862int EVP_PKEY_size(EVP_PKEY *pkey); 848int EVP_PKEY_size(EVP_PKEY *pkey);
863int EVP_PKEY_assign(EVP_PKEY *pkey,int type,char *key); 849int EVP_PKEY_set_type(EVP_PKEY *pkey,int type);
850int EVP_PKEY_set_type_str(EVP_PKEY *pkey, const char *str, int len);
851int EVP_PKEY_assign(EVP_PKEY *pkey,int type,void *key);
852void * EVP_PKEY_get0(EVP_PKEY *pkey);
864 853
865#ifndef OPENSSL_NO_RSA 854#ifndef OPENSSL_NO_RSA
866struct rsa_st; 855struct rsa_st;
@@ -903,6 +892,15 @@ int EVP_PKEY_cmp_parameters(const EVP_PKEY *a, const EVP_PKEY *b);
903 892
904int EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b); 893int EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b);
905 894
895int EVP_PKEY_print_public(BIO *out, const EVP_PKEY *pkey,
896 int indent, ASN1_PCTX *pctx);
897int EVP_PKEY_print_private(BIO *out, const EVP_PKEY *pkey,
898 int indent, ASN1_PCTX *pctx);
899int EVP_PKEY_print_params(BIO *out, const EVP_PKEY *pkey,
900 int indent, ASN1_PCTX *pctx);
901
902int EVP_PKEY_get_default_digest_nid(EVP_PKEY *pkey, int *pnid);
903
906int EVP_CIPHER_type(const EVP_CIPHER *ctx); 904int EVP_CIPHER_type(const EVP_CIPHER *ctx);
907 905
908/* calls methods */ 906/* calls methods */
@@ -920,6 +918,10 @@ int PKCS5_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
920int PKCS5_PBKDF2_HMAC_SHA1(const char *pass, int passlen, 918int PKCS5_PBKDF2_HMAC_SHA1(const char *pass, int passlen,
921 const unsigned char *salt, int saltlen, int iter, 919 const unsigned char *salt, int saltlen, int iter,
922 int keylen, unsigned char *out); 920 int keylen, unsigned char *out);
921int PKCS5_PBKDF2_HMAC(const char *pass, int passlen,
922 const unsigned char *salt, int saltlen, int iter,
923 const EVP_MD *digest,
924 int keylen, unsigned char *out);
923int PKCS5_v2_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, 925int PKCS5_v2_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
924 ASN1_TYPE *param, const EVP_CIPHER *cipher, const EVP_MD *md, 926 ASN1_TYPE *param, const EVP_CIPHER *cipher, const EVP_MD *md,
925 int en_de); 927 int en_de);
@@ -928,27 +930,260 @@ void PKCS5_PBE_add(void);
928 930
929int EVP_PBE_CipherInit (ASN1_OBJECT *pbe_obj, const char *pass, int passlen, 931int EVP_PBE_CipherInit (ASN1_OBJECT *pbe_obj, const char *pass, int passlen,
930 ASN1_TYPE *param, EVP_CIPHER_CTX *ctx, int en_de); 932 ASN1_TYPE *param, EVP_CIPHER_CTX *ctx, int en_de);
933
934/* PBE type */
935
936/* Can appear as the outermost AlgorithmIdentifier */
937#define EVP_PBE_TYPE_OUTER 0x0
938/* Is an PRF type OID */
939#define EVP_PBE_TYPE_PRF 0x1
940
941int EVP_PBE_alg_add_type(int pbe_type, int pbe_nid, int cipher_nid, int md_nid,
942 EVP_PBE_KEYGEN *keygen);
931int EVP_PBE_alg_add(int nid, const EVP_CIPHER *cipher, const EVP_MD *md, 943int EVP_PBE_alg_add(int nid, const EVP_CIPHER *cipher, const EVP_MD *md,
932 EVP_PBE_KEYGEN *keygen); 944 EVP_PBE_KEYGEN *keygen);
945int EVP_PBE_find(int type, int pbe_nid,
946 int *pcnid, int *pmnid, EVP_PBE_KEYGEN **pkeygen);
933void EVP_PBE_cleanup(void); 947void EVP_PBE_cleanup(void);
934 948
935#ifdef OPENSSL_FIPS 949#define ASN1_PKEY_ALIAS 0x1
936#ifndef OPENSSL_NO_ENGINE 950#define ASN1_PKEY_DYNAMIC 0x2
937void int_EVP_MD_set_engine_callbacks( 951#define ASN1_PKEY_SIGPARAM_NULL 0x4
938 int (*eng_md_init)(ENGINE *impl), 952
939 int (*eng_md_fin)(ENGINE *impl), 953#define ASN1_PKEY_CTRL_PKCS7_SIGN 0x1
940 int (*eng_md_evp) 954#define ASN1_PKEY_CTRL_PKCS7_ENCRYPT 0x2
941 (EVP_MD_CTX *ctx, const EVP_MD **ptype, ENGINE *impl)); 955#define ASN1_PKEY_CTRL_DEFAULT_MD_NID 0x3
942void int_EVP_MD_init_engine_callbacks(void); 956#define ASN1_PKEY_CTRL_CMS_SIGN 0x5
943void int_EVP_CIPHER_set_engine_callbacks( 957#define ASN1_PKEY_CTRL_CMS_ENVELOPE 0x7
944 int (*eng_ciph_fin)(ENGINE *impl), 958
945 int (*eng_ciph_evp) 959int EVP_PKEY_asn1_get_count(void);
946 (EVP_CIPHER_CTX *ctx, const EVP_CIPHER **pciph, ENGINE *impl)); 960const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_get0(int idx);
947void int_EVP_CIPHER_init_engine_callbacks(void); 961const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find(ENGINE **pe, int type);
948#endif 962const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find_str(ENGINE **pe,
949#endif 963 const char *str, int len);
964int EVP_PKEY_asn1_add0(const EVP_PKEY_ASN1_METHOD *ameth);
965int EVP_PKEY_asn1_add_alias(int to, int from);
966int EVP_PKEY_asn1_get0_info(int *ppkey_id, int *pkey_base_id, int *ppkey_flags,
967 const char **pinfo, const char **ppem_str,
968 const EVP_PKEY_ASN1_METHOD *ameth);
969
970const EVP_PKEY_ASN1_METHOD* EVP_PKEY_get0_asn1(EVP_PKEY *pkey);
971EVP_PKEY_ASN1_METHOD* EVP_PKEY_asn1_new(int id, int flags,
972 const char *pem_str, const char *info);
973void EVP_PKEY_asn1_copy(EVP_PKEY_ASN1_METHOD *dst,
974 const EVP_PKEY_ASN1_METHOD *src);
975void EVP_PKEY_asn1_free(EVP_PKEY_ASN1_METHOD *ameth);
976void EVP_PKEY_asn1_set_public(EVP_PKEY_ASN1_METHOD *ameth,
977 int (*pub_decode)(EVP_PKEY *pk, X509_PUBKEY *pub),
978 int (*pub_encode)(X509_PUBKEY *pub, const EVP_PKEY *pk),
979 int (*pub_cmp)(const EVP_PKEY *a, const EVP_PKEY *b),
980 int (*pub_print)(BIO *out, const EVP_PKEY *pkey, int indent,
981 ASN1_PCTX *pctx),
982 int (*pkey_size)(const EVP_PKEY *pk),
983 int (*pkey_bits)(const EVP_PKEY *pk));
984void EVP_PKEY_asn1_set_private(EVP_PKEY_ASN1_METHOD *ameth,
985 int (*priv_decode)(EVP_PKEY *pk, PKCS8_PRIV_KEY_INFO *p8inf),
986 int (*priv_encode)(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pk),
987 int (*priv_print)(BIO *out, const EVP_PKEY *pkey, int indent,
988 ASN1_PCTX *pctx));
989void EVP_PKEY_asn1_set_param(EVP_PKEY_ASN1_METHOD *ameth,
990 int (*param_decode)(EVP_PKEY *pkey,
991 const unsigned char **pder, int derlen),
992 int (*param_encode)(const EVP_PKEY *pkey, unsigned char **pder),
993 int (*param_missing)(const EVP_PKEY *pk),
994 int (*param_copy)(EVP_PKEY *to, const EVP_PKEY *from),
995 int (*param_cmp)(const EVP_PKEY *a, const EVP_PKEY *b),
996 int (*param_print)(BIO *out, const EVP_PKEY *pkey, int indent,
997 ASN1_PCTX *pctx));
998
999void EVP_PKEY_asn1_set_free(EVP_PKEY_ASN1_METHOD *ameth,
1000 void (*pkey_free)(EVP_PKEY *pkey));
1001void EVP_PKEY_asn1_set_ctrl(EVP_PKEY_ASN1_METHOD *ameth,
1002 int (*pkey_ctrl)(EVP_PKEY *pkey, int op,
1003 long arg1, void *arg2));
1004
1005
1006#define EVP_PKEY_OP_UNDEFINED 0
1007#define EVP_PKEY_OP_PARAMGEN (1<<1)
1008#define EVP_PKEY_OP_KEYGEN (1<<2)
1009#define EVP_PKEY_OP_SIGN (1<<3)
1010#define EVP_PKEY_OP_VERIFY (1<<4)
1011#define EVP_PKEY_OP_VERIFYRECOVER (1<<5)
1012#define EVP_PKEY_OP_SIGNCTX (1<<6)
1013#define EVP_PKEY_OP_VERIFYCTX (1<<7)
1014#define EVP_PKEY_OP_ENCRYPT (1<<8)
1015#define EVP_PKEY_OP_DECRYPT (1<<9)
1016#define EVP_PKEY_OP_DERIVE (1<<10)
1017
1018#define EVP_PKEY_OP_TYPE_SIG \
1019 (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYRECOVER \
1020 | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
1021
1022#define EVP_PKEY_OP_TYPE_CRYPT \
1023 (EVP_PKEY_OP_ENCRYPT | EVP_PKEY_OP_DECRYPT)
1024
1025#define EVP_PKEY_OP_TYPE_NOGEN \
1026 (EVP_PKEY_OP_SIG | EVP_PKEY_OP_CRYPT | EVP_PKEY_OP_DERIVE)
1027
1028#define EVP_PKEY_OP_TYPE_GEN \
1029 (EVP_PKEY_OP_PARAMGEN | EVP_PKEY_OP_KEYGEN)
1030
1031#define EVP_PKEY_CTX_set_signature_md(ctx, md) \
1032 EVP_PKEY_CTX_ctrl(ctx, -1, EVP_PKEY_OP_TYPE_SIG, \
1033 EVP_PKEY_CTRL_MD, 0, (void *)md)
1034
1035#define EVP_PKEY_CTRL_MD 1
1036#define EVP_PKEY_CTRL_PEER_KEY 2
1037
1038#define EVP_PKEY_CTRL_PKCS7_ENCRYPT 3
1039#define EVP_PKEY_CTRL_PKCS7_DECRYPT 4
1040
1041#define EVP_PKEY_CTRL_PKCS7_SIGN 5
1042
1043#define EVP_PKEY_CTRL_SET_MAC_KEY 6
1044
1045#define EVP_PKEY_CTRL_DIGESTINIT 7
1046
1047/* Used by GOST key encryption in TLS */
1048#define EVP_PKEY_CTRL_SET_IV 8
1049
1050#define EVP_PKEY_CTRL_CMS_ENCRYPT 9
1051#define EVP_PKEY_CTRL_CMS_DECRYPT 10
1052#define EVP_PKEY_CTRL_CMS_SIGN 11
1053
1054#define EVP_PKEY_ALG_CTRL 0x1000
1055
1056
1057#define EVP_PKEY_FLAG_AUTOARGLEN 2
1058
1059const EVP_PKEY_METHOD *EVP_PKEY_meth_find(int type);
1060EVP_PKEY_METHOD* EVP_PKEY_meth_new(int id, int flags);
1061void EVP_PKEY_meth_free(EVP_PKEY_METHOD *pmeth);
1062int EVP_PKEY_meth_add0(const EVP_PKEY_METHOD *pmeth);
1063
1064EVP_PKEY_CTX *EVP_PKEY_CTX_new(EVP_PKEY *pkey, ENGINE *e);
1065EVP_PKEY_CTX *EVP_PKEY_CTX_new_id(int id, ENGINE *e);
1066EVP_PKEY_CTX *EVP_PKEY_CTX_dup(EVP_PKEY_CTX *ctx);
1067void EVP_PKEY_CTX_free(EVP_PKEY_CTX *ctx);
1068
1069int EVP_PKEY_CTX_ctrl(EVP_PKEY_CTX *ctx, int keytype, int optype,
1070 int cmd, int p1, void *p2);
1071int EVP_PKEY_CTX_ctrl_str(EVP_PKEY_CTX *ctx, const char *type,
1072 const char *value);
1073
1074int EVP_PKEY_CTX_get_operation(EVP_PKEY_CTX *ctx);
1075void EVP_PKEY_CTX_set0_keygen_info(EVP_PKEY_CTX *ctx, int *dat, int datlen);
1076
1077EVP_PKEY *EVP_PKEY_new_mac_key(int type, ENGINE *e,
1078 unsigned char *key, int keylen);
1079
1080void EVP_PKEY_CTX_set_data(EVP_PKEY_CTX *ctx, void *data);
1081void *EVP_PKEY_CTX_get_data(EVP_PKEY_CTX *ctx);
1082EVP_PKEY *EVP_PKEY_CTX_get0_pkey(EVP_PKEY_CTX *ctx);
1083
1084EVP_PKEY *EVP_PKEY_CTX_get0_peerkey(EVP_PKEY_CTX *ctx);
1085
1086void EVP_PKEY_CTX_set_app_data(EVP_PKEY_CTX *ctx, void *data);
1087void *EVP_PKEY_CTX_get_app_data(EVP_PKEY_CTX *ctx);
1088
1089int EVP_PKEY_sign_init(EVP_PKEY_CTX *ctx);
1090int EVP_PKEY_sign(EVP_PKEY_CTX *ctx,
1091 unsigned char *sig, size_t *siglen,
1092 const unsigned char *tbs, size_t tbslen);
1093int EVP_PKEY_verify_init(EVP_PKEY_CTX *ctx);
1094int EVP_PKEY_verify(EVP_PKEY_CTX *ctx,
1095 const unsigned char *sig, size_t siglen,
1096 const unsigned char *tbs, size_t tbslen);
1097int EVP_PKEY_verify_recover_init(EVP_PKEY_CTX *ctx);
1098int EVP_PKEY_verify_recover(EVP_PKEY_CTX *ctx,
1099 unsigned char *rout, size_t *routlen,
1100 const unsigned char *sig, size_t siglen);
1101int EVP_PKEY_encrypt_init(EVP_PKEY_CTX *ctx);
1102int EVP_PKEY_encrypt(EVP_PKEY_CTX *ctx,
1103 unsigned char *out, size_t *outlen,
1104 const unsigned char *in, size_t inlen);
1105int EVP_PKEY_decrypt_init(EVP_PKEY_CTX *ctx);
1106int EVP_PKEY_decrypt(EVP_PKEY_CTX *ctx,
1107 unsigned char *out, size_t *outlen,
1108 const unsigned char *in, size_t inlen);
1109
1110int EVP_PKEY_derive_init(EVP_PKEY_CTX *ctx);
1111int EVP_PKEY_derive_set_peer(EVP_PKEY_CTX *ctx, EVP_PKEY *peer);
1112int EVP_PKEY_derive(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen);
1113
1114typedef int EVP_PKEY_gen_cb(EVP_PKEY_CTX *ctx);
1115
1116int EVP_PKEY_paramgen_init(EVP_PKEY_CTX *ctx);
1117int EVP_PKEY_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey);
1118int EVP_PKEY_keygen_init(EVP_PKEY_CTX *ctx);
1119int EVP_PKEY_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey);
1120
1121void EVP_PKEY_CTX_set_cb(EVP_PKEY_CTX *ctx, EVP_PKEY_gen_cb *cb);
1122EVP_PKEY_gen_cb *EVP_PKEY_CTX_get_cb(EVP_PKEY_CTX *ctx);
1123
1124int EVP_PKEY_CTX_get_keygen_info(EVP_PKEY_CTX *ctx, int idx);
1125
1126void EVP_PKEY_meth_set_init(EVP_PKEY_METHOD *pmeth,
1127 int (*init)(EVP_PKEY_CTX *ctx));
1128
1129void EVP_PKEY_meth_set_copy(EVP_PKEY_METHOD *pmeth,
1130 int (*copy)(EVP_PKEY_CTX *dst, EVP_PKEY_CTX *src));
1131
1132void EVP_PKEY_meth_set_cleanup(EVP_PKEY_METHOD *pmeth,
1133 void (*cleanup)(EVP_PKEY_CTX *ctx));
1134
1135void EVP_PKEY_meth_set_paramgen(EVP_PKEY_METHOD *pmeth,
1136 int (*paramgen_init)(EVP_PKEY_CTX *ctx),
1137 int (*paramgen)(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey));
1138
1139void EVP_PKEY_meth_set_keygen(EVP_PKEY_METHOD *pmeth,
1140 int (*keygen_init)(EVP_PKEY_CTX *ctx),
1141 int (*keygen)(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey));
950 1142
951void EVP_add_alg_module(void); 1143void EVP_PKEY_meth_set_sign(EVP_PKEY_METHOD *pmeth,
1144 int (*sign_init)(EVP_PKEY_CTX *ctx),
1145 int (*sign)(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen,
1146 const unsigned char *tbs, size_t tbslen));
1147
1148void EVP_PKEY_meth_set_verify(EVP_PKEY_METHOD *pmeth,
1149 int (*verify_init)(EVP_PKEY_CTX *ctx),
1150 int (*verify)(EVP_PKEY_CTX *ctx, const unsigned char *sig, size_t siglen,
1151 const unsigned char *tbs, size_t tbslen));
1152
1153void EVP_PKEY_meth_set_verify_recover(EVP_PKEY_METHOD *pmeth,
1154 int (*verify_recover_init)(EVP_PKEY_CTX *ctx),
1155 int (*verify_recover)(EVP_PKEY_CTX *ctx,
1156 unsigned char *sig, size_t *siglen,
1157 const unsigned char *tbs, size_t tbslen));
1158
1159void EVP_PKEY_meth_set_signctx(EVP_PKEY_METHOD *pmeth,
1160 int (*signctx_init)(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx),
1161 int (*signctx)(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen,
1162 EVP_MD_CTX *mctx));
1163
1164void EVP_PKEY_meth_set_verifyctx(EVP_PKEY_METHOD *pmeth,
1165 int (*verifyctx_init)(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx),
1166 int (*verifyctx)(EVP_PKEY_CTX *ctx, const unsigned char *sig,int siglen,
1167 EVP_MD_CTX *mctx));
1168
1169void EVP_PKEY_meth_set_encrypt(EVP_PKEY_METHOD *pmeth,
1170 int (*encrypt_init)(EVP_PKEY_CTX *ctx),
1171 int (*encryptfn)(EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen,
1172 const unsigned char *in, size_t inlen));
1173
1174void EVP_PKEY_meth_set_decrypt(EVP_PKEY_METHOD *pmeth,
1175 int (*decrypt_init)(EVP_PKEY_CTX *ctx),
1176 int (*decrypt)(EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen,
1177 const unsigned char *in, size_t inlen));
1178
1179void EVP_PKEY_meth_set_derive(EVP_PKEY_METHOD *pmeth,
1180 int (*derive_init)(EVP_PKEY_CTX *ctx),
1181 int (*derive)(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen));
1182
1183void EVP_PKEY_meth_set_ctrl(EVP_PKEY_METHOD *pmeth,
1184 int (*ctrl)(EVP_PKEY_CTX *ctx, int type, int p1, void *p2),
1185 int (*ctrl_str)(EVP_PKEY_CTX *ctx,
1186 const char *type, const char *value));
952 1187
953/* BEGIN ERROR CODES */ 1188/* BEGIN ERROR CODES */
954/* The following lines are auto generated by the script mkerr.pl. Any changes 1189/* The following lines are auto generated by the script mkerr.pl. Any changes
@@ -961,46 +1196,66 @@ void ERR_load_EVP_strings(void);
961/* Function codes. */ 1196/* Function codes. */
962#define EVP_F_AESNI_INIT_KEY 165 1197#define EVP_F_AESNI_INIT_KEY 165
963#define EVP_F_AES_INIT_KEY 133 1198#define EVP_F_AES_INIT_KEY 133
964#define EVP_F_ALG_MODULE_INIT 138
965#define EVP_F_CAMELLIA_INIT_KEY 159 1199#define EVP_F_CAMELLIA_INIT_KEY 159
966#define EVP_F_D2I_PKEY 100 1200#define EVP_F_D2I_PKEY 100
967#define EVP_F_DO_EVP_ENC_ENGINE 140 1201#define EVP_F_DO_SIGVER_INIT 161
968#define EVP_F_DO_EVP_ENC_ENGINE_FULL 141
969#define EVP_F_DO_EVP_MD_ENGINE 139
970#define EVP_F_DO_EVP_MD_ENGINE_FULL 142
971#define EVP_F_DSAPKEY2PKCS8 134 1202#define EVP_F_DSAPKEY2PKCS8 134
972#define EVP_F_DSA_PKEY2PKCS8 135 1203#define EVP_F_DSA_PKEY2PKCS8 135
973#define EVP_F_ECDSA_PKEY2PKCS8 129 1204#define EVP_F_ECDSA_PKEY2PKCS8 129
974#define EVP_F_ECKEY_PKEY2PKCS8 132 1205#define EVP_F_ECKEY_PKEY2PKCS8 132
975#define EVP_F_EVP_CIPHERINIT 137
976#define EVP_F_EVP_CIPHERINIT_EX 123 1206#define EVP_F_EVP_CIPHERINIT_EX 123
1207#define EVP_F_EVP_CIPHER_CTX_COPY 163
977#define EVP_F_EVP_CIPHER_CTX_CTRL 124 1208#define EVP_F_EVP_CIPHER_CTX_CTRL 124
978#define EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH 122 1209#define EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH 122
979#define EVP_F_EVP_DECRYPTFINAL_EX 101 1210#define EVP_F_EVP_DECRYPTFINAL_EX 101
980#define EVP_F_EVP_DIGESTINIT 136
981#define EVP_F_EVP_DIGESTINIT_EX 128 1211#define EVP_F_EVP_DIGESTINIT_EX 128
982#define EVP_F_EVP_ENCRYPTFINAL_EX 127 1212#define EVP_F_EVP_ENCRYPTFINAL_EX 127
983#define EVP_F_EVP_MD_CTX_COPY_EX 110 1213#define EVP_F_EVP_MD_CTX_COPY_EX 110
1214#define EVP_F_EVP_MD_SIZE 162
984#define EVP_F_EVP_OPENINIT 102 1215#define EVP_F_EVP_OPENINIT 102
985#define EVP_F_EVP_PBE_ALG_ADD 115 1216#define EVP_F_EVP_PBE_ALG_ADD 115
1217#define EVP_F_EVP_PBE_ALG_ADD_TYPE 160
986#define EVP_F_EVP_PBE_CIPHERINIT 116 1218#define EVP_F_EVP_PBE_CIPHERINIT 116
987#define EVP_F_EVP_PKCS82PKEY 111 1219#define EVP_F_EVP_PKCS82PKEY 111
1220#define EVP_F_EVP_PKCS82PKEY_BROKEN 136
988#define EVP_F_EVP_PKEY2PKCS8_BROKEN 113 1221#define EVP_F_EVP_PKEY2PKCS8_BROKEN 113
989#define EVP_F_EVP_PKEY_COPY_PARAMETERS 103 1222#define EVP_F_EVP_PKEY_COPY_PARAMETERS 103
1223#define EVP_F_EVP_PKEY_CTX_CTRL 137
1224#define EVP_F_EVP_PKEY_CTX_CTRL_STR 150
1225#define EVP_F_EVP_PKEY_CTX_DUP 156
990#define EVP_F_EVP_PKEY_DECRYPT 104 1226#define EVP_F_EVP_PKEY_DECRYPT 104
1227#define EVP_F_EVP_PKEY_DECRYPT_INIT 138
1228#define EVP_F_EVP_PKEY_DECRYPT_OLD 151
1229#define EVP_F_EVP_PKEY_DERIVE 153
1230#define EVP_F_EVP_PKEY_DERIVE_INIT 154
1231#define EVP_F_EVP_PKEY_DERIVE_SET_PEER 155
991#define EVP_F_EVP_PKEY_ENCRYPT 105 1232#define EVP_F_EVP_PKEY_ENCRYPT 105
1233#define EVP_F_EVP_PKEY_ENCRYPT_INIT 139
1234#define EVP_F_EVP_PKEY_ENCRYPT_OLD 152
992#define EVP_F_EVP_PKEY_GET1_DH 119 1235#define EVP_F_EVP_PKEY_GET1_DH 119
993#define EVP_F_EVP_PKEY_GET1_DSA 120 1236#define EVP_F_EVP_PKEY_GET1_DSA 120
994#define EVP_F_EVP_PKEY_GET1_ECDSA 130 1237#define EVP_F_EVP_PKEY_GET1_ECDSA 130
995#define EVP_F_EVP_PKEY_GET1_EC_KEY 131 1238#define EVP_F_EVP_PKEY_GET1_EC_KEY 131
996#define EVP_F_EVP_PKEY_GET1_RSA 121 1239#define EVP_F_EVP_PKEY_GET1_RSA 121
1240#define EVP_F_EVP_PKEY_KEYGEN 146
1241#define EVP_F_EVP_PKEY_KEYGEN_INIT 147
997#define EVP_F_EVP_PKEY_NEW 106 1242#define EVP_F_EVP_PKEY_NEW 106
1243#define EVP_F_EVP_PKEY_PARAMGEN 148
1244#define EVP_F_EVP_PKEY_PARAMGEN_INIT 149
1245#define EVP_F_EVP_PKEY_SIGN 140
1246#define EVP_F_EVP_PKEY_SIGN_INIT 141
1247#define EVP_F_EVP_PKEY_VERIFY 142
1248#define EVP_F_EVP_PKEY_VERIFY_INIT 143
1249#define EVP_F_EVP_PKEY_VERIFY_RECOVER 144
1250#define EVP_F_EVP_PKEY_VERIFY_RECOVER_INIT 145
998#define EVP_F_EVP_RIJNDAEL 126 1251#define EVP_F_EVP_RIJNDAEL 126
999#define EVP_F_EVP_SIGNFINAL 107 1252#define EVP_F_EVP_SIGNFINAL 107
1000#define EVP_F_EVP_VERIFYFINAL 108 1253#define EVP_F_EVP_VERIFYFINAL 108
1254#define EVP_F_INT_CTX_NEW 157
1001#define EVP_F_PKCS5_PBE_KEYIVGEN 117 1255#define EVP_F_PKCS5_PBE_KEYIVGEN 117
1002#define EVP_F_PKCS5_V2_PBE_KEYIVGEN 118 1256#define EVP_F_PKCS5_V2_PBE_KEYIVGEN 118
1003#define EVP_F_PKCS8_SET_BROKEN 112 1257#define EVP_F_PKCS8_SET_BROKEN 112
1258#define EVP_F_PKEY_SET_TYPE 158
1004#define EVP_F_RC2_MAGIC_TO_METH 109 1259#define EVP_F_RC2_MAGIC_TO_METH 109
1005#define EVP_F_RC5_CTRL 125 1260#define EVP_F_RC5_CTRL 125
1006 1261
@@ -1012,41 +1267,52 @@ void ERR_load_EVP_strings(void);
1012#define EVP_R_BAD_KEY_LENGTH 137 1267#define EVP_R_BAD_KEY_LENGTH 137
1013#define EVP_R_BN_DECODE_ERROR 112 1268#define EVP_R_BN_DECODE_ERROR 112
1014#define EVP_R_BN_PUBKEY_ERROR 113 1269#define EVP_R_BN_PUBKEY_ERROR 113
1270#define EVP_R_BUFFER_TOO_SMALL 155
1015#define EVP_R_CAMELLIA_KEY_SETUP_FAILED 157 1271#define EVP_R_CAMELLIA_KEY_SETUP_FAILED 157
1016#define EVP_R_CIPHER_PARAMETER_ERROR 122 1272#define EVP_R_CIPHER_PARAMETER_ERROR 122
1273#define EVP_R_COMMAND_NOT_SUPPORTED 147
1017#define EVP_R_CTRL_NOT_IMPLEMENTED 132 1274#define EVP_R_CTRL_NOT_IMPLEMENTED 132
1018#define EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED 133 1275#define EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED 133
1019#define EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH 138 1276#define EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH 138
1020#define EVP_R_DECODE_ERROR 114 1277#define EVP_R_DECODE_ERROR 114
1021#define EVP_R_DIFFERENT_KEY_TYPES 101 1278#define EVP_R_DIFFERENT_KEY_TYPES 101
1022#define EVP_R_DISABLED_FOR_FIPS 144 1279#define EVP_R_DIFFERENT_PARAMETERS 153
1023#define EVP_R_ENCODE_ERROR 115 1280#define EVP_R_ENCODE_ERROR 115
1024#define EVP_R_ERROR_LOADING_SECTION 145
1025#define EVP_R_ERROR_SETTING_FIPS_MODE 146
1026#define EVP_R_EVP_PBE_CIPHERINIT_ERROR 119 1281#define EVP_R_EVP_PBE_CIPHERINIT_ERROR 119
1027#define EVP_R_EXPECTING_AN_RSA_KEY 127 1282#define EVP_R_EXPECTING_AN_RSA_KEY 127
1028#define EVP_R_EXPECTING_A_DH_KEY 128 1283#define EVP_R_EXPECTING_A_DH_KEY 128
1029#define EVP_R_EXPECTING_A_DSA_KEY 129 1284#define EVP_R_EXPECTING_A_DSA_KEY 129
1030#define EVP_R_EXPECTING_A_ECDSA_KEY 141 1285#define EVP_R_EXPECTING_A_ECDSA_KEY 141
1031#define EVP_R_EXPECTING_A_EC_KEY 142 1286#define EVP_R_EXPECTING_A_EC_KEY 142
1032#define EVP_R_FIPS_MODE_NOT_SUPPORTED 147
1033#define EVP_R_INITIALIZATION_ERROR 134 1287#define EVP_R_INITIALIZATION_ERROR 134
1034#define EVP_R_INPUT_NOT_INITIALIZED 111 1288#define EVP_R_INPUT_NOT_INITIALIZED 111
1035#define EVP_R_INVALID_FIPS_MODE 148 1289#define EVP_R_INVALID_DIGEST 152
1036#define EVP_R_INVALID_KEY_LENGTH 130 1290#define EVP_R_INVALID_KEY_LENGTH 130
1291#define EVP_R_INVALID_OPERATION 148
1037#define EVP_R_IV_TOO_LARGE 102 1292#define EVP_R_IV_TOO_LARGE 102
1038#define EVP_R_KEYGEN_FAILURE 120 1293#define EVP_R_KEYGEN_FAILURE 120
1294#define EVP_R_MESSAGE_DIGEST_IS_NULL 159
1295#define EVP_R_METHOD_NOT_SUPPORTED 144
1039#define EVP_R_MISSING_PARAMETERS 103 1296#define EVP_R_MISSING_PARAMETERS 103
1040#define EVP_R_NO_CIPHER_SET 131 1297#define EVP_R_NO_CIPHER_SET 131
1298#define EVP_R_NO_DEFAULT_DIGEST 158
1041#define EVP_R_NO_DIGEST_SET 139 1299#define EVP_R_NO_DIGEST_SET 139
1042#define EVP_R_NO_DSA_PARAMETERS 116 1300#define EVP_R_NO_DSA_PARAMETERS 116
1301#define EVP_R_NO_KEY_SET 154
1302#define EVP_R_NO_OPERATION_SET 149
1043#define EVP_R_NO_SIGN_FUNCTION_CONFIGURED 104 1303#define EVP_R_NO_SIGN_FUNCTION_CONFIGURED 104
1044#define EVP_R_NO_VERIFY_FUNCTION_CONFIGURED 105 1304#define EVP_R_NO_VERIFY_FUNCTION_CONFIGURED 105
1305#define EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE 150
1306#define EVP_R_OPERATON_NOT_INITIALIZED 151
1045#define EVP_R_PKCS8_UNKNOWN_BROKEN_TYPE 117 1307#define EVP_R_PKCS8_UNKNOWN_BROKEN_TYPE 117
1308#define EVP_R_PRIVATE_KEY_DECODE_ERROR 145
1309#define EVP_R_PRIVATE_KEY_ENCODE_ERROR 146
1046#define EVP_R_PUBLIC_KEY_NOT_RSA 106 1310#define EVP_R_PUBLIC_KEY_NOT_RSA 106
1047#define EVP_R_UNKNOWN_OPTION 149 1311#define EVP_R_UNKNOWN_CIPHER 160
1312#define EVP_R_UNKNOWN_DIGEST 161
1048#define EVP_R_UNKNOWN_PBE_ALGORITHM 121 1313#define EVP_R_UNKNOWN_PBE_ALGORITHM 121
1049#define EVP_R_UNSUPORTED_NUMBER_OF_ROUNDS 135 1314#define EVP_R_UNSUPORTED_NUMBER_OF_ROUNDS 135
1315#define EVP_R_UNSUPPORTED_ALGORITHM 156
1050#define EVP_R_UNSUPPORTED_CIPHER 107 1316#define EVP_R_UNSUPPORTED_CIPHER 107
1051#define EVP_R_UNSUPPORTED_KEYLENGTH 123 1317#define EVP_R_UNSUPPORTED_KEYLENGTH 123
1052#define EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION 124 1318#define EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION 124
@@ -1056,7 +1322,6 @@ void ERR_load_EVP_strings(void);
1056#define EVP_R_UNSUPPORTED_SALT_TYPE 126 1322#define EVP_R_UNSUPPORTED_SALT_TYPE 126
1057#define EVP_R_WRONG_FINAL_BLOCK_LENGTH 109 1323#define EVP_R_WRONG_FINAL_BLOCK_LENGTH 109
1058#define EVP_R_WRONG_PUBLIC_KEY_TYPE 110 1324#define EVP_R_WRONG_PUBLIC_KEY_TYPE 110
1059#define EVP_R_SEED_KEY_SETUP_FAILED 162
1060 1325
1061#ifdef __cplusplus 1326#ifdef __cplusplus
1062} 1327}
diff --git a/src/lib/libcrypto/evp/evp_cnf.c b/src/lib/libcrypto/evp/evp_cnf.c
deleted file mode 100644
index 2e4db30235..0000000000
--- a/src/lib/libcrypto/evp/evp_cnf.c
+++ /dev/null
@@ -1,125 +0,0 @@
1/* evp_cnf.c */
2/* Written by Stephen Henson (steve@openssl.org) for the OpenSSL
3 * project 2007.
4 */
5/* ====================================================================
6 * Copyright (c) 2007 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 <ctype.h>
61#include <openssl/crypto.h>
62#include "cryptlib.h"
63#include <openssl/conf.h>
64#include <openssl/dso.h>
65#include <openssl/x509.h>
66#include <openssl/x509v3.h>
67#ifdef OPENSSL_FIPS
68#include <openssl/fips.h>
69#endif
70
71
72/* Algorithm configuration module. */
73
74static int alg_module_init(CONF_IMODULE *md, const CONF *cnf)
75 {
76 int i;
77 const char *oid_section;
78 STACK_OF(CONF_VALUE) *sktmp;
79 CONF_VALUE *oval;
80 oid_section = CONF_imodule_get_value(md);
81 if(!(sktmp = NCONF_get_section(cnf, oid_section)))
82 {
83 EVPerr(EVP_F_ALG_MODULE_INIT, EVP_R_ERROR_LOADING_SECTION);
84 return 0;
85 }
86 for(i = 0; i < sk_CONF_VALUE_num(sktmp); i++)
87 {
88 oval = sk_CONF_VALUE_value(sktmp, i);
89 if (!strcmp(oval->name, "fips_mode"))
90 {
91 int m;
92 if (!X509V3_get_value_bool(oval, &m))
93 {
94 EVPerr(EVP_F_ALG_MODULE_INIT, EVP_R_INVALID_FIPS_MODE);
95 return 0;
96 }
97 if (m > 0)
98 {
99#ifdef OPENSSL_FIPS
100 if (!FIPS_mode() && !FIPS_mode_set(1))
101 {
102 EVPerr(EVP_F_ALG_MODULE_INIT, EVP_R_ERROR_SETTING_FIPS_MODE);
103 return 0;
104 }
105#else
106 EVPerr(EVP_F_ALG_MODULE_INIT, EVP_R_FIPS_MODE_NOT_SUPPORTED);
107 return 0;
108#endif
109 }
110 }
111 else
112 {
113 EVPerr(EVP_F_ALG_MODULE_INIT, EVP_R_UNKNOWN_OPTION);
114 ERR_add_error_data(4, "name=", oval->name,
115 ", value=", oval->value);
116 }
117
118 }
119 return 1;
120 }
121
122void EVP_add_alg_module(void)
123 {
124 CONF_module_add("alg_section", alg_module_init, 0);
125 }
diff --git a/src/lib/libcrypto/evp/evp_enc.c b/src/lib/libcrypto/evp/evp_enc.c
index 30e0ca4d9f..bead6a2170 100644
--- a/src/lib/libcrypto/evp/evp_enc.c
+++ b/src/lib/libcrypto/evp/evp_enc.c
@@ -66,16 +66,14 @@
66#endif 66#endif
67#include "evp_locl.h" 67#include "evp_locl.h"
68 68
69#ifdef OPENSSL_FIPS
70 #define M_do_cipher(ctx, out, in, inl) \
71 EVP_Cipher(ctx,out,in,inl)
72#else
73 #define M_do_cipher(ctx, out, in, inl) \
74 ctx->cipher->do_cipher(ctx,out,in,inl)
75#endif
76
77const char EVP_version[]="EVP" OPENSSL_VERSION_PTEXT; 69const char EVP_version[]="EVP" OPENSSL_VERSION_PTEXT;
78 70
71void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *ctx)
72 {
73 memset(ctx,0,sizeof(EVP_CIPHER_CTX));
74 /* ctx->cipher=NULL; */
75 }
76
79EVP_CIPHER_CTX *EVP_CIPHER_CTX_new(void) 77EVP_CIPHER_CTX *EVP_CIPHER_CTX_new(void)
80 { 78 {
81 EVP_CIPHER_CTX *ctx=OPENSSL_malloc(sizeof *ctx); 79 EVP_CIPHER_CTX *ctx=OPENSSL_malloc(sizeof *ctx);
@@ -92,6 +90,144 @@ int EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
92 return EVP_CipherInit_ex(ctx,cipher,NULL,key,iv,enc); 90 return EVP_CipherInit_ex(ctx,cipher,NULL,key,iv,enc);
93 } 91 }
94 92
93int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, ENGINE *impl,
94 const unsigned char *key, const unsigned char *iv, int enc)
95 {
96 if (enc == -1)
97 enc = ctx->encrypt;
98 else
99 {
100 if (enc)
101 enc = 1;
102 ctx->encrypt = enc;
103 }
104#ifndef OPENSSL_NO_ENGINE
105 /* Whether it's nice or not, "Inits" can be used on "Final"'d contexts
106 * so this context may already have an ENGINE! Try to avoid releasing
107 * the previous handle, re-querying for an ENGINE, and having a
108 * reinitialisation, when it may all be unecessary. */
109 if (ctx->engine && ctx->cipher && (!cipher ||
110 (cipher && (cipher->nid == ctx->cipher->nid))))
111 goto skip_to_init;
112#endif
113 if (cipher)
114 {
115 /* Ensure a context left lying around from last time is cleared
116 * (the previous check attempted to avoid this if the same
117 * ENGINE and EVP_CIPHER could be used). */
118 EVP_CIPHER_CTX_cleanup(ctx);
119
120 /* Restore encrypt field: it is zeroed by cleanup */
121 ctx->encrypt = enc;
122#ifndef OPENSSL_NO_ENGINE
123 if(impl)
124 {
125 if (!ENGINE_init(impl))
126 {
127 EVPerr(EVP_F_EVP_CIPHERINIT_EX, EVP_R_INITIALIZATION_ERROR);
128 return 0;
129 }
130 }
131 else
132 /* Ask if an ENGINE is reserved for this job */
133 impl = ENGINE_get_cipher_engine(cipher->nid);
134 if(impl)
135 {
136 /* There's an ENGINE for this job ... (apparently) */
137 const EVP_CIPHER *c = ENGINE_get_cipher(impl, cipher->nid);
138 if(!c)
139 {
140 /* One positive side-effect of US's export
141 * control history, is that we should at least
142 * be able to avoid using US mispellings of
143 * "initialisation"? */
144 EVPerr(EVP_F_EVP_CIPHERINIT_EX, EVP_R_INITIALIZATION_ERROR);
145 return 0;
146 }
147 /* We'll use the ENGINE's private cipher definition */
148 cipher = c;
149 /* Store the ENGINE functional reference so we know
150 * 'cipher' came from an ENGINE and we need to release
151 * it when done. */
152 ctx->engine = impl;
153 }
154 else
155 ctx->engine = NULL;
156#endif
157
158 ctx->cipher=cipher;
159 if (ctx->cipher->ctx_size)
160 {
161 ctx->cipher_data=OPENSSL_malloc(ctx->cipher->ctx_size);
162 if (!ctx->cipher_data)
163 {
164 EVPerr(EVP_F_EVP_CIPHERINIT_EX, ERR_R_MALLOC_FAILURE);
165 return 0;
166 }
167 }
168 else
169 {
170 ctx->cipher_data = NULL;
171 }
172 ctx->key_len = cipher->key_len;
173 ctx->flags = 0;
174 if(ctx->cipher->flags & EVP_CIPH_CTRL_INIT)
175 {
176 if(!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_INIT, 0, NULL))
177 {
178 EVPerr(EVP_F_EVP_CIPHERINIT_EX, EVP_R_INITIALIZATION_ERROR);
179 return 0;
180 }
181 }
182 }
183 else if(!ctx->cipher)
184 {
185 EVPerr(EVP_F_EVP_CIPHERINIT_EX, EVP_R_NO_CIPHER_SET);
186 return 0;
187 }
188#ifndef OPENSSL_NO_ENGINE
189skip_to_init:
190#endif
191 /* we assume block size is a power of 2 in *cryptUpdate */
192 OPENSSL_assert(ctx->cipher->block_size == 1
193 || ctx->cipher->block_size == 8
194 || ctx->cipher->block_size == 16);
195
196 if(!(EVP_CIPHER_CTX_flags(ctx) & EVP_CIPH_CUSTOM_IV)) {
197 switch(EVP_CIPHER_CTX_mode(ctx)) {
198
199 case EVP_CIPH_STREAM_CIPHER:
200 case EVP_CIPH_ECB_MODE:
201 break;
202
203 case EVP_CIPH_CFB_MODE:
204 case EVP_CIPH_OFB_MODE:
205
206 ctx->num = 0;
207
208 case EVP_CIPH_CBC_MODE:
209
210 OPENSSL_assert(EVP_CIPHER_CTX_iv_length(ctx) <=
211 (int)sizeof(ctx->iv));
212 if(iv) memcpy(ctx->oiv, iv, EVP_CIPHER_CTX_iv_length(ctx));
213 memcpy(ctx->iv, ctx->oiv, EVP_CIPHER_CTX_iv_length(ctx));
214 break;
215
216 default:
217 return 0;
218 break;
219 }
220 }
221
222 if(key || (ctx->cipher->flags & EVP_CIPH_ALWAYS_CALL_INIT)) {
223 if(!ctx->cipher->init(ctx,key,iv,enc)) return 0;
224 }
225 ctx->buf_len=0;
226 ctx->final_used=0;
227 ctx->block_mask=ctx->cipher->block_size-1;
228 return 1;
229 }
230
95int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, 231int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
96 const unsigned char *in, int inl) 232 const unsigned char *in, int inl)
97 { 233 {
@@ -151,7 +287,7 @@ int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
151 287
152 if(ctx->buf_len == 0 && (inl&(ctx->block_mask)) == 0) 288 if(ctx->buf_len == 0 && (inl&(ctx->block_mask)) == 0)
153 { 289 {
154 if(M_do_cipher(ctx,out,in,inl)) 290 if(ctx->cipher->do_cipher(ctx,out,in,inl))
155 { 291 {
156 *outl=inl; 292 *outl=inl;
157 return 1; 293 return 1;
@@ -178,7 +314,7 @@ int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
178 { 314 {
179 j=bl-i; 315 j=bl-i;
180 memcpy(&(ctx->buf[i]),in,j); 316 memcpy(&(ctx->buf[i]),in,j);
181 if(!M_do_cipher(ctx,out,ctx->buf,bl)) return 0; 317 if(!ctx->cipher->do_cipher(ctx,out,ctx->buf,bl)) return 0;
182 inl-=j; 318 inl-=j;
183 in+=j; 319 in+=j;
184 out+=bl; 320 out+=bl;
@@ -191,7 +327,7 @@ int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
191 inl-=i; 327 inl-=i;
192 if (inl > 0) 328 if (inl > 0)
193 { 329 {
194 if(!M_do_cipher(ctx,out,in,inl)) return 0; 330 if(!ctx->cipher->do_cipher(ctx,out,in,inl)) return 0;
195 *outl+=inl; 331 *outl+=inl;
196 } 332 }
197 333
@@ -235,7 +371,7 @@ int EVP_EncryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl)
235 n=b-bl; 371 n=b-bl;
236 for (i=bl; i<b; i++) 372 for (i=bl; i<b; i++)
237 ctx->buf[i]=n; 373 ctx->buf[i]=n;
238 ret=M_do_cipher(ctx,out,ctx->buf,b); 374 ret=ctx->cipher->do_cipher(ctx,out,ctx->buf,b);
239 375
240 376
241 if(ret) 377 if(ret)
@@ -357,6 +493,28 @@ void EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *ctx)
357 } 493 }
358 } 494 }
359 495
496int EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *c)
497 {
498 if (c->cipher != NULL)
499 {
500 if(c->cipher->cleanup && !c->cipher->cleanup(c))
501 return 0;
502 /* Cleanse cipher context data */
503 if (c->cipher_data)
504 OPENSSL_cleanse(c->cipher_data, c->cipher->ctx_size);
505 }
506 if (c->cipher_data)
507 OPENSSL_free(c->cipher_data);
508#ifndef OPENSSL_NO_ENGINE
509 if (c->engine)
510 /* The EVP_CIPHER we used belongs to an ENGINE, release the
511 * functional reference we held for this reason. */
512 ENGINE_finish(c->engine);
513#endif
514 memset(c,0,sizeof(EVP_CIPHER_CTX));
515 return 1;
516 }
517
360int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *c, int keylen) 518int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *c, int keylen)
361 { 519 {
362 if(c->cipher->flags & EVP_CIPH_CUSTOM_KEY_LENGTH) 520 if(c->cipher->flags & EVP_CIPH_CUSTOM_KEY_LENGTH)
@@ -378,6 +536,27 @@ int EVP_CIPHER_CTX_set_padding(EVP_CIPHER_CTX *ctx, int pad)
378 return 1; 536 return 1;
379 } 537 }
380 538
539int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr)
540{
541 int ret;
542 if(!ctx->cipher) {
543 EVPerr(EVP_F_EVP_CIPHER_CTX_CTRL, EVP_R_NO_CIPHER_SET);
544 return 0;
545 }
546
547 if(!ctx->cipher->ctrl) {
548 EVPerr(EVP_F_EVP_CIPHER_CTX_CTRL, EVP_R_CTRL_NOT_IMPLEMENTED);
549 return 0;
550 }
551
552 ret = ctx->cipher->ctrl(ctx, type, arg, ptr);
553 if(ret == -1) {
554 EVPerr(EVP_F_EVP_CIPHER_CTX_CTRL, EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED);
555 return 0;
556 }
557 return ret;
558}
559
381int EVP_CIPHER_CTX_rand_key(EVP_CIPHER_CTX *ctx, unsigned char *key) 560int EVP_CIPHER_CTX_rand_key(EVP_CIPHER_CTX *ctx, unsigned char *key)
382 { 561 {
383 if (ctx->cipher->flags & EVP_CIPH_RAND_KEY) 562 if (ctx->cipher->flags & EVP_CIPH_RAND_KEY)
@@ -387,54 +566,38 @@ int EVP_CIPHER_CTX_rand_key(EVP_CIPHER_CTX *ctx, unsigned char *key)
387 return 1; 566 return 1;
388 } 567 }
389 568
390#ifndef OPENSSL_NO_ENGINE 569int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, const EVP_CIPHER_CTX *in)
391
392#ifdef OPENSSL_FIPS
393
394static int do_evp_enc_engine_full(EVP_CIPHER_CTX *ctx, const EVP_CIPHER **pcipher, ENGINE *impl)
395 { 570 {
396 if(impl) 571 if ((in == NULL) || (in->cipher == NULL))
397 { 572 {
398 if (!ENGINE_init(impl)) 573 EVPerr(EVP_F_EVP_CIPHER_CTX_COPY,EVP_R_INPUT_NOT_INITIALIZED);
399 { 574 return 0;
400 EVPerr(EVP_F_DO_EVP_ENC_ENGINE_FULL, EVP_R_INITIALIZATION_ERROR);
401 return 0;
402 }
403 } 575 }
404 else 576#ifndef OPENSSL_NO_ENGINE
405 /* Ask if an ENGINE is reserved for this job */ 577 /* Make sure it's safe to copy a cipher context using an ENGINE */
406 impl = ENGINE_get_cipher_engine((*pcipher)->nid); 578 if (in->engine && !ENGINE_init(in->engine))
407 if(impl) 579 {
580 EVPerr(EVP_F_EVP_CIPHER_CTX_COPY,ERR_R_ENGINE_LIB);
581 return 0;
582 }
583#endif
584
585 EVP_CIPHER_CTX_cleanup(out);
586 memcpy(out,in,sizeof *out);
587
588 if (in->cipher_data && in->cipher->ctx_size)
408 { 589 {
409 /* There's an ENGINE for this job ... (apparently) */ 590 out->cipher_data=OPENSSL_malloc(in->cipher->ctx_size);
410 const EVP_CIPHER *c = ENGINE_get_cipher(impl, (*pcipher)->nid); 591 if (!out->cipher_data)
411 if(!c)
412 { 592 {
413 /* One positive side-effect of US's export 593 EVPerr(EVP_F_EVP_CIPHER_CTX_COPY,ERR_R_MALLOC_FAILURE);
414 * control history, is that we should at least
415 * be able to avoid using US mispellings of
416 * "initialisation"? */
417 EVPerr(EVP_F_DO_EVP_ENC_ENGINE_FULL, EVP_R_INITIALIZATION_ERROR);
418 return 0; 594 return 0;
419 } 595 }
420 /* We'll use the ENGINE's private cipher definition */ 596 memcpy(out->cipher_data,in->cipher_data,in->cipher->ctx_size);
421 *pcipher = c;
422 /* Store the ENGINE functional reference so we know
423 * 'cipher' came from an ENGINE and we need to release
424 * it when done. */
425 ctx->engine = impl;
426 } 597 }
427 else
428 ctx->engine = NULL;
429 return 1;
430 }
431 598
432void int_EVP_CIPHER_init_engine_callbacks(void) 599 if (in->cipher->flags & EVP_CIPH_CUSTOM_COPY)
433 { 600 return in->cipher->ctrl((EVP_CIPHER_CTX *)in, EVP_CTRL_COPY, 0, out);
434 int_EVP_CIPHER_set_engine_callbacks( 601 return 1;
435 ENGINE_finish, do_evp_enc_engine_full);
436 } 602 }
437 603
438#endif
439
440#endif
diff --git a/src/lib/libcrypto/evp/evp_err.c b/src/lib/libcrypto/evp/evp_err.c
index ec2d127cd8..6b585c7483 100644
--- a/src/lib/libcrypto/evp/evp_err.c
+++ b/src/lib/libcrypto/evp/evp_err.c
@@ -1,6 +1,6 @@
1/* crypto/evp/evp_err.c */ 1/* crypto/evp/evp_err.c */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1999-2007 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1999-2008 The OpenSSL Project. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
@@ -72,46 +72,66 @@ static ERR_STRING_DATA EVP_str_functs[]=
72 { 72 {
73{ERR_FUNC(EVP_F_AESNI_INIT_KEY), "AESNI_INIT_KEY"}, 73{ERR_FUNC(EVP_F_AESNI_INIT_KEY), "AESNI_INIT_KEY"},
74{ERR_FUNC(EVP_F_AES_INIT_KEY), "AES_INIT_KEY"}, 74{ERR_FUNC(EVP_F_AES_INIT_KEY), "AES_INIT_KEY"},
75{ERR_FUNC(EVP_F_ALG_MODULE_INIT), "ALG_MODULE_INIT"},
76{ERR_FUNC(EVP_F_CAMELLIA_INIT_KEY), "CAMELLIA_INIT_KEY"}, 75{ERR_FUNC(EVP_F_CAMELLIA_INIT_KEY), "CAMELLIA_INIT_KEY"},
77{ERR_FUNC(EVP_F_D2I_PKEY), "D2I_PKEY"}, 76{ERR_FUNC(EVP_F_D2I_PKEY), "D2I_PKEY"},
78{ERR_FUNC(EVP_F_DO_EVP_ENC_ENGINE), "DO_EVP_ENC_ENGINE"}, 77{ERR_FUNC(EVP_F_DO_SIGVER_INIT), "DO_SIGVER_INIT"},
79{ERR_FUNC(EVP_F_DO_EVP_ENC_ENGINE_FULL), "DO_EVP_ENC_ENGINE_FULL"},
80{ERR_FUNC(EVP_F_DO_EVP_MD_ENGINE), "DO_EVP_MD_ENGINE"},
81{ERR_FUNC(EVP_F_DO_EVP_MD_ENGINE_FULL), "DO_EVP_MD_ENGINE_FULL"},
82{ERR_FUNC(EVP_F_DSAPKEY2PKCS8), "DSAPKEY2PKCS8"}, 78{ERR_FUNC(EVP_F_DSAPKEY2PKCS8), "DSAPKEY2PKCS8"},
83{ERR_FUNC(EVP_F_DSA_PKEY2PKCS8), "DSA_PKEY2PKCS8"}, 79{ERR_FUNC(EVP_F_DSA_PKEY2PKCS8), "DSA_PKEY2PKCS8"},
84{ERR_FUNC(EVP_F_ECDSA_PKEY2PKCS8), "ECDSA_PKEY2PKCS8"}, 80{ERR_FUNC(EVP_F_ECDSA_PKEY2PKCS8), "ECDSA_PKEY2PKCS8"},
85{ERR_FUNC(EVP_F_ECKEY_PKEY2PKCS8), "ECKEY_PKEY2PKCS8"}, 81{ERR_FUNC(EVP_F_ECKEY_PKEY2PKCS8), "ECKEY_PKEY2PKCS8"},
86{ERR_FUNC(EVP_F_EVP_CIPHERINIT), "EVP_CipherInit"},
87{ERR_FUNC(EVP_F_EVP_CIPHERINIT_EX), "EVP_CipherInit_ex"}, 82{ERR_FUNC(EVP_F_EVP_CIPHERINIT_EX), "EVP_CipherInit_ex"},
83{ERR_FUNC(EVP_F_EVP_CIPHER_CTX_COPY), "EVP_CIPHER_CTX_copy"},
88{ERR_FUNC(EVP_F_EVP_CIPHER_CTX_CTRL), "EVP_CIPHER_CTX_ctrl"}, 84{ERR_FUNC(EVP_F_EVP_CIPHER_CTX_CTRL), "EVP_CIPHER_CTX_ctrl"},
89{ERR_FUNC(EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH), "EVP_CIPHER_CTX_set_key_length"}, 85{ERR_FUNC(EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH), "EVP_CIPHER_CTX_set_key_length"},
90{ERR_FUNC(EVP_F_EVP_DECRYPTFINAL_EX), "EVP_DecryptFinal_ex"}, 86{ERR_FUNC(EVP_F_EVP_DECRYPTFINAL_EX), "EVP_DecryptFinal_ex"},
91{ERR_FUNC(EVP_F_EVP_DIGESTINIT), "EVP_DigestInit"},
92{ERR_FUNC(EVP_F_EVP_DIGESTINIT_EX), "EVP_DigestInit_ex"}, 87{ERR_FUNC(EVP_F_EVP_DIGESTINIT_EX), "EVP_DigestInit_ex"},
93{ERR_FUNC(EVP_F_EVP_ENCRYPTFINAL_EX), "EVP_EncryptFinal_ex"}, 88{ERR_FUNC(EVP_F_EVP_ENCRYPTFINAL_EX), "EVP_EncryptFinal_ex"},
94{ERR_FUNC(EVP_F_EVP_MD_CTX_COPY_EX), "EVP_MD_CTX_copy_ex"}, 89{ERR_FUNC(EVP_F_EVP_MD_CTX_COPY_EX), "EVP_MD_CTX_copy_ex"},
90{ERR_FUNC(EVP_F_EVP_MD_SIZE), "EVP_MD_SIZE"},
95{ERR_FUNC(EVP_F_EVP_OPENINIT), "EVP_OpenInit"}, 91{ERR_FUNC(EVP_F_EVP_OPENINIT), "EVP_OpenInit"},
96{ERR_FUNC(EVP_F_EVP_PBE_ALG_ADD), "EVP_PBE_alg_add"}, 92{ERR_FUNC(EVP_F_EVP_PBE_ALG_ADD), "EVP_PBE_alg_add"},
93{ERR_FUNC(EVP_F_EVP_PBE_ALG_ADD_TYPE), "EVP_PBE_alg_add_type"},
97{ERR_FUNC(EVP_F_EVP_PBE_CIPHERINIT), "EVP_PBE_CipherInit"}, 94{ERR_FUNC(EVP_F_EVP_PBE_CIPHERINIT), "EVP_PBE_CipherInit"},
98{ERR_FUNC(EVP_F_EVP_PKCS82PKEY), "EVP_PKCS82PKEY"}, 95{ERR_FUNC(EVP_F_EVP_PKCS82PKEY), "EVP_PKCS82PKEY"},
96{ERR_FUNC(EVP_F_EVP_PKCS82PKEY_BROKEN), "EVP_PKCS82PKEY_BROKEN"},
99{ERR_FUNC(EVP_F_EVP_PKEY2PKCS8_BROKEN), "EVP_PKEY2PKCS8_broken"}, 97{ERR_FUNC(EVP_F_EVP_PKEY2PKCS8_BROKEN), "EVP_PKEY2PKCS8_broken"},
100{ERR_FUNC(EVP_F_EVP_PKEY_COPY_PARAMETERS), "EVP_PKEY_copy_parameters"}, 98{ERR_FUNC(EVP_F_EVP_PKEY_COPY_PARAMETERS), "EVP_PKEY_copy_parameters"},
99{ERR_FUNC(EVP_F_EVP_PKEY_CTX_CTRL), "EVP_PKEY_CTX_ctrl"},
100{ERR_FUNC(EVP_F_EVP_PKEY_CTX_CTRL_STR), "EVP_PKEY_CTX_ctrl_str"},
101{ERR_FUNC(EVP_F_EVP_PKEY_CTX_DUP), "EVP_PKEY_CTX_dup"},
101{ERR_FUNC(EVP_F_EVP_PKEY_DECRYPT), "EVP_PKEY_decrypt"}, 102{ERR_FUNC(EVP_F_EVP_PKEY_DECRYPT), "EVP_PKEY_decrypt"},
103{ERR_FUNC(EVP_F_EVP_PKEY_DECRYPT_INIT), "EVP_PKEY_decrypt_init"},
104{ERR_FUNC(EVP_F_EVP_PKEY_DECRYPT_OLD), "EVP_PKEY_decrypt_old"},
105{ERR_FUNC(EVP_F_EVP_PKEY_DERIVE), "EVP_PKEY_derive"},
106{ERR_FUNC(EVP_F_EVP_PKEY_DERIVE_INIT), "EVP_PKEY_derive_init"},
107{ERR_FUNC(EVP_F_EVP_PKEY_DERIVE_SET_PEER), "EVP_PKEY_derive_set_peer"},
102{ERR_FUNC(EVP_F_EVP_PKEY_ENCRYPT), "EVP_PKEY_encrypt"}, 108{ERR_FUNC(EVP_F_EVP_PKEY_ENCRYPT), "EVP_PKEY_encrypt"},
109{ERR_FUNC(EVP_F_EVP_PKEY_ENCRYPT_INIT), "EVP_PKEY_encrypt_init"},
110{ERR_FUNC(EVP_F_EVP_PKEY_ENCRYPT_OLD), "EVP_PKEY_encrypt_old"},
103{ERR_FUNC(EVP_F_EVP_PKEY_GET1_DH), "EVP_PKEY_get1_DH"}, 111{ERR_FUNC(EVP_F_EVP_PKEY_GET1_DH), "EVP_PKEY_get1_DH"},
104{ERR_FUNC(EVP_F_EVP_PKEY_GET1_DSA), "EVP_PKEY_get1_DSA"}, 112{ERR_FUNC(EVP_F_EVP_PKEY_GET1_DSA), "EVP_PKEY_get1_DSA"},
105{ERR_FUNC(EVP_F_EVP_PKEY_GET1_ECDSA), "EVP_PKEY_GET1_ECDSA"}, 113{ERR_FUNC(EVP_F_EVP_PKEY_GET1_ECDSA), "EVP_PKEY_GET1_ECDSA"},
106{ERR_FUNC(EVP_F_EVP_PKEY_GET1_EC_KEY), "EVP_PKEY_get1_EC_KEY"}, 114{ERR_FUNC(EVP_F_EVP_PKEY_GET1_EC_KEY), "EVP_PKEY_get1_EC_KEY"},
107{ERR_FUNC(EVP_F_EVP_PKEY_GET1_RSA), "EVP_PKEY_get1_RSA"}, 115{ERR_FUNC(EVP_F_EVP_PKEY_GET1_RSA), "EVP_PKEY_get1_RSA"},
116{ERR_FUNC(EVP_F_EVP_PKEY_KEYGEN), "EVP_PKEY_keygen"},
117{ERR_FUNC(EVP_F_EVP_PKEY_KEYGEN_INIT), "EVP_PKEY_keygen_init"},
108{ERR_FUNC(EVP_F_EVP_PKEY_NEW), "EVP_PKEY_new"}, 118{ERR_FUNC(EVP_F_EVP_PKEY_NEW), "EVP_PKEY_new"},
119{ERR_FUNC(EVP_F_EVP_PKEY_PARAMGEN), "EVP_PKEY_paramgen"},
120{ERR_FUNC(EVP_F_EVP_PKEY_PARAMGEN_INIT), "EVP_PKEY_paramgen_init"},
121{ERR_FUNC(EVP_F_EVP_PKEY_SIGN), "EVP_PKEY_sign"},
122{ERR_FUNC(EVP_F_EVP_PKEY_SIGN_INIT), "EVP_PKEY_sign_init"},
123{ERR_FUNC(EVP_F_EVP_PKEY_VERIFY), "EVP_PKEY_verify"},
124{ERR_FUNC(EVP_F_EVP_PKEY_VERIFY_INIT), "EVP_PKEY_verify_init"},
125{ERR_FUNC(EVP_F_EVP_PKEY_VERIFY_RECOVER), "EVP_PKEY_verify_recover"},
126{ERR_FUNC(EVP_F_EVP_PKEY_VERIFY_RECOVER_INIT), "EVP_PKEY_verify_recover_init"},
109{ERR_FUNC(EVP_F_EVP_RIJNDAEL), "EVP_RIJNDAEL"}, 127{ERR_FUNC(EVP_F_EVP_RIJNDAEL), "EVP_RIJNDAEL"},
110{ERR_FUNC(EVP_F_EVP_SIGNFINAL), "EVP_SignFinal"}, 128{ERR_FUNC(EVP_F_EVP_SIGNFINAL), "EVP_SignFinal"},
111{ERR_FUNC(EVP_F_EVP_VERIFYFINAL), "EVP_VerifyFinal"}, 129{ERR_FUNC(EVP_F_EVP_VERIFYFINAL), "EVP_VerifyFinal"},
130{ERR_FUNC(EVP_F_INT_CTX_NEW), "INT_CTX_NEW"},
112{ERR_FUNC(EVP_F_PKCS5_PBE_KEYIVGEN), "PKCS5_PBE_keyivgen"}, 131{ERR_FUNC(EVP_F_PKCS5_PBE_KEYIVGEN), "PKCS5_PBE_keyivgen"},
113{ERR_FUNC(EVP_F_PKCS5_V2_PBE_KEYIVGEN), "PKCS5_v2_PBE_keyivgen"}, 132{ERR_FUNC(EVP_F_PKCS5_V2_PBE_KEYIVGEN), "PKCS5_v2_PBE_keyivgen"},
114{ERR_FUNC(EVP_F_PKCS8_SET_BROKEN), "PKCS8_set_broken"}, 133{ERR_FUNC(EVP_F_PKCS8_SET_BROKEN), "PKCS8_set_broken"},
134{ERR_FUNC(EVP_F_PKEY_SET_TYPE), "PKEY_SET_TYPE"},
115{ERR_FUNC(EVP_F_RC2_MAGIC_TO_METH), "RC2_MAGIC_TO_METH"}, 135{ERR_FUNC(EVP_F_RC2_MAGIC_TO_METH), "RC2_MAGIC_TO_METH"},
116{ERR_FUNC(EVP_F_RC5_CTRL), "RC5_CTRL"}, 136{ERR_FUNC(EVP_F_RC5_CTRL), "RC5_CTRL"},
117{0,NULL} 137{0,NULL}
@@ -126,42 +146,52 @@ static ERR_STRING_DATA EVP_str_reasons[]=
126{ERR_REASON(EVP_R_BAD_KEY_LENGTH) ,"bad key length"}, 146{ERR_REASON(EVP_R_BAD_KEY_LENGTH) ,"bad key length"},
127{ERR_REASON(EVP_R_BN_DECODE_ERROR) ,"bn decode error"}, 147{ERR_REASON(EVP_R_BN_DECODE_ERROR) ,"bn decode error"},
128{ERR_REASON(EVP_R_BN_PUBKEY_ERROR) ,"bn pubkey error"}, 148{ERR_REASON(EVP_R_BN_PUBKEY_ERROR) ,"bn pubkey error"},
149{ERR_REASON(EVP_R_BUFFER_TOO_SMALL) ,"buffer too small"},
129{ERR_REASON(EVP_R_CAMELLIA_KEY_SETUP_FAILED),"camellia key setup failed"}, 150{ERR_REASON(EVP_R_CAMELLIA_KEY_SETUP_FAILED),"camellia key setup failed"},
130{ERR_REASON(EVP_R_CIPHER_PARAMETER_ERROR),"cipher parameter error"}, 151{ERR_REASON(EVP_R_CIPHER_PARAMETER_ERROR),"cipher parameter error"},
152{ERR_REASON(EVP_R_COMMAND_NOT_SUPPORTED) ,"command not supported"},
131{ERR_REASON(EVP_R_CTRL_NOT_IMPLEMENTED) ,"ctrl not implemented"}, 153{ERR_REASON(EVP_R_CTRL_NOT_IMPLEMENTED) ,"ctrl not implemented"},
132{ERR_REASON(EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED),"ctrl operation not implemented"}, 154{ERR_REASON(EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED),"ctrl operation not implemented"},
133{ERR_REASON(EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH),"data not multiple of block length"}, 155{ERR_REASON(EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH),"data not multiple of block length"},
134{ERR_REASON(EVP_R_DECODE_ERROR) ,"decode error"}, 156{ERR_REASON(EVP_R_DECODE_ERROR) ,"decode error"},
135{ERR_REASON(EVP_R_DIFFERENT_KEY_TYPES) ,"different key types"}, 157{ERR_REASON(EVP_R_DIFFERENT_KEY_TYPES) ,"different key types"},
136{ERR_REASON(EVP_R_DISABLED_FOR_FIPS) ,"disabled for fips"}, 158{ERR_REASON(EVP_R_DIFFERENT_PARAMETERS) ,"different parameters"},
137{ERR_REASON(EVP_R_ENCODE_ERROR) ,"encode error"}, 159{ERR_REASON(EVP_R_ENCODE_ERROR) ,"encode error"},
138{ERR_REASON(EVP_R_ERROR_LOADING_SECTION) ,"error loading section"},
139{ERR_REASON(EVP_R_ERROR_SETTING_FIPS_MODE),"error setting fips mode"},
140{ERR_REASON(EVP_R_EVP_PBE_CIPHERINIT_ERROR),"evp pbe cipherinit error"}, 160{ERR_REASON(EVP_R_EVP_PBE_CIPHERINIT_ERROR),"evp pbe cipherinit error"},
141{ERR_REASON(EVP_R_EXPECTING_AN_RSA_KEY) ,"expecting an rsa key"}, 161{ERR_REASON(EVP_R_EXPECTING_AN_RSA_KEY) ,"expecting an rsa key"},
142{ERR_REASON(EVP_R_EXPECTING_A_DH_KEY) ,"expecting a dh key"}, 162{ERR_REASON(EVP_R_EXPECTING_A_DH_KEY) ,"expecting a dh key"},
143{ERR_REASON(EVP_R_EXPECTING_A_DSA_KEY) ,"expecting a dsa key"}, 163{ERR_REASON(EVP_R_EXPECTING_A_DSA_KEY) ,"expecting a dsa key"},
144{ERR_REASON(EVP_R_EXPECTING_A_ECDSA_KEY) ,"expecting a ecdsa key"}, 164{ERR_REASON(EVP_R_EXPECTING_A_ECDSA_KEY) ,"expecting a ecdsa key"},
145{ERR_REASON(EVP_R_EXPECTING_A_EC_KEY) ,"expecting a ec key"}, 165{ERR_REASON(EVP_R_EXPECTING_A_EC_KEY) ,"expecting a ec key"},
146{ERR_REASON(EVP_R_FIPS_MODE_NOT_SUPPORTED),"fips mode not supported"},
147{ERR_REASON(EVP_R_INITIALIZATION_ERROR) ,"initialization error"}, 166{ERR_REASON(EVP_R_INITIALIZATION_ERROR) ,"initialization error"},
148{ERR_REASON(EVP_R_INPUT_NOT_INITIALIZED) ,"input not initialized"}, 167{ERR_REASON(EVP_R_INPUT_NOT_INITIALIZED) ,"input not initialized"},
149{ERR_REASON(EVP_R_INVALID_FIPS_MODE) ,"invalid fips mode"}, 168{ERR_REASON(EVP_R_INVALID_DIGEST) ,"invalid digest"},
150{ERR_REASON(EVP_R_INVALID_KEY_LENGTH) ,"invalid key length"}, 169{ERR_REASON(EVP_R_INVALID_KEY_LENGTH) ,"invalid key length"},
170{ERR_REASON(EVP_R_INVALID_OPERATION) ,"invalid operation"},
151{ERR_REASON(EVP_R_IV_TOO_LARGE) ,"iv too large"}, 171{ERR_REASON(EVP_R_IV_TOO_LARGE) ,"iv too large"},
152{ERR_REASON(EVP_R_KEYGEN_FAILURE) ,"keygen failure"}, 172{ERR_REASON(EVP_R_KEYGEN_FAILURE) ,"keygen failure"},
173{ERR_REASON(EVP_R_MESSAGE_DIGEST_IS_NULL),"message digest is null"},
174{ERR_REASON(EVP_R_METHOD_NOT_SUPPORTED) ,"method not supported"},
153{ERR_REASON(EVP_R_MISSING_PARAMETERS) ,"missing parameters"}, 175{ERR_REASON(EVP_R_MISSING_PARAMETERS) ,"missing parameters"},
154{ERR_REASON(EVP_R_NO_CIPHER_SET) ,"no cipher set"}, 176{ERR_REASON(EVP_R_NO_CIPHER_SET) ,"no cipher set"},
177{ERR_REASON(EVP_R_NO_DEFAULT_DIGEST) ,"no default digest"},
155{ERR_REASON(EVP_R_NO_DIGEST_SET) ,"no digest set"}, 178{ERR_REASON(EVP_R_NO_DIGEST_SET) ,"no digest set"},
156{ERR_REASON(EVP_R_NO_DSA_PARAMETERS) ,"no dsa parameters"}, 179{ERR_REASON(EVP_R_NO_DSA_PARAMETERS) ,"no dsa parameters"},
180{ERR_REASON(EVP_R_NO_KEY_SET) ,"no key set"},
181{ERR_REASON(EVP_R_NO_OPERATION_SET) ,"no operation set"},
157{ERR_REASON(EVP_R_NO_SIGN_FUNCTION_CONFIGURED),"no sign function configured"}, 182{ERR_REASON(EVP_R_NO_SIGN_FUNCTION_CONFIGURED),"no sign function configured"},
158{ERR_REASON(EVP_R_NO_VERIFY_FUNCTION_CONFIGURED),"no verify function configured"}, 183{ERR_REASON(EVP_R_NO_VERIFY_FUNCTION_CONFIGURED),"no verify function configured"},
184{ERR_REASON(EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE),"operation not supported for this keytype"},
185{ERR_REASON(EVP_R_OPERATON_NOT_INITIALIZED),"operaton not initialized"},
159{ERR_REASON(EVP_R_PKCS8_UNKNOWN_BROKEN_TYPE),"pkcs8 unknown broken type"}, 186{ERR_REASON(EVP_R_PKCS8_UNKNOWN_BROKEN_TYPE),"pkcs8 unknown broken type"},
187{ERR_REASON(EVP_R_PRIVATE_KEY_DECODE_ERROR),"private key decode error"},
188{ERR_REASON(EVP_R_PRIVATE_KEY_ENCODE_ERROR),"private key encode error"},
160{ERR_REASON(EVP_R_PUBLIC_KEY_NOT_RSA) ,"public key not rsa"}, 189{ERR_REASON(EVP_R_PUBLIC_KEY_NOT_RSA) ,"public key not rsa"},
161{ERR_REASON(EVP_R_SEED_KEY_SETUP_FAILED) ,"seed key setup failed"}, 190{ERR_REASON(EVP_R_UNKNOWN_CIPHER) ,"unknown cipher"},
162{ERR_REASON(EVP_R_UNKNOWN_OPTION) ,"unknown option"}, 191{ERR_REASON(EVP_R_UNKNOWN_DIGEST) ,"unknown digest"},
163{ERR_REASON(EVP_R_UNKNOWN_PBE_ALGORITHM) ,"unknown pbe algorithm"}, 192{ERR_REASON(EVP_R_UNKNOWN_PBE_ALGORITHM) ,"unknown pbe algorithm"},
164{ERR_REASON(EVP_R_UNSUPORTED_NUMBER_OF_ROUNDS),"unsuported number of rounds"}, 193{ERR_REASON(EVP_R_UNSUPORTED_NUMBER_OF_ROUNDS),"unsuported number of rounds"},
194{ERR_REASON(EVP_R_UNSUPPORTED_ALGORITHM) ,"unsupported algorithm"},
165{ERR_REASON(EVP_R_UNSUPPORTED_CIPHER) ,"unsupported cipher"}, 195{ERR_REASON(EVP_R_UNSUPPORTED_CIPHER) ,"unsupported cipher"},
166{ERR_REASON(EVP_R_UNSUPPORTED_KEYLENGTH) ,"unsupported keylength"}, 196{ERR_REASON(EVP_R_UNSUPPORTED_KEYLENGTH) ,"unsupported keylength"},
167{ERR_REASON(EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION),"unsupported key derivation function"}, 197{ERR_REASON(EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION),"unsupported key derivation function"},
diff --git a/src/lib/libcrypto/evp/evp_key.c b/src/lib/libcrypto/evp/evp_key.c
index 361ea69ab6..839d6a3a16 100644
--- a/src/lib/libcrypto/evp/evp_key.c
+++ b/src/lib/libcrypto/evp/evp_key.c
@@ -90,6 +90,11 @@ char *EVP_get_pw_prompt(void)
90 * this function will fail */ 90 * this function will fail */
91int EVP_read_pw_string(char *buf, int len, const char *prompt, int verify) 91int EVP_read_pw_string(char *buf, int len, const char *prompt, int verify)
92 { 92 {
93 return EVP_read_pw_string_min(buf, 0, len, prompt, verify);
94 }
95
96int EVP_read_pw_string_min(char *buf, int min, int len, const char *prompt, int verify)
97 {
93 int ret; 98 int ret;
94 char buff[BUFSIZ]; 99 char buff[BUFSIZ];
95 UI *ui; 100 UI *ui;
@@ -97,10 +102,10 @@ int EVP_read_pw_string(char *buf, int len, const char *prompt, int verify)
97 if ((prompt == NULL) && (prompt_string[0] != '\0')) 102 if ((prompt == NULL) && (prompt_string[0] != '\0'))
98 prompt=prompt_string; 103 prompt=prompt_string;
99 ui = UI_new(); 104 ui = UI_new();
100 UI_add_input_string(ui,prompt,0,buf,0,(len>=BUFSIZ)?BUFSIZ-1:len); 105 UI_add_input_string(ui,prompt,0,buf,min,(len>=BUFSIZ)?BUFSIZ-1:len);
101 if (verify) 106 if (verify)
102 UI_add_verify_string(ui,prompt,0, 107 UI_add_verify_string(ui,prompt,0,
103 buff,0,(len>=BUFSIZ)?BUFSIZ-1:len,buf); 108 buff,min,(len>=BUFSIZ)?BUFSIZ-1:len,buf);
104 ret = UI_process(ui); 109 ret = UI_process(ui);
105 UI_free(ui); 110 UI_free(ui);
106 OPENSSL_cleanse(buff,BUFSIZ); 111 OPENSSL_cleanse(buff,BUFSIZ);
diff --git a/src/lib/libcrypto/evp/evp_lib.c b/src/lib/libcrypto/evp/evp_lib.c
index 174cf6c594..40951a04f0 100644
--- a/src/lib/libcrypto/evp/evp_lib.c
+++ b/src/lib/libcrypto/evp/evp_lib.c
@@ -67,8 +67,6 @@ int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type)
67 67
68 if (c->cipher->set_asn1_parameters != NULL) 68 if (c->cipher->set_asn1_parameters != NULL)
69 ret=c->cipher->set_asn1_parameters(c,type); 69 ret=c->cipher->set_asn1_parameters(c,type);
70 else if (c->cipher->flags & EVP_CIPH_FLAG_DEFAULT_ASN1)
71 ret=EVP_CIPHER_set_asn1_iv(c, type);
72 else 70 else
73 ret=-1; 71 ret=-1;
74 return(ret); 72 return(ret);
@@ -80,8 +78,6 @@ int EVP_CIPHER_asn1_to_param(EVP_CIPHER_CTX *c, ASN1_TYPE *type)
80 78
81 if (c->cipher->get_asn1_parameters != NULL) 79 if (c->cipher->get_asn1_parameters != NULL)
82 ret=c->cipher->get_asn1_parameters(c,type); 80 ret=c->cipher->get_asn1_parameters(c,type);
83 else if (c->cipher->flags & EVP_CIPH_FLAG_DEFAULT_ASN1)
84 ret=EVP_CIPHER_get_asn1_iv(c, type);
85 else 81 else
86 ret=-1; 82 ret=-1;
87 return(ret); 83 return(ret);
@@ -163,6 +159,12 @@ int EVP_CIPHER_type(const EVP_CIPHER *ctx)
163 159
164 return NID_des_cfb64; 160 return NID_des_cfb64;
165 161
162 case NID_des_ede3_cfb64:
163 case NID_des_ede3_cfb8:
164 case NID_des_ede3_cfb1:
165
166 return NID_des_cfb64;
167
166 default: 168 default:
167 /* Check it has an OID and it is valid */ 169 /* Check it has an OID and it is valid */
168 otmp = OBJ_nid2obj(nid); 170 otmp = OBJ_nid2obj(nid);
@@ -182,6 +184,11 @@ int EVP_CIPHER_CTX_block_size(const EVP_CIPHER_CTX *ctx)
182 return ctx->cipher->block_size; 184 return ctx->cipher->block_size;
183 } 185 }
184 186
187int EVP_Cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, unsigned int inl)
188 {
189 return ctx->cipher->do_cipher(ctx,out,in,inl);
190 }
191
185const EVP_CIPHER *EVP_CIPHER_CTX_cipher(const EVP_CIPHER_CTX *ctx) 192const EVP_CIPHER *EVP_CIPHER_CTX_cipher(const EVP_CIPHER_CTX *ctx)
186 { 193 {
187 return ctx->cipher; 194 return ctx->cipher;
@@ -192,6 +199,11 @@ unsigned long EVP_CIPHER_flags(const EVP_CIPHER *cipher)
192 return cipher->flags; 199 return cipher->flags;
193 } 200 }
194 201
202unsigned long EVP_CIPHER_CTX_flags(const EVP_CIPHER_CTX *ctx)
203 {
204 return ctx->cipher->flags;
205 }
206
195void *EVP_CIPHER_CTX_get_app_data(const EVP_CIPHER_CTX *ctx) 207void *EVP_CIPHER_CTX_get_app_data(const EVP_CIPHER_CTX *ctx)
196 { 208 {
197 return ctx->app_data; 209 return ctx->app_data;
@@ -207,6 +219,11 @@ int EVP_CIPHER_iv_length(const EVP_CIPHER *cipher)
207 return cipher->iv_len; 219 return cipher->iv_len;
208 } 220 }
209 221
222int EVP_CIPHER_CTX_iv_length(const EVP_CIPHER_CTX *ctx)
223 {
224 return ctx->cipher->iv_len;
225 }
226
210int EVP_CIPHER_key_length(const EVP_CIPHER *cipher) 227int EVP_CIPHER_key_length(const EVP_CIPHER *cipher)
211 { 228 {
212 return cipher->key_len; 229 return cipher->key_len;
@@ -217,6 +234,11 @@ int EVP_CIPHER_CTX_key_length(const EVP_CIPHER_CTX *ctx)
217 return ctx->key_len; 234 return ctx->key_len;
218 } 235 }
219 236
237int EVP_CIPHER_nid(const EVP_CIPHER *cipher)
238 {
239 return cipher->nid;
240 }
241
220int EVP_CIPHER_CTX_nid(const EVP_CIPHER_CTX *ctx) 242int EVP_CIPHER_CTX_nid(const EVP_CIPHER_CTX *ctx)
221 { 243 {
222 return ctx->cipher->nid; 244 return ctx->cipher->nid;
@@ -239,11 +261,23 @@ int EVP_MD_pkey_type(const EVP_MD *md)
239 261
240int EVP_MD_size(const EVP_MD *md) 262int EVP_MD_size(const EVP_MD *md)
241 { 263 {
264 if (!md)
265 {
266 EVPerr(EVP_F_EVP_MD_SIZE, EVP_R_MESSAGE_DIGEST_IS_NULL);
267 return -1;
268 }
242 return md->md_size; 269 return md->md_size;
243 } 270 }
244 271
245const EVP_MD * EVP_MD_CTX_md(const EVP_MD_CTX *ctx) 272unsigned long EVP_MD_flags(const EVP_MD *md)
273 {
274 return md->flags;
275 }
276
277const EVP_MD *EVP_MD_CTX_md(const EVP_MD_CTX *ctx)
246 { 278 {
279 if (!ctx)
280 return NULL;
247 return ctx->digest; 281 return ctx->digest;
248 } 282 }
249 283
diff --git a/src/lib/libcrypto/evp/evp_locl.h b/src/lib/libcrypto/evp/evp_locl.h
index eabcc96f30..292d74c188 100644
--- a/src/lib/libcrypto/evp/evp_locl.h
+++ b/src/lib/libcrypto/evp/evp_locl.h
@@ -61,38 +61,66 @@
61/* Wrapper functions for each cipher mode */ 61/* Wrapper functions for each cipher mode */
62 62
63#define BLOCK_CIPHER_ecb_loop() \ 63#define BLOCK_CIPHER_ecb_loop() \
64 unsigned int i, bl; \ 64 size_t i, bl; \
65 bl = ctx->cipher->block_size;\ 65 bl = ctx->cipher->block_size;\
66 if(inl < bl) return 1;\ 66 if(inl < bl) return 1;\
67 inl -= bl; \ 67 inl -= bl; \
68 for(i=0; i <= inl; i+=bl) 68 for(i=0; i <= inl; i+=bl)
69 69
70#define BLOCK_CIPHER_func_ecb(cname, cprefix, kstruct, ksched) \ 70#define BLOCK_CIPHER_func_ecb(cname, cprefix, kstruct, ksched) \
71static int cname##_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, unsigned int inl) \ 71static int cname##_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) \
72{\ 72{\
73 BLOCK_CIPHER_ecb_loop() \ 73 BLOCK_CIPHER_ecb_loop() \
74 cprefix##_ecb_encrypt(in + i, out + i, &((kstruct *)ctx->cipher_data)->ksched, ctx->encrypt);\ 74 cprefix##_ecb_encrypt(in + i, out + i, &((kstruct *)ctx->cipher_data)->ksched, ctx->encrypt);\
75 return 1;\ 75 return 1;\
76} 76}
77 77
78#define EVP_MAXCHUNK ((size_t)1<<(sizeof(long)*8-2))
79
78#define BLOCK_CIPHER_func_ofb(cname, cprefix, cbits, kstruct, ksched) \ 80#define BLOCK_CIPHER_func_ofb(cname, cprefix, cbits, kstruct, ksched) \
79static int cname##_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, unsigned int inl) \ 81static int cname##_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) \
80{\ 82{\
81 cprefix##_ofb##cbits##_encrypt(in, out, (long)inl, &((kstruct *)ctx->cipher_data)->ksched, ctx->iv, &ctx->num);\ 83 while(inl>=EVP_MAXCHUNK)\
84 {\
85 cprefix##_ofb##cbits##_encrypt(in, out, (long)EVP_MAXCHUNK, &((kstruct *)ctx->cipher_data)->ksched, ctx->iv, &ctx->num);\
86 inl-=EVP_MAXCHUNK;\
87 in +=EVP_MAXCHUNK;\
88 out+=EVP_MAXCHUNK;\
89 }\
90 if (inl)\
91 cprefix##_ofb##cbits##_encrypt(in, out, (long)inl, &((kstruct *)ctx->cipher_data)->ksched, ctx->iv, &ctx->num);\
82 return 1;\ 92 return 1;\
83} 93}
84 94
85#define BLOCK_CIPHER_func_cbc(cname, cprefix, kstruct, ksched) \ 95#define BLOCK_CIPHER_func_cbc(cname, cprefix, kstruct, ksched) \
86static int cname##_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, unsigned int inl) \ 96static int cname##_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) \
87{\ 97{\
88 cprefix##_cbc_encrypt(in, out, (long)inl, &((kstruct *)ctx->cipher_data)->ksched, ctx->iv, ctx->encrypt);\ 98 while(inl>=EVP_MAXCHUNK) \
99 {\
100 cprefix##_cbc_encrypt(in, out, (long)EVP_MAXCHUNK, &((kstruct *)ctx->cipher_data)->ksched, ctx->iv, ctx->encrypt);\
101 inl-=EVP_MAXCHUNK;\
102 in +=EVP_MAXCHUNK;\
103 out+=EVP_MAXCHUNK;\
104 }\
105 if (inl)\
106 cprefix##_cbc_encrypt(in, out, (long)inl, &((kstruct *)ctx->cipher_data)->ksched, ctx->iv, ctx->encrypt);\
89 return 1;\ 107 return 1;\
90} 108}
91 109
92#define BLOCK_CIPHER_func_cfb(cname, cprefix, cbits, kstruct, ksched) \ 110#define BLOCK_CIPHER_func_cfb(cname, cprefix, cbits, kstruct, ksched) \
93static int cname##_cfb##cbits##_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, unsigned int inl) \ 111static int cname##_cfb##cbits##_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) \
94{\ 112{\
95 cprefix##_cfb##cbits##_encrypt(in, out, (long)((cbits==1) && !(ctx->flags & EVP_CIPH_FLAG_LENGTH_BITS) ?inl*8:inl), &((kstruct *)ctx->cipher_data)->ksched, ctx->iv, &ctx->num, ctx->encrypt);\ 113 size_t chunk=EVP_MAXCHUNK;\
114 if (cbits==1) chunk>>=3;\
115 if (inl<chunk) chunk=inl;\
116 while(inl && inl>=chunk)\
117 {\
118 cprefix##_cfb##cbits##_encrypt(in, out, (long)((cbits==1) && !(ctx->flags & EVP_CIPH_FLAG_LENGTH_BITS) ?inl*8:inl), &((kstruct *)ctx->cipher_data)->ksched, ctx->iv, &ctx->num, ctx->encrypt);\
119 inl-=chunk;\
120 in +=chunk;\
121 out+=chunk;\
122 if(inl<chunk) chunk=inl;\
123 }\
96 return 1;\ 124 return 1;\
97} 125}
98 126
@@ -139,10 +167,10 @@ BLOCK_CIPHER_def1(cname, ofb##cbits, ofb, OFB, kstruct, nid, 1, \
139 get_asn1, ctrl) 167 get_asn1, ctrl)
140 168
141#define BLOCK_CIPHER_def_ecb(cname, kstruct, nid, block_size, key_len, \ 169#define BLOCK_CIPHER_def_ecb(cname, kstruct, nid, block_size, key_len, \
142 iv_len, flags, init_key, cleanup, set_asn1, \ 170 flags, init_key, cleanup, set_asn1, \
143 get_asn1, ctrl) \ 171 get_asn1, ctrl) \
144BLOCK_CIPHER_def1(cname, ecb, ecb, ECB, kstruct, nid, block_size, key_len, \ 172BLOCK_CIPHER_def1(cname, ecb, ecb, ECB, kstruct, nid, block_size, key_len, \
145 iv_len, flags, init_key, cleanup, set_asn1, get_asn1, ctrl) 173 0, flags, init_key, cleanup, set_asn1, get_asn1, ctrl)
146 174
147#define BLOCK_CIPHER_defs(cname, kstruct, \ 175#define BLOCK_CIPHER_defs(cname, kstruct, \
148 nid, block_size, key_len, iv_len, cbits, flags, \ 176 nid, block_size, key_len, iv_len, cbits, flags, \
@@ -153,7 +181,7 @@ BLOCK_CIPHER_def_cfb(cname, kstruct, nid, key_len, iv_len, cbits, \
153 flags, init_key, cleanup, set_asn1, get_asn1, ctrl) \ 181 flags, init_key, cleanup, set_asn1, get_asn1, ctrl) \
154BLOCK_CIPHER_def_ofb(cname, kstruct, nid, key_len, iv_len, cbits, \ 182BLOCK_CIPHER_def_ofb(cname, kstruct, nid, key_len, iv_len, cbits, \
155 flags, init_key, cleanup, set_asn1, get_asn1, ctrl) \ 183 flags, init_key, cleanup, set_asn1, get_asn1, ctrl) \
156BLOCK_CIPHER_def_ecb(cname, kstruct, nid, block_size, key_len, iv_len, flags, \ 184BLOCK_CIPHER_def_ecb(cname, kstruct, nid, block_size, key_len, flags, \
157 init_key, cleanup, set_asn1, get_asn1, ctrl) 185 init_key, cleanup, set_asn1, get_asn1, ctrl)
158 186
159 187
@@ -226,27 +254,92 @@ const EVP_CIPHER *EVP_##cname##_ecb(void) { return &cname##_ecb; }
226 254
227#define EVP_C_DATA(kstruct, ctx) ((kstruct *)(ctx)->cipher_data) 255#define EVP_C_DATA(kstruct, ctx) ((kstruct *)(ctx)->cipher_data)
228 256
229#define IMPLEMENT_CFBR(cipher,cprefix,kstruct,ksched,keysize,cbits,iv_len,fl) \ 257#define IMPLEMENT_CFBR(cipher,cprefix,kstruct,ksched,keysize,cbits,iv_len) \
230 BLOCK_CIPHER_func_cfb(cipher##_##keysize,cprefix,cbits,kstruct,ksched) \ 258 BLOCK_CIPHER_func_cfb(cipher##_##keysize,cprefix,cbits,kstruct,ksched) \
231 BLOCK_CIPHER_def_cfb(cipher##_##keysize,kstruct, \ 259 BLOCK_CIPHER_def_cfb(cipher##_##keysize,kstruct, \
232 NID_##cipher##_##keysize, keysize/8, iv_len, cbits, \ 260 NID_##cipher##_##keysize, keysize/8, iv_len, cbits, \
233 (fl)|EVP_CIPH_FLAG_DEFAULT_ASN1, \ 261 0, cipher##_init_key, NULL, \
234 cipher##_init_key, NULL, NULL, NULL, NULL) 262 EVP_CIPHER_set_asn1_iv, \
235 263 EVP_CIPHER_get_asn1_iv, \
236#ifdef OPENSSL_FIPS 264 NULL)
237#define RC2_set_key private_RC2_set_key 265
238#define RC4_set_key private_RC4_set_key 266struct evp_pkey_ctx_st
239#define CAST_set_key private_CAST_set_key 267 {
240#define RC5_32_set_key private_RC5_32_set_key 268 /* Method associated with this operation */
241#define BF_set_key private_BF_set_key 269 const EVP_PKEY_METHOD *pmeth;
242#define Camellia_set_key private_Camellia_set_key 270 /* Engine that implements this method or NULL if builtin */
243#define idea_set_encrypt_key private_idea_set_encrypt_key 271 ENGINE *engine;
244 272 /* Key: may be NULL */
245#define MD5_Init private_MD5_Init 273 EVP_PKEY *pkey;
246#define MD4_Init private_MD4_Init 274 /* Peer key for key agreement, may be NULL */
247#define MD2_Init private_MD2_Init 275 EVP_PKEY *peerkey;
248#define MDC2_Init private_MDC2_Init 276 /* Actual operation */
249#define SHA_Init private_SHA_Init 277 int operation;
250 278 /* Algorithm specific data */
251#endif 279 void *data;
280 /* Application specific data */
281 void *app_data;
282 /* Keygen callback */
283 EVP_PKEY_gen_cb *pkey_gencb;
284 /* implementation specific keygen data */
285 int *keygen_info;
286 int keygen_info_count;
287 } /* EVP_PKEY_CTX */;
288
289#define EVP_PKEY_FLAG_DYNAMIC 1
290
291struct evp_pkey_method_st
292 {
293 int pkey_id;
294 int flags;
295
296 int (*init)(EVP_PKEY_CTX *ctx);
297 int (*copy)(EVP_PKEY_CTX *dst, EVP_PKEY_CTX *src);
298 void (*cleanup)(EVP_PKEY_CTX *ctx);
299
300 int (*paramgen_init)(EVP_PKEY_CTX *ctx);
301 int (*paramgen)(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey);
302
303 int (*keygen_init)(EVP_PKEY_CTX *ctx);
304 int (*keygen)(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey);
305
306 int (*sign_init)(EVP_PKEY_CTX *ctx);
307 int (*sign)(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen,
308 const unsigned char *tbs, size_t tbslen);
309
310 int (*verify_init)(EVP_PKEY_CTX *ctx);
311 int (*verify)(EVP_PKEY_CTX *ctx,
312 const unsigned char *sig, size_t siglen,
313 const unsigned char *tbs, size_t tbslen);
314
315 int (*verify_recover_init)(EVP_PKEY_CTX *ctx);
316 int (*verify_recover)(EVP_PKEY_CTX *ctx,
317 unsigned char *rout, size_t *routlen,
318 const unsigned char *sig, size_t siglen);
319
320 int (*signctx_init)(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx);
321 int (*signctx)(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen,
322 EVP_MD_CTX *mctx);
323
324 int (*verifyctx_init)(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx);
325 int (*verifyctx)(EVP_PKEY_CTX *ctx, const unsigned char *sig,int siglen,
326 EVP_MD_CTX *mctx);
327
328 int (*encrypt_init)(EVP_PKEY_CTX *ctx);
329 int (*encrypt)(EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen,
330 const unsigned char *in, size_t inlen);
331
332 int (*decrypt_init)(EVP_PKEY_CTX *ctx);
333 int (*decrypt)(EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen,
334 const unsigned char *in, size_t inlen);
335
336 int (*derive_init)(EVP_PKEY_CTX *ctx);
337 int (*derive)(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen);
338
339 int (*ctrl)(EVP_PKEY_CTX *ctx, int type, int p1, void *p2);
340 int (*ctrl_str)(EVP_PKEY_CTX *ctx, const char *type, const char *value);
341
342
343 } /* EVP_PKEY_METHOD */;
252 344
345void evp_pkey_set_cb_translate(BN_GENCB *cb, EVP_PKEY_CTX *ctx);
diff --git a/src/lib/libcrypto/evp/evp_pbe.c b/src/lib/libcrypto/evp/evp_pbe.c
index 5e830be65f..c9d932d205 100644
--- a/src/lib/libcrypto/evp/evp_pbe.c
+++ b/src/lib/libcrypto/evp/evp_pbe.c
@@ -3,7 +3,7 @@
3 * project 1999. 3 * project 1999.
4 */ 4 */
5/* ==================================================================== 5/* ====================================================================
6 * Copyright (c) 1999 The OpenSSL Project. All rights reserved. 6 * Copyright (c) 1999-2006 The OpenSSL Project. All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
@@ -59,79 +59,253 @@
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60#include "cryptlib.h"
61#include <openssl/evp.h> 61#include <openssl/evp.h>
62#include <openssl/pkcs12.h>
62#include <openssl/x509.h> 63#include <openssl/x509.h>
63 64
64/* Password based encryption (PBE) functions */ 65/* Password based encryption (PBE) functions */
65 66
66static STACK *pbe_algs; 67DECLARE_STACK_OF(EVP_PBE_CTL)
68static STACK_OF(EVP_PBE_CTL) *pbe_algs;
67 69
68/* Setup a cipher context from a PBE algorithm */ 70/* Setup a cipher context from a PBE algorithm */
69 71
70typedef struct { 72typedef struct
71int pbe_nid; 73 {
72const EVP_CIPHER *cipher; 74 int pbe_type;
73const EVP_MD *md; 75 int pbe_nid;
74EVP_PBE_KEYGEN *keygen; 76 int cipher_nid;
75} EVP_PBE_CTL; 77 int md_nid;
78 EVP_PBE_KEYGEN *keygen;
79 } EVP_PBE_CTL;
76 80
77int EVP_PBE_CipherInit(ASN1_OBJECT *pbe_obj, const char *pass, int passlen, 81static const EVP_PBE_CTL builtin_pbe[] =
78 ASN1_TYPE *param, EVP_CIPHER_CTX *ctx, int en_de) 82 {
79{ 83 {EVP_PBE_TYPE_OUTER, NID_pbeWithMD2AndDES_CBC,
84 NID_des_cbc, NID_md2, PKCS5_PBE_keyivgen},
85 {EVP_PBE_TYPE_OUTER, NID_pbeWithMD5AndDES_CBC,
86 NID_des_cbc, NID_md5, PKCS5_PBE_keyivgen},
87 {EVP_PBE_TYPE_OUTER, NID_pbeWithSHA1AndRC2_CBC,
88 NID_rc2_64_cbc, NID_sha1, PKCS5_PBE_keyivgen},
80 89
81 EVP_PBE_CTL *pbetmp, pbelu; 90 {EVP_PBE_TYPE_OUTER, NID_pbe_WithSHA1And128BitRC4,
82 int i; 91 NID_rc4, NID_sha1, PKCS12_PBE_keyivgen},
83 pbelu.pbe_nid = OBJ_obj2nid(pbe_obj); 92 {EVP_PBE_TYPE_OUTER, NID_pbe_WithSHA1And40BitRC4,
84 if (pbelu.pbe_nid != NID_undef) i = sk_find(pbe_algs, (char *)&pbelu); 93 NID_rc4_40, NID_sha1, PKCS12_PBE_keyivgen},
85 else i = -1; 94 {EVP_PBE_TYPE_OUTER, NID_pbe_WithSHA1And3_Key_TripleDES_CBC,
95 NID_des_ede3_cbc, NID_sha1, PKCS12_PBE_keyivgen},
96 {EVP_PBE_TYPE_OUTER, NID_pbe_WithSHA1And2_Key_TripleDES_CBC,
97 NID_des_ede_cbc, NID_sha1, PKCS12_PBE_keyivgen},
98 {EVP_PBE_TYPE_OUTER, NID_pbe_WithSHA1And128BitRC2_CBC,
99 NID_rc2_cbc, NID_sha1, PKCS12_PBE_keyivgen},
100 {EVP_PBE_TYPE_OUTER, NID_pbe_WithSHA1And40BitRC2_CBC,
101 NID_rc2_40_cbc, NID_sha1, PKCS12_PBE_keyivgen},
102
103#ifndef OPENSSL_NO_HMAC
104 {EVP_PBE_TYPE_OUTER, NID_pbes2, -1, -1, PKCS5_v2_PBE_keyivgen},
105#endif
106 {EVP_PBE_TYPE_OUTER, NID_pbeWithMD2AndRC2_CBC,
107 NID_rc2_64_cbc, NID_md2, PKCS5_PBE_keyivgen},
108 {EVP_PBE_TYPE_OUTER, NID_pbeWithMD5AndRC2_CBC,
109 NID_rc2_64_cbc, NID_md5, PKCS5_PBE_keyivgen},
110 {EVP_PBE_TYPE_OUTER, NID_pbeWithSHA1AndDES_CBC,
111 NID_des_cbc, NID_sha1, PKCS5_PBE_keyivgen},
112
113
114 {EVP_PBE_TYPE_PRF, NID_hmacWithSHA1, -1, NID_sha1, 0},
115 {EVP_PBE_TYPE_PRF, NID_hmacWithMD5, -1, NID_md5, 0},
116 {EVP_PBE_TYPE_PRF, NID_hmacWithSHA224, -1, NID_sha224, 0},
117 {EVP_PBE_TYPE_PRF, NID_hmacWithSHA256, -1, NID_sha256, 0},
118 {EVP_PBE_TYPE_PRF, NID_hmacWithSHA384, -1, NID_sha384, 0},
119 {EVP_PBE_TYPE_PRF, NID_hmacWithSHA512, -1, NID_sha512, 0},
120 {EVP_PBE_TYPE_PRF, NID_id_HMACGostR3411_94, -1, NID_id_GostR3411_94, 0},
121 };
122
123#ifdef TEST
124int main(int argc, char **argv)
125 {
126 int i, nid_md, nid_cipher;
127 EVP_PBE_CTL *tpbe, *tpbe2;
128 /*OpenSSL_add_all_algorithms();*/
129
130 for (i = 0; i < sizeof(builtin_pbe)/sizeof(EVP_PBE_CTL); i++)
131 {
132 tpbe = builtin_pbe + i;
133 fprintf(stderr, "%d %d %s ", tpbe->pbe_type, tpbe->pbe_nid,
134 OBJ_nid2sn(tpbe->pbe_nid));
135 if (EVP_PBE_find(tpbe->pbe_type, tpbe->pbe_nid,
136 &nid_cipher ,&nid_md,0))
137 fprintf(stderr, "Found %s %s\n",
138 OBJ_nid2sn(nid_cipher),
139 OBJ_nid2sn(nid_md));
140 else
141 fprintf(stderr, "Find ERROR!!\n");
142 }
143
144 return 0;
145 }
146#endif
147
148
149
150int EVP_PBE_CipherInit(ASN1_OBJECT *pbe_obj, const char *pass, int passlen,
151 ASN1_TYPE *param, EVP_CIPHER_CTX *ctx, int en_de)
152 {
153 const EVP_CIPHER *cipher;
154 const EVP_MD *md;
155 int cipher_nid, md_nid;
156 EVP_PBE_KEYGEN *keygen;
86 157
87 if (i == -1) { 158 if (!EVP_PBE_find(EVP_PBE_TYPE_OUTER, OBJ_obj2nid(pbe_obj),
159 &cipher_nid, &md_nid, &keygen))
160 {
88 char obj_tmp[80]; 161 char obj_tmp[80];
89 EVPerr(EVP_F_EVP_PBE_CIPHERINIT,EVP_R_UNKNOWN_PBE_ALGORITHM); 162 EVPerr(EVP_F_EVP_PBE_CIPHERINIT,EVP_R_UNKNOWN_PBE_ALGORITHM);
90 if (!pbe_obj) BUF_strlcpy (obj_tmp, "NULL", sizeof obj_tmp); 163 if (!pbe_obj) BUF_strlcpy (obj_tmp, "NULL", sizeof obj_tmp);
91 else i2t_ASN1_OBJECT(obj_tmp, sizeof obj_tmp, pbe_obj); 164 else i2t_ASN1_OBJECT(obj_tmp, sizeof obj_tmp, pbe_obj);
92 ERR_add_error_data(2, "TYPE=", obj_tmp); 165 ERR_add_error_data(2, "TYPE=", obj_tmp);
93 return 0; 166 return 0;
94 } 167 }
95 if(!pass) passlen = 0; 168
96 else if (passlen == -1) passlen = strlen(pass); 169 if(!pass)
97 pbetmp = (EVP_PBE_CTL *)sk_value (pbe_algs, i); 170 passlen = 0;
98 i = (*pbetmp->keygen)(ctx, pass, passlen, param, pbetmp->cipher, 171 else if (passlen == -1)
99 pbetmp->md, en_de); 172 passlen = strlen(pass);
100 if (!i) { 173
174 if (cipher_nid == -1)
175 cipher = NULL;
176 else
177 {
178 cipher = EVP_get_cipherbynid(cipher_nid);
179 if (!cipher)
180 {
181 EVPerr(EVP_F_EVP_PBE_CIPHERINIT,EVP_R_UNKNOWN_CIPHER);
182 return 0;
183 }
184 }
185
186 if (md_nid == -1)
187 md = NULL;
188 else
189 {
190 md = EVP_get_digestbynid(md_nid);
191 if (!md)
192 {
193 EVPerr(EVP_F_EVP_PBE_CIPHERINIT,EVP_R_UNKNOWN_DIGEST);
194 return 0;
195 }
196 }
197
198 if (!keygen(ctx, pass, passlen, param, cipher, md, en_de))
199 {
101 EVPerr(EVP_F_EVP_PBE_CIPHERINIT,EVP_R_KEYGEN_FAILURE); 200 EVPerr(EVP_F_EVP_PBE_CIPHERINIT,EVP_R_KEYGEN_FAILURE);
102 return 0; 201 return 0;
103 } 202 }
104 return 1; 203 return 1;
105} 204}
106 205
107static int pbe_cmp(const char * const *a, const char * const *b) 206DECLARE_OBJ_BSEARCH_CMP_FN(EVP_PBE_CTL, EVP_PBE_CTL, pbe2);
108{ 207
109 const EVP_PBE_CTL * const *pbe1 = (const EVP_PBE_CTL * const *) a, 208static int pbe2_cmp(const EVP_PBE_CTL *pbe1, const EVP_PBE_CTL *pbe2)
110 * const *pbe2 = (const EVP_PBE_CTL * const *)b; 209 {
111 return ((*pbe1)->pbe_nid - (*pbe2)->pbe_nid); 210 int ret = pbe1->pbe_type - pbe2->pbe_type;
112} 211 if (ret)
212 return ret;
213 else
214 return pbe1->pbe_nid - pbe2->pbe_nid;
215 }
216
217IMPLEMENT_OBJ_BSEARCH_CMP_FN(EVP_PBE_CTL, EVP_PBE_CTL, pbe2);
218
219static int pbe_cmp(const EVP_PBE_CTL * const *a, const EVP_PBE_CTL * const *b)
220 {
221 int ret = (*a)->pbe_type - (*b)->pbe_type;
222 if (ret)
223 return ret;
224 else
225 return (*a)->pbe_nid - (*b)->pbe_nid;
226 }
113 227
114/* Add a PBE algorithm */ 228/* Add a PBE algorithm */
115 229
116int EVP_PBE_alg_add(int nid, const EVP_CIPHER *cipher, const EVP_MD *md, 230int EVP_PBE_alg_add_type(int pbe_type, int pbe_nid, int cipher_nid, int md_nid,
117 EVP_PBE_KEYGEN *keygen) 231 EVP_PBE_KEYGEN *keygen)
118{ 232 {
119 EVP_PBE_CTL *pbe_tmp; 233 EVP_PBE_CTL *pbe_tmp;
120 if (!pbe_algs) pbe_algs = sk_new(pbe_cmp); 234 if (!pbe_algs)
121 if (!(pbe_tmp = (EVP_PBE_CTL*) OPENSSL_malloc (sizeof(EVP_PBE_CTL)))) { 235 pbe_algs = sk_EVP_PBE_CTL_new(pbe_cmp);
122 EVPerr(EVP_F_EVP_PBE_ALG_ADD,ERR_R_MALLOC_FAILURE); 236 if (!(pbe_tmp = (EVP_PBE_CTL*) OPENSSL_malloc (sizeof(EVP_PBE_CTL))))
237 {
238 EVPerr(EVP_F_EVP_PBE_ALG_ADD_TYPE,ERR_R_MALLOC_FAILURE);
123 return 0; 239 return 0;
124 } 240 }
125 pbe_tmp->pbe_nid = nid; 241 pbe_tmp->pbe_type = pbe_type;
126 pbe_tmp->cipher = cipher; 242 pbe_tmp->pbe_nid = pbe_nid;
127 pbe_tmp->md = md; 243 pbe_tmp->cipher_nid = cipher_nid;
244 pbe_tmp->md_nid = md_nid;
128 pbe_tmp->keygen = keygen; 245 pbe_tmp->keygen = keygen;
129 sk_push (pbe_algs, (char *)pbe_tmp); 246
247
248 sk_EVP_PBE_CTL_push (pbe_algs, pbe_tmp);
130 return 1; 249 return 1;
131} 250 }
251
252int EVP_PBE_alg_add(int nid, const EVP_CIPHER *cipher, const EVP_MD *md,
253 EVP_PBE_KEYGEN *keygen)
254 {
255 int cipher_nid, md_nid;
256 if (cipher)
257 cipher_nid = EVP_CIPHER_type(cipher);
258 else
259 cipher_nid = -1;
260 if (md)
261 md_nid = EVP_MD_type(md);
262 else
263 md_nid = -1;
264
265 return EVP_PBE_alg_add_type(EVP_PBE_TYPE_OUTER, nid,
266 cipher_nid, md_nid, keygen);
267 }
268
269int EVP_PBE_find(int type, int pbe_nid,
270 int *pcnid, int *pmnid, EVP_PBE_KEYGEN **pkeygen)
271 {
272 EVP_PBE_CTL *pbetmp = NULL, pbelu;
273 int i;
274 if (pbe_nid == NID_undef)
275 return 0;
276
277 pbelu.pbe_type = type;
278 pbelu.pbe_nid = pbe_nid;
279
280 if (pbe_algs)
281 {
282 i = sk_EVP_PBE_CTL_find(pbe_algs, &pbelu);
283 if (i != -1)
284 pbetmp = sk_EVP_PBE_CTL_value (pbe_algs, i);
285 }
286 if (pbetmp == NULL)
287 {
288 pbetmp = OBJ_bsearch_pbe2(&pbelu, builtin_pbe,
289 sizeof(builtin_pbe)/sizeof(EVP_PBE_CTL));
290 }
291 if (pbetmp == NULL)
292 return 0;
293 if (pcnid)
294 *pcnid = pbetmp->cipher_nid;
295 if (pmnid)
296 *pmnid = pbetmp->md_nid;
297 if (pkeygen)
298 *pkeygen = pbetmp->keygen;
299 return 1;
300 }
301
302static void free_evp_pbe_ctl(EVP_PBE_CTL *pbe)
303 {
304 OPENSSL_freeFunc(pbe);
305 }
132 306
133void EVP_PBE_cleanup(void) 307void EVP_PBE_cleanup(void)
134{ 308 {
135 sk_pop_free(pbe_algs, OPENSSL_freeFunc); 309 sk_EVP_PBE_CTL_pop_free(pbe_algs, free_evp_pbe_ctl);
136 pbe_algs = NULL; 310 pbe_algs = NULL;
137} 311 }
diff --git a/src/lib/libcrypto/evp/evp_pkey.c b/src/lib/libcrypto/evp/evp_pkey.c
index 10d9e9e772..ceebf69284 100644
--- a/src/lib/libcrypto/evp/evp_pkey.c
+++ b/src/lib/libcrypto/evp/evp_pkey.c
@@ -3,7 +3,7 @@
3 * project 1999. 3 * project 1999.
4 */ 4 */
5/* ==================================================================== 5/* ====================================================================
6 * Copyright (c) 1999-2002 The OpenSSL Project. All rights reserved. 6 * Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
@@ -61,287 +61,52 @@
61#include "cryptlib.h" 61#include "cryptlib.h"
62#include <openssl/x509.h> 62#include <openssl/x509.h>
63#include <openssl/rand.h> 63#include <openssl/rand.h>
64#ifndef OPENSSL_NO_RSA 64#include "asn1_locl.h"
65#include <openssl/rsa.h>
66#endif
67#ifndef OPENSSL_NO_DSA
68#include <openssl/dsa.h>
69#endif
70#include <openssl/bn.h>
71
72#ifndef OPENSSL_NO_DSA
73static int dsa_pkey2pkcs8(PKCS8_PRIV_KEY_INFO *p8inf, EVP_PKEY *pkey);
74#endif
75#ifndef OPENSSL_NO_EC
76static int eckey_pkey2pkcs8(PKCS8_PRIV_KEY_INFO *p8inf, EVP_PKEY *pkey);
77#endif
78 65
79/* Extract a private key from a PKCS8 structure */ 66/* Extract a private key from a PKCS8 structure */
80 67
81EVP_PKEY *EVP_PKCS82PKEY(PKCS8_PRIV_KEY_INFO *p8) 68EVP_PKEY *EVP_PKCS82PKEY(PKCS8_PRIV_KEY_INFO *p8)
82{ 69{
83 EVP_PKEY *pkey = NULL; 70 EVP_PKEY *pkey = NULL;
84#ifndef OPENSSL_NO_RSA 71 ASN1_OBJECT *algoid;
85 RSA *rsa = NULL;
86#endif
87#ifndef OPENSSL_NO_DSA
88 DSA *dsa = NULL;
89 ASN1_TYPE *t1, *t2;
90 ASN1_INTEGER *privkey;
91 STACK_OF(ASN1_TYPE) *ndsa = NULL;
92#endif
93#ifndef OPENSSL_NO_EC
94 EC_KEY *eckey = NULL;
95 const unsigned char *p_tmp;
96#endif
97#if !defined(OPENSSL_NO_DSA) || !defined(OPENSSL_NO_EC)
98 ASN1_TYPE *param = NULL;
99 BN_CTX *ctx = NULL;
100 int plen;
101#endif
102 X509_ALGOR *a;
103 const unsigned char *p;
104 const unsigned char *cp;
105 int pkeylen;
106 int nid;
107 char obj_tmp[80]; 72 char obj_tmp[80];
108 73
109 if(p8->pkey->type == V_ASN1_OCTET_STRING) { 74 if (!PKCS8_pkey_get0(&algoid, NULL, NULL, NULL, p8))
110 p8->broken = PKCS8_OK; 75 return NULL;
111 p = p8->pkey->value.octet_string->data; 76
112 pkeylen = p8->pkey->value.octet_string->length;
113 } else {
114 p8->broken = PKCS8_NO_OCTET;
115 p = p8->pkey->value.sequence->data;
116 pkeylen = p8->pkey->value.sequence->length;
117 }
118 if (!(pkey = EVP_PKEY_new())) { 77 if (!(pkey = EVP_PKEY_new())) {
119 EVPerr(EVP_F_EVP_PKCS82PKEY,ERR_R_MALLOC_FAILURE); 78 EVPerr(EVP_F_EVP_PKCS82PKEY,ERR_R_MALLOC_FAILURE);
120 return NULL; 79 return NULL;
121 } 80 }
122 a = p8->pkeyalg;
123 nid = OBJ_obj2nid(a->algorithm);
124 switch(nid)
125 {
126#ifndef OPENSSL_NO_RSA
127 case NID_rsaEncryption:
128 cp = p;
129 if (!(rsa = d2i_RSAPrivateKey (NULL,&cp, pkeylen))) {
130 EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR);
131 return NULL;
132 }
133 EVP_PKEY_assign_RSA (pkey, rsa);
134 break;
135#endif
136#ifndef OPENSSL_NO_DSA
137 case NID_dsa:
138 /* PKCS#8 DSA is weird: you just get a private key integer
139 * and parameters in the AlgorithmIdentifier the pubkey must
140 * be recalculated.
141 */
142
143 /* Check for broken DSA PKCS#8, UGH! */
144 if(*p == (V_ASN1_SEQUENCE|V_ASN1_CONSTRUCTED)) {
145 if(!(ndsa = ASN1_seq_unpack_ASN1_TYPE(p, pkeylen,
146 d2i_ASN1_TYPE,
147 ASN1_TYPE_free))) {
148 EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR);
149 goto dsaerr;
150 }
151 if(sk_ASN1_TYPE_num(ndsa) != 2 ) {
152 EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR);
153 goto dsaerr;
154 }
155 /* Handle Two broken types:
156 * SEQUENCE {parameters, priv_key}
157 * SEQUENCE {pub_key, priv_key}
158 */
159
160 t1 = sk_ASN1_TYPE_value(ndsa, 0);
161 t2 = sk_ASN1_TYPE_value(ndsa, 1);
162 if(t1->type == V_ASN1_SEQUENCE) {
163 p8->broken = PKCS8_EMBEDDED_PARAM;
164 param = t1;
165 } else if(a->parameter->type == V_ASN1_SEQUENCE) {
166 p8->broken = PKCS8_NS_DB;
167 param = a->parameter;
168 } else {
169 EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR);
170 goto dsaerr;
171 }
172
173 if(t2->type != V_ASN1_INTEGER) {
174 EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR);
175 goto dsaerr;
176 }
177 privkey = t2->value.integer;
178 } else {
179 if (!(privkey=d2i_ASN1_INTEGER (NULL, &p, pkeylen))) {
180 EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR);
181 goto dsaerr;
182 }
183 param = p8->pkeyalg->parameter;
184 }
185 if (!param || (param->type != V_ASN1_SEQUENCE)) {
186 EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR);
187 goto dsaerr;
188 }
189 cp = p = param->value.sequence->data;
190 plen = param->value.sequence->length;
191 if (!(dsa = d2i_DSAparams (NULL, &cp, plen))) {
192 EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR);
193 goto dsaerr;
194 }
195 /* We have parameters now set private key */
196 if (!(dsa->priv_key = ASN1_INTEGER_to_BN(privkey, NULL))) {
197 EVPerr(EVP_F_EVP_PKCS82PKEY,EVP_R_BN_DECODE_ERROR);
198 goto dsaerr;
199 }
200 /* Calculate public key (ouch!) */
201 if (!(dsa->pub_key = BN_new())) {
202 EVPerr(EVP_F_EVP_PKCS82PKEY,ERR_R_MALLOC_FAILURE);
203 goto dsaerr;
204 }
205 if (!(ctx = BN_CTX_new())) {
206 EVPerr(EVP_F_EVP_PKCS82PKEY,ERR_R_MALLOC_FAILURE);
207 goto dsaerr;
208 }
209
210 if (!BN_mod_exp(dsa->pub_key, dsa->g,
211 dsa->priv_key, dsa->p, ctx)) {
212
213 EVPerr(EVP_F_EVP_PKCS82PKEY,EVP_R_BN_PUBKEY_ERROR);
214 goto dsaerr;
215 }
216 81
217 EVP_PKEY_assign_DSA(pkey, dsa); 82 if (!EVP_PKEY_set_type(pkey, OBJ_obj2nid(algoid)))
218 BN_CTX_free (ctx);
219 if(ndsa) sk_ASN1_TYPE_pop_free(ndsa, ASN1_TYPE_free);
220 else ASN1_INTEGER_free(privkey);
221 break;
222 dsaerr:
223 BN_CTX_free (ctx);
224 sk_ASN1_TYPE_pop_free(ndsa, ASN1_TYPE_free);
225 DSA_free(dsa);
226 EVP_PKEY_free(pkey);
227 return NULL;
228 break;
229#endif
230#ifndef OPENSSL_NO_EC
231 case NID_X9_62_id_ecPublicKey:
232 p_tmp = p;
233 /* extract the ec parameters */
234 param = p8->pkeyalg->parameter;
235
236 if (!param || ((param->type != V_ASN1_SEQUENCE) &&
237 (param->type != V_ASN1_OBJECT)))
238 { 83 {
239 EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR); 84 EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM);
240 goto ecerr; 85 i2t_ASN1_OBJECT(obj_tmp, 80, algoid);
86 ERR_add_error_data(2, "TYPE=", obj_tmp);
87 goto error;
241 } 88 }
242 89
243 if (param->type == V_ASN1_SEQUENCE) 90 if (pkey->ameth->priv_decode)
244 { 91 {
245 cp = p = param->value.sequence->data; 92 if (!pkey->ameth->priv_decode(pkey, p8))
246 plen = param->value.sequence->length;
247
248 if (!(eckey = d2i_ECParameters(NULL, &cp, plen)))
249 { 93 {
250 EVPerr(EVP_F_EVP_PKCS82PKEY, 94 EVPerr(EVP_F_EVP_PKCS82PKEY,
251 EVP_R_DECODE_ERROR); 95 EVP_R_PRIVATE_KEY_DECODE_ERROR);
252 goto ecerr; 96 goto error;
253 } 97 }
254 } 98 }
255 else 99 else
256 { 100 {
257 EC_GROUP *group; 101 EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_METHOD_NOT_SUPPORTED);
258 cp = p = param->value.object->data; 102 goto error;
259 plen = param->value.object->length;
260
261 /* type == V_ASN1_OBJECT => the parameters are given
262 * by an asn1 OID
263 */
264 if ((eckey = EC_KEY_new()) == NULL)
265 {
266 EVPerr(EVP_F_EVP_PKCS82PKEY,
267 ERR_R_MALLOC_FAILURE);
268 goto ecerr;
269 }
270 group = EC_GROUP_new_by_curve_name(OBJ_obj2nid(a->parameter->value.object));
271 if (group == NULL)
272 goto ecerr;
273 EC_GROUP_set_asn1_flag(group, OPENSSL_EC_NAMED_CURVE);
274 if (EC_KEY_set_group(eckey, group) == 0)
275 goto ecerr;
276 EC_GROUP_free(group);
277 }
278
279 /* We have parameters now set private key */
280 if (!d2i_ECPrivateKey(&eckey, &p_tmp, pkeylen))
281 {
282 EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR);
283 goto ecerr;
284 }
285
286 /* calculate public key (if necessary) */
287 if (EC_KEY_get0_public_key(eckey) == NULL)
288 {
289 const BIGNUM *priv_key;
290 const EC_GROUP *group;
291 EC_POINT *pub_key;
292 /* the public key was not included in the SEC1 private
293 * key => calculate the public key */
294 group = EC_KEY_get0_group(eckey);
295 pub_key = EC_POINT_new(group);
296 if (pub_key == NULL)
297 {
298 EVPerr(EVP_F_EVP_PKCS82PKEY, ERR_R_EC_LIB);
299 goto ecerr;
300 }
301 if (!EC_POINT_copy(pub_key, EC_GROUP_get0_generator(group)))
302 {
303 EC_POINT_free(pub_key);
304 EVPerr(EVP_F_EVP_PKCS82PKEY, ERR_R_EC_LIB);
305 goto ecerr;
306 }
307 priv_key = EC_KEY_get0_private_key(eckey);
308 if (!EC_POINT_mul(group, pub_key, priv_key, NULL, NULL, ctx))
309 {
310 EC_POINT_free(pub_key);
311 EVPerr(EVP_F_EVP_PKCS82PKEY, ERR_R_EC_LIB);
312 goto ecerr;
313 }
314 if (EC_KEY_set_public_key(eckey, pub_key) == 0)
315 {
316 EC_POINT_free(pub_key);
317 EVPerr(EVP_F_EVP_PKCS82PKEY, ERR_R_EC_LIB);
318 goto ecerr;
319 }
320 EC_POINT_free(pub_key);
321 } 103 }
322 104
323 EVP_PKEY_assign_EC_KEY(pkey, eckey);
324 if (ctx)
325 BN_CTX_free(ctx);
326 break;
327ecerr:
328 if (ctx)
329 BN_CTX_free(ctx);
330 if (eckey)
331 EC_KEY_free(eckey);
332 if (pkey)
333 EVP_PKEY_free(pkey);
334 return NULL;
335#endif
336 default:
337 EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM);
338 if (!a->algorithm) BUF_strlcpy (obj_tmp, "NULL", sizeof obj_tmp);
339 else i2t_ASN1_OBJECT(obj_tmp, 80, a->algorithm);
340 ERR_add_error_data(2, "TYPE=", obj_tmp);
341 EVP_PKEY_free (pkey);
342 return NULL;
343 }
344 return pkey; 105 return pkey;
106
107 error:
108 EVP_PKEY_free (pkey);
109 return NULL;
345} 110}
346 111
347PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(EVP_PKEY *pkey) 112PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(EVP_PKEY *pkey)
@@ -360,59 +125,37 @@ PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8_broken(EVP_PKEY *pkey, int broken)
360 return NULL; 125 return NULL;
361 } 126 }
362 p8->broken = broken; 127 p8->broken = broken;
363 if (!ASN1_INTEGER_set(p8->version, 0)) {
364 EVPerr(EVP_F_EVP_PKEY2PKCS8_BROKEN,ERR_R_MALLOC_FAILURE);
365 PKCS8_PRIV_KEY_INFO_free (p8);
366 return NULL;
367 }
368 if (!(p8->pkeyalg->parameter = ASN1_TYPE_new ())) {
369 EVPerr(EVP_F_EVP_PKEY2PKCS8_BROKEN,ERR_R_MALLOC_FAILURE);
370 PKCS8_PRIV_KEY_INFO_free (p8);
371 return NULL;
372 }
373 p8->pkey->type = V_ASN1_OCTET_STRING;
374 switch (EVP_PKEY_type(pkey->type)) {
375#ifndef OPENSSL_NO_RSA
376 case EVP_PKEY_RSA:
377 128
378 if(p8->broken == PKCS8_NO_OCTET) p8->pkey->type = V_ASN1_SEQUENCE; 129 if (pkey->ameth)
379 130 {
380 p8->pkeyalg->algorithm = OBJ_nid2obj(NID_rsaEncryption); 131 if (pkey->ameth->priv_encode)
381 p8->pkeyalg->parameter->type = V_ASN1_NULL; 132 {
382 if (!ASN1_pack_string_of (EVP_PKEY,pkey, i2d_PrivateKey, 133 if (!pkey->ameth->priv_encode(p8, pkey))
383 &p8->pkey->value.octet_string)) { 134 {
384 EVPerr(EVP_F_EVP_PKEY2PKCS8_BROKEN,ERR_R_MALLOC_FAILURE); 135 EVPerr(EVP_F_EVP_PKEY2PKCS8_BROKEN,
385 PKCS8_PRIV_KEY_INFO_free (p8); 136 EVP_R_PRIVATE_KEY_ENCODE_ERROR);
386 return NULL; 137 goto error;
387 } 138 }
388 break; 139 }
389#endif 140 else
390#ifndef OPENSSL_NO_DSA 141 {
391 case EVP_PKEY_DSA: 142 EVPerr(EVP_F_EVP_PKEY2PKCS8_BROKEN,
392 if(!dsa_pkey2pkcs8(p8, pkey)) { 143 EVP_R_METHOD_NOT_SUPPORTED);
393 PKCS8_PRIV_KEY_INFO_free (p8); 144 goto error;
394 return NULL; 145 }
395 } 146 }
396 147 else
397 break;
398#endif
399#ifndef OPENSSL_NO_EC
400 case EVP_PKEY_EC:
401 if (!eckey_pkey2pkcs8(p8, pkey))
402 { 148 {
403 PKCS8_PRIV_KEY_INFO_free(p8); 149 EVPerr(EVP_F_EVP_PKEY2PKCS8_BROKEN,
404 return(NULL); 150 EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM);
151 goto error;
405 } 152 }
406 break;
407#endif
408 default:
409 EVPerr(EVP_F_EVP_PKEY2PKCS8_BROKEN, EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM);
410 PKCS8_PRIV_KEY_INFO_free (p8);
411 return NULL;
412 }
413 RAND_add(p8->pkey->value.octet_string->data, 153 RAND_add(p8->pkey->value.octet_string->data,
414 p8->pkey->value.octet_string->length, 0.0); 154 p8->pkey->value.octet_string->length, 0.0);
415 return p8; 155 return p8;
156 error:
157 PKCS8_PRIV_KEY_INFO_free(p8);
158 return NULL;
416} 159}
417 160
418PKCS8_PRIV_KEY_INFO *PKCS8_set_broken(PKCS8_PRIV_KEY_INFO *p8, int broken) 161PKCS8_PRIV_KEY_INFO *PKCS8_set_broken(PKCS8_PRIV_KEY_INFO *p8, int broken)
@@ -436,301 +179,6 @@ PKCS8_PRIV_KEY_INFO *PKCS8_set_broken(PKCS8_PRIV_KEY_INFO *p8, int broken)
436 } 179 }
437} 180}
438 181
439#ifndef OPENSSL_NO_DSA
440static int dsa_pkey2pkcs8(PKCS8_PRIV_KEY_INFO *p8, EVP_PKEY *pkey)
441{
442 ASN1_STRING *params = NULL;
443 ASN1_INTEGER *prkey = NULL;
444 ASN1_TYPE *ttmp = NULL;
445 STACK_OF(ASN1_TYPE) *ndsa = NULL;
446 unsigned char *p = NULL, *q;
447 int len;
448
449 p8->pkeyalg->algorithm = OBJ_nid2obj(NID_dsa);
450 len = i2d_DSAparams (pkey->pkey.dsa, NULL);
451 if (!(p = OPENSSL_malloc(len))) {
452 EVPerr(EVP_F_DSA_PKEY2PKCS8,ERR_R_MALLOC_FAILURE);
453 goto err;
454 }
455 q = p;
456 i2d_DSAparams (pkey->pkey.dsa, &q);
457 if (!(params = ASN1_STRING_new())) {
458 EVPerr(EVP_F_DSA_PKEY2PKCS8,ERR_R_MALLOC_FAILURE);
459 goto err;
460 }
461 if (!ASN1_STRING_set(params, p, len)) {
462 EVPerr(EVP_F_DSA_PKEY2PKCS8,ERR_R_MALLOC_FAILURE);
463 goto err;
464 }
465 OPENSSL_free(p);
466 p = NULL;
467 /* Get private key into integer */
468 if (!(prkey = BN_to_ASN1_INTEGER (pkey->pkey.dsa->priv_key, NULL))) {
469 EVPerr(EVP_F_DSA_PKEY2PKCS8,EVP_R_ENCODE_ERROR);
470 goto err;
471 }
472
473 switch(p8->broken) {
474
475 case PKCS8_OK:
476 case PKCS8_NO_OCTET:
477
478 if (!ASN1_pack_string_of(ASN1_INTEGER,prkey, i2d_ASN1_INTEGER,
479 &p8->pkey->value.octet_string)) {
480 EVPerr(EVP_F_DSA_PKEY2PKCS8,ERR_R_MALLOC_FAILURE);
481 goto err;
482 }
483
484 M_ASN1_INTEGER_free (prkey);
485 prkey = NULL;
486 p8->pkeyalg->parameter->value.sequence = params;
487 params = NULL;
488 p8->pkeyalg->parameter->type = V_ASN1_SEQUENCE;
489
490 break;
491
492 case PKCS8_NS_DB:
493
494 p8->pkeyalg->parameter->value.sequence = params;
495 params = NULL;
496 p8->pkeyalg->parameter->type = V_ASN1_SEQUENCE;
497 if (!(ndsa = sk_ASN1_TYPE_new_null())) {
498 EVPerr(EVP_F_DSA_PKEY2PKCS8,ERR_R_MALLOC_FAILURE);
499 goto err;
500 }
501 if (!(ttmp = ASN1_TYPE_new())) {
502 EVPerr(EVP_F_DSA_PKEY2PKCS8,ERR_R_MALLOC_FAILURE);
503 goto err;
504 }
505 if (!(ttmp->value.integer =
506 BN_to_ASN1_INTEGER(pkey->pkey.dsa->pub_key, NULL))) {
507 EVPerr(EVP_F_DSA_PKEY2PKCS8,EVP_R_ENCODE_ERROR);
508 goto err;
509 }
510 ttmp->type = V_ASN1_INTEGER;
511 if (!sk_ASN1_TYPE_push(ndsa, ttmp)) {
512 EVPerr(EVP_F_DSA_PKEY2PKCS8,ERR_R_MALLOC_FAILURE);
513 goto err;
514 }
515
516 if (!(ttmp = ASN1_TYPE_new())) {
517 EVPerr(EVP_F_DSA_PKEY2PKCS8,ERR_R_MALLOC_FAILURE);
518 goto err;
519 }
520 ttmp->value.integer = prkey;
521 prkey = NULL;
522 ttmp->type = V_ASN1_INTEGER;
523 if (!sk_ASN1_TYPE_push(ndsa, ttmp)) {
524 EVPerr(EVP_F_DSA_PKEY2PKCS8,ERR_R_MALLOC_FAILURE);
525 goto err;
526 }
527 ttmp = NULL;
528
529 if (!(p8->pkey->value.octet_string = ASN1_OCTET_STRING_new())) {
530 EVPerr(EVP_F_DSA_PKEY2PKCS8,ERR_R_MALLOC_FAILURE);
531 goto err;
532 }
533
534 if (!ASN1_seq_pack_ASN1_TYPE(ndsa, i2d_ASN1_TYPE,
535 &p8->pkey->value.octet_string->data,
536 &p8->pkey->value.octet_string->length)) {
537
538 EVPerr(EVP_F_DSA_PKEY2PKCS8,ERR_R_MALLOC_FAILURE);
539 goto err;
540 }
541 sk_ASN1_TYPE_pop_free(ndsa, ASN1_TYPE_free);
542 break;
543
544 case PKCS8_EMBEDDED_PARAM:
545
546 p8->pkeyalg->parameter->type = V_ASN1_NULL;
547 if (!(ndsa = sk_ASN1_TYPE_new_null())) {
548 EVPerr(EVP_F_DSA_PKEY2PKCS8,ERR_R_MALLOC_FAILURE);
549 goto err;
550 }
551 if (!(ttmp = ASN1_TYPE_new())) {
552 EVPerr(EVP_F_DSA_PKEY2PKCS8,ERR_R_MALLOC_FAILURE);
553 goto err;
554 }
555 ttmp->value.sequence = params;
556 params = NULL;
557 ttmp->type = V_ASN1_SEQUENCE;
558 if (!sk_ASN1_TYPE_push(ndsa, ttmp)) {
559 EVPerr(EVP_F_DSA_PKEY2PKCS8,ERR_R_MALLOC_FAILURE);
560 goto err;
561 }
562
563 if (!(ttmp = ASN1_TYPE_new())) {
564 EVPerr(EVP_F_DSA_PKEY2PKCS8,ERR_R_MALLOC_FAILURE);
565 goto err;
566 }
567 ttmp->value.integer = prkey;
568 prkey = NULL;
569 ttmp->type = V_ASN1_INTEGER;
570 if (!sk_ASN1_TYPE_push(ndsa, ttmp)) {
571 EVPerr(EVP_F_DSA_PKEY2PKCS8,ERR_R_MALLOC_FAILURE);
572 goto err;
573 }
574 ttmp = NULL;
575
576 if (!(p8->pkey->value.octet_string = ASN1_OCTET_STRING_new())) {
577 EVPerr(EVP_F_DSA_PKEY2PKCS8,ERR_R_MALLOC_FAILURE);
578 goto err;
579 }
580
581 if (!ASN1_seq_pack_ASN1_TYPE(ndsa, i2d_ASN1_TYPE,
582 &p8->pkey->value.octet_string->data,
583 &p8->pkey->value.octet_string->length)) {
584
585 EVPerr(EVP_F_DSA_PKEY2PKCS8,ERR_R_MALLOC_FAILURE);
586 goto err;
587 }
588 sk_ASN1_TYPE_pop_free(ndsa, ASN1_TYPE_free);
589 break;
590 }
591 return 1;
592err:
593 if (p != NULL) OPENSSL_free(p);
594 if (params != NULL) ASN1_STRING_free(params);
595 if (prkey != NULL) M_ASN1_INTEGER_free(prkey);
596 if (ttmp != NULL) ASN1_TYPE_free(ttmp);
597 if (ndsa != NULL) sk_ASN1_TYPE_pop_free(ndsa, ASN1_TYPE_free);
598 return 0;
599}
600#endif
601
602#ifndef OPENSSL_NO_EC
603static int eckey_pkey2pkcs8(PKCS8_PRIV_KEY_INFO *p8, EVP_PKEY *pkey)
604{
605 EC_KEY *ec_key;
606 const EC_GROUP *group;
607 unsigned char *p, *pp;
608 int nid, i, ret = 0;
609 unsigned int tmp_flags, old_flags;
610
611 ec_key = pkey->pkey.ec;
612 if (ec_key == NULL || (group = EC_KEY_get0_group(ec_key)) == NULL)
613 {
614 EVPerr(EVP_F_ECKEY_PKEY2PKCS8, EVP_R_MISSING_PARAMETERS);
615 return 0;
616 }
617
618 /* set the ec parameters OID */
619 if (p8->pkeyalg->algorithm)
620 ASN1_OBJECT_free(p8->pkeyalg->algorithm);
621
622 p8->pkeyalg->algorithm = OBJ_nid2obj(NID_X9_62_id_ecPublicKey);
623
624 /* set the ec parameters */
625
626 if (p8->pkeyalg->parameter)
627 {
628 ASN1_TYPE_free(p8->pkeyalg->parameter);
629 p8->pkeyalg->parameter = NULL;
630 }
631
632 if ((p8->pkeyalg->parameter = ASN1_TYPE_new()) == NULL)
633 {
634 EVPerr(EVP_F_ECKEY_PKEY2PKCS8, ERR_R_MALLOC_FAILURE);
635 return 0;
636 }
637
638 if (EC_GROUP_get_asn1_flag(group)
639 && (nid = EC_GROUP_get_curve_name(group)))
640 {
641 /* we have a 'named curve' => just set the OID */
642 p8->pkeyalg->parameter->type = V_ASN1_OBJECT;
643 p8->pkeyalg->parameter->value.object = OBJ_nid2obj(nid);
644 }
645 else /* explicit parameters */
646 {
647 if ((i = i2d_ECParameters(ec_key, NULL)) == 0)
648 {
649 EVPerr(EVP_F_ECKEY_PKEY2PKCS8, ERR_R_EC_LIB);
650 return 0;
651 }
652 if ((p = (unsigned char *) OPENSSL_malloc(i)) == NULL)
653 {
654 EVPerr(EVP_F_ECKEY_PKEY2PKCS8, ERR_R_MALLOC_FAILURE);
655 return 0;
656 }
657 pp = p;
658 if (!i2d_ECParameters(ec_key, &pp))
659 {
660 EVPerr(EVP_F_ECKEY_PKEY2PKCS8, ERR_R_EC_LIB);
661 OPENSSL_free(p);
662 return 0;
663 }
664 p8->pkeyalg->parameter->type = V_ASN1_SEQUENCE;
665 if ((p8->pkeyalg->parameter->value.sequence
666 = ASN1_STRING_new()) == NULL)
667 {
668 EVPerr(EVP_F_ECKEY_PKEY2PKCS8, ERR_R_ASN1_LIB);
669 OPENSSL_free(p);
670 return 0;
671 }
672 ASN1_STRING_set(p8->pkeyalg->parameter->value.sequence, p, i);
673 OPENSSL_free(p);
674 }
675
676 /* set the private key */
677
678 /* do not include the parameters in the SEC1 private key
679 * see PKCS#11 12.11 */
680 old_flags = EC_KEY_get_enc_flags(pkey->pkey.ec);
681 tmp_flags = old_flags | EC_PKEY_NO_PARAMETERS;
682 EC_KEY_set_enc_flags(pkey->pkey.ec, tmp_flags);
683 i = i2d_ECPrivateKey(pkey->pkey.ec, NULL);
684 if (!i)
685 {
686 EC_KEY_set_enc_flags(pkey->pkey.ec, old_flags);
687 EVPerr(EVP_F_ECKEY_PKEY2PKCS8, ERR_R_EC_LIB);
688 return 0;
689 }
690 p = (unsigned char *) OPENSSL_malloc(i);
691 if (!p)
692 {
693 EC_KEY_set_enc_flags(pkey->pkey.ec, old_flags);
694 EVPerr(EVP_F_ECKEY_PKEY2PKCS8, ERR_R_MALLOC_FAILURE);
695 return 0;
696 }
697 pp = p;
698 if (!i2d_ECPrivateKey(pkey->pkey.ec, &pp))
699 {
700 EC_KEY_set_enc_flags(pkey->pkey.ec, old_flags);
701 EVPerr(EVP_F_ECKEY_PKEY2PKCS8, ERR_R_EC_LIB);
702 OPENSSL_free(p);
703 return 0;
704 }
705 /* restore old encoding flags */
706 EC_KEY_set_enc_flags(pkey->pkey.ec, old_flags);
707
708 switch(p8->broken) {
709
710 case PKCS8_OK:
711 p8->pkey->value.octet_string = ASN1_OCTET_STRING_new();
712 if (!p8->pkey->value.octet_string ||
713 !M_ASN1_OCTET_STRING_set(p8->pkey->value.octet_string,
714 (const void *)p, i))
715
716 {
717 EVPerr(EVP_F_ECKEY_PKEY2PKCS8, ERR_R_MALLOC_FAILURE);
718 }
719 else
720 ret = 1;
721 break;
722 case PKCS8_NO_OCTET: /* RSA specific */
723 case PKCS8_NS_DB: /* DSA specific */
724 case PKCS8_EMBEDDED_PARAM: /* DSA specific */
725 default:
726 EVPerr(EVP_F_ECKEY_PKEY2PKCS8,EVP_R_ENCODE_ERROR);
727 }
728 OPENSSL_cleanse(p, (size_t)i);
729 OPENSSL_free(p);
730 return ret;
731}
732#endif
733
734/* EVP_PKEY attribute functions */ 182/* EVP_PKEY attribute functions */
735 183
736int EVP_PKEY_get_attr_count(const EVP_PKEY *key) 184int EVP_PKEY_get_attr_count(const EVP_PKEY *key)
diff --git a/src/lib/libcrypto/evp/evp_test.c b/src/lib/libcrypto/evp/evp_test.c
index 436be20bf1..902efac975 100644
--- a/src/lib/libcrypto/evp/evp_test.c
+++ b/src/lib/libcrypto/evp/evp_test.c
@@ -153,8 +153,8 @@ static void test1(const EVP_CIPHER *c,const unsigned char *key,int kn,
153 153
154 if(kn != c->key_len) 154 if(kn != c->key_len)
155 { 155 {
156 fprintf(stderr,"Key length doesn't match, got %d expected %d\n",kn, 156 fprintf(stderr,"Key length doesn't match, got %d expected %lu\n",kn,
157 c->key_len); 157 (unsigned long)c->key_len);
158 test1_exit(5); 158 test1_exit(5);
159 } 159 }
160 EVP_CIPHER_CTX_init(&ctx); 160 EVP_CIPHER_CTX_init(&ctx);
@@ -441,7 +441,7 @@ int main(int argc,char **argv)
441#endif 441#endif
442 EVP_cleanup(); 442 EVP_cleanup();
443 CRYPTO_cleanup_all_ex_data(); 443 CRYPTO_cleanup_all_ex_data();
444 ERR_remove_state(0); 444 ERR_remove_thread_state(NULL);
445 ERR_free_strings(); 445 ERR_free_strings();
446 CRYPTO_mem_leaks_fp(stderr); 446 CRYPTO_mem_leaks_fp(stderr);
447 447
diff --git a/src/lib/libcrypto/evp/m_dss.c b/src/lib/libcrypto/evp/m_dss.c
index 6b0c0aa7a3..48c2689504 100644
--- a/src/lib/libcrypto/evp/m_dss.c
+++ b/src/lib/libcrypto/evp/m_dss.c
@@ -81,7 +81,7 @@ static const EVP_MD dsa_md=
81 NID_dsaWithSHA, 81 NID_dsaWithSHA,
82 NID_dsaWithSHA, 82 NID_dsaWithSHA,
83 SHA_DIGEST_LENGTH, 83 SHA_DIGEST_LENGTH,
84 EVP_MD_FLAG_FIPS, 84 EVP_MD_FLAG_PKEY_DIGEST,
85 init, 85 init,
86 update, 86 update,
87 final, 87 final,
diff --git a/src/lib/libcrypto/evp/m_dss1.c b/src/lib/libcrypto/evp/m_dss1.c
index da8babc147..4f03fb70e0 100644
--- a/src/lib/libcrypto/evp/m_dss1.c
+++ b/src/lib/libcrypto/evp/m_dss1.c
@@ -68,8 +68,6 @@
68#include <openssl/dsa.h> 68#include <openssl/dsa.h>
69#endif 69#endif
70 70
71#ifndef OPENSSL_FIPS
72
73static int init(EVP_MD_CTX *ctx) 71static int init(EVP_MD_CTX *ctx)
74 { return SHA1_Init(ctx->md_data); } 72 { return SHA1_Init(ctx->md_data); }
75 73
@@ -84,7 +82,7 @@ static const EVP_MD dss1_md=
84 NID_dsa, 82 NID_dsa,
85 NID_dsaWithSHA1, 83 NID_dsaWithSHA1,
86 SHA_DIGEST_LENGTH, 84 SHA_DIGEST_LENGTH,
87 0, 85 EVP_MD_FLAG_PKEY_DIGEST,
88 init, 86 init,
89 update, 87 update,
90 final, 88 final,
@@ -100,4 +98,3 @@ const EVP_MD *EVP_dss1(void)
100 return(&dss1_md); 98 return(&dss1_md);
101 } 99 }
102#endif 100#endif
103#endif
diff --git a/src/lib/libcrypto/evp/m_md2.c b/src/lib/libcrypto/evp/m_md2.c
index 8eee6236ba..5ce849f161 100644
--- a/src/lib/libcrypto/evp/m_md2.c
+++ b/src/lib/libcrypto/evp/m_md2.c
@@ -58,7 +58,6 @@
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60#include "cryptlib.h"
61#include "evp_locl.h"
62 61
63#ifndef OPENSSL_NO_MD2 62#ifndef OPENSSL_NO_MD2
64 63
diff --git a/src/lib/libcrypto/evp/m_md4.c b/src/lib/libcrypto/evp/m_md4.c
index 5cd2ab5ade..1e0b7c5b42 100644
--- a/src/lib/libcrypto/evp/m_md4.c
+++ b/src/lib/libcrypto/evp/m_md4.c
@@ -58,7 +58,6 @@
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60#include "cryptlib.h"
61#include "evp_locl.h"
62 61
63#ifndef OPENSSL_NO_MD4 62#ifndef OPENSSL_NO_MD4
64 63
diff --git a/src/lib/libcrypto/evp/m_md5.c b/src/lib/libcrypto/evp/m_md5.c
index 6455829671..63c142119e 100644
--- a/src/lib/libcrypto/evp/m_md5.c
+++ b/src/lib/libcrypto/evp/m_md5.c
@@ -62,7 +62,6 @@
62#ifndef OPENSSL_NO_MD5 62#ifndef OPENSSL_NO_MD5
63 63
64#include <openssl/evp.h> 64#include <openssl/evp.h>
65#include "evp_locl.h"
66#include <openssl/objects.h> 65#include <openssl/objects.h>
67#include <openssl/x509.h> 66#include <openssl/x509.h>
68#include <openssl/md5.h> 67#include <openssl/md5.h>
diff --git a/src/lib/libcrypto/evp/m_mdc2.c b/src/lib/libcrypto/evp/m_mdc2.c
index 9f9bcf06ed..b08d559803 100644
--- a/src/lib/libcrypto/evp/m_mdc2.c
+++ b/src/lib/libcrypto/evp/m_mdc2.c
@@ -58,7 +58,6 @@
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60#include "cryptlib.h"
61#include "evp_locl.h"
62 61
63#ifndef OPENSSL_NO_MDC2 62#ifndef OPENSSL_NO_MDC2
64 63
@@ -66,7 +65,9 @@
66#include <openssl/objects.h> 65#include <openssl/objects.h>
67#include <openssl/x509.h> 66#include <openssl/x509.h>
68#include <openssl/mdc2.h> 67#include <openssl/mdc2.h>
68#ifndef OPENSSL_NO_RSA
69#include <openssl/rsa.h> 69#include <openssl/rsa.h>
70#endif
70 71
71static int init(EVP_MD_CTX *ctx) 72static int init(EVP_MD_CTX *ctx)
72 { return MDC2_Init(ctx->md_data); } 73 { return MDC2_Init(ctx->md_data); }
diff --git a/src/lib/libcrypto/evp/m_sha.c b/src/lib/libcrypto/evp/m_sha.c
index 3f30dfc579..acccc8f92d 100644
--- a/src/lib/libcrypto/evp/m_sha.c
+++ b/src/lib/libcrypto/evp/m_sha.c
@@ -58,7 +58,6 @@
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60#include "cryptlib.h"
61#include "evp_locl.h"
62 61
63#if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA0) 62#if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA0)
64 63
diff --git a/src/lib/libcrypto/evp/m_sha1.c b/src/lib/libcrypto/evp/m_sha1.c
index 471ec30be0..9a2790fdea 100644
--- a/src/lib/libcrypto/evp/m_sha1.c
+++ b/src/lib/libcrypto/evp/m_sha1.c
@@ -68,8 +68,6 @@
68#include <openssl/rsa.h> 68#include <openssl/rsa.h>
69#endif 69#endif
70 70
71#ifndef OPENSSL_FIPS
72
73static int init(EVP_MD_CTX *ctx) 71static int init(EVP_MD_CTX *ctx)
74 { return SHA1_Init(ctx->md_data); } 72 { return SHA1_Init(ctx->md_data); }
75 73
@@ -84,7 +82,7 @@ static const EVP_MD sha1_md=
84 NID_sha1, 82 NID_sha1,
85 NID_sha1WithRSAEncryption, 83 NID_sha1WithRSAEncryption,
86 SHA_DIGEST_LENGTH, 84 SHA_DIGEST_LENGTH,
87 0, 85 EVP_MD_FLAG_PKEY_METHOD_SIGNATURE|EVP_MD_FLAG_DIGALGID_ABSENT,
88 init, 86 init,
89 update, 87 update,
90 final, 88 final,
@@ -99,6 +97,7 @@ const EVP_MD *EVP_sha1(void)
99 { 97 {
100 return(&sha1_md); 98 return(&sha1_md);
101 } 99 }
100#endif
102 101
103#ifndef OPENSSL_NO_SHA256 102#ifndef OPENSSL_NO_SHA256
104static int init224(EVP_MD_CTX *ctx) 103static int init224(EVP_MD_CTX *ctx)
@@ -120,7 +119,7 @@ static const EVP_MD sha224_md=
120 NID_sha224, 119 NID_sha224,
121 NID_sha224WithRSAEncryption, 120 NID_sha224WithRSAEncryption,
122 SHA224_DIGEST_LENGTH, 121 SHA224_DIGEST_LENGTH,
123 0, 122 EVP_MD_FLAG_PKEY_METHOD_SIGNATURE|EVP_MD_FLAG_DIGALGID_ABSENT,
124 init224, 123 init224,
125 update256, 124 update256,
126 final256, 125 final256,
@@ -139,7 +138,7 @@ static const EVP_MD sha256_md=
139 NID_sha256, 138 NID_sha256,
140 NID_sha256WithRSAEncryption, 139 NID_sha256WithRSAEncryption,
141 SHA256_DIGEST_LENGTH, 140 SHA256_DIGEST_LENGTH,
142 0, 141 EVP_MD_FLAG_PKEY_METHOD_SIGNATURE|EVP_MD_FLAG_DIGALGID_ABSENT,
143 init256, 142 init256,
144 update256, 143 update256,
145 final256, 144 final256,
@@ -170,7 +169,7 @@ static const EVP_MD sha384_md=
170 NID_sha384, 169 NID_sha384,
171 NID_sha384WithRSAEncryption, 170 NID_sha384WithRSAEncryption,
172 SHA384_DIGEST_LENGTH, 171 SHA384_DIGEST_LENGTH,
173 0, 172 EVP_MD_FLAG_PKEY_METHOD_SIGNATURE|EVP_MD_FLAG_DIGALGID_ABSENT,
174 init384, 173 init384,
175 update512, 174 update512,
176 final512, 175 final512,
@@ -189,7 +188,7 @@ static const EVP_MD sha512_md=
189 NID_sha512, 188 NID_sha512,
190 NID_sha512WithRSAEncryption, 189 NID_sha512WithRSAEncryption,
191 SHA512_DIGEST_LENGTH, 190 SHA512_DIGEST_LENGTH,
192 0, 191 EVP_MD_FLAG_PKEY_METHOD_SIGNATURE|EVP_MD_FLAG_DIGALGID_ABSENT,
193 init512, 192 init512,
194 update512, 193 update512,
195 final512, 194 final512,
@@ -203,7 +202,3 @@ static const EVP_MD sha512_md=
203const EVP_MD *EVP_sha512(void) 202const EVP_MD *EVP_sha512(void)
204 { return(&sha512_md); } 203 { return(&sha512_md); }
205#endif /* ifndef OPENSSL_NO_SHA512 */ 204#endif /* ifndef OPENSSL_NO_SHA512 */
206
207#endif
208
209#endif
diff --git a/src/lib/libcrypto/evp/names.c b/src/lib/libcrypto/evp/names.c
index e2e04c3570..f2869f5c78 100644
--- a/src/lib/libcrypto/evp/names.c
+++ b/src/lib/libcrypto/evp/names.c
@@ -66,35 +66,32 @@ int EVP_add_cipher(const EVP_CIPHER *c)
66 { 66 {
67 int r; 67 int r;
68 68
69#ifdef OPENSSL_FIPS
70 OPENSSL_init();
71#endif
72
73 r=OBJ_NAME_add(OBJ_nid2sn(c->nid),OBJ_NAME_TYPE_CIPHER_METH,(const char *)c); 69 r=OBJ_NAME_add(OBJ_nid2sn(c->nid),OBJ_NAME_TYPE_CIPHER_METH,(const char *)c);
74 if (r == 0) return(0); 70 if (r == 0) return(0);
71 check_defer(c->nid);
75 r=OBJ_NAME_add(OBJ_nid2ln(c->nid),OBJ_NAME_TYPE_CIPHER_METH,(const char *)c); 72 r=OBJ_NAME_add(OBJ_nid2ln(c->nid),OBJ_NAME_TYPE_CIPHER_METH,(const char *)c);
76 return(r); 73 return(r);
77 } 74 }
78 75
76
79int EVP_add_digest(const EVP_MD *md) 77int EVP_add_digest(const EVP_MD *md)
80 { 78 {
81 int r; 79 int r;
82 const char *name; 80 const char *name;
83 81
84#ifdef OPENSSL_FIPS
85 OPENSSL_init();
86#endif
87 name=OBJ_nid2sn(md->type); 82 name=OBJ_nid2sn(md->type);
88 r=OBJ_NAME_add(name,OBJ_NAME_TYPE_MD_METH,(const char *)md); 83 r=OBJ_NAME_add(name,OBJ_NAME_TYPE_MD_METH,(const char *)md);
89 if (r == 0) return(0); 84 if (r == 0) return(0);
85 check_defer(md->type);
90 r=OBJ_NAME_add(OBJ_nid2ln(md->type),OBJ_NAME_TYPE_MD_METH,(const char *)md); 86 r=OBJ_NAME_add(OBJ_nid2ln(md->type),OBJ_NAME_TYPE_MD_METH,(const char *)md);
91 if (r == 0) return(0); 87 if (r == 0) return(0);
92 88
93 if (md->type != md->pkey_type) 89 if (md->pkey_type && md->type != md->pkey_type)
94 { 90 {
95 r=OBJ_NAME_add(OBJ_nid2sn(md->pkey_type), 91 r=OBJ_NAME_add(OBJ_nid2sn(md->pkey_type),
96 OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS,name); 92 OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS,name);
97 if (r == 0) return(0); 93 if (r == 0) return(0);
94 check_defer(md->pkey_type);
98 r=OBJ_NAME_add(OBJ_nid2ln(md->pkey_type), 95 r=OBJ_NAME_add(OBJ_nid2ln(md->pkey_type),
99 OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS,name); 96 OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS,name);
100 } 97 }
@@ -127,4 +124,78 @@ void EVP_cleanup(void)
127 OBJ_NAME_cleanup(-1); 124 OBJ_NAME_cleanup(-1);
128 125
129 EVP_PBE_cleanup(); 126 EVP_PBE_cleanup();
127 if (obj_cleanup_defer == 2)
128 {
129 obj_cleanup_defer = 0;
130 OBJ_cleanup();
131 }
132 OBJ_sigid_free();
133 }
134
135struct doall_cipher
136 {
137 void *arg;
138 void (*fn)(const EVP_CIPHER *ciph,
139 const char *from, const char *to, void *arg);
140 };
141
142static void do_all_cipher_fn(const OBJ_NAME *nm, void *arg)
143 {
144 struct doall_cipher *dc = arg;
145 if (nm->alias)
146 dc->fn(NULL, nm->name, nm->data, dc->arg);
147 else
148 dc->fn((const EVP_CIPHER *)nm->data, nm->name, NULL, dc->arg);
149 }
150
151void EVP_CIPHER_do_all(void (*fn)(const EVP_CIPHER *ciph,
152 const char *from, const char *to, void *x), void *arg)
153 {
154 struct doall_cipher dc;
155 dc.fn = fn;
156 dc.arg = arg;
157 OBJ_NAME_do_all(OBJ_NAME_TYPE_CIPHER_METH, do_all_cipher_fn, &dc);
158 }
159
160void EVP_CIPHER_do_all_sorted(void (*fn)(const EVP_CIPHER *ciph,
161 const char *from, const char *to, void *x), void *arg)
162 {
163 struct doall_cipher dc;
164 dc.fn = fn;
165 dc.arg = arg;
166 OBJ_NAME_do_all_sorted(OBJ_NAME_TYPE_CIPHER_METH, do_all_cipher_fn,&dc);
167 }
168
169struct doall_md
170 {
171 void *arg;
172 void (*fn)(const EVP_MD *ciph,
173 const char *from, const char *to, void *arg);
174 };
175
176static void do_all_md_fn(const OBJ_NAME *nm, void *arg)
177 {
178 struct doall_md *dc = arg;
179 if (nm->alias)
180 dc->fn(NULL, nm->name, nm->data, dc->arg);
181 else
182 dc->fn((const EVP_MD *)nm->data, nm->name, NULL, dc->arg);
183 }
184
185void EVP_MD_do_all(void (*fn)(const EVP_MD *md,
186 const char *from, const char *to, void *x), void *arg)
187 {
188 struct doall_md dc;
189 dc.fn = fn;
190 dc.arg = arg;
191 OBJ_NAME_do_all(OBJ_NAME_TYPE_MD_METH, do_all_md_fn, &dc);
192 }
193
194void EVP_MD_do_all_sorted(void (*fn)(const EVP_MD *md,
195 const char *from, const char *to, void *x), void *arg)
196 {
197 struct doall_md dc;
198 dc.fn = fn;
199 dc.arg = arg;
200 OBJ_NAME_do_all_sorted(OBJ_NAME_TYPE_MD_METH, do_all_md_fn, &dc);
130 } 201 }
diff --git a/src/lib/libcrypto/evp/p5_crpt.c b/src/lib/libcrypto/evp/p5_crpt.c
index 2a265fdee2..7ecfa8dad9 100644
--- a/src/lib/libcrypto/evp/p5_crpt.c
+++ b/src/lib/libcrypto/evp/p5_crpt.c
@@ -62,42 +62,11 @@
62#include <openssl/x509.h> 62#include <openssl/x509.h>
63#include <openssl/evp.h> 63#include <openssl/evp.h>
64 64
65/* PKCS#5 v1.5 compatible PBE functions: see PKCS#5 v2.0 for more info. 65/* Doesn't do anything now: Builtin PBE algorithms in static table.
66 */ 66 */
67 67
68void PKCS5_PBE_add(void) 68void PKCS5_PBE_add(void)
69{ 69{
70#ifndef OPENSSL_NO_DES
71# ifndef OPENSSL_NO_MD5
72EVP_PBE_alg_add(NID_pbeWithMD5AndDES_CBC, EVP_des_cbc(), EVP_md5(),
73 PKCS5_PBE_keyivgen);
74# endif
75# ifndef OPENSSL_NO_MD2
76EVP_PBE_alg_add(NID_pbeWithMD2AndDES_CBC, EVP_des_cbc(), EVP_md2(),
77 PKCS5_PBE_keyivgen);
78# endif
79# ifndef OPENSSL_NO_SHA
80EVP_PBE_alg_add(NID_pbeWithSHA1AndDES_CBC, EVP_des_cbc(), EVP_sha1(),
81 PKCS5_PBE_keyivgen);
82# endif
83#endif
84#ifndef OPENSSL_NO_RC2
85# ifndef OPENSSL_NO_MD5
86EVP_PBE_alg_add(NID_pbeWithMD5AndRC2_CBC, EVP_rc2_64_cbc(), EVP_md5(),
87 PKCS5_PBE_keyivgen);
88# endif
89# ifndef OPENSSL_NO_MD2
90EVP_PBE_alg_add(NID_pbeWithMD2AndRC2_CBC, EVP_rc2_64_cbc(), EVP_md2(),
91 PKCS5_PBE_keyivgen);
92# endif
93# ifndef OPENSSL_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 OPENSSL_NO_HMAC
99EVP_PBE_alg_add(NID_pbes2, NULL, NULL, PKCS5_v2_PBE_keyivgen);
100#endif
101} 70}
102 71
103int PKCS5_PBE_keyivgen(EVP_CIPHER_CTX *cctx, const char *pass, int passlen, 72int PKCS5_PBE_keyivgen(EVP_CIPHER_CTX *cctx, const char *pass, int passlen,
@@ -112,6 +81,7 @@ int PKCS5_PBE_keyivgen(EVP_CIPHER_CTX *cctx, const char *pass, int passlen,
112 int saltlen, iter; 81 int saltlen, iter;
113 unsigned char *salt; 82 unsigned char *salt;
114 const unsigned char *pbuf; 83 const unsigned char *pbuf;
84 int mdsize;
115 85
116 /* Extract useful info from parameter */ 86 /* Extract useful info from parameter */
117 if (param == NULL || param->type != V_ASN1_SEQUENCE || 87 if (param == NULL || param->type != V_ASN1_SEQUENCE ||
@@ -140,9 +110,12 @@ int PKCS5_PBE_keyivgen(EVP_CIPHER_CTX *cctx, const char *pass, int passlen,
140 EVP_DigestUpdate(&ctx, salt, saltlen); 110 EVP_DigestUpdate(&ctx, salt, saltlen);
141 PBEPARAM_free(pbe); 111 PBEPARAM_free(pbe);
142 EVP_DigestFinal_ex(&ctx, md_tmp, NULL); 112 EVP_DigestFinal_ex(&ctx, md_tmp, NULL);
113 mdsize = EVP_MD_size(md);
114 if (mdsize < 0)
115 return 0;
143 for (i = 1; i < iter; i++) { 116 for (i = 1; i < iter; i++) {
144 EVP_DigestInit_ex(&ctx, md, NULL); 117 EVP_DigestInit_ex(&ctx, md, NULL);
145 EVP_DigestUpdate(&ctx, md_tmp, EVP_MD_size(md)); 118 EVP_DigestUpdate(&ctx, md_tmp, mdsize);
146 EVP_DigestFinal_ex (&ctx, md_tmp, NULL); 119 EVP_DigestFinal_ex (&ctx, md_tmp, NULL);
147 } 120 }
148 EVP_MD_CTX_cleanup(&ctx); 121 EVP_MD_CTX_cleanup(&ctx);
diff --git a/src/lib/libcrypto/evp/p5_crpt2.c b/src/lib/libcrypto/evp/p5_crpt2.c
index 6bec77baf9..334379f310 100644
--- a/src/lib/libcrypto/evp/p5_crpt2.c
+++ b/src/lib/libcrypto/evp/p5_crpt2.c
@@ -3,7 +3,7 @@
3 * project 1999. 3 * project 1999.
4 */ 4 */
5/* ==================================================================== 5/* ====================================================================
6 * Copyright (c) 1999 The OpenSSL Project. All rights reserved. 6 * Copyright (c) 1999-2006 The OpenSSL Project. All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
@@ -71,28 +71,38 @@
71#endif 71#endif
72 72
73/* This is an implementation of PKCS#5 v2.0 password based encryption key 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 74 * derivation function PBKDF2.
75 * with SHA1. Verified against test vectors posted by Peter Gutmann 75 * SHA1 version verified against test vectors posted by Peter Gutmann
76 * <pgut001@cs.auckland.ac.nz> to the PKCS-TNG <pkcs-tng@rsa.com> mailing list. 76 * <pgut001@cs.auckland.ac.nz> to the PKCS-TNG <pkcs-tng@rsa.com> mailing list.
77 */ 77 */
78 78
79int PKCS5_PBKDF2_HMAC_SHA1(const char *pass, int passlen, 79int PKCS5_PBKDF2_HMAC(const char *pass, int passlen,
80 const unsigned char *salt, int saltlen, int iter, 80 const unsigned char *salt, int saltlen, int iter,
81 const EVP_MD *digest,
81 int keylen, unsigned char *out) 82 int keylen, unsigned char *out)
82{ 83 {
83 unsigned char digtmp[SHA_DIGEST_LENGTH], *p, itmp[4]; 84 unsigned char digtmp[EVP_MAX_MD_SIZE], *p, itmp[4];
84 int cplen, j, k, tkeylen; 85 int cplen, j, k, tkeylen, mdlen;
85 unsigned long i = 1; 86 unsigned long i = 1;
86 HMAC_CTX hctx; 87 HMAC_CTX hctx;
87 88
89 mdlen = EVP_MD_size(digest);
90 if (mdlen < 0)
91 return 0;
92
88 HMAC_CTX_init(&hctx); 93 HMAC_CTX_init(&hctx);
89 p = out; 94 p = out;
90 tkeylen = keylen; 95 tkeylen = keylen;
91 if(!pass) passlen = 0; 96 if(!pass)
92 else if(passlen == -1) passlen = strlen(pass); 97 passlen = 0;
93 while(tkeylen) { 98 else if(passlen == -1)
94 if(tkeylen > SHA_DIGEST_LENGTH) cplen = SHA_DIGEST_LENGTH; 99 passlen = strlen(pass);
95 else cplen = tkeylen; 100 while(tkeylen)
101 {
102 if(tkeylen > mdlen)
103 cplen = mdlen;
104 else
105 cplen = tkeylen;
96 /* We are unlikely to ever use more than 256 blocks (5120 bits!) 106 /* We are unlikely to ever use more than 256 blocks (5120 bits!)
97 * but just in case... 107 * but just in case...
98 */ 108 */
@@ -100,20 +110,22 @@ int PKCS5_PBKDF2_HMAC_SHA1(const char *pass, int passlen,
100 itmp[1] = (unsigned char)((i >> 16) & 0xff); 110 itmp[1] = (unsigned char)((i >> 16) & 0xff);
101 itmp[2] = (unsigned char)((i >> 8) & 0xff); 111 itmp[2] = (unsigned char)((i >> 8) & 0xff);
102 itmp[3] = (unsigned char)(i & 0xff); 112 itmp[3] = (unsigned char)(i & 0xff);
103 HMAC_Init_ex(&hctx, pass, passlen, EVP_sha1(), NULL); 113 HMAC_Init_ex(&hctx, pass, passlen, digest, NULL);
104 HMAC_Update(&hctx, salt, saltlen); 114 HMAC_Update(&hctx, salt, saltlen);
105 HMAC_Update(&hctx, itmp, 4); 115 HMAC_Update(&hctx, itmp, 4);
106 HMAC_Final(&hctx, digtmp, NULL); 116 HMAC_Final(&hctx, digtmp, NULL);
107 memcpy(p, digtmp, cplen); 117 memcpy(p, digtmp, cplen);
108 for(j = 1; j < iter; j++) { 118 for(j = 1; j < iter; j++)
109 HMAC(EVP_sha1(), pass, passlen, 119 {
110 digtmp, SHA_DIGEST_LENGTH, digtmp, NULL); 120 HMAC(digest, pass, passlen,
111 for(k = 0; k < cplen; k++) p[k] ^= digtmp[k]; 121 digtmp, mdlen, digtmp, NULL);
112 } 122 for(k = 0; k < cplen; k++)
123 p[k] ^= digtmp[k];
124 }
113 tkeylen-= cplen; 125 tkeylen-= cplen;
114 i++; 126 i++;
115 p+= cplen; 127 p+= cplen;
116 } 128 }
117 HMAC_CTX_cleanup(&hctx); 129 HMAC_CTX_cleanup(&hctx);
118#ifdef DEBUG_PKCS5V2 130#ifdef DEBUG_PKCS5V2
119 fprintf(stderr, "Password:\n"); 131 fprintf(stderr, "Password:\n");
@@ -125,7 +137,15 @@ int PKCS5_PBKDF2_HMAC_SHA1(const char *pass, int passlen,
125 h__dump (out, keylen); 137 h__dump (out, keylen);
126#endif 138#endif
127 return 1; 139 return 1;
128} 140 }
141
142int PKCS5_PBKDF2_HMAC_SHA1(const char *pass, int passlen,
143 const unsigned char *salt, int saltlen, int iter,
144 int keylen, unsigned char *out)
145 {
146 return PKCS5_PBKDF2_HMAC(pass, passlen, salt, saltlen, iter, EVP_sha1(),
147 keylen, out);
148 }
129 149
130#ifdef DO_TEST 150#ifdef DO_TEST
131main() 151main()
@@ -155,6 +175,8 @@ int PKCS5_v2_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
155 PBE2PARAM *pbe2 = NULL; 175 PBE2PARAM *pbe2 = NULL;
156 const EVP_CIPHER *cipher; 176 const EVP_CIPHER *cipher;
157 PBKDF2PARAM *kdf = NULL; 177 PBKDF2PARAM *kdf = NULL;
178 const EVP_MD *prfmd;
179 int prf_nid, hmac_md_nid;
158 180
159 if (param == NULL || param->type != V_ASN1_SEQUENCE || 181 if (param == NULL || param->type != V_ASN1_SEQUENCE ||
160 param->value.sequence == NULL) { 182 param->value.sequence == NULL) {
@@ -180,8 +202,7 @@ int PKCS5_v2_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
180 /* lets see if we recognise the encryption algorithm. 202 /* lets see if we recognise the encryption algorithm.
181 */ 203 */
182 204
183 cipher = EVP_get_cipherbyname( 205 cipher = EVP_get_cipherbyobj(pbe2->encryption->algorithm);
184 OBJ_nid2sn(OBJ_obj2nid(pbe2->encryption->algorithm)));
185 206
186 if(!cipher) { 207 if(!cipher) {
187 EVPerr(EVP_F_PKCS5_V2_PBE_KEYIVGEN, 208 EVPerr(EVP_F_PKCS5_V2_PBE_KEYIVGEN,
@@ -226,10 +247,23 @@ int PKCS5_v2_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
226 goto err; 247 goto err;
227 } 248 }
228 249
229 if(kdf->prf && (OBJ_obj2nid(kdf->prf->algorithm) != NID_hmacWithSHA1)) { 250 if (kdf->prf)
251 prf_nid = OBJ_obj2nid(kdf->prf->algorithm);
252 else
253 prf_nid = NID_hmacWithSHA1;
254
255 if (!EVP_PBE_find(EVP_PBE_TYPE_PRF, prf_nid, NULL, &hmac_md_nid, 0))
256 {
230 EVPerr(EVP_F_PKCS5_V2_PBE_KEYIVGEN, EVP_R_UNSUPPORTED_PRF); 257 EVPerr(EVP_F_PKCS5_V2_PBE_KEYIVGEN, EVP_R_UNSUPPORTED_PRF);
231 goto err; 258 goto err;
232 } 259 }
260
261 prfmd = EVP_get_digestbynid(hmac_md_nid);
262 if (prfmd == NULL)
263 {
264 EVPerr(EVP_F_PKCS5_V2_PBE_KEYIVGEN, EVP_R_UNSUPPORTED_PRF);
265 goto err;
266 }
233 267
234 if(kdf->salt->type != V_ASN1_OCTET_STRING) { 268 if(kdf->salt->type != V_ASN1_OCTET_STRING) {
235 EVPerr(EVP_F_PKCS5_V2_PBE_KEYIVGEN, 269 EVPerr(EVP_F_PKCS5_V2_PBE_KEYIVGEN,
@@ -241,7 +275,9 @@ int PKCS5_v2_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
241 salt = kdf->salt->value.octet_string->data; 275 salt = kdf->salt->value.octet_string->data;
242 saltlen = kdf->salt->value.octet_string->length; 276 saltlen = kdf->salt->value.octet_string->length;
243 iter = ASN1_INTEGER_get(kdf->iter); 277 iter = ASN1_INTEGER_get(kdf->iter);
244 PKCS5_PBKDF2_HMAC_SHA1(pass, passlen, salt, saltlen, iter, keylen, key); 278 if(!PKCS5_PBKDF2_HMAC(pass, passlen, salt, saltlen, iter, prfmd,
279 keylen, key))
280 goto err;
245 EVP_CipherInit_ex(ctx, NULL, NULL, key, NULL, en_de); 281 EVP_CipherInit_ex(ctx, NULL, NULL, key, NULL, en_de);
246 OPENSSL_cleanse(key, keylen); 282 OPENSSL_cleanse(key, keylen);
247 PBKDF2PARAM_free(kdf); 283 PBKDF2PARAM_free(kdf);
diff --git a/src/lib/libcrypto/evp/p_dec.c b/src/lib/libcrypto/evp/p_dec.c
index f64901f653..4201dcbad9 100644
--- a/src/lib/libcrypto/evp/p_dec.c
+++ b/src/lib/libcrypto/evp/p_dec.c
@@ -66,7 +66,7 @@
66#include <openssl/objects.h> 66#include <openssl/objects.h>
67#include <openssl/x509.h> 67#include <openssl/x509.h>
68 68
69int EVP_PKEY_decrypt(unsigned char *key, const unsigned char *ek, int ekl, 69int EVP_PKEY_decrypt_old(unsigned char *key, const unsigned char *ek, int ekl,
70 EVP_PKEY *priv) 70 EVP_PKEY *priv)
71 { 71 {
72 int ret= -1; 72 int ret= -1;
@@ -75,7 +75,7 @@ int EVP_PKEY_decrypt(unsigned char *key, const unsigned char *ek, int ekl,
75 if (priv->type != EVP_PKEY_RSA) 75 if (priv->type != EVP_PKEY_RSA)
76 { 76 {
77#endif 77#endif
78 EVPerr(EVP_F_EVP_PKEY_DECRYPT,EVP_R_PUBLIC_KEY_NOT_RSA); 78 EVPerr(EVP_F_EVP_PKEY_DECRYPT_OLD,EVP_R_PUBLIC_KEY_NOT_RSA);
79#ifndef OPENSSL_NO_RSA 79#ifndef OPENSSL_NO_RSA
80 goto err; 80 goto err;
81 } 81 }
diff --git a/src/lib/libcrypto/evp/p_enc.c b/src/lib/libcrypto/evp/p_enc.c
index c2dfdc52ad..b5a3a84c41 100644
--- a/src/lib/libcrypto/evp/p_enc.c
+++ b/src/lib/libcrypto/evp/p_enc.c
@@ -66,7 +66,7 @@
66#include <openssl/objects.h> 66#include <openssl/objects.h>
67#include <openssl/x509.h> 67#include <openssl/x509.h>
68 68
69int EVP_PKEY_encrypt(unsigned char *ek, const unsigned char *key, int key_len, 69int EVP_PKEY_encrypt_old(unsigned char *ek, const unsigned char *key, int key_len,
70 EVP_PKEY *pubk) 70 EVP_PKEY *pubk)
71 { 71 {
72 int ret=0; 72 int ret=0;
@@ -75,7 +75,7 @@ int EVP_PKEY_encrypt(unsigned char *ek, const unsigned char *key, int key_len,
75 if (pubk->type != EVP_PKEY_RSA) 75 if (pubk->type != EVP_PKEY_RSA)
76 { 76 {
77#endif 77#endif
78 EVPerr(EVP_F_EVP_PKEY_ENCRYPT,EVP_R_PUBLIC_KEY_NOT_RSA); 78 EVPerr(EVP_F_EVP_PKEY_ENCRYPT_OLD,EVP_R_PUBLIC_KEY_NOT_RSA);
79#ifndef OPENSSL_NO_RSA 79#ifndef OPENSSL_NO_RSA
80 goto err; 80 goto err;
81 } 81 }
diff --git a/src/lib/libcrypto/evp/p_lib.c b/src/lib/libcrypto/evp/p_lib.c
index 22155ecf62..1916c61699 100644
--- a/src/lib/libcrypto/evp/p_lib.c
+++ b/src/lib/libcrypto/evp/p_lib.c
@@ -74,66 +74,26 @@
74#include <openssl/dh.h> 74#include <openssl/dh.h>
75#endif 75#endif
76 76
77#ifndef OPENSSL_NO_ENGINE
78#include <openssl/engine.h>
79#endif
80
81#include "asn1_locl.h"
82
77static void EVP_PKEY_free_it(EVP_PKEY *x); 83static void EVP_PKEY_free_it(EVP_PKEY *x);
78 84
79int EVP_PKEY_bits(EVP_PKEY *pkey) 85int EVP_PKEY_bits(EVP_PKEY *pkey)
80 { 86 {
81 if (0) 87 if (pkey && pkey->ameth && pkey->ameth->pkey_bits)
82 return 0; 88 return pkey->ameth->pkey_bits(pkey);
83#ifndef OPENSSL_NO_RSA 89 return 0;
84 else if (pkey->type == EVP_PKEY_RSA)
85 return(BN_num_bits(pkey->pkey.rsa->n));
86#endif
87#ifndef OPENSSL_NO_DSA
88 else if (pkey->type == EVP_PKEY_DSA)
89 return(BN_num_bits(pkey->pkey.dsa->p));
90#endif
91#ifndef OPENSSL_NO_EC
92 else if (pkey->type == EVP_PKEY_EC)
93 {
94 BIGNUM *order = BN_new();
95 const EC_GROUP *group;
96 int ret;
97
98 if (!order)
99 {
100 ERR_clear_error();
101 return 0;
102 }
103 group = EC_KEY_get0_group(pkey->pkey.ec);
104 if (!EC_GROUP_get_order(group, order, NULL))
105 {
106 ERR_clear_error();
107 return 0;
108 }
109
110 ret = BN_num_bits(order);
111 BN_free(order);
112 return ret;
113 }
114#endif
115 return(0);
116 } 90 }
117 91
118int EVP_PKEY_size(EVP_PKEY *pkey) 92int EVP_PKEY_size(EVP_PKEY *pkey)
119 { 93 {
120 if (pkey == NULL) 94 if (pkey && pkey->ameth && pkey->ameth->pkey_size)
121 return(0); 95 return pkey->ameth->pkey_size(pkey);
122#ifndef OPENSSL_NO_RSA 96 return 0;
123 if (pkey->type == EVP_PKEY_RSA)
124 return(RSA_size(pkey->pkey.rsa));
125 else
126#endif
127#ifndef OPENSSL_NO_DSA
128 if (pkey->type == EVP_PKEY_DSA)
129 return(DSA_size(pkey->pkey.dsa));
130#endif
131#ifndef OPENSSL_NO_ECDSA
132 if (pkey->type == EVP_PKEY_EC)
133 return(ECDSA_size(pkey->pkey.ec));
134#endif
135
136 return(0);
137 } 97 }
138 98
139int EVP_PKEY_save_parameters(EVP_PKEY *pkey, int mode) 99int EVP_PKEY_save_parameters(EVP_PKEY *pkey, int mode)
@@ -174,88 +134,26 @@ int EVP_PKEY_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from)
174 EVPerr(EVP_F_EVP_PKEY_COPY_PARAMETERS,EVP_R_MISSING_PARAMETERS); 134 EVPerr(EVP_F_EVP_PKEY_COPY_PARAMETERS,EVP_R_MISSING_PARAMETERS);
175 goto err; 135 goto err;
176 } 136 }
177#ifndef OPENSSL_NO_DSA 137 if (from->ameth && from->ameth->param_copy)
178 if (to->type == EVP_PKEY_DSA) 138 return from->ameth->param_copy(to, from);
179 {
180 BIGNUM *a;
181
182 if ((a=BN_dup(from->pkey.dsa->p)) == NULL) goto err;
183 if (to->pkey.dsa->p != NULL) BN_free(to->pkey.dsa->p);
184 to->pkey.dsa->p=a;
185
186 if ((a=BN_dup(from->pkey.dsa->q)) == NULL) goto err;
187 if (to->pkey.dsa->q != NULL) BN_free(to->pkey.dsa->q);
188 to->pkey.dsa->q=a;
189
190 if ((a=BN_dup(from->pkey.dsa->g)) == NULL) goto err;
191 if (to->pkey.dsa->g != NULL) BN_free(to->pkey.dsa->g);
192 to->pkey.dsa->g=a;
193 }
194#endif
195#ifndef OPENSSL_NO_EC
196 if (to->type == EVP_PKEY_EC)
197 {
198 EC_GROUP *group = EC_GROUP_dup(EC_KEY_get0_group(from->pkey.ec));
199 if (group == NULL)
200 goto err;
201 if (EC_KEY_set_group(to->pkey.ec, group) == 0)
202 goto err;
203 EC_GROUP_free(group);
204 }
205#endif
206 return(1);
207err: 139err:
208 return(0); 140 return 0;
209 } 141 }
210 142
211int EVP_PKEY_missing_parameters(const EVP_PKEY *pkey) 143int EVP_PKEY_missing_parameters(const EVP_PKEY *pkey)
212 { 144 {
213#ifndef OPENSSL_NO_DSA 145 if (pkey->ameth && pkey->ameth->param_missing)
214 if (pkey->type == EVP_PKEY_DSA) 146 return pkey->ameth->param_missing(pkey);
215 { 147 return 0;
216 DSA *dsa;
217
218 dsa=pkey->pkey.dsa;
219 if ((dsa->p == NULL) || (dsa->q == NULL) || (dsa->g == NULL))
220 return(1);
221 }
222#endif
223#ifndef OPENSSL_NO_EC
224 if (pkey->type == EVP_PKEY_EC)
225 {
226 if (EC_KEY_get0_group(pkey->pkey.ec) == NULL)
227 return(1);
228 }
229#endif
230
231 return(0);
232 } 148 }
233 149
234int EVP_PKEY_cmp_parameters(const EVP_PKEY *a, const EVP_PKEY *b) 150int EVP_PKEY_cmp_parameters(const EVP_PKEY *a, const EVP_PKEY *b)
235 { 151 {
236#ifndef OPENSSL_NO_DSA 152 if (a->type != b->type)
237 if ((a->type == EVP_PKEY_DSA) && (b->type == EVP_PKEY_DSA)) 153 return -1;
238 { 154 if (a->ameth && a->ameth->param_cmp)
239 if ( BN_cmp(a->pkey.dsa->p,b->pkey.dsa->p) || 155 return a->ameth->param_cmp(a, b);
240 BN_cmp(a->pkey.dsa->q,b->pkey.dsa->q) || 156 return -2;
241 BN_cmp(a->pkey.dsa->g,b->pkey.dsa->g))
242 return(0);
243 else
244 return(1);
245 }
246#endif
247#ifndef OPENSSL_NO_EC
248 if (a->type == EVP_PKEY_EC && b->type == EVP_PKEY_EC)
249 {
250 const EC_GROUP *group_a = EC_KEY_get0_group(a->pkey.ec),
251 *group_b = EC_KEY_get0_group(b->pkey.ec);
252 if (EC_GROUP_cmp(group_a, group_b, NULL))
253 return 0;
254 else
255 return 1;
256 }
257#endif
258 return(-1);
259 } 157 }
260 158
261int EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b) 159int EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b)
@@ -263,51 +161,22 @@ int EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b)
263 if (a->type != b->type) 161 if (a->type != b->type)
264 return -1; 162 return -1;
265 163
266 if (EVP_PKEY_cmp_parameters(a, b) == 0) 164 if (a->ameth)
267 return 0;
268
269 switch (a->type)
270 { 165 {
271#ifndef OPENSSL_NO_RSA 166 int ret;
272 case EVP_PKEY_RSA: 167 /* Compare parameters if the algorithm has them */
273 if (BN_cmp(b->pkey.rsa->n,a->pkey.rsa->n) != 0 168 if (a->ameth->param_cmp)
274 || BN_cmp(b->pkey.rsa->e,a->pkey.rsa->e) != 0)
275 return 0;
276 break;
277#endif
278#ifndef OPENSSL_NO_DSA
279 case EVP_PKEY_DSA:
280 if (BN_cmp(b->pkey.dsa->pub_key,a->pkey.dsa->pub_key) != 0)
281 return 0;
282 break;
283#endif
284#ifndef OPENSSL_NO_EC
285 case EVP_PKEY_EC:
286 {
287 int r;
288 const EC_GROUP *group = EC_KEY_get0_group(b->pkey.ec);
289 const EC_POINT *pa = EC_KEY_get0_public_key(a->pkey.ec),
290 *pb = EC_KEY_get0_public_key(b->pkey.ec);
291 r = EC_POINT_cmp(group, pa, pb, NULL);
292 if (r != 0)
293 { 169 {
294 if (r == 1) 170 ret = a->ameth->param_cmp(a, b);
295 return 0; 171 if (ret <= 0)
296 else 172 return ret;
297 return -2;
298 } 173 }
299 } 174
300 break; 175 if (a->ameth->pub_cmp)
301#endif 176 return a->ameth->pub_cmp(a, b);
302#ifndef OPENSSL_NO_DH
303 case EVP_PKEY_DH:
304 return -2;
305#endif
306 default:
307 return -2;
308 } 177 }
309 178
310 return 1; 179 return -2;
311 } 180 }
312 181
313EVP_PKEY *EVP_PKEY_new(void) 182EVP_PKEY *EVP_PKEY_new(void)
@@ -321,22 +190,87 @@ EVP_PKEY *EVP_PKEY_new(void)
321 return(NULL); 190 return(NULL);
322 } 191 }
323 ret->type=EVP_PKEY_NONE; 192 ret->type=EVP_PKEY_NONE;
193 ret->save_type=EVP_PKEY_NONE;
324 ret->references=1; 194 ret->references=1;
195 ret->ameth=NULL;
196 ret->engine=NULL;
325 ret->pkey.ptr=NULL; 197 ret->pkey.ptr=NULL;
326 ret->attributes=NULL; 198 ret->attributes=NULL;
327 ret->save_parameters=1; 199 ret->save_parameters=1;
328 return(ret); 200 return(ret);
329 } 201 }
330 202
331int EVP_PKEY_assign(EVP_PKEY *pkey, int type, char *key) 203/* Setup a public key ASN1 method and ENGINE from a NID or a string.
204 * If pkey is NULL just return 1 or 0 if the algorithm exists.
205 */
206
207static int pkey_set_type(EVP_PKEY *pkey, int type, const char *str, int len)
332 { 208 {
333 if (pkey == NULL) return(0); 209 const EVP_PKEY_ASN1_METHOD *ameth;
334 if (pkey->pkey.ptr != NULL) 210 ENGINE *e = NULL;
335 EVP_PKEY_free_it(pkey); 211 if (pkey)
336 pkey->type=EVP_PKEY_type(type); 212 {
337 pkey->save_type=type; 213 if (pkey->pkey.ptr)
214 EVP_PKEY_free_it(pkey);
215 /* If key type matches and a method exists then this
216 * lookup has succeeded once so just indicate success.
217 */
218 if ((type == pkey->save_type) && pkey->ameth)
219 return 1;
220#ifndef OPENSSL_NO_ENGINE
221 /* If we have an ENGINE release it */
222 if (pkey->engine)
223 {
224 ENGINE_finish(pkey->engine);
225 pkey->engine = NULL;
226 }
227#endif
228 }
229 if (str)
230 ameth = EVP_PKEY_asn1_find_str(&e, str, len);
231 else
232 ameth = EVP_PKEY_asn1_find(&e, type);
233#ifndef OPENSSL_NO_ENGINE
234 if (!pkey && e)
235 ENGINE_finish(e);
236#endif
237 if (!ameth)
238 {
239 EVPerr(EVP_F_PKEY_SET_TYPE, EVP_R_UNSUPPORTED_ALGORITHM);
240 return 0;
241 }
242 if (pkey)
243 {
244 pkey->ameth = ameth;
245 pkey->engine = e;
246
247 pkey->type = pkey->ameth->pkey_id;
248 pkey->save_type=type;
249 }
250 return 1;
251 }
252
253int EVP_PKEY_set_type(EVP_PKEY *pkey, int type)
254 {
255 return pkey_set_type(pkey, type, NULL, -1);
256 }
257
258int EVP_PKEY_set_type_str(EVP_PKEY *pkey, const char *str, int len)
259 {
260 return pkey_set_type(pkey, EVP_PKEY_NONE, str, len);
261 }
262
263int EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key)
264 {
265 if (!EVP_PKEY_set_type(pkey, type))
266 return 0;
338 pkey->pkey.ptr=key; 267 pkey->pkey.ptr=key;
339 return(key != NULL); 268 return (key != NULL);
269 }
270
271void *EVP_PKEY_get0(EVP_PKEY *pkey)
272 {
273 return pkey->pkey.ptr;
340 } 274 }
341 275
342#ifndef OPENSSL_NO_RSA 276#ifndef OPENSSL_NO_RSA
@@ -425,24 +359,29 @@ DH *EVP_PKEY_get1_DH(EVP_PKEY *pkey)
425 359
426int EVP_PKEY_type(int type) 360int EVP_PKEY_type(int type)
427 { 361 {
428 switch (type) 362 int ret;
429 { 363 const EVP_PKEY_ASN1_METHOD *ameth;
430 case EVP_PKEY_RSA: 364 ENGINE *e;
431 case EVP_PKEY_RSA2: 365 ameth = EVP_PKEY_asn1_find(&e, type);
432 return(EVP_PKEY_RSA); 366 if (ameth)
433 case EVP_PKEY_DSA: 367 ret = ameth->pkey_id;
434 case EVP_PKEY_DSA1: 368 else
435 case EVP_PKEY_DSA2: 369 ret = NID_undef;
436 case EVP_PKEY_DSA3: 370#ifndef OPENSSL_NO_ENGINE
437 case EVP_PKEY_DSA4: 371 if (e)
438 return(EVP_PKEY_DSA); 372 ENGINE_finish(e);
439 case EVP_PKEY_DH: 373#endif
440 return(EVP_PKEY_DH); 374 return ret;
441 case EVP_PKEY_EC: 375 }
442 return(EVP_PKEY_EC); 376
443 default: 377int EVP_PKEY_id(const EVP_PKEY *pkey)
444 return(NID_undef); 378 {
445 } 379 return pkey->type;
380 }
381
382int EVP_PKEY_base_id(const EVP_PKEY *pkey)
383 {
384 return EVP_PKEY_type(pkey->type);
446 } 385 }
447 386
448void EVP_PKEY_free(EVP_PKEY *x) 387void EVP_PKEY_free(EVP_PKEY *x)
@@ -471,32 +410,57 @@ void EVP_PKEY_free(EVP_PKEY *x)
471 410
472static void EVP_PKEY_free_it(EVP_PKEY *x) 411static void EVP_PKEY_free_it(EVP_PKEY *x)
473 { 412 {
474 switch (x->type) 413 if (x->ameth && x->ameth->pkey_free)
414 x->ameth->pkey_free(x);
415#ifndef OPENSSL_NO_ENGINE
416 if (x->engine)
475 { 417 {
476#ifndef OPENSSL_NO_RSA 418 ENGINE_finish(x->engine);
477 case EVP_PKEY_RSA: 419 x->engine = NULL;
478 case EVP_PKEY_RSA2:
479 RSA_free(x->pkey.rsa);
480 break;
481#endif
482#ifndef OPENSSL_NO_DSA
483 case EVP_PKEY_DSA:
484 case EVP_PKEY_DSA2:
485 case EVP_PKEY_DSA3:
486 case EVP_PKEY_DSA4:
487 DSA_free(x->pkey.dsa);
488 break;
489#endif
490#ifndef OPENSSL_NO_EC
491 case EVP_PKEY_EC:
492 EC_KEY_free(x->pkey.ec);
493 break;
494#endif
495#ifndef OPENSSL_NO_DH
496 case EVP_PKEY_DH:
497 DH_free(x->pkey.dh);
498 break;
499#endif
500 } 420 }
421#endif
422 }
423
424static int unsup_alg(BIO *out, const EVP_PKEY *pkey, int indent,
425 const char *kstr)
426 {
427 BIO_indent(out, indent, 128);
428 BIO_printf(out, "%s algorithm \"%s\" unsupported\n",
429 kstr, OBJ_nid2ln(pkey->type));
430 return 1;
431 }
432
433int EVP_PKEY_print_public(BIO *out, const EVP_PKEY *pkey,
434 int indent, ASN1_PCTX *pctx)
435 {
436 if (pkey->ameth && pkey->ameth->pub_print)
437 return pkey->ameth->pub_print(out, pkey, indent, pctx);
438
439 return unsup_alg(out, pkey, indent, "Public Key");
440 }
441
442int EVP_PKEY_print_private(BIO *out, const EVP_PKEY *pkey,
443 int indent, ASN1_PCTX *pctx)
444 {
445 if (pkey->ameth && pkey->ameth->priv_print)
446 return pkey->ameth->priv_print(out, pkey, indent, pctx);
447
448 return unsup_alg(out, pkey, indent, "Private Key");
449 }
450
451int EVP_PKEY_print_params(BIO *out, const EVP_PKEY *pkey,
452 int indent, ASN1_PCTX *pctx)
453 {
454 if (pkey->ameth && pkey->ameth->param_print)
455 return pkey->ameth->param_print(out, pkey, indent, pctx);
456 return unsup_alg(out, pkey, indent, "Parameters");
457 }
458
459int EVP_PKEY_get_default_digest_nid(EVP_PKEY *pkey, int *pnid)
460 {
461 if (!pkey->ameth || !pkey->ameth->pkey_ctrl)
462 return -2;
463 return pkey->ameth->pkey_ctrl(pkey, ASN1_PKEY_CTRL_DEFAULT_MD_NID,
464 0, pnid);
501 } 465 }
502 466
diff --git a/src/lib/libcrypto/evp/p_open.c b/src/lib/libcrypto/evp/p_open.c
index 9935206d0f..53a59a295c 100644
--- a/src/lib/libcrypto/evp/p_open.c
+++ b/src/lib/libcrypto/evp/p_open.c
@@ -95,7 +95,7 @@ int EVP_OpenInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type,
95 goto err; 95 goto err;
96 } 96 }
97 97
98 i=EVP_PKEY_decrypt(key,ek,ekl,priv); 98 i=EVP_PKEY_decrypt_old(key,ek,ekl,priv);
99 if ((i <= 0) || !EVP_CIPHER_CTX_set_key_length(ctx, i)) 99 if ((i <= 0) || !EVP_CIPHER_CTX_set_key_length(ctx, i))
100 { 100 {
101 /* ERROR */ 101 /* ERROR */
diff --git a/src/lib/libcrypto/evp/p_seal.c b/src/lib/libcrypto/evp/p_seal.c
index 8cc8fcb0bd..d8324526e7 100644
--- a/src/lib/libcrypto/evp/p_seal.c
+++ b/src/lib/libcrypto/evp/p_seal.c
@@ -87,7 +87,7 @@ int EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, unsigned char **ek
87 87
88 for (i=0; i<npubk; i++) 88 for (i=0; i<npubk; i++)
89 { 89 {
90 ekl[i]=EVP_PKEY_encrypt(ek[i],key,EVP_CIPHER_CTX_key_length(ctx), 90 ekl[i]=EVP_PKEY_encrypt_old(ek[i],key,EVP_CIPHER_CTX_key_length(ctx),
91 pubk[i]); 91 pubk[i]);
92 if (ekl[i] <= 0) return(-1); 92 if (ekl[i] <= 0) return(-1);
93 } 93 }
diff --git a/src/lib/libcrypto/evp/p_sign.c b/src/lib/libcrypto/evp/p_sign.c
index bf41a0db68..8df6d48a7e 100644
--- a/src/lib/libcrypto/evp/p_sign.c
+++ b/src/lib/libcrypto/evp/p_sign.c
@@ -84,6 +84,32 @@ int EVP_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, unsigned int *siglen,
84 MS_STATIC EVP_MD_CTX tmp_ctx; 84 MS_STATIC EVP_MD_CTX tmp_ctx;
85 85
86 *siglen=0; 86 *siglen=0;
87 EVP_MD_CTX_init(&tmp_ctx);
88 EVP_MD_CTX_copy_ex(&tmp_ctx,ctx);
89 EVP_DigestFinal_ex(&tmp_ctx,&(m[0]),&m_len);
90 EVP_MD_CTX_cleanup(&tmp_ctx);
91
92 if (ctx->digest->flags & EVP_MD_FLAG_PKEY_METHOD_SIGNATURE)
93 {
94 EVP_PKEY_CTX *pkctx = NULL;
95 size_t sltmp = (size_t)EVP_PKEY_size(pkey);
96 i = 0;
97 pkctx = EVP_PKEY_CTX_new(pkey, NULL);
98 if (!pkctx)
99 goto err;
100 if (EVP_PKEY_sign_init(pkctx) <= 0)
101 goto err;
102 if (EVP_PKEY_CTX_set_signature_md(pkctx, ctx->digest) <= 0)
103 goto err;
104 if (EVP_PKEY_sign(pkctx, sigret, &sltmp, m, m_len) <= 0)
105 goto err;
106 *siglen = sltmp;
107 i = 1;
108 err:
109 EVP_PKEY_CTX_free(pkctx);
110 return i;
111 }
112
87 for (i=0; i<4; i++) 113 for (i=0; i<4; i++)
88 { 114 {
89 v=ctx->digest->required_pkey_type[i]; 115 v=ctx->digest->required_pkey_type[i];
@@ -99,28 +125,13 @@ int EVP_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, unsigned int *siglen,
99 EVPerr(EVP_F_EVP_SIGNFINAL,EVP_R_WRONG_PUBLIC_KEY_TYPE); 125 EVPerr(EVP_F_EVP_SIGNFINAL,EVP_R_WRONG_PUBLIC_KEY_TYPE);
100 return(0); 126 return(0);
101 } 127 }
128
102 if (ctx->digest->sign == NULL) 129 if (ctx->digest->sign == NULL)
103 { 130 {
104 EVPerr(EVP_F_EVP_SIGNFINAL,EVP_R_NO_SIGN_FUNCTION_CONFIGURED); 131 EVPerr(EVP_F_EVP_SIGNFINAL,EVP_R_NO_SIGN_FUNCTION_CONFIGURED);
105 return(0); 132 return(0);
106 } 133 }
107 EVP_MD_CTX_init(&tmp_ctx); 134 return(ctx->digest->sign(ctx->digest->type,m,m_len,sigret,siglen,
108 EVP_MD_CTX_copy_ex(&tmp_ctx,ctx); 135 pkey->pkey.ptr));
109 if (ctx->digest->flags & EVP_MD_FLAG_SVCTX)
110 {
111 EVP_MD_SVCTX sctmp;
112 sctmp.mctx = &tmp_ctx;
113 sctmp.key = pkey->pkey.ptr;
114 i = ctx->digest->sign(ctx->digest->type,
115 NULL, -1, sigret, siglen, &sctmp);
116 }
117 else
118 {
119 EVP_DigestFinal_ex(&tmp_ctx,&(m[0]),&m_len);
120 i = ctx->digest->sign(ctx->digest->type,m,m_len,sigret,siglen,
121 pkey->pkey.ptr);
122 }
123 EVP_MD_CTX_cleanup(&tmp_ctx);
124 return i;
125 } 136 }
126 137
diff --git a/src/lib/libcrypto/evp/p_verify.c b/src/lib/libcrypto/evp/p_verify.c
index 2d46dffe7e..8db46412f3 100644
--- a/src/lib/libcrypto/evp/p_verify.c
+++ b/src/lib/libcrypto/evp/p_verify.c
@@ -70,6 +70,28 @@ int EVP_VerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sigbuf,
70 int i,ok=0,v; 70 int i,ok=0,v;
71 MS_STATIC EVP_MD_CTX tmp_ctx; 71 MS_STATIC EVP_MD_CTX tmp_ctx;
72 72
73 EVP_MD_CTX_init(&tmp_ctx);
74 EVP_MD_CTX_copy_ex(&tmp_ctx,ctx);
75 EVP_DigestFinal_ex(&tmp_ctx,&(m[0]),&m_len);
76 EVP_MD_CTX_cleanup(&tmp_ctx);
77
78 if (ctx->digest->flags & EVP_MD_FLAG_PKEY_METHOD_SIGNATURE)
79 {
80 EVP_PKEY_CTX *pkctx = NULL;
81 i = -1;
82 pkctx = EVP_PKEY_CTX_new(pkey, NULL);
83 if (!pkctx)
84 goto err;
85 if (EVP_PKEY_verify_init(pkctx) <= 0)
86 goto err;
87 if (EVP_PKEY_CTX_set_signature_md(pkctx, ctx->digest) <= 0)
88 goto err;
89 i = EVP_PKEY_verify(pkctx, sigbuf, siglen, m, m_len);
90 err:
91 EVP_PKEY_CTX_free(pkctx);
92 return i;
93 }
94
73 for (i=0; i<4; i++) 95 for (i=0; i<4; i++)
74 { 96 {
75 v=ctx->digest->required_pkey_type[i]; 97 v=ctx->digest->required_pkey_type[i];
@@ -85,29 +107,13 @@ int EVP_VerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sigbuf,
85 EVPerr(EVP_F_EVP_VERIFYFINAL,EVP_R_WRONG_PUBLIC_KEY_TYPE); 107 EVPerr(EVP_F_EVP_VERIFYFINAL,EVP_R_WRONG_PUBLIC_KEY_TYPE);
86 return(-1); 108 return(-1);
87 } 109 }
88 if (ctx->digest->verify == NULL) 110 if (ctx->digest->verify == NULL)
89 { 111 {
90 EVPerr(EVP_F_EVP_VERIFYFINAL,EVP_R_NO_VERIFY_FUNCTION_CONFIGURED); 112 EVPerr(EVP_F_EVP_VERIFYFINAL,EVP_R_NO_VERIFY_FUNCTION_CONFIGURED);
91 return(0); 113 return(0);
92 } 114 }
93 115
94 EVP_MD_CTX_init(&tmp_ctx); 116 return(ctx->digest->verify(ctx->digest->type,m,m_len,
95 EVP_MD_CTX_copy_ex(&tmp_ctx,ctx); 117 sigbuf,siglen,pkey->pkey.ptr));
96 if (ctx->digest->flags & EVP_MD_FLAG_SVCTX)
97 {
98 EVP_MD_SVCTX sctmp;
99 sctmp.mctx = &tmp_ctx;
100 sctmp.key = pkey->pkey.ptr;
101 i = ctx->digest->verify(ctx->digest->type,
102 NULL, -1, sigbuf, siglen, &sctmp);
103 }
104 else
105 {
106 EVP_DigestFinal_ex(&tmp_ctx,&(m[0]),&m_len);
107 i = ctx->digest->verify(ctx->digest->type,m,m_len,
108 sigbuf,siglen,pkey->pkey.ptr);
109 }
110 EVP_MD_CTX_cleanup(&tmp_ctx);
111 return i;
112 } 118 }
113 119