diff options
| author | beck <> | 2002-05-15 02:29:21 +0000 |
|---|---|---|
| committer | beck <> | 2002-05-15 02:29:21 +0000 |
| commit | b64270d1e45fe7f3241e4c9b6ce60d5ac89bc2e9 (patch) | |
| tree | fa27cf82a1250b64ed3bf5f4a18c7354d470bbcc /src/lib/libcrypto/evp | |
| parent | e471e1ea98d673597b182ea85f29e30c97cd08b5 (diff) | |
| download | openbsd-b64270d1e45fe7f3241e4c9b6ce60d5ac89bc2e9.tar.gz openbsd-b64270d1e45fe7f3241e4c9b6ce60d5ac89bc2e9.tar.bz2 openbsd-b64270d1e45fe7f3241e4c9b6ce60d5ac89bc2e9.zip | |
OpenSSL 0.9.7 stable 2002 05 08 merge
Diffstat (limited to 'src/lib/libcrypto/evp')
52 files changed, 2962 insertions, 1441 deletions
diff --git a/src/lib/libcrypto/evp/Makefile.ssl b/src/lib/libcrypto/evp/Makefile.ssl index 624168031d..4abe93dafe 100644 --- a/src/lib/libcrypto/evp/Makefile.ssl +++ b/src/lib/libcrypto/evp/Makefile.ssl | |||
| @@ -5,26 +5,28 @@ | |||
| 5 | DIR= evp | 5 | DIR= evp |
| 6 | TOP= ../.. | 6 | TOP= ../.. |
| 7 | CC= cc | 7 | CC= cc |
| 8 | INCLUDES= -I.. -I../../include | 8 | INCLUDES= -I.. -I$(TOP) -I../../include |
| 9 | CFLAG=-g | 9 | CFLAG=-g |
| 10 | INSTALL_PREFIX= | 10 | INSTALL_PREFIX= |
| 11 | OPENSSLDIR= /usr/local/ssl | 11 | OPENSSLDIR= /usr/local/ssl |
| 12 | INSTALLTOP=/usr/local/ssl | 12 | INSTALLTOP=/usr/local/ssl |
| 13 | MAKE= make -f Makefile.ssl | 13 | MAKE= make -f Makefile.ssl |
| 14 | MAKEDEPEND= $(TOP)/util/domd $(TOP) | 14 | MAKEDEPPROG= makedepend |
| 15 | MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG) | ||
| 15 | MAKEFILE= Makefile.ssl | 16 | MAKEFILE= Makefile.ssl |
| 16 | AR= ar r | 17 | AR= ar r |
| 17 | 18 | ||
| 18 | CFLAGS= $(INCLUDES) $(CFLAG) | 19 | CFLAGS= $(INCLUDES) $(CFLAG) |
| 19 | 20 | ||
| 20 | GENERAL=Makefile | 21 | GENERAL=Makefile |
| 21 | TEST= | 22 | TEST=evp_test.c |
| 23 | TESTDATA=evptests.txt | ||
| 22 | APPS= | 24 | APPS= |
| 23 | 25 | ||
| 24 | LIB=$(TOP)/libcrypto.a | 26 | LIB=$(TOP)/libcrypto.a |
| 25 | LIBSRC= encode.c digest.c evp_enc.c evp_key.c \ | 27 | LIBSRC= encode.c digest.c evp_enc.c evp_key.c evp_acnf.c \ |
| 26 | e_des.c e_bf.c e_idea.c e_des3.c \ | 28 | e_des.c e_bf.c e_idea.c e_des3.c \ |
| 27 | e_rc4.c names.c \ | 29 | e_rc4.c e_aes.c names.c \ |
| 28 | e_xcbc_d.c e_rc2.c e_cast.c e_rc5.c \ | 30 | e_xcbc_d.c e_rc2.c e_cast.c e_rc5.c \ |
| 29 | m_null.c m_md2.c m_md4.c m_md5.c m_sha.c m_sha1.c \ | 31 | m_null.c m_md2.c m_md4.c m_md5.c m_sha.c m_sha1.c \ |
| 30 | m_dss.c m_dss1.c m_mdc2.c m_ripemd.c \ | 32 | m_dss.c m_dss1.c m_mdc2.c m_ripemd.c \ |
| @@ -33,9 +35,9 @@ LIBSRC= encode.c digest.c evp_enc.c evp_key.c \ | |||
| 33 | c_all.c c_allc.c c_alld.c evp_lib.c bio_ok.c \ | 35 | c_all.c c_allc.c c_alld.c evp_lib.c bio_ok.c \ |
| 34 | evp_pkey.c evp_pbe.c p5_crpt.c p5_crpt2.c | 36 | evp_pkey.c evp_pbe.c p5_crpt.c p5_crpt2.c |
| 35 | 37 | ||
| 36 | LIBOBJ= encode.o digest.o evp_enc.o evp_key.o \ | 38 | LIBOBJ= encode.o digest.o evp_enc.o evp_key.o evp_acnf.o \ |
| 37 | e_des.o e_bf.o e_idea.o e_des3.o \ | 39 | e_des.o e_bf.o e_idea.o e_des3.o \ |
| 38 | e_rc4.o names.o \ | 40 | e_rc4.o e_aes.o names.o \ |
| 39 | e_xcbc_d.o e_rc2.o e_cast.o e_rc5.o \ | 41 | e_xcbc_d.o e_rc2.o e_cast.o e_rc5.o \ |
| 40 | m_null.o m_md2.o m_md4.o m_md5.o m_sha.o m_sha1.o \ | 42 | m_null.o m_md2.o m_md4.o m_md5.o m_sha.o m_sha1.o \ |
| 41 | m_dss.o m_dss1.o m_mdc2.o m_ripemd.o \ | 43 | m_dss.o m_dss1.o m_mdc2.o m_ripemd.o \ |
| @@ -58,8 +60,7 @@ all: lib | |||
| 58 | 60 | ||
| 59 | lib: $(LIBOBJ) | 61 | lib: $(LIBOBJ) |
| 60 | $(AR) $(LIB) $(LIBOBJ) | 62 | $(AR) $(LIB) $(LIBOBJ) |
| 61 | @echo You may get an error following this line. Please ignore. | 63 | $(RANLIB) $(LIB) || echo Never mind. |
| 62 | - $(RANLIB) $(LIB) | ||
| 63 | @touch lib | 64 | @touch lib |
| 64 | 65 | ||
| 65 | files: | 66 | files: |
| @@ -69,6 +70,7 @@ links: | |||
| 69 | @$(SHELL) $(TOP)/util/point.sh Makefile.ssl Makefile | 70 | @$(SHELL) $(TOP)/util/point.sh Makefile.ssl Makefile |
| 70 | @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER) | 71 | @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER) |
| 71 | @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST) | 72 | @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST) |
| 73 | @$(PERL) $(TOP)/util/mklink.pl ../../test $(TESTDATA) | ||
| 72 | @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS) | 74 | @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS) |
| 73 | 75 | ||
| 74 | install: | 76 | install: |
| @@ -98,820 +100,563 @@ clean: | |||
| 98 | 100 | ||
| 99 | # DO NOT DELETE THIS LINE -- make depend depends on it. | 101 | # DO NOT DELETE THIS LINE -- make depend depends on it. |
| 100 | 102 | ||
| 101 | bio_b64.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 103 | bio_b64.o: ../../e_os.h ../../include/openssl/asn1.h |
| 102 | bio_b64.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 104 | bio_b64.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
| 103 | bio_b64.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | 105 | bio_b64.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
| 104 | bio_b64.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | 106 | bio_b64.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
| 105 | bio_b64.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | 107 | bio_b64.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h |
| 106 | bio_b64.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
| 107 | bio_b64.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
| 108 | bio_b64.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
| 109 | bio_b64.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
| 110 | bio_b64.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
| 111 | bio_b64.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 108 | bio_b64.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h |
| 112 | bio_b64.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 109 | bio_b64.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
| 113 | bio_b64.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | 110 | bio_b64.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h |
| 114 | bio_b64.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | 111 | bio_b64.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
| 115 | bio_b64.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 112 | bio_b64.o: ../cryptlib.h bio_b64.c |
| 116 | bio_b64.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 113 | bio_enc.o: ../../e_os.h ../../include/openssl/asn1.h |
| 117 | bio_b64.o: ../../include/openssl/symhacks.h ../cryptlib.h | 114 | bio_enc.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
| 118 | bio_enc.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 115 | bio_enc.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
| 119 | bio_enc.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 116 | bio_enc.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
| 120 | bio_enc.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | 117 | bio_enc.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h |
| 121 | bio_enc.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
| 122 | bio_enc.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
| 123 | bio_enc.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
| 124 | bio_enc.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
| 125 | bio_enc.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
| 126 | bio_enc.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
| 127 | bio_enc.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
| 128 | bio_enc.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 118 | bio_enc.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h |
| 129 | bio_enc.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 119 | bio_enc.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
| 130 | bio_enc.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | 120 | bio_enc.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h |
| 131 | bio_enc.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | 121 | bio_enc.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
| 132 | bio_enc.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 122 | bio_enc.o: ../cryptlib.h bio_enc.c |
| 133 | bio_enc.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 123 | bio_md.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
| 134 | bio_enc.o: ../../include/openssl/symhacks.h ../cryptlib.h | 124 | bio_md.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
| 135 | bio_md.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 125 | bio_md.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
| 136 | bio_md.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
| 137 | bio_md.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
| 138 | bio_md.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
| 139 | bio_md.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
| 140 | bio_md.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
| 141 | bio_md.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 126 | bio_md.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
| 142 | bio_md.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | 127 | bio_md.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
| 143 | bio_md.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | 128 | bio_md.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
| 144 | bio_md.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | 129 | bio_md.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
| 145 | bio_md.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 130 | bio_md.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
| 146 | bio_md.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 131 | bio_md.o: ../../include/openssl/symhacks.h ../cryptlib.h bio_md.c |
| 147 | bio_md.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | 132 | bio_ok.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
| 148 | bio_md.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | 133 | bio_ok.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
| 149 | bio_md.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 134 | bio_ok.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
| 150 | bio_md.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
| 151 | bio_md.o: ../../include/openssl/symhacks.h ../cryptlib.h | ||
| 152 | bio_ok.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
| 153 | bio_ok.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
| 154 | bio_ok.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
| 155 | bio_ok.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
| 156 | bio_ok.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
| 157 | bio_ok.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
| 158 | bio_ok.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 135 | bio_ok.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
| 159 | bio_ok.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | 136 | bio_ok.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
| 160 | bio_ok.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | 137 | bio_ok.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
| 161 | bio_ok.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | 138 | bio_ok.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
| 162 | bio_ok.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 139 | bio_ok.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h |
| 163 | bio_ok.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
| 164 | bio_ok.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h | ||
| 165 | bio_ok.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
| 166 | bio_ok.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
| 167 | bio_ok.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
| 168 | bio_ok.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 140 | bio_ok.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
| 169 | bio_ok.o: ../cryptlib.h | 141 | bio_ok.o: ../cryptlib.h bio_ok.c |
| 170 | c_all.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 142 | c_all.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
| 171 | c_all.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 143 | c_all.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
| 172 | c_all.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | 144 | c_all.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
| 173 | c_all.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
| 174 | c_all.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
| 175 | c_all.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
| 176 | c_all.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 145 | c_all.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
| 177 | c_all.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | 146 | c_all.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
| 178 | c_all.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | 147 | c_all.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
| 179 | c_all.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | 148 | c_all.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
| 180 | c_all.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 149 | c_all.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
| 181 | c_all.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 150 | c_all.o: ../../include/openssl/symhacks.h ../cryptlib.h c_all.c |
| 182 | c_all.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | 151 | c_allc.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
| 183 | c_all.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | 152 | c_allc.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
| 184 | c_all.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 153 | c_allc.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
| 185 | c_all.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 154 | c_allc.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
| 186 | c_all.o: ../../include/openssl/symhacks.h ../cryptlib.h | ||
| 187 | c_allc.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
| 188 | c_allc.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
| 189 | c_allc.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
| 190 | c_allc.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
| 191 | c_allc.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
| 192 | c_allc.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
| 193 | c_allc.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 155 | c_allc.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
| 194 | c_allc.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | 156 | c_allc.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
| 195 | c_allc.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | 157 | c_allc.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
| 196 | c_allc.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | 158 | c_allc.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
| 197 | c_allc.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
| 198 | c_allc.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
| 199 | c_allc.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h | 159 | c_allc.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h |
| 200 | c_allc.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
| 201 | c_allc.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
| 202 | c_allc.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 160 | c_allc.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
| 203 | c_allc.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 161 | c_allc.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
| 204 | c_allc.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 162 | c_allc.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h |
| 205 | c_allc.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | 163 | c_allc.o: ../../include/openssl/x509_vfy.h ../cryptlib.h c_allc.c |
| 206 | c_alld.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 164 | c_alld.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
| 207 | c_alld.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 165 | c_alld.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
| 208 | c_alld.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | 166 | c_alld.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
| 209 | c_alld.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | 167 | c_alld.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
| 210 | c_alld.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
| 211 | c_alld.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
| 212 | c_alld.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 168 | c_alld.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
| 213 | c_alld.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | 169 | c_alld.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
| 214 | c_alld.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | 170 | c_alld.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
| 215 | c_alld.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | 171 | c_alld.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
| 216 | c_alld.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
| 217 | c_alld.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
| 218 | c_alld.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h | 172 | c_alld.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h |
| 219 | c_alld.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
| 220 | c_alld.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
| 221 | c_alld.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 173 | c_alld.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
| 222 | c_alld.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 174 | c_alld.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
| 223 | c_alld.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 175 | c_alld.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h |
| 224 | c_alld.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | 176 | c_alld.o: ../../include/openssl/x509_vfy.h ../cryptlib.h c_alld.c |
| 225 | digest.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 177 | digest.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
| 226 | digest.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 178 | digest.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
| 227 | digest.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | 179 | digest.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
| 228 | digest.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | 180 | digest.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
| 229 | digest.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | 181 | digest.o: ../../include/openssl/engine.h ../../include/openssl/err.h |
| 230 | digest.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | 182 | digest.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h |
| 231 | digest.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
| 232 | digest.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
| 233 | digest.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
| 234 | digest.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
| 235 | digest.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 183 | digest.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h |
| 236 | digest.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 184 | digest.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
| 237 | digest.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | 185 | digest.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rand.h |
| 238 | digest.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
| 239 | digest.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 186 | digest.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
| 240 | digest.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 187 | digest.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
| 241 | digest.o: ../../include/openssl/symhacks.h ../cryptlib.h | 188 | digest.o: ../../include/openssl/ui.h ../cryptlib.h digest.c |
| 242 | e_bf.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 189 | e_aes.o: ../../include/openssl/aes.h ../../include/openssl/asn1.h |
| 190 | e_aes.o: ../../include/openssl/bio.h ../../include/openssl/bn.h | ||
| 191 | e_aes.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
| 192 | e_aes.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
| 193 | e_aes.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h | ||
| 194 | e_aes.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
| 195 | e_aes.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
| 196 | e_aes.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | ||
| 197 | e_aes.o: ../../include/openssl/symhacks.h e_aes.c evp_locl.h | ||
| 198 | e_bf.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
| 243 | e_bf.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 199 | e_bf.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h |
| 244 | e_bf.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | 200 | e_bf.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
| 245 | e_bf.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | 201 | e_bf.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
| 246 | e_bf.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | 202 | e_bf.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h |
| 247 | e_bf.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
| 248 | e_bf.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
| 249 | e_bf.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
| 250 | e_bf.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
| 251 | e_bf.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
| 252 | e_bf.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 203 | e_bf.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h |
| 253 | e_bf.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 204 | e_bf.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
| 254 | e_bf.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | 205 | e_bf.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h |
| 255 | e_bf.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | 206 | e_bf.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
| 256 | e_bf.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 207 | e_bf.o: ../cryptlib.h e_bf.c evp_locl.h |
| 257 | e_bf.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 208 | e_cast.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
| 258 | e_bf.o: ../../include/openssl/symhacks.h ../cryptlib.h evp_locl.h | 209 | e_cast.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
| 259 | e_cast.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 210 | e_cast.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h |
| 260 | e_cast.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 211 | e_cast.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
| 261 | e_cast.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | 212 | e_cast.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h |
| 262 | e_cast.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
| 263 | e_cast.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
| 264 | e_cast.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
| 265 | e_cast.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
| 266 | e_cast.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
| 267 | e_cast.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
| 268 | e_cast.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
| 269 | e_cast.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 213 | e_cast.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h |
| 270 | e_cast.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 214 | e_cast.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
| 271 | e_cast.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | 215 | e_cast.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h |
| 272 | e_cast.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | 216 | e_cast.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
| 273 | e_cast.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 217 | e_cast.o: ../cryptlib.h e_cast.c evp_locl.h |
| 274 | e_cast.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 218 | e_des.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
| 275 | e_cast.o: ../../include/openssl/symhacks.h ../cryptlib.h evp_locl.h | 219 | e_des.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
| 276 | e_des.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
| 277 | e_des.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
| 278 | e_des.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
| 279 | e_des.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | 220 | e_des.o: ../../include/openssl/crypto.h ../../include/openssl/des.h |
| 280 | e_des.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | 221 | e_des.o: ../../include/openssl/des_old.h ../../include/openssl/e_os2.h |
| 281 | e_des.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
| 282 | e_des.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 222 | e_des.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
| 283 | e_des.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | 223 | e_des.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
| 284 | e_des.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | 224 | e_des.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
| 285 | e_des.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | 225 | e_des.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
| 286 | e_des.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 226 | e_des.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
| 287 | e_des.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 227 | e_des.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h |
| 288 | e_des.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | 228 | e_des.o: ../../include/openssl/ui_compat.h ../cryptlib.h e_des.c evp_locl.h |
| 289 | e_des.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | 229 | e_des3.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
| 290 | e_des.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 230 | e_des3.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
| 291 | e_des.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
| 292 | e_des.o: ../../include/openssl/symhacks.h ../cryptlib.h evp_locl.h | ||
| 293 | e_des3.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
| 294 | e_des3.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
| 295 | e_des3.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
| 296 | e_des3.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | 231 | e_des3.o: ../../include/openssl/crypto.h ../../include/openssl/des.h |
| 297 | e_des3.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | 232 | e_des3.o: ../../include/openssl/des_old.h ../../include/openssl/e_os2.h |
| 298 | e_des3.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
| 299 | e_des3.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 233 | e_des3.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
| 300 | e_des3.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | 234 | e_des3.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
| 301 | e_des3.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | 235 | e_des3.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
| 302 | e_des3.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | 236 | e_des3.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
| 303 | e_des3.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 237 | e_des3.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
| 304 | e_des3.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 238 | e_des3.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h |
| 305 | e_des3.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | 239 | e_des3.o: ../../include/openssl/ui_compat.h ../cryptlib.h e_des3.c evp_locl.h |
| 306 | e_des3.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | 240 | e_idea.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
| 307 | e_des3.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 241 | e_idea.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
| 308 | e_des3.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 242 | e_idea.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
| 309 | e_des3.o: ../../include/openssl/symhacks.h ../cryptlib.h evp_locl.h | ||
| 310 | e_idea.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
| 311 | e_idea.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
| 312 | e_idea.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
| 313 | e_idea.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
| 314 | e_idea.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
| 315 | e_idea.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
| 316 | e_idea.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 243 | e_idea.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
| 317 | e_idea.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | 244 | e_idea.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h |
| 318 | e_idea.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
| 319 | e_idea.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
| 320 | e_idea.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 245 | e_idea.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h |
| 321 | e_idea.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 246 | e_idea.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
| 322 | e_idea.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | 247 | e_idea.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h |
| 323 | e_idea.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | 248 | e_idea.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
| 324 | e_idea.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 249 | e_idea.o: ../cryptlib.h e_idea.c evp_locl.h |
| 325 | e_idea.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 250 | e_null.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
| 326 | e_idea.o: ../../include/openssl/symhacks.h ../cryptlib.h evp_locl.h | 251 | e_null.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
| 327 | e_null.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 252 | e_null.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
| 328 | e_null.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
| 329 | e_null.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
| 330 | e_null.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
| 331 | e_null.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
| 332 | e_null.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
| 333 | e_null.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 253 | e_null.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
| 334 | e_null.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | 254 | e_null.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
| 335 | e_null.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | 255 | e_null.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
| 336 | e_null.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | 256 | e_null.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
| 337 | e_null.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 257 | e_null.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
| 338 | e_null.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 258 | e_null.o: ../../include/openssl/symhacks.h ../cryptlib.h e_null.c |
| 339 | e_null.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | 259 | e_rc2.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
| 340 | e_null.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | 260 | e_rc2.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
| 341 | e_null.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 261 | e_rc2.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
| 342 | e_null.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
| 343 | e_null.o: ../../include/openssl/symhacks.h ../cryptlib.h | ||
| 344 | e_rc2.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
| 345 | e_rc2.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
| 346 | e_rc2.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
| 347 | e_rc2.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
| 348 | e_rc2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
| 349 | e_rc2.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
| 350 | e_rc2.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 262 | e_rc2.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
| 351 | e_rc2.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | 263 | e_rc2.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
| 352 | e_rc2.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | 264 | e_rc2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
| 353 | e_rc2.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | 265 | e_rc2.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
| 354 | e_rc2.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 266 | e_rc2.o: ../../include/openssl/rc2.h ../../include/openssl/safestack.h |
| 355 | e_rc2.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 267 | e_rc2.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
| 356 | e_rc2.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | 268 | e_rc2.o: ../cryptlib.h e_rc2.c evp_locl.h |
| 357 | e_rc2.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | 269 | e_rc4.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
| 358 | e_rc2.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 270 | e_rc4.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
| 359 | e_rc2.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 271 | e_rc4.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
| 360 | e_rc2.o: ../../include/openssl/symhacks.h ../cryptlib.h evp_locl.h | ||
| 361 | e_rc4.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
| 362 | e_rc4.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
| 363 | e_rc4.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
| 364 | e_rc4.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
| 365 | e_rc4.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
| 366 | e_rc4.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
| 367 | e_rc4.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 272 | e_rc4.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
| 368 | e_rc4.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | 273 | e_rc4.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
| 369 | e_rc4.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | 274 | e_rc4.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
| 370 | e_rc4.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | 275 | e_rc4.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
| 371 | e_rc4.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 276 | e_rc4.o: ../../include/openssl/rc4.h ../../include/openssl/safestack.h |
| 372 | e_rc4.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 277 | e_rc4.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
| 373 | e_rc4.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | 278 | e_rc4.o: ../cryptlib.h e_rc4.c |
| 374 | e_rc4.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | 279 | e_rc5.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
| 375 | e_rc4.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 280 | e_rc5.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
| 376 | e_rc4.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 281 | e_rc5.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
| 377 | e_rc4.o: ../../include/openssl/symhacks.h ../cryptlib.h | ||
| 378 | e_rc5.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
| 379 | e_rc5.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
| 380 | e_rc5.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
| 381 | e_rc5.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
| 382 | e_rc5.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
| 383 | e_rc5.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
| 384 | e_rc5.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 282 | e_rc5.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
| 385 | e_rc5.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | 283 | e_rc5.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
| 386 | e_rc5.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | 284 | e_rc5.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
| 387 | e_rc5.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | 285 | e_rc5.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
| 388 | e_rc5.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 286 | e_rc5.o: ../../include/openssl/rc5.h ../../include/openssl/safestack.h |
| 389 | e_rc5.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 287 | e_rc5.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
| 390 | e_rc5.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | 288 | e_rc5.o: ../cryptlib.h e_rc5.c evp_locl.h |
| 391 | e_rc5.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | 289 | e_xcbc_d.o: ../../e_os.h ../../include/openssl/asn1.h |
| 392 | e_rc5.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 290 | e_xcbc_d.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
| 393 | e_rc5.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 291 | e_xcbc_d.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
| 394 | e_rc5.o: ../../include/openssl/symhacks.h ../cryptlib.h evp_locl.h | 292 | e_xcbc_d.o: ../../include/openssl/des.h ../../include/openssl/des_old.h |
| 395 | e_xcbc_d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 293 | e_xcbc_d.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
| 396 | e_xcbc_d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 294 | e_xcbc_d.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h |
| 397 | e_xcbc_d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
| 398 | e_xcbc_d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
| 399 | e_xcbc_d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
| 400 | e_xcbc_d.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
| 401 | e_xcbc_d.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
| 402 | e_xcbc_d.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
| 403 | e_xcbc_d.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
| 404 | e_xcbc_d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
| 405 | e_xcbc_d.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 295 | e_xcbc_d.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h |
| 406 | e_xcbc_d.o: ../../include/openssl/opensslconf.h | 296 | e_xcbc_d.o: ../../include/openssl/opensslconf.h |
| 407 | e_xcbc_d.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h | 297 | e_xcbc_d.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
| 408 | e_xcbc_d.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | 298 | e_xcbc_d.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
| 409 | e_xcbc_d.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | 299 | e_xcbc_d.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h |
| 410 | e_xcbc_d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | 300 | e_xcbc_d.o: ../../include/openssl/ui_compat.h ../cryptlib.h e_xcbc_d.c |
| 411 | e_xcbc_d.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 301 | encode.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
| 412 | e_xcbc_d.o: ../cryptlib.h | 302 | encode.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
| 413 | encode.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 303 | encode.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
| 414 | encode.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
| 415 | encode.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
| 416 | encode.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
| 417 | encode.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
| 418 | encode.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
| 419 | encode.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 304 | encode.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
| 420 | encode.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | 305 | encode.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
| 421 | encode.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | 306 | encode.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
| 422 | encode.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | 307 | encode.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
| 423 | encode.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 308 | encode.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
| 424 | encode.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 309 | encode.o: ../../include/openssl/symhacks.h ../cryptlib.h encode.c |
| 425 | encode.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | 310 | evp_acnf.o: ../../e_os.h ../../include/openssl/asn1.h |
| 426 | encode.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | 311 | evp_acnf.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
| 427 | encode.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 312 | evp_acnf.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h |
| 428 | encode.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 313 | evp_acnf.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
| 429 | encode.o: ../../include/openssl/symhacks.h ../cryptlib.h | 314 | evp_acnf.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
| 430 | evp_enc.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 315 | evp_acnf.o: ../../include/openssl/engine.h ../../include/openssl/err.h |
| 431 | evp_enc.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 316 | evp_acnf.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h |
| 432 | evp_enc.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | 317 | evp_acnf.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h |
| 433 | evp_enc.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | 318 | evp_acnf.o: ../../include/openssl/opensslconf.h |
| 319 | evp_acnf.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
| 320 | evp_acnf.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h | ||
| 321 | evp_acnf.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | ||
| 322 | evp_acnf.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h | ||
| 323 | evp_acnf.o: ../cryptlib.h evp_acnf.c | ||
| 324 | evp_enc.o: ../../e_os.h ../../include/openssl/asn1.h | ||
| 325 | evp_enc.o: ../../include/openssl/bio.h ../../include/openssl/bn.h | ||
| 326 | evp_enc.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
| 434 | evp_enc.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | 327 | evp_enc.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h |
| 435 | evp_enc.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | 328 | evp_enc.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h |
| 436 | evp_enc.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 329 | evp_enc.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
| 437 | evp_enc.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | 330 | evp_enc.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
| 438 | evp_enc.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | 331 | evp_enc.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
| 439 | evp_enc.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | 332 | evp_enc.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
| 440 | evp_enc.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 333 | evp_enc.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h |
| 441 | evp_enc.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 334 | evp_enc.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
| 442 | evp_enc.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | 335 | evp_enc.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h |
| 443 | evp_enc.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | 336 | evp_enc.o: ../cryptlib.h evp_enc.c evp_locl.h |
| 444 | evp_enc.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
| 445 | evp_enc.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
| 446 | evp_enc.o: ../../include/openssl/symhacks.h ../cryptlib.h evp_locl.h | ||
| 447 | evp_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 337 | evp_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h |
| 448 | evp_err.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 338 | evp_err.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h |
| 449 | evp_err.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h | 339 | evp_err.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
| 450 | evp_err.o: ../../include/openssl/des.h ../../include/openssl/dh.h | 340 | evp_err.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h |
| 451 | evp_err.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h | ||
| 452 | evp_err.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
| 453 | evp_err.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
| 454 | evp_err.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
| 455 | evp_err.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
| 456 | evp_err.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 341 | evp_err.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h |
| 457 | evp_err.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 342 | evp_err.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
| 458 | evp_err.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | 343 | evp_err.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h |
| 459 | evp_err.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | 344 | evp_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
| 460 | evp_err.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 345 | evp_err.o: evp_err.c |
| 461 | evp_err.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 346 | evp_key.o: ../../e_os.h ../../include/openssl/asn1.h |
| 462 | evp_err.o: ../../include/openssl/symhacks.h | 347 | evp_key.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
| 463 | evp_key.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 348 | evp_key.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
| 464 | evp_key.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
| 465 | evp_key.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
| 466 | evp_key.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
| 467 | evp_key.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | 349 | evp_key.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h |
| 468 | evp_key.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | 350 | evp_key.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
| 469 | evp_key.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 351 | evp_key.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h |
| 470 | evp_key.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
| 471 | evp_key.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
| 472 | evp_key.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
| 473 | evp_key.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 352 | evp_key.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h |
| 474 | evp_key.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 353 | evp_key.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
| 475 | evp_key.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | 354 | evp_key.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h |
| 476 | evp_key.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | 355 | evp_key.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
| 477 | evp_key.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | 356 | evp_key.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
| 478 | evp_key.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | 357 | evp_key.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h |
| 479 | evp_key.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
| 480 | evp_key.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | 358 | evp_key.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h |
| 481 | evp_key.o: ../cryptlib.h | 359 | evp_key.o: ../cryptlib.h evp_key.c |
| 482 | evp_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 360 | evp_lib.o: ../../e_os.h ../../include/openssl/asn1.h |
| 483 | evp_lib.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 361 | evp_lib.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
| 484 | evp_lib.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | 362 | evp_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
| 485 | evp_lib.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | 363 | evp_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
| 486 | evp_lib.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | 364 | evp_lib.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h |
| 487 | evp_lib.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
| 488 | evp_lib.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
| 489 | evp_lib.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
| 490 | evp_lib.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
| 491 | evp_lib.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
| 492 | evp_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 365 | evp_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h |
| 493 | evp_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 366 | evp_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
| 494 | evp_lib.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | 367 | evp_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h |
| 495 | evp_lib.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | 368 | evp_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
| 496 | evp_lib.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 369 | evp_lib.o: ../cryptlib.h evp_lib.c |
| 497 | evp_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 370 | evp_pbe.o: ../../e_os.h ../../include/openssl/asn1.h |
| 498 | evp_lib.o: ../../include/openssl/symhacks.h ../cryptlib.h | 371 | evp_pbe.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
| 499 | evp_pbe.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 372 | evp_pbe.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
| 500 | evp_pbe.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
| 501 | evp_pbe.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
| 502 | evp_pbe.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
| 503 | evp_pbe.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | 373 | evp_pbe.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h |
| 504 | evp_pbe.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | 374 | evp_pbe.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
| 505 | evp_pbe.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 375 | evp_pbe.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h |
| 506 | evp_pbe.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
| 507 | evp_pbe.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
| 508 | evp_pbe.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
| 509 | evp_pbe.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 376 | evp_pbe.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h |
| 510 | evp_pbe.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 377 | evp_pbe.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
| 511 | evp_pbe.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | 378 | evp_pbe.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h |
| 512 | evp_pbe.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | 379 | evp_pbe.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
| 513 | evp_pbe.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | 380 | evp_pbe.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
| 514 | evp_pbe.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | 381 | evp_pbe.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h |
| 515 | evp_pbe.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 382 | evp_pbe.o: ../../include/openssl/x509_vfy.h ../cryptlib.h evp_pbe.c |
| 516 | evp_pbe.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | 383 | evp_pkey.o: ../../e_os.h ../../include/openssl/asn1.h |
| 517 | evp_pbe.o: ../cryptlib.h | 384 | evp_pkey.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
| 518 | evp_pkey.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 385 | evp_pkey.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
| 519 | evp_pkey.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
| 520 | evp_pkey.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
| 521 | evp_pkey.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
| 522 | evp_pkey.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | 386 | evp_pkey.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h |
| 523 | evp_pkey.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | 387 | evp_pkey.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
| 524 | evp_pkey.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 388 | evp_pkey.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h |
| 525 | evp_pkey.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
| 526 | evp_pkey.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
| 527 | evp_pkey.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
| 528 | evp_pkey.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 389 | evp_pkey.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h |
| 529 | evp_pkey.o: ../../include/openssl/opensslconf.h | 390 | evp_pkey.o: ../../include/openssl/opensslconf.h |
| 530 | evp_pkey.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | 391 | evp_pkey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
| 531 | evp_pkey.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h | 392 | evp_pkey.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h |
| 532 | evp_pkey.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | 393 | evp_pkey.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
| 533 | evp_pkey.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | 394 | evp_pkey.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
| 534 | evp_pkey.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | 395 | evp_pkey.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h |
| 535 | evp_pkey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 396 | evp_pkey.o: ../../include/openssl/x509_vfy.h ../cryptlib.h evp_pkey.c |
| 536 | evp_pkey.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | 397 | m_dss.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
| 537 | evp_pkey.o: ../cryptlib.h | 398 | m_dss.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
| 538 | m_dss.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 399 | m_dss.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
| 539 | m_dss.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 400 | m_dss.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
| 540 | m_dss.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
| 541 | m_dss.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
| 542 | m_dss.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
| 543 | m_dss.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
| 544 | m_dss.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 401 | m_dss.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
| 545 | m_dss.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | 402 | m_dss.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
| 546 | m_dss.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | 403 | m_dss.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
| 547 | m_dss.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | 404 | m_dss.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
| 548 | m_dss.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 405 | m_dss.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h |
| 549 | m_dss.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
| 550 | m_dss.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | ||
| 551 | m_dss.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
| 552 | m_dss.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
| 553 | m_dss.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | 406 | m_dss.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
| 554 | m_dss.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 407 | m_dss.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
| 555 | m_dss.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | 408 | m_dss.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h |
| 556 | m_dss.o: ../cryptlib.h | 409 | m_dss.o: ../cryptlib.h m_dss.c |
| 557 | m_dss1.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 410 | m_dss1.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
| 558 | m_dss1.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 411 | m_dss1.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
| 559 | m_dss1.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | 412 | m_dss1.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
| 560 | m_dss1.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | 413 | m_dss1.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
| 561 | m_dss1.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
| 562 | m_dss1.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
| 563 | m_dss1.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 414 | m_dss1.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
| 564 | m_dss1.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | 415 | m_dss1.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
| 565 | m_dss1.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | 416 | m_dss1.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
| 566 | m_dss1.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | 417 | m_dss1.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
| 567 | m_dss1.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 418 | m_dss1.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h |
| 568 | m_dss1.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
| 569 | m_dss1.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | ||
| 570 | m_dss1.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
| 571 | m_dss1.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
| 572 | m_dss1.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | 419 | m_dss1.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
| 573 | m_dss1.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 420 | m_dss1.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
| 574 | m_dss1.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | 421 | m_dss1.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h |
| 575 | m_dss1.o: ../cryptlib.h | 422 | m_dss1.o: ../cryptlib.h m_dss1.c |
| 576 | m_md2.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 423 | m_md2.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
| 577 | m_md2.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 424 | m_md2.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
| 578 | m_md2.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | 425 | m_md2.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
| 579 | m_md2.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | 426 | m_md2.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
| 580 | m_md2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
| 581 | m_md2.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
| 582 | m_md2.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 427 | m_md2.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
| 583 | m_md2.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | 428 | m_md2.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h |
| 584 | m_md2.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
| 585 | m_md2.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
| 586 | m_md2.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 429 | m_md2.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h |
| 587 | m_md2.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 430 | m_md2.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
| 588 | m_md2.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | 431 | m_md2.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h |
| 589 | m_md2.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | 432 | m_md2.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
| 590 | m_md2.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | 433 | m_md2.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
| 591 | m_md2.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | 434 | m_md2.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h |
| 592 | m_md2.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 435 | m_md2.o: ../../include/openssl/x509_vfy.h ../cryptlib.h m_md2.c |
| 593 | m_md2.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | 436 | m_md4.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
| 594 | m_md2.o: ../cryptlib.h | 437 | m_md4.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
| 595 | m_md4.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 438 | m_md4.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
| 596 | m_md4.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 439 | m_md4.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
| 597 | m_md4.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
| 598 | m_md4.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
| 599 | m_md4.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
| 600 | m_md4.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
| 601 | m_md4.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 440 | m_md4.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
| 602 | m_md4.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | 441 | m_md4.o: ../../include/openssl/lhash.h ../../include/openssl/md4.h |
| 603 | m_md4.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
| 604 | m_md4.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
| 605 | m_md4.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 442 | m_md4.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h |
| 606 | m_md4.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 443 | m_md4.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
| 607 | m_md4.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | 444 | m_md4.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h |
| 608 | m_md4.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | 445 | m_md4.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
| 609 | m_md4.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | 446 | m_md4.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
| 610 | m_md4.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | 447 | m_md4.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h |
| 611 | m_md4.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 448 | m_md4.o: ../../include/openssl/x509_vfy.h ../cryptlib.h m_md4.c |
| 612 | m_md4.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | 449 | m_md5.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
| 613 | m_md4.o: ../cryptlib.h | 450 | m_md5.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
| 614 | m_md5.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 451 | m_md5.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
| 615 | m_md5.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 452 | m_md5.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
| 616 | m_md5.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
| 617 | m_md5.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
| 618 | m_md5.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
| 619 | m_md5.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
| 620 | m_md5.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 453 | m_md5.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
| 621 | m_md5.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | 454 | m_md5.o: ../../include/openssl/lhash.h ../../include/openssl/md5.h |
| 622 | m_md5.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
| 623 | m_md5.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
| 624 | m_md5.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 455 | m_md5.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h |
| 625 | m_md5.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 456 | m_md5.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
| 626 | m_md5.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | 457 | m_md5.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h |
| 627 | m_md5.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | 458 | m_md5.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
| 628 | m_md5.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | 459 | m_md5.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
| 629 | m_md5.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | 460 | m_md5.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h |
| 630 | m_md5.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 461 | m_md5.o: ../../include/openssl/x509_vfy.h ../cryptlib.h m_md5.c |
| 631 | m_md5.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | 462 | m_mdc2.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
| 632 | m_md5.o: ../cryptlib.h | 463 | m_mdc2.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
| 633 | m_mdc2.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
| 634 | m_mdc2.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
| 635 | m_mdc2.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
| 636 | m_mdc2.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | 464 | m_mdc2.o: ../../include/openssl/crypto.h ../../include/openssl/des.h |
| 637 | m_mdc2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | 465 | m_mdc2.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h |
| 638 | m_mdc2.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | 466 | m_mdc2.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
| 639 | m_mdc2.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 467 | m_mdc2.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
| 640 | m_mdc2.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | 468 | m_mdc2.o: ../../include/openssl/lhash.h ../../include/openssl/mdc2.h |
| 641 | m_mdc2.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
| 642 | m_mdc2.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
| 643 | m_mdc2.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 469 | m_mdc2.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h |
| 644 | m_mdc2.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 470 | m_mdc2.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
| 645 | m_mdc2.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | 471 | m_mdc2.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h |
| 646 | m_mdc2.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | 472 | m_mdc2.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
| 647 | m_mdc2.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | 473 | m_mdc2.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
| 648 | m_mdc2.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | 474 | m_mdc2.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h |
| 649 | m_mdc2.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 475 | m_mdc2.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h |
| 650 | m_mdc2.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | 476 | m_mdc2.o: ../../include/openssl/x509_vfy.h ../cryptlib.h m_mdc2.c |
| 651 | m_mdc2.o: ../cryptlib.h | 477 | m_null.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
| 652 | m_null.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 478 | m_null.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
| 653 | m_null.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 479 | m_null.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
| 654 | m_null.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | 480 | m_null.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
| 655 | m_null.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
| 656 | m_null.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
| 657 | m_null.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
| 658 | m_null.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 481 | m_null.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
| 659 | m_null.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | 482 | m_null.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
| 660 | m_null.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | 483 | m_null.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
| 661 | m_null.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | 484 | m_null.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
| 662 | m_null.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 485 | m_null.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h |
| 663 | m_null.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
| 664 | m_null.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | ||
| 665 | m_null.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
| 666 | m_null.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
| 667 | m_null.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | 486 | m_null.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
| 668 | m_null.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 487 | m_null.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
| 669 | m_null.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | 488 | m_null.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h |
| 670 | m_null.o: ../cryptlib.h | 489 | m_null.o: ../cryptlib.h m_null.c |
| 671 | m_ripemd.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 490 | m_ripemd.o: ../../e_os.h ../../include/openssl/asn1.h |
| 672 | m_ripemd.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 491 | m_ripemd.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
| 673 | m_ripemd.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | 492 | m_ripemd.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
| 674 | m_ripemd.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
| 675 | m_ripemd.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | 493 | m_ripemd.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h |
| 676 | m_ripemd.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | 494 | m_ripemd.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
| 677 | m_ripemd.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 495 | m_ripemd.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h |
| 678 | m_ripemd.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
| 679 | m_ripemd.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
| 680 | m_ripemd.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
| 681 | m_ripemd.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 496 | m_ripemd.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h |
| 682 | m_ripemd.o: ../../include/openssl/opensslconf.h | 497 | m_ripemd.o: ../../include/openssl/opensslconf.h |
| 683 | m_ripemd.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | 498 | m_ripemd.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
| 684 | m_ripemd.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | 499 | m_ripemd.o: ../../include/openssl/pkcs7.h ../../include/openssl/ripemd.h |
| 685 | m_ripemd.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
| 686 | m_ripemd.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 500 | m_ripemd.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
| 687 | m_ripemd.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 501 | m_ripemd.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
| 688 | m_ripemd.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 502 | m_ripemd.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h |
| 689 | m_ripemd.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | 503 | m_ripemd.o: ../../include/openssl/x509_vfy.h ../cryptlib.h m_ripemd.c |
| 690 | m_sha.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 504 | m_sha.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
| 691 | m_sha.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 505 | m_sha.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
| 692 | m_sha.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | 506 | m_sha.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
| 693 | m_sha.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | 507 | m_sha.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
| 694 | m_sha.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
| 695 | m_sha.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
| 696 | m_sha.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 508 | m_sha.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
| 697 | m_sha.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | 509 | m_sha.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
| 698 | m_sha.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | 510 | m_sha.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
| 699 | m_sha.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | 511 | m_sha.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
| 700 | m_sha.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 512 | m_sha.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h |
| 701 | m_sha.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
| 702 | m_sha.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | ||
| 703 | m_sha.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
| 704 | m_sha.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
| 705 | m_sha.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | 513 | m_sha.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
| 706 | m_sha.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 514 | m_sha.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
| 707 | m_sha.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | 515 | m_sha.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h |
| 708 | m_sha.o: ../cryptlib.h | 516 | m_sha.o: ../cryptlib.h m_sha.c |
| 709 | m_sha1.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 517 | m_sha1.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
| 710 | m_sha1.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 518 | m_sha1.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
| 711 | m_sha1.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | 519 | m_sha1.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
| 712 | m_sha1.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | 520 | m_sha1.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
| 713 | m_sha1.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
| 714 | m_sha1.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
| 715 | m_sha1.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 521 | m_sha1.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
| 716 | m_sha1.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | 522 | m_sha1.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
| 717 | m_sha1.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | 523 | m_sha1.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
| 718 | m_sha1.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | 524 | m_sha1.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
| 719 | m_sha1.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 525 | m_sha1.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h |
| 720 | m_sha1.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
| 721 | m_sha1.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | ||
| 722 | m_sha1.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
| 723 | m_sha1.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
| 724 | m_sha1.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | 526 | m_sha1.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
| 725 | m_sha1.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 527 | m_sha1.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
| 726 | m_sha1.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | 528 | m_sha1.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h |
| 727 | m_sha1.o: ../cryptlib.h | 529 | m_sha1.o: ../cryptlib.h m_sha1.c |
| 728 | names.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 530 | names.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
| 729 | names.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 531 | names.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
| 730 | names.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | 532 | names.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
| 731 | names.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | 533 | names.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
| 732 | names.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
| 733 | names.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
| 734 | names.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 534 | names.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
| 735 | names.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | 535 | names.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
| 736 | names.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | 536 | names.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
| 737 | names.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | 537 | names.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
| 738 | names.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 538 | names.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h |
| 739 | names.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
| 740 | names.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | ||
| 741 | names.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
| 742 | names.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
| 743 | names.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | 539 | names.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
| 744 | names.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 540 | names.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
| 745 | names.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | 541 | names.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h |
| 746 | names.o: ../cryptlib.h | 542 | names.o: ../cryptlib.h names.c |
| 747 | p5_crpt.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 543 | p5_crpt.o: ../../e_os.h ../../include/openssl/asn1.h |
| 748 | p5_crpt.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 544 | p5_crpt.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
| 749 | p5_crpt.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | 545 | p5_crpt.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
| 750 | p5_crpt.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
| 751 | p5_crpt.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | 546 | p5_crpt.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h |
| 752 | p5_crpt.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | 547 | p5_crpt.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
| 753 | p5_crpt.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 548 | p5_crpt.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h |
| 754 | p5_crpt.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
| 755 | p5_crpt.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
| 756 | p5_crpt.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
| 757 | p5_crpt.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 549 | p5_crpt.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h |
| 758 | p5_crpt.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 550 | p5_crpt.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
| 759 | p5_crpt.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | 551 | p5_crpt.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h |
| 760 | p5_crpt.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | 552 | p5_crpt.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
| 761 | p5_crpt.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | 553 | p5_crpt.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
| 762 | p5_crpt.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | 554 | p5_crpt.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h |
| 763 | p5_crpt.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 555 | p5_crpt.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p5_crpt.c |
| 764 | p5_crpt.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | 556 | p5_crpt2.o: ../../e_os.h ../../include/openssl/asn1.h |
| 765 | p5_crpt.o: ../cryptlib.h | 557 | p5_crpt2.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
| 766 | p5_crpt2.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 558 | p5_crpt2.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
| 767 | p5_crpt2.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
| 768 | p5_crpt2.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
| 769 | p5_crpt2.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
| 770 | p5_crpt2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | 559 | p5_crpt2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h |
| 771 | p5_crpt2.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | 560 | p5_crpt2.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
| 772 | p5_crpt2.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 561 | p5_crpt2.o: ../../include/openssl/evp.h ../../include/openssl/hmac.h |
| 773 | p5_crpt2.o: ../../include/openssl/hmac.h ../../include/openssl/idea.h | 562 | p5_crpt2.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
| 774 | p5_crpt2.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
| 775 | p5_crpt2.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | ||
| 776 | p5_crpt2.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
| 777 | p5_crpt2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | 563 | p5_crpt2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
| 778 | p5_crpt2.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | 564 | p5_crpt2.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
| 779 | p5_crpt2.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | 565 | p5_crpt2.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h |
| 780 | p5_crpt2.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | 566 | p5_crpt2.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
| 781 | p5_crpt2.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 567 | p5_crpt2.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
| 782 | p5_crpt2.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 568 | p5_crpt2.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h |
| 783 | p5_crpt2.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 569 | p5_crpt2.o: ../cryptlib.h p5_crpt2.c |
| 784 | p5_crpt2.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | 570 | p_dec.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
| 785 | p_dec.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 571 | p_dec.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
| 786 | p_dec.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 572 | p_dec.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
| 787 | p_dec.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | 573 | p_dec.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
| 788 | p_dec.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
| 789 | p_dec.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
| 790 | p_dec.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
| 791 | p_dec.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 574 | p_dec.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
| 792 | p_dec.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | 575 | p_dec.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
| 793 | p_dec.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | 576 | p_dec.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
| 794 | p_dec.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | 577 | p_dec.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
| 795 | p_dec.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
| 796 | p_dec.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
| 797 | p_dec.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h | 578 | p_dec.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h |
| 798 | p_dec.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
| 799 | p_dec.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
| 800 | p_dec.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 579 | p_dec.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
| 801 | p_dec.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 580 | p_dec.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
| 802 | p_dec.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 581 | p_dec.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h |
| 803 | p_dec.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | 582 | p_dec.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p_dec.c |
| 804 | p_enc.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 583 | p_enc.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
| 805 | p_enc.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 584 | p_enc.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
| 806 | p_enc.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | 585 | p_enc.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
| 807 | p_enc.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | 586 | p_enc.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
| 808 | p_enc.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
| 809 | p_enc.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
| 810 | p_enc.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 587 | p_enc.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
| 811 | p_enc.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | 588 | p_enc.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
| 812 | p_enc.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | 589 | p_enc.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
| 813 | p_enc.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | 590 | p_enc.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
| 814 | p_enc.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
| 815 | p_enc.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
| 816 | p_enc.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h | 591 | p_enc.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h |
| 817 | p_enc.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
| 818 | p_enc.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
| 819 | p_enc.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 592 | p_enc.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
| 820 | p_enc.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 593 | p_enc.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
| 821 | p_enc.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 594 | p_enc.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h |
| 822 | p_enc.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | 595 | p_enc.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p_enc.c |
| 823 | p_lib.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | 596 | p_lib.o: ../../e_os.h ../../include/openssl/asn1.h |
| 824 | p_lib.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | 597 | p_lib.o: ../../include/openssl/asn1_mac.h ../../include/openssl/bio.h |
| 825 | p_lib.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 598 | p_lib.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
| 826 | p_lib.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h | 599 | p_lib.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
| 827 | p_lib.o: ../../include/openssl/des.h ../../include/openssl/dh.h | 600 | p_lib.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
| 828 | p_lib.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h | 601 | p_lib.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
| 829 | p_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 602 | p_lib.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
| 830 | p_lib.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | ||
| 831 | p_lib.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
| 832 | p_lib.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | ||
| 833 | p_lib.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
| 834 | p_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | 603 | p_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
| 835 | p_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | 604 | p_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
| 836 | p_lib.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | 605 | p_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h |
| 837 | p_lib.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | 606 | p_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
| 838 | p_lib.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 607 | p_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
| 839 | p_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 608 | p_lib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h |
| 840 | p_lib.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 609 | p_lib.o: ../cryptlib.h p_lib.c |
| 841 | p_lib.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | 610 | p_open.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
| 842 | p_open.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 611 | p_open.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
| 843 | p_open.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 612 | p_open.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
| 844 | p_open.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | 613 | p_open.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
| 845 | p_open.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
| 846 | p_open.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
| 847 | p_open.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
| 848 | p_open.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 614 | p_open.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
| 849 | p_open.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | 615 | p_open.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
| 850 | p_open.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | 616 | p_open.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
| 851 | p_open.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | 617 | p_open.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
| 852 | p_open.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 618 | p_open.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h |
| 853 | p_open.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
| 854 | p_open.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | ||
| 855 | p_open.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
| 856 | p_open.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
| 857 | p_open.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | 619 | p_open.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
| 858 | p_open.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 620 | p_open.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
| 859 | p_open.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | 621 | p_open.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h |
| 860 | p_open.o: ../cryptlib.h | 622 | p_open.o: ../cryptlib.h p_open.c |
| 861 | p_seal.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 623 | p_seal.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
| 862 | p_seal.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 624 | p_seal.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
| 863 | p_seal.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | 625 | p_seal.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
| 864 | p_seal.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | 626 | p_seal.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
| 865 | p_seal.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
| 866 | p_seal.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
| 867 | p_seal.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 627 | p_seal.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
| 868 | p_seal.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | 628 | p_seal.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
| 869 | p_seal.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | 629 | p_seal.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
| 870 | p_seal.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | 630 | p_seal.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
| 871 | p_seal.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
| 872 | p_seal.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
| 873 | p_seal.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h | 631 | p_seal.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h |
| 874 | p_seal.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
| 875 | p_seal.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
| 876 | p_seal.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 632 | p_seal.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
| 877 | p_seal.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 633 | p_seal.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
| 878 | p_seal.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 634 | p_seal.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h |
| 879 | p_seal.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | 635 | p_seal.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p_seal.c |
| 880 | p_sign.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 636 | p_sign.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
| 881 | p_sign.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 637 | p_sign.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
| 882 | p_sign.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | 638 | p_sign.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
| 883 | p_sign.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | 639 | p_sign.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
| 884 | p_sign.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
| 885 | p_sign.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
| 886 | p_sign.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 640 | p_sign.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
| 887 | p_sign.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | 641 | p_sign.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
| 888 | p_sign.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | 642 | p_sign.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
| 889 | p_sign.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | 643 | p_sign.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
| 890 | p_sign.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 644 | p_sign.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h |
| 891 | p_sign.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
| 892 | p_sign.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | ||
| 893 | p_sign.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
| 894 | p_sign.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
| 895 | p_sign.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | 645 | p_sign.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
| 896 | p_sign.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 646 | p_sign.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
| 897 | p_sign.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | 647 | p_sign.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h |
| 898 | p_sign.o: ../cryptlib.h | 648 | p_sign.o: ../cryptlib.h p_sign.c |
| 899 | p_verify.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 649 | p_verify.o: ../../e_os.h ../../include/openssl/asn1.h |
| 900 | p_verify.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 650 | p_verify.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
| 901 | p_verify.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | 651 | p_verify.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
| 902 | p_verify.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
| 903 | p_verify.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | 652 | p_verify.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h |
| 904 | p_verify.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | 653 | p_verify.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
| 905 | p_verify.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 654 | p_verify.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h |
| 906 | p_verify.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
| 907 | p_verify.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
| 908 | p_verify.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
| 909 | p_verify.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 655 | p_verify.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h |
| 910 | p_verify.o: ../../include/openssl/opensslconf.h | 656 | p_verify.o: ../../include/openssl/opensslconf.h |
| 911 | p_verify.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | 657 | p_verify.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
| 912 | p_verify.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | 658 | p_verify.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h |
| 913 | p_verify.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | 659 | p_verify.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
| 914 | p_verify.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 660 | p_verify.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
| 915 | p_verify.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 661 | p_verify.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h |
| 916 | p_verify.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 662 | p_verify.o: ../cryptlib.h p_verify.c |
| 917 | p_verify.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | ||
diff --git a/src/lib/libcrypto/evp/bio_b64.c b/src/lib/libcrypto/evp/bio_b64.c index af6fa2ae8f..f12eac1b55 100644 --- a/src/lib/libcrypto/evp/bio_b64.c +++ b/src/lib/libcrypto/evp/bio_b64.c | |||
| @@ -465,7 +465,8 @@ static long b64_ctrl(BIO *b, int cmd, long num, void *ptr) | |||
| 465 | break; | 465 | break; |
| 466 | case BIO_CTRL_WPENDING: /* More to write in buffer */ | 466 | case BIO_CTRL_WPENDING: /* More to write in buffer */ |
| 467 | ret=ctx->buf_len-ctx->buf_off; | 467 | ret=ctx->buf_len-ctx->buf_off; |
| 468 | if ((ret == 0) && (ctx->base64.num != 0)) | 468 | if ((ret == 0) && (ctx->encode != B64_NONE) |
| 469 | && (ctx->base64.num != 0)) | ||
| 469 | ret=1; | 470 | ret=1; |
| 470 | else if (ret <= 0) | 471 | else if (ret <= 0) |
| 471 | ret=BIO_ctrl(b->next_bio,cmd,num,ptr); | 472 | ret=BIO_ctrl(b->next_bio,cmd,num,ptr); |
| @@ -500,7 +501,7 @@ again: | |||
| 500 | goto again; | 501 | goto again; |
| 501 | } | 502 | } |
| 502 | } | 503 | } |
| 503 | else if (ctx->base64.num != 0) | 504 | else if (ctx->encode != B64_NONE && ctx->base64.num != 0) |
| 504 | { | 505 | { |
| 505 | ctx->buf_off=0; | 506 | ctx->buf_off=0; |
| 506 | EVP_EncodeFinal(&(ctx->base64), | 507 | EVP_EncodeFinal(&(ctx->base64), |
diff --git a/src/lib/libcrypto/evp/bio_enc.c b/src/lib/libcrypto/evp/bio_enc.c index 831c71a2b5..05f4249458 100644 --- a/src/lib/libcrypto/evp/bio_enc.c +++ b/src/lib/libcrypto/evp/bio_enc.c | |||
| @@ -71,6 +71,7 @@ static int enc_new(BIO *h); | |||
| 71 | static int enc_free(BIO *data); | 71 | static int enc_free(BIO *data); |
| 72 | static long enc_callback_ctrl(BIO *h, int cmd, bio_info_cb *fps); | 72 | static long enc_callback_ctrl(BIO *h, int cmd, bio_info_cb *fps); |
| 73 | #define ENC_BLOCK_SIZE (1024*4) | 73 | #define ENC_BLOCK_SIZE (1024*4) |
| 74 | #define BUF_OFFSET EVP_MAX_BLOCK_LENGTH | ||
| 74 | 75 | ||
| 75 | typedef struct enc_struct | 76 | typedef struct enc_struct |
| 76 | { | 77 | { |
| @@ -80,7 +81,10 @@ typedef struct enc_struct | |||
| 80 | int finished; | 81 | int finished; |
| 81 | int ok; /* bad decrypt */ | 82 | int ok; /* bad decrypt */ |
| 82 | EVP_CIPHER_CTX cipher; | 83 | EVP_CIPHER_CTX cipher; |
| 83 | char buf[ENC_BLOCK_SIZE+10]; | 84 | /* buf is larger than ENC_BLOCK_SIZE because EVP_DecryptUpdate |
| 85 | * can return up to a block more data than is presented to it | ||
| 86 | */ | ||
| 87 | char buf[ENC_BLOCK_SIZE+BUF_OFFSET+2]; | ||
| 84 | } BIO_ENC_CTX; | 88 | } BIO_ENC_CTX; |
| 85 | 89 | ||
| 86 | static BIO_METHOD methods_enc= | 90 | static BIO_METHOD methods_enc= |
| @@ -170,9 +174,9 @@ static int enc_read(BIO *b, char *out, int outl) | |||
| 170 | { | 174 | { |
| 171 | if (ctx->cont <= 0) break; | 175 | if (ctx->cont <= 0) break; |
| 172 | 176 | ||
| 173 | /* read in at offset 8, read the EVP_Cipher | 177 | /* read in at IV offset, read the EVP_Cipher |
| 174 | * documentation about why */ | 178 | * documentation about why */ |
| 175 | i=BIO_read(b->next_bio,&(ctx->buf[8]),ENC_BLOCK_SIZE); | 179 | i=BIO_read(b->next_bio,&(ctx->buf[BUF_OFFSET]),ENC_BLOCK_SIZE); |
| 176 | 180 | ||
| 177 | if (i <= 0) | 181 | if (i <= 0) |
| 178 | { | 182 | { |
| @@ -180,7 +184,7 @@ static int enc_read(BIO *b, char *out, int outl) | |||
| 180 | if (!BIO_should_retry(b->next_bio)) | 184 | if (!BIO_should_retry(b->next_bio)) |
| 181 | { | 185 | { |
| 182 | ctx->cont=i; | 186 | ctx->cont=i; |
| 183 | i=EVP_CipherFinal(&(ctx->cipher), | 187 | i=EVP_CipherFinal_ex(&(ctx->cipher), |
| 184 | (unsigned char *)ctx->buf, | 188 | (unsigned char *)ctx->buf, |
| 185 | &(ctx->buf_len)); | 189 | &(ctx->buf_len)); |
| 186 | ctx->ok=i; | 190 | ctx->ok=i; |
| @@ -196,7 +200,7 @@ static int enc_read(BIO *b, char *out, int outl) | |||
| 196 | { | 200 | { |
| 197 | EVP_CipherUpdate(&(ctx->cipher), | 201 | EVP_CipherUpdate(&(ctx->cipher), |
| 198 | (unsigned char *)ctx->buf,&ctx->buf_len, | 202 | (unsigned char *)ctx->buf,&ctx->buf_len, |
| 199 | (unsigned char *)&(ctx->buf[8]),i); | 203 | (unsigned char *)&(ctx->buf[BUF_OFFSET]),i); |
| 200 | ctx->cont=1; | 204 | ctx->cont=1; |
| 201 | /* Note: it is possible for EVP_CipherUpdate to | 205 | /* Note: it is possible for EVP_CipherUpdate to |
| 202 | * decrypt zero bytes because this is or looks like | 206 | * decrypt zero bytes because this is or looks like |
| @@ -294,7 +298,7 @@ static long enc_ctrl(BIO *b, int cmd, long num, void *ptr) | |||
| 294 | case BIO_CTRL_RESET: | 298 | case BIO_CTRL_RESET: |
| 295 | ctx->ok=1; | 299 | ctx->ok=1; |
| 296 | ctx->finished=0; | 300 | ctx->finished=0; |
| 297 | EVP_CipherInit(&(ctx->cipher),NULL,NULL,NULL, | 301 | EVP_CipherInit_ex(&(ctx->cipher),NULL,NULL,NULL,NULL, |
| 298 | ctx->cipher.encrypt); | 302 | ctx->cipher.encrypt); |
| 299 | ret=BIO_ctrl(b->next_bio,cmd,num,ptr); | 303 | ret=BIO_ctrl(b->next_bio,cmd,num,ptr); |
| 300 | break; | 304 | break; |
| @@ -331,7 +335,7 @@ again: | |||
| 331 | { | 335 | { |
| 332 | ctx->finished=1; | 336 | ctx->finished=1; |
| 333 | ctx->buf_off=0; | 337 | ctx->buf_off=0; |
| 334 | ret=EVP_CipherFinal(&(ctx->cipher), | 338 | ret=EVP_CipherFinal_ex(&(ctx->cipher), |
| 335 | (unsigned char *)ctx->buf, | 339 | (unsigned char *)ctx->buf, |
| 336 | &(ctx->buf_len)); | 340 | &(ctx->buf_len)); |
| 337 | ctx->ok=(int)ret; | 341 | ctx->ok=(int)ret; |
| @@ -417,7 +421,7 @@ void BIO_set_cipher(BIO *b, const EVP_CIPHER *c, unsigned char *k, | |||
| 417 | 421 | ||
| 418 | b->init=1; | 422 | b->init=1; |
| 419 | ctx=(BIO_ENC_CTX *)b->ptr; | 423 | ctx=(BIO_ENC_CTX *)b->ptr; |
| 420 | EVP_CipherInit(&(ctx->cipher),c,k,i,e); | 424 | EVP_CipherInit_ex(&(ctx->cipher),c,NULL, k,i,e); |
| 421 | 425 | ||
| 422 | if (b->callback != NULL) | 426 | if (b->callback != NULL) |
| 423 | b->callback(b,BIO_CB_CTRL,(const char *)c,BIO_CTRL_SET,e,1L); | 427 | b->callback(b,BIO_CB_CTRL,(const char *)c,BIO_CTRL_SET,e,1L); |
diff --git a/src/lib/libcrypto/evp/bio_md.c b/src/lib/libcrypto/evp/bio_md.c index 2373c247d8..c632dfb202 100644 --- a/src/lib/libcrypto/evp/bio_md.c +++ b/src/lib/libcrypto/evp/bio_md.c | |||
| @@ -96,7 +96,7 @@ static int md_new(BIO *bi) | |||
| 96 | { | 96 | { |
| 97 | EVP_MD_CTX *ctx; | 97 | EVP_MD_CTX *ctx; |
| 98 | 98 | ||
| 99 | ctx=(EVP_MD_CTX *)OPENSSL_malloc(sizeof(EVP_MD_CTX)); | 99 | ctx=EVP_MD_CTX_create(); |
| 100 | if (ctx == NULL) return(0); | 100 | if (ctx == NULL) return(0); |
| 101 | 101 | ||
| 102 | bi->init=0; | 102 | bi->init=0; |
| @@ -108,7 +108,7 @@ static int md_new(BIO *bi) | |||
| 108 | static int md_free(BIO *a) | 108 | static int md_free(BIO *a) |
| 109 | { | 109 | { |
| 110 | if (a == NULL) return(0); | 110 | if (a == NULL) return(0); |
| 111 | OPENSSL_free(a->ptr); | 111 | EVP_MD_CTX_destroy(a->ptr); |
| 112 | a->ptr=NULL; | 112 | a->ptr=NULL; |
| 113 | a->init=0; | 113 | a->init=0; |
| 114 | a->flags=0; | 114 | a->flags=0; |
| @@ -121,7 +121,7 @@ static int md_read(BIO *b, char *out, int outl) | |||
| 121 | EVP_MD_CTX *ctx; | 121 | EVP_MD_CTX *ctx; |
| 122 | 122 | ||
| 123 | if (out == NULL) return(0); | 123 | if (out == NULL) return(0); |
| 124 | ctx=(EVP_MD_CTX *)b->ptr; | 124 | ctx=b->ptr; |
| 125 | 125 | ||
| 126 | if ((ctx == NULL) || (b->next_bio == NULL)) return(0); | 126 | if ((ctx == NULL) || (b->next_bio == NULL)) return(0); |
| 127 | 127 | ||
| @@ -145,7 +145,7 @@ static int md_write(BIO *b, const char *in, int inl) | |||
| 145 | EVP_MD_CTX *ctx; | 145 | EVP_MD_CTX *ctx; |
| 146 | 146 | ||
| 147 | if ((in == NULL) || (inl <= 0)) return(0); | 147 | if ((in == NULL) || (inl <= 0)) return(0); |
| 148 | ctx=(EVP_MD_CTX *)b->ptr; | 148 | ctx=b->ptr; |
| 149 | 149 | ||
| 150 | if ((ctx != NULL) && (b->next_bio != NULL)) | 150 | if ((ctx != NULL) && (b->next_bio != NULL)) |
| 151 | ret=BIO_write(b->next_bio,in,inl); | 151 | ret=BIO_write(b->next_bio,in,inl); |
| @@ -170,13 +170,13 @@ static long md_ctrl(BIO *b, int cmd, long num, void *ptr) | |||
| 170 | long ret=1; | 170 | long ret=1; |
| 171 | BIO *dbio; | 171 | BIO *dbio; |
| 172 | 172 | ||
| 173 | ctx=(EVP_MD_CTX *)b->ptr; | 173 | ctx=b->ptr; |
| 174 | 174 | ||
| 175 | switch (cmd) | 175 | switch (cmd) |
| 176 | { | 176 | { |
| 177 | case BIO_CTRL_RESET: | 177 | case BIO_CTRL_RESET: |
| 178 | if (b->init) | 178 | if (b->init) |
| 179 | EVP_DigestInit(ctx,ctx->digest); | 179 | EVP_DigestInit_ex(ctx,ctx->digest, NULL); |
| 180 | else | 180 | else |
| 181 | ret=0; | 181 | ret=0; |
| 182 | ret=BIO_ctrl(b->next_bio,cmd,num,ptr); | 182 | ret=BIO_ctrl(b->next_bio,cmd,num,ptr); |
| @@ -184,7 +184,7 @@ static long md_ctrl(BIO *b, int cmd, long num, void *ptr) | |||
| 184 | case BIO_C_GET_MD: | 184 | case BIO_C_GET_MD: |
| 185 | if (b->init) | 185 | if (b->init) |
| 186 | { | 186 | { |
| 187 | ppmd=(const EVP_MD **)ptr; | 187 | ppmd=ptr; |
| 188 | *ppmd=ctx->digest; | 188 | *ppmd=ctx->digest; |
| 189 | } | 189 | } |
| 190 | else | 190 | else |
| @@ -193,7 +193,7 @@ static long md_ctrl(BIO *b, int cmd, long num, void *ptr) | |||
| 193 | case BIO_C_GET_MD_CTX: | 193 | case BIO_C_GET_MD_CTX: |
| 194 | if (b->init) | 194 | if (b->init) |
| 195 | { | 195 | { |
| 196 | pctx=(EVP_MD_CTX **)ptr; | 196 | pctx=ptr; |
| 197 | *pctx=ctx; | 197 | *pctx=ctx; |
| 198 | } | 198 | } |
| 199 | else | 199 | else |
| @@ -206,14 +206,14 @@ static long md_ctrl(BIO *b, int cmd, long num, void *ptr) | |||
| 206 | break; | 206 | break; |
| 207 | 207 | ||
| 208 | case BIO_C_SET_MD: | 208 | case BIO_C_SET_MD: |
| 209 | md=(EVP_MD *)ptr; | 209 | md=ptr; |
| 210 | EVP_DigestInit(ctx,md); | 210 | EVP_DigestInit_ex(ctx,md, NULL); |
| 211 | b->init=1; | 211 | b->init=1; |
| 212 | break; | 212 | break; |
| 213 | case BIO_CTRL_DUP: | 213 | case BIO_CTRL_DUP: |
| 214 | dbio=(BIO *)ptr; | 214 | dbio=ptr; |
| 215 | dctx=(EVP_MD_CTX *)dbio->ptr; | 215 | dctx=dbio->ptr; |
| 216 | memcpy(dctx,ctx,sizeof(ctx)); | 216 | EVP_MD_CTX_copy_ex(dctx,ctx); |
| 217 | b->init=1; | 217 | b->init=1; |
| 218 | break; | 218 | break; |
| 219 | default: | 219 | default: |
| @@ -243,10 +243,10 @@ static int md_gets(BIO *bp, char *buf, int size) | |||
| 243 | unsigned int ret; | 243 | unsigned int ret; |
| 244 | 244 | ||
| 245 | 245 | ||
| 246 | ctx=(EVP_MD_CTX *)bp->ptr; | 246 | ctx=bp->ptr; |
| 247 | if (size < ctx->digest->md_size) | 247 | if (size < ctx->digest->md_size) |
| 248 | return(0); | 248 | return(0); |
| 249 | EVP_DigestFinal(ctx,(unsigned char *)buf,&ret); | 249 | EVP_DigestFinal_ex(ctx,(unsigned char *)buf,&ret); |
| 250 | return((int)ret); | 250 | return((int)ret); |
| 251 | } | 251 | } |
| 252 | 252 | ||
diff --git a/src/lib/libcrypto/evp/bio_ok.c b/src/lib/libcrypto/evp/bio_ok.c index e617ce1d43..3cbc6e7848 100644 --- a/src/lib/libcrypto/evp/bio_ok.c +++ b/src/lib/libcrypto/evp/bio_ok.c | |||
| @@ -162,7 +162,7 @@ typedef struct ok_struct | |||
| 162 | EVP_MD_CTX md; | 162 | EVP_MD_CTX md; |
| 163 | int blockout; /* output block is ready */ | 163 | int blockout; /* output block is ready */ |
| 164 | int sigio; /* must process signature */ | 164 | int sigio; /* must process signature */ |
| 165 | char buf[IOBS]; | 165 | unsigned char buf[IOBS]; |
| 166 | } BIO_OK_CTX; | 166 | } BIO_OK_CTX; |
| 167 | 167 | ||
| 168 | static BIO_METHOD methods_ok= | 168 | static BIO_METHOD methods_ok= |
| @@ -199,6 +199,8 @@ static int ok_new(BIO *bi) | |||
| 199 | ctx->blockout= 0; | 199 | ctx->blockout= 0; |
| 200 | ctx->sigio=1; | 200 | ctx->sigio=1; |
| 201 | 201 | ||
| 202 | EVP_MD_CTX_init(&ctx->md); | ||
| 203 | |||
| 202 | bi->init=0; | 204 | bi->init=0; |
| 203 | bi->ptr=(char *)ctx; | 205 | bi->ptr=(char *)ctx; |
| 204 | bi->flags=0; | 206 | bi->flags=0; |
| @@ -208,6 +210,7 @@ static int ok_new(BIO *bi) | |||
| 208 | static int ok_free(BIO *a) | 210 | static int ok_free(BIO *a) |
| 209 | { | 211 | { |
| 210 | if (a == NULL) return(0); | 212 | if (a == NULL) return(0); |
| 213 | EVP_MD_CTX_cleanup(&((BIO_OK_CTX *)a->ptr)->md); | ||
| 211 | memset(a->ptr,0,sizeof(BIO_OK_CTX)); | 214 | memset(a->ptr,0,sizeof(BIO_OK_CTX)); |
| 212 | OPENSSL_free(a->ptr); | 215 | OPENSSL_free(a->ptr); |
| 213 | a->ptr=NULL; | 216 | a->ptr=NULL; |
| @@ -353,7 +356,7 @@ static long ok_ctrl(BIO *b, int cmd, long num, void *ptr) | |||
| 353 | long ret=1; | 356 | long ret=1; |
| 354 | int i; | 357 | int i; |
| 355 | 358 | ||
| 356 | ctx=(BIO_OK_CTX *)b->ptr; | 359 | ctx=b->ptr; |
| 357 | 360 | ||
| 358 | switch (cmd) | 361 | switch (cmd) |
| 359 | { | 362 | { |
| @@ -411,14 +414,14 @@ static long ok_ctrl(BIO *b, int cmd, long num, void *ptr) | |||
| 411 | ret=(long)ctx->cont; | 414 | ret=(long)ctx->cont; |
| 412 | break; | 415 | break; |
| 413 | case BIO_C_SET_MD: | 416 | case BIO_C_SET_MD: |
| 414 | md=(EVP_MD *)ptr; | 417 | md=ptr; |
| 415 | EVP_DigestInit(&(ctx->md),md); | 418 | EVP_DigestInit_ex(&ctx->md, md, NULL); |
| 416 | b->init=1; | 419 | b->init=1; |
| 417 | break; | 420 | break; |
| 418 | case BIO_C_GET_MD: | 421 | case BIO_C_GET_MD: |
| 419 | if (b->init) | 422 | if (b->init) |
| 420 | { | 423 | { |
| 421 | ppmd=(const EVP_MD **)ptr; | 424 | ppmd=ptr; |
| 422 | *ppmd=ctx->md.digest; | 425 | *ppmd=ctx->md.digest; |
| 423 | } | 426 | } |
| 424 | else | 427 | else |
| @@ -462,19 +465,22 @@ static void sig_out(BIO* b) | |||
| 462 | BIO_OK_CTX *ctx; | 465 | BIO_OK_CTX *ctx; |
| 463 | EVP_MD_CTX *md; | 466 | EVP_MD_CTX *md; |
| 464 | 467 | ||
| 465 | ctx=(BIO_OK_CTX *)b->ptr; | 468 | ctx=b->ptr; |
| 466 | md= &(ctx->md); | 469 | md=&ctx->md; |
| 467 | 470 | ||
| 468 | if(ctx->buf_len+ 2* md->digest->md_size > OK_BLOCK_SIZE) return; | 471 | if(ctx->buf_len+ 2* md->digest->md_size > OK_BLOCK_SIZE) return; |
| 469 | 472 | ||
| 470 | EVP_DigestInit(md, md->digest); | 473 | EVP_DigestInit_ex(md, md->digest, NULL); |
| 471 | RAND_pseudo_bytes(&(md->md.base[0]), md->digest->md_size); | 474 | /* FIXME: there's absolutely no guarantee this makes any sense at all, |
| 472 | memcpy(&(ctx->buf[ctx->buf_len]), &(md->md.base[0]), md->digest->md_size); | 475 | * particularly now EVP_MD_CTX has been restructured. |
| 476 | */ | ||
| 477 | RAND_pseudo_bytes(md->md_data, md->digest->md_size); | ||
| 478 | memcpy(&(ctx->buf[ctx->buf_len]), md->md_data, md->digest->md_size); | ||
| 473 | longswap(&(ctx->buf[ctx->buf_len]), md->digest->md_size); | 479 | longswap(&(ctx->buf[ctx->buf_len]), md->digest->md_size); |
| 474 | ctx->buf_len+= md->digest->md_size; | 480 | ctx->buf_len+= md->digest->md_size; |
| 475 | 481 | ||
| 476 | EVP_DigestUpdate(md, WELLKNOWN, strlen(WELLKNOWN)); | 482 | EVP_DigestUpdate(md, WELLKNOWN, strlen(WELLKNOWN)); |
| 477 | md->digest->final(&(ctx->buf[ctx->buf_len]), &(md->md.base[0])); | 483 | EVP_DigestFinal_ex(md, &(ctx->buf[ctx->buf_len]), NULL); |
| 478 | ctx->buf_len+= md->digest->md_size; | 484 | ctx->buf_len+= md->digest->md_size; |
| 479 | ctx->blockout= 1; | 485 | ctx->blockout= 1; |
| 480 | ctx->sigio= 0; | 486 | ctx->sigio= 0; |
| @@ -487,18 +493,18 @@ static void sig_in(BIO* b) | |||
| 487 | unsigned char tmp[EVP_MAX_MD_SIZE]; | 493 | unsigned char tmp[EVP_MAX_MD_SIZE]; |
| 488 | int ret= 0; | 494 | int ret= 0; |
| 489 | 495 | ||
| 490 | ctx=(BIO_OK_CTX *)b->ptr; | 496 | ctx=b->ptr; |
| 491 | md= &(ctx->md); | 497 | md=&ctx->md; |
| 492 | 498 | ||
| 493 | if(ctx->buf_len- ctx->buf_off < 2* md->digest->md_size) return; | 499 | if(ctx->buf_len- ctx->buf_off < 2* md->digest->md_size) return; |
| 494 | 500 | ||
| 495 | EVP_DigestInit(md, md->digest); | 501 | EVP_DigestInit_ex(md, md->digest, NULL); |
| 496 | memcpy(&(md->md.base[0]), &(ctx->buf[ctx->buf_off]), md->digest->md_size); | 502 | memcpy(md->md_data, &(ctx->buf[ctx->buf_off]), md->digest->md_size); |
| 497 | longswap(&(md->md.base[0]), md->digest->md_size); | 503 | longswap(md->md_data, md->digest->md_size); |
| 498 | ctx->buf_off+= md->digest->md_size; | 504 | ctx->buf_off+= md->digest->md_size; |
| 499 | 505 | ||
| 500 | EVP_DigestUpdate(md, WELLKNOWN, strlen(WELLKNOWN)); | 506 | EVP_DigestUpdate(md, WELLKNOWN, strlen(WELLKNOWN)); |
| 501 | md->digest->final(tmp, &(md->md.base[0])); | 507 | EVP_DigestFinal_ex(md, tmp, NULL); |
| 502 | ret= memcmp(&(ctx->buf[ctx->buf_off]), tmp, md->digest->md_size) == 0; | 508 | ret= memcmp(&(ctx->buf[ctx->buf_off]), tmp, md->digest->md_size) == 0; |
| 503 | ctx->buf_off+= md->digest->md_size; | 509 | ctx->buf_off+= md->digest->md_size; |
| 504 | if(ret == 1) | 510 | if(ret == 1) |
| @@ -523,15 +529,15 @@ static void block_out(BIO* b) | |||
| 523 | EVP_MD_CTX *md; | 529 | EVP_MD_CTX *md; |
| 524 | unsigned long tl; | 530 | unsigned long tl; |
| 525 | 531 | ||
| 526 | ctx=(BIO_OK_CTX *)b->ptr; | 532 | ctx=b->ptr; |
| 527 | md= &(ctx->md); | 533 | md=&ctx->md; |
| 528 | 534 | ||
| 529 | tl= ctx->buf_len- OK_BLOCK_BLOCK; | 535 | tl= ctx->buf_len- OK_BLOCK_BLOCK; |
| 530 | tl= swapem(tl); | 536 | tl= swapem(tl); |
| 531 | memcpy(ctx->buf, &tl, OK_BLOCK_BLOCK); | 537 | memcpy(ctx->buf, &tl, OK_BLOCK_BLOCK); |
| 532 | tl= swapem(tl); | 538 | tl= swapem(tl); |
| 533 | EVP_DigestUpdate(md, (unsigned char*) &(ctx->buf[OK_BLOCK_BLOCK]), tl); | 539 | EVP_DigestUpdate(md, (unsigned char*) &(ctx->buf[OK_BLOCK_BLOCK]), tl); |
| 534 | md->digest->final(&(ctx->buf[ctx->buf_len]), &(md->md.base[0])); | 540 | EVP_DigestFinal_ex(md, &(ctx->buf[ctx->buf_len]), NULL); |
| 535 | ctx->buf_len+= md->digest->md_size; | 541 | ctx->buf_len+= md->digest->md_size; |
| 536 | ctx->blockout= 1; | 542 | ctx->blockout= 1; |
| 537 | } | 543 | } |
| @@ -543,15 +549,15 @@ static void block_in(BIO* b) | |||
| 543 | long tl= 0; | 549 | long tl= 0; |
| 544 | unsigned char tmp[EVP_MAX_MD_SIZE]; | 550 | unsigned char tmp[EVP_MAX_MD_SIZE]; |
| 545 | 551 | ||
| 546 | ctx=(BIO_OK_CTX *)b->ptr; | 552 | ctx=b->ptr; |
| 547 | md= &(ctx->md); | 553 | md=&ctx->md; |
| 548 | 554 | ||
| 549 | memcpy(&tl, ctx->buf, OK_BLOCK_BLOCK); | 555 | memcpy(&tl, ctx->buf, OK_BLOCK_BLOCK); |
| 550 | tl= swapem(tl); | 556 | tl= swapem(tl); |
| 551 | if (ctx->buf_len < tl+ OK_BLOCK_BLOCK+ md->digest->md_size) return; | 557 | if (ctx->buf_len < tl+ OK_BLOCK_BLOCK+ md->digest->md_size) return; |
| 552 | 558 | ||
| 553 | EVP_DigestUpdate(md, (unsigned char*) &(ctx->buf[OK_BLOCK_BLOCK]), tl); | 559 | EVP_DigestUpdate(md, (unsigned char*) &(ctx->buf[OK_BLOCK_BLOCK]), tl); |
| 554 | md->digest->final(tmp, &(md->md.base[0])); | 560 | EVP_DigestFinal_ex(md, tmp, NULL); |
| 555 | if(memcmp(&(ctx->buf[tl+ OK_BLOCK_BLOCK]), tmp, md->digest->md_size) == 0) | 561 | if(memcmp(&(ctx->buf[tl+ OK_BLOCK_BLOCK]), tmp, md->digest->md_size) == 0) |
| 556 | { | 562 | { |
| 557 | /* there might be parts from next block lurking around ! */ | 563 | /* there might be parts from next block lurking around ! */ |
diff --git a/src/lib/libcrypto/evp/c_all.c b/src/lib/libcrypto/evp/c_all.c index 1e185830a3..3d390dfbf1 100644 --- a/src/lib/libcrypto/evp/c_all.c +++ b/src/lib/libcrypto/evp/c_all.c | |||
| @@ -60,8 +60,16 @@ | |||
| 60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
| 61 | #include <openssl/evp.h> | 61 | #include <openssl/evp.h> |
| 62 | 62 | ||
| 63 | #undef OpenSSL_add_all_algorithms | ||
| 64 | |||
| 63 | void OpenSSL_add_all_algorithms(void) | 65 | void OpenSSL_add_all_algorithms(void) |
| 64 | { | 66 | { |
| 67 | OPENSSL_add_all_algorithms_noconf(); | ||
| 68 | } | ||
| 69 | |||
| 70 | void OPENSSL_add_all_algorithms_noconf(void) | ||
| 71 | { | ||
| 65 | OpenSSL_add_all_ciphers(); | 72 | OpenSSL_add_all_ciphers(); |
| 66 | OpenSSL_add_all_digests(); | 73 | OpenSSL_add_all_digests(); |
| 67 | } | 74 | ENGINE_setup_openbsd(); |
| 75 | } | ||
diff --git a/src/lib/libcrypto/evp/c_allc.c b/src/lib/libcrypto/evp/c_allc.c index f24d3756c9..37e6ab83a5 100644 --- a/src/lib/libcrypto/evp/c_allc.c +++ b/src/lib/libcrypto/evp/c_allc.c | |||
| @@ -64,7 +64,8 @@ | |||
| 64 | 64 | ||
| 65 | void OpenSSL_add_all_ciphers(void) | 65 | void OpenSSL_add_all_ciphers(void) |
| 66 | { | 66 | { |
| 67 | #ifndef NO_DES | 67 | |
| 68 | #ifndef OPENSSL_NO_DES | ||
| 68 | EVP_add_cipher(EVP_des_cfb()); | 69 | EVP_add_cipher(EVP_des_cfb()); |
| 69 | EVP_add_cipher(EVP_des_ede_cfb()); | 70 | EVP_add_cipher(EVP_des_ede_cfb()); |
| 70 | EVP_add_cipher(EVP_des_ede3_cfb()); | 71 | EVP_add_cipher(EVP_des_ede3_cfb()); |
| @@ -90,12 +91,12 @@ void OpenSSL_add_all_ciphers(void) | |||
| 90 | EVP_add_cipher(EVP_des_ede3()); | 91 | EVP_add_cipher(EVP_des_ede3()); |
| 91 | #endif | 92 | #endif |
| 92 | 93 | ||
| 93 | #ifndef NO_RC4 | 94 | #ifndef OPENSSL_NO_RC4 |
| 94 | EVP_add_cipher(EVP_rc4()); | 95 | EVP_add_cipher(EVP_rc4()); |
| 95 | EVP_add_cipher(EVP_rc4_40()); | 96 | EVP_add_cipher(EVP_rc4_40()); |
| 96 | #endif | 97 | #endif |
| 97 | 98 | ||
| 98 | #ifndef NO_IDEA | 99 | #ifndef OPENSSL_NO_IDEA |
| 99 | EVP_add_cipher(EVP_idea_ecb()); | 100 | EVP_add_cipher(EVP_idea_ecb()); |
| 100 | EVP_add_cipher(EVP_idea_cfb()); | 101 | EVP_add_cipher(EVP_idea_cfb()); |
| 101 | EVP_add_cipher(EVP_idea_ofb()); | 102 | EVP_add_cipher(EVP_idea_ofb()); |
| @@ -104,7 +105,7 @@ void OpenSSL_add_all_ciphers(void) | |||
| 104 | EVP_add_cipher_alias(SN_idea_cbc,"idea"); | 105 | EVP_add_cipher_alias(SN_idea_cbc,"idea"); |
| 105 | #endif | 106 | #endif |
| 106 | 107 | ||
| 107 | #ifndef NO_RC2 | 108 | #ifndef OPENSSL_NO_RC2 |
| 108 | EVP_add_cipher(EVP_rc2_ecb()); | 109 | EVP_add_cipher(EVP_rc2_ecb()); |
| 109 | EVP_add_cipher(EVP_rc2_cfb()); | 110 | EVP_add_cipher(EVP_rc2_cfb()); |
| 110 | EVP_add_cipher(EVP_rc2_ofb()); | 111 | EVP_add_cipher(EVP_rc2_ofb()); |
| @@ -115,7 +116,7 @@ void OpenSSL_add_all_ciphers(void) | |||
| 115 | EVP_add_cipher_alias(SN_rc2_cbc,"rc2"); | 116 | EVP_add_cipher_alias(SN_rc2_cbc,"rc2"); |
| 116 | #endif | 117 | #endif |
| 117 | 118 | ||
| 118 | #ifndef NO_BF | 119 | #ifndef OPENSSL_NO_BF |
| 119 | EVP_add_cipher(EVP_bf_ecb()); | 120 | EVP_add_cipher(EVP_bf_ecb()); |
| 120 | EVP_add_cipher(EVP_bf_cfb()); | 121 | EVP_add_cipher(EVP_bf_cfb()); |
| 121 | EVP_add_cipher(EVP_bf_ofb()); | 122 | EVP_add_cipher(EVP_bf_ofb()); |
| @@ -125,7 +126,7 @@ void OpenSSL_add_all_ciphers(void) | |||
| 125 | EVP_add_cipher_alias(SN_bf_cbc,"blowfish"); | 126 | EVP_add_cipher_alias(SN_bf_cbc,"blowfish"); |
| 126 | #endif | 127 | #endif |
| 127 | 128 | ||
| 128 | #ifndef NO_CAST | 129 | #ifndef OPENSSL_NO_CAST |
| 129 | EVP_add_cipher(EVP_cast5_ecb()); | 130 | EVP_add_cipher(EVP_cast5_ecb()); |
| 130 | EVP_add_cipher(EVP_cast5_cfb()); | 131 | EVP_add_cipher(EVP_cast5_cfb()); |
| 131 | EVP_add_cipher(EVP_cast5_ofb()); | 132 | EVP_add_cipher(EVP_cast5_ofb()); |
| @@ -136,7 +137,7 @@ void OpenSSL_add_all_ciphers(void) | |||
| 136 | EVP_add_cipher_alias(SN_cast5_cbc,"cast-cbc"); | 137 | EVP_add_cipher_alias(SN_cast5_cbc,"cast-cbc"); |
| 137 | #endif | 138 | #endif |
| 138 | 139 | ||
| 139 | #ifndef NO_RC5 | 140 | #ifndef OPENSSL_NO_RC5 |
| 140 | EVP_add_cipher(EVP_rc5_32_12_16_ecb()); | 141 | EVP_add_cipher(EVP_rc5_32_12_16_ecb()); |
| 141 | EVP_add_cipher(EVP_rc5_32_12_16_cfb()); | 142 | EVP_add_cipher(EVP_rc5_32_12_16_cfb()); |
| 142 | EVP_add_cipher(EVP_rc5_32_12_16_ofb()); | 143 | EVP_add_cipher(EVP_rc5_32_12_16_ofb()); |
| @@ -144,6 +145,21 @@ void OpenSSL_add_all_ciphers(void) | |||
| 144 | EVP_add_cipher_alias(SN_rc5_cbc,"rc5"); | 145 | EVP_add_cipher_alias(SN_rc5_cbc,"rc5"); |
| 145 | EVP_add_cipher_alias(SN_rc5_cbc,"RC5"); | 146 | EVP_add_cipher_alias(SN_rc5_cbc,"RC5"); |
| 146 | #endif | 147 | #endif |
| 148 | |||
| 149 | #ifndef OPENSSL_NO_AES | ||
| 150 | EVP_add_cipher(EVP_aes_128_ecb()); | ||
| 151 | EVP_add_cipher(EVP_aes_128_cbc()); | ||
| 152 | EVP_add_cipher_alias(SN_aes_128_cbc,"AES128"); | ||
| 153 | EVP_add_cipher_alias(SN_aes_128_cbc,"aes128"); | ||
| 154 | EVP_add_cipher(EVP_aes_192_ecb()); | ||
| 155 | EVP_add_cipher(EVP_aes_192_cbc()); | ||
| 156 | EVP_add_cipher_alias(SN_aes_192_cbc,"AES192"); | ||
| 157 | EVP_add_cipher_alias(SN_aes_192_cbc,"aes192"); | ||
| 158 | EVP_add_cipher(EVP_aes_256_ecb()); | ||
| 159 | EVP_add_cipher(EVP_aes_256_cbc()); | ||
| 160 | EVP_add_cipher_alias(SN_aes_256_cbc,"AES256"); | ||
| 161 | EVP_add_cipher_alias(SN_aes_256_cbc,"aes256"); | ||
| 162 | #endif | ||
| 147 | PKCS12_PBE_add(); | 163 | PKCS12_PBE_add(); |
| 148 | PKCS5_PBE_add(); | 164 | PKCS5_PBE_add(); |
| 149 | } | 165 | } |
diff --git a/src/lib/libcrypto/evp/c_alld.c b/src/lib/libcrypto/evp/c_alld.c index bbf059eb85..be91cdb037 100644 --- a/src/lib/libcrypto/evp/c_alld.c +++ b/src/lib/libcrypto/evp/c_alld.c | |||
| @@ -64,38 +64,38 @@ | |||
| 64 | 64 | ||
| 65 | void OpenSSL_add_all_digests(void) | 65 | void OpenSSL_add_all_digests(void) |
| 66 | { | 66 | { |
| 67 | #ifndef NO_MD2 | 67 | #ifndef OPENSSL_NO_MD2 |
| 68 | EVP_add_digest(EVP_md2()); | 68 | EVP_add_digest(EVP_md2()); |
| 69 | #endif | 69 | #endif |
| 70 | #ifndef NO_MD4 | 70 | #ifndef OPENSSL_NO_MD4 |
| 71 | EVP_add_digest(EVP_md4()); | 71 | EVP_add_digest(EVP_md4()); |
| 72 | #endif | 72 | #endif |
| 73 | #ifndef NO_MD5 | 73 | #ifndef OPENSSL_NO_MD5 |
| 74 | EVP_add_digest(EVP_md5()); | 74 | EVP_add_digest(EVP_md5()); |
| 75 | EVP_add_digest_alias(SN_md5,"ssl2-md5"); | 75 | EVP_add_digest_alias(SN_md5,"ssl2-md5"); |
| 76 | EVP_add_digest_alias(SN_md5,"ssl3-md5"); | 76 | EVP_add_digest_alias(SN_md5,"ssl3-md5"); |
| 77 | #endif | 77 | #endif |
| 78 | #ifndef NO_SHA | 78 | #ifndef OPENSSL_NO_SHA |
| 79 | EVP_add_digest(EVP_sha()); | 79 | EVP_add_digest(EVP_sha()); |
| 80 | #ifndef NO_DSA | 80 | #ifndef OPENSSL_NO_DSA |
| 81 | EVP_add_digest(EVP_dss()); | 81 | EVP_add_digest(EVP_dss()); |
| 82 | #endif | 82 | #endif |
| 83 | #endif | 83 | #endif |
| 84 | #ifndef NO_SHA | 84 | #ifndef OPENSSL_NO_SHA |
| 85 | EVP_add_digest(EVP_sha1()); | 85 | EVP_add_digest(EVP_sha1()); |
| 86 | EVP_add_digest_alias(SN_sha1,"ssl3-sha1"); | 86 | EVP_add_digest_alias(SN_sha1,"ssl3-sha1"); |
| 87 | EVP_add_digest_alias(SN_sha1WithRSAEncryption,SN_sha1WithRSA); | 87 | EVP_add_digest_alias(SN_sha1WithRSAEncryption,SN_sha1WithRSA); |
| 88 | #ifndef NO_DSA | 88 | #ifndef OPENSSL_NO_DSA |
| 89 | EVP_add_digest(EVP_dss1()); | 89 | EVP_add_digest(EVP_dss1()); |
| 90 | EVP_add_digest_alias(SN_dsaWithSHA1,SN_dsaWithSHA1_2); | 90 | EVP_add_digest_alias(SN_dsaWithSHA1,SN_dsaWithSHA1_2); |
| 91 | EVP_add_digest_alias(SN_dsaWithSHA1,"DSS1"); | 91 | EVP_add_digest_alias(SN_dsaWithSHA1,"DSS1"); |
| 92 | EVP_add_digest_alias(SN_dsaWithSHA1,"dss1"); | 92 | EVP_add_digest_alias(SN_dsaWithSHA1,"dss1"); |
| 93 | #endif | 93 | #endif |
| 94 | #endif | 94 | #endif |
| 95 | #if !defined(NO_MDC2) && !defined(NO_DES) | 95 | #if !defined(OPENSSL_NO_MDC2) && !defined(OPENSSL_NO_DES) |
| 96 | EVP_add_digest(EVP_mdc2()); | 96 | EVP_add_digest(EVP_mdc2()); |
| 97 | #endif | 97 | #endif |
| 98 | #ifndef NO_RIPEMD | 98 | #ifndef OPENSSL_NO_RIPEMD |
| 99 | EVP_add_digest(EVP_ripemd160()); | 99 | EVP_add_digest(EVP_ripemd160()); |
| 100 | EVP_add_digest_alias(SN_ripemd160,"ripemd"); | 100 | EVP_add_digest_alias(SN_ripemd160,"ripemd"); |
| 101 | EVP_add_digest_alias(SN_ripemd160,"rmd160"); | 101 | EVP_add_digest_alias(SN_ripemd160,"rmd160"); |
diff --git a/src/lib/libcrypto/evp/digest.c b/src/lib/libcrypto/evp/digest.c index c560733568..a969ac69ed 100644 --- a/src/lib/libcrypto/evp/digest.c +++ b/src/lib/libcrypto/evp/digest.c | |||
| @@ -55,38 +55,258 @@ | |||
| 55 | * copied and put under another distribution licence | 55 | * copied and put under another distribution licence |
| 56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
| 57 | */ | 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 | */ | ||
| 58 | 111 | ||
| 59 | #include <stdio.h> | 112 | #include <stdio.h> |
| 60 | #include "cryptlib.h" | 113 | #include "cryptlib.h" |
| 61 | #include <openssl/objects.h> | 114 | #include <openssl/objects.h> |
| 62 | #include <openssl/evp.h> | 115 | #include <openssl/evp.h> |
| 116 | #include <openssl/engine.h> | ||
| 117 | |||
| 118 | void EVP_MD_CTX_init(EVP_MD_CTX *ctx) | ||
| 119 | { | ||
| 120 | memset(ctx,'\0',sizeof *ctx); | ||
| 121 | } | ||
| 122 | |||
| 123 | EVP_MD_CTX *EVP_MD_CTX_create(void) | ||
| 124 | { | ||
| 125 | EVP_MD_CTX *ctx=OPENSSL_malloc(sizeof *ctx); | ||
| 126 | |||
| 127 | EVP_MD_CTX_init(ctx); | ||
| 128 | |||
| 129 | return ctx; | ||
| 130 | } | ||
| 131 | |||
| 132 | int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type) | ||
| 133 | { | ||
| 134 | EVP_MD_CTX_init(ctx); | ||
| 135 | return EVP_DigestInit_ex(ctx, type, NULL); | ||
| 136 | } | ||
| 63 | 137 | ||
| 64 | void EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type) | 138 | int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl) |
| 65 | { | 139 | { |
| 66 | ctx->digest=type; | 140 | EVP_MD_CTX_clear_flags(ctx,EVP_MD_CTX_FLAG_CLEANED); |
| 67 | type->init(&(ctx->md)); | 141 | /* Whether it's nice or not, "Inits" can be used on "Final"'d contexts |
| 142 | * so this context may already have an ENGINE! Try to avoid releasing | ||
| 143 | * the previous handle, re-querying for an ENGINE, and having a | ||
| 144 | * reinitialisation, when it may all be unecessary. */ | ||
| 145 | if (ctx->engine && ctx->digest && (!type || | ||
| 146 | (type && (type->type == ctx->digest->type)))) | ||
| 147 | goto skip_to_init; | ||
| 148 | if (type) | ||
| 149 | { | ||
| 150 | /* Ensure an ENGINE left lying around from last time is cleared | ||
| 151 | * (the previous check attempted to avoid this if the same | ||
| 152 | * ENGINE and EVP_MD could be used). */ | ||
| 153 | if(ctx->engine) | ||
| 154 | ENGINE_finish(ctx->engine); | ||
| 155 | if(impl) | ||
| 156 | { | ||
| 157 | if (!ENGINE_init(impl)) | ||
| 158 | { | ||
| 159 | EVPerr(EVP_F_EVP_DIGESTINIT, EVP_R_INITIALIZATION_ERROR); | ||
| 160 | return 0; | ||
| 161 | } | ||
| 162 | } | ||
| 163 | else | ||
| 164 | /* Ask if an ENGINE is reserved for this job */ | ||
| 165 | impl = ENGINE_get_digest_engine(type->type); | ||
| 166 | if(impl) | ||
| 167 | { | ||
| 168 | /* There's an ENGINE for this job ... (apparently) */ | ||
| 169 | const EVP_MD *d = ENGINE_get_digest(impl, type->type); | ||
| 170 | if(!d) | ||
| 171 | { | ||
| 172 | /* Same comment from evp_enc.c */ | ||
| 173 | EVPerr(EVP_F_EVP_DIGESTINIT, EVP_R_INITIALIZATION_ERROR); | ||
| 174 | return 0; | ||
| 175 | } | ||
| 176 | /* We'll use the ENGINE's private digest definition */ | ||
| 177 | type = d; | ||
| 178 | /* Store the ENGINE functional reference so we know | ||
| 179 | * 'type' came from an ENGINE and we need to release | ||
| 180 | * it when done. */ | ||
| 181 | ctx->engine = impl; | ||
| 182 | } | ||
| 183 | else | ||
| 184 | ctx->engine = NULL; | ||
| 185 | } | ||
| 186 | else if(!ctx->digest) | ||
| 187 | { | ||
| 188 | EVPerr(EVP_F_EVP_DIGESTINIT, EVP_R_NO_DIGEST_SET); | ||
| 189 | return 0; | ||
| 190 | } | ||
| 191 | if (ctx->digest != type) | ||
| 192 | { | ||
| 193 | if (ctx->digest && ctx->digest->ctx_size) | ||
| 194 | OPENSSL_free(ctx->md_data); | ||
| 195 | ctx->digest=type; | ||
| 196 | if (type->ctx_size) | ||
| 197 | ctx->md_data=OPENSSL_malloc(type->ctx_size); | ||
| 198 | } | ||
| 199 | skip_to_init: | ||
| 200 | return ctx->digest->init(ctx); | ||
| 68 | } | 201 | } |
| 69 | 202 | ||
| 70 | void EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *data, | 203 | int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *data, |
| 71 | unsigned int count) | 204 | unsigned int count) |
| 72 | { | 205 | { |
| 73 | ctx->digest->update(&(ctx->md.base[0]),data,(unsigned long)count); | 206 | return ctx->digest->update(ctx,data,(unsigned long)count); |
| 207 | } | ||
| 208 | |||
| 209 | /* The caller can assume that this removes any secret data from the context */ | ||
| 210 | int EVP_DigestFinal(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *size) | ||
| 211 | { | ||
| 212 | int ret; | ||
| 213 | ret = EVP_DigestFinal_ex(ctx, md, size); | ||
| 214 | EVP_MD_CTX_cleanup(ctx); | ||
| 215 | return ret; | ||
| 74 | } | 216 | } |
| 75 | 217 | ||
| 76 | void EVP_DigestFinal(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *size) | 218 | /* The caller can assume that this removes any secret data from the context */ |
| 219 | int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *size) | ||
| 77 | { | 220 | { |
| 78 | ctx->digest->final(md,&(ctx->md.base[0])); | 221 | int ret; |
| 222 | ret=ctx->digest->final(ctx,md); | ||
| 79 | if (size != NULL) | 223 | if (size != NULL) |
| 80 | *size=ctx->digest->md_size; | 224 | *size=ctx->digest->md_size; |
| 81 | memset(&(ctx->md),0,sizeof(ctx->md)); | 225 | if (ctx->digest->cleanup) |
| 226 | { | ||
| 227 | ctx->digest->cleanup(ctx); | ||
| 228 | EVP_MD_CTX_set_flags(ctx,EVP_MD_CTX_FLAG_CLEANED); | ||
| 229 | } | ||
| 230 | memset(ctx->md_data,0,ctx->digest->ctx_size); | ||
| 231 | return ret; | ||
| 232 | } | ||
| 233 | |||
| 234 | int EVP_MD_CTX_copy(EVP_MD_CTX *out, const EVP_MD_CTX *in) | ||
| 235 | { | ||
| 236 | EVP_MD_CTX_init(out); | ||
| 237 | return EVP_MD_CTX_copy_ex(out, in); | ||
| 238 | } | ||
| 239 | |||
| 240 | int EVP_MD_CTX_copy_ex(EVP_MD_CTX *out, const EVP_MD_CTX *in) | ||
| 241 | { | ||
| 242 | if ((in == NULL) || (in->digest == NULL)) | ||
| 243 | { | ||
| 244 | EVPerr(EVP_F_EVP_MD_CTX_COPY,EVP_R_INPUT_NOT_INITIALIZED); | ||
| 245 | return 0; | ||
| 246 | } | ||
| 247 | /* Make sure it's safe to copy a digest context using an ENGINE */ | ||
| 248 | if (in->engine && !ENGINE_init(in->engine)) | ||
| 249 | { | ||
| 250 | EVPerr(EVP_F_EVP_MD_CTX_COPY,ERR_R_ENGINE_LIB); | ||
| 251 | return 0; | ||
| 252 | } | ||
| 253 | |||
| 254 | EVP_MD_CTX_cleanup(out); | ||
| 255 | memcpy(out,in,sizeof *out); | ||
| 256 | |||
| 257 | if (out->digest->ctx_size) | ||
| 258 | { | ||
| 259 | out->md_data=OPENSSL_malloc(out->digest->ctx_size); | ||
| 260 | memcpy(out->md_data,in->md_data,out->digest->ctx_size); | ||
| 261 | } | ||
| 262 | |||
| 263 | if (out->digest->copy) | ||
| 264 | return out->digest->copy(out,in); | ||
| 265 | |||
| 266 | return 1; | ||
| 267 | } | ||
| 268 | |||
| 269 | int EVP_Digest(void *data, unsigned int count, | ||
| 270 | unsigned char *md, unsigned int *size, const EVP_MD *type, ENGINE *impl) | ||
| 271 | { | ||
| 272 | EVP_MD_CTX ctx; | ||
| 273 | int ret; | ||
| 274 | |||
| 275 | EVP_MD_CTX_init(&ctx); | ||
| 276 | EVP_MD_CTX_set_flags(&ctx,EVP_MD_CTX_FLAG_ONESHOT); | ||
| 277 | ret=EVP_DigestInit_ex(&ctx, type, impl) | ||
| 278 | && EVP_DigestUpdate(&ctx, data, count) | ||
| 279 | && EVP_DigestFinal_ex(&ctx, md, size); | ||
| 280 | EVP_MD_CTX_cleanup(&ctx); | ||
| 281 | |||
| 282 | return ret; | ||
| 82 | } | 283 | } |
| 83 | 284 | ||
| 84 | int EVP_MD_CTX_copy(EVP_MD_CTX *out, EVP_MD_CTX *in) | 285 | void EVP_MD_CTX_destroy(EVP_MD_CTX *ctx) |
| 85 | { | 286 | { |
| 86 | if ((in == NULL) || (in->digest == NULL)) { | 287 | EVP_MD_CTX_cleanup(ctx); |
| 87 | EVPerr(EVP_F_EVP_MD_CTX_COPY,EVP_R_INPUT_NOT_INITIALIZED); | 288 | OPENSSL_free(ctx); |
| 88 | return 0; | 289 | } |
| 89 | } | 290 | |
| 90 | memcpy((char *)out,(char *)in,in->digest->ctx_size); | 291 | /* This call frees resources associated with the context */ |
| 91 | return 1; | 292 | int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx) |
| 92 | } | 293 | { |
| 294 | /* Don't assume ctx->md_data was cleaned in EVP_Digest_Final, | ||
| 295 | * because sometimes only copies of the context are ever finalised. | ||
| 296 | */ | ||
| 297 | if (ctx->digest && ctx->digest->cleanup | ||
| 298 | && !EVP_MD_CTX_test_flags(ctx,EVP_MD_CTX_FLAG_CLEANED)) | ||
| 299 | ctx->digest->cleanup(ctx); | ||
| 300 | if (ctx->digest && ctx->digest->ctx_size && ctx->md_data) | ||
| 301 | { | ||
| 302 | memset(ctx->md_data,0,ctx->digest->ctx_size); | ||
| 303 | OPENSSL_free(ctx->md_data); | ||
| 304 | } | ||
| 305 | if(ctx->engine) | ||
| 306 | /* The EVP_MD we used belongs to an ENGINE, release the | ||
| 307 | * functional reference we held for this reason. */ | ||
| 308 | ENGINE_finish(ctx->engine); | ||
| 309 | memset(ctx,'\0',sizeof *ctx); | ||
| 310 | |||
| 311 | return 1; | ||
| 312 | } | ||
diff --git a/src/lib/libcrypto/evp/e_aes.c b/src/lib/libcrypto/evp/e_aes.c new file mode 100644 index 0000000000..9d03a9602f --- /dev/null +++ b/src/lib/libcrypto/evp/e_aes.c | |||
| @@ -0,0 +1,99 @@ | |||
| 1 | /* ==================================================================== | ||
| 2 | * Copyright (c) 2001 The OpenSSL Project. All rights reserved. | ||
| 3 | * | ||
| 4 | * Redistribution and use in source and binary forms, with or without | ||
| 5 | * modification, are permitted provided that the following conditions | ||
| 6 | * are met: | ||
| 7 | * | ||
| 8 | * 1. Redistributions of source code must retain the above copyright | ||
| 9 | * notice, this list of conditions and the following disclaimer. | ||
| 10 | * | ||
| 11 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 12 | * notice, this list of conditions and the following disclaimer in | ||
| 13 | * the documentation and/or other materials provided with the | ||
| 14 | * distribution. | ||
| 15 | * | ||
| 16 | * 3. All advertising materials mentioning features or use of this | ||
| 17 | * software must display the following acknowledgment: | ||
| 18 | * "This product includes software developed by the OpenSSL Project | ||
| 19 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
| 20 | * | ||
| 21 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
| 22 | * endorse or promote products derived from this software without | ||
| 23 | * prior written permission. For written permission, please contact | ||
| 24 | * openssl-core@openssl.org. | ||
| 25 | * | ||
| 26 | * 5. Products derived from this software may not be called "OpenSSL" | ||
| 27 | * nor may "OpenSSL" appear in their names without prior written | ||
| 28 | * permission of the OpenSSL Project. | ||
| 29 | * | ||
| 30 | * 6. Redistributions of any form whatsoever must retain the following | ||
| 31 | * acknowledgment: | ||
| 32 | * "This product includes software developed by the OpenSSL Project | ||
| 33 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
| 34 | * | ||
| 35 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
| 36 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 37 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
| 38 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
| 39 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| 40 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
| 41 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
| 42 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 43 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
| 44 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
| 45 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
| 46 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 47 | * ==================================================================== | ||
| 48 | * | ||
| 49 | */ | ||
| 50 | |||
| 51 | #ifndef OPENSSL_NO_AES | ||
| 52 | #include <openssl/evp.h> | ||
| 53 | #include <openssl/err.h> | ||
| 54 | #include <string.h> | ||
| 55 | #include <assert.h> | ||
| 56 | #include <openssl/aes.h> | ||
| 57 | #include "evp_locl.h" | ||
| 58 | |||
| 59 | static int aes_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | ||
| 60 | const unsigned char *iv, int enc); | ||
| 61 | |||
| 62 | typedef struct | ||
| 63 | { | ||
| 64 | AES_KEY ks; | ||
| 65 | } EVP_AES_KEY; | ||
| 66 | |||
| 67 | #define data(ctx) EVP_C_DATA(EVP_AES_KEY,ctx) | ||
| 68 | |||
| 69 | IMPLEMENT_BLOCK_CIPHER(aes_128, ks, AES, EVP_AES_KEY, | ||
| 70 | NID_aes_128, 16, 16, 16, 128, | ||
| 71 | 0, aes_init_key, NULL, | ||
| 72 | EVP_CIPHER_set_asn1_iv, | ||
| 73 | EVP_CIPHER_get_asn1_iv, | ||
| 74 | NULL) | ||
| 75 | IMPLEMENT_BLOCK_CIPHER(aes_192, ks, AES, EVP_AES_KEY, | ||
| 76 | NID_aes_192, 16, 24, 16, 128, | ||
| 77 | 0, aes_init_key, NULL, | ||
| 78 | EVP_CIPHER_set_asn1_iv, | ||
| 79 | EVP_CIPHER_get_asn1_iv, | ||
| 80 | NULL) | ||
| 81 | IMPLEMENT_BLOCK_CIPHER(aes_256, ks, AES, EVP_AES_KEY, | ||
| 82 | NID_aes_256, 16, 32, 16, 128, | ||
| 83 | 0, aes_init_key, NULL, | ||
| 84 | EVP_CIPHER_set_asn1_iv, | ||
| 85 | EVP_CIPHER_get_asn1_iv, | ||
| 86 | NULL) | ||
| 87 | |||
| 88 | static int aes_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | ||
| 89 | const unsigned char *iv, int enc) { | ||
| 90 | |||
| 91 | if (enc) | ||
| 92 | AES_set_encrypt_key(key, ctx->key_len * 8, ctx->cipher_data); | ||
| 93 | else | ||
| 94 | AES_set_decrypt_key(key, ctx->key_len * 8, ctx->cipher_data); | ||
| 95 | |||
| 96 | return 1; | ||
| 97 | } | ||
| 98 | |||
| 99 | #endif | ||
diff --git a/src/lib/libcrypto/evp/e_bf.c b/src/lib/libcrypto/evp/e_bf.c index 53559b0b65..e74337567b 100644 --- a/src/lib/libcrypto/evp/e_bf.c +++ b/src/lib/libcrypto/evp/e_bf.c | |||
| @@ -56,24 +56,32 @@ | |||
| 56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
| 57 | */ | 57 | */ |
| 58 | 58 | ||
| 59 | #ifndef NO_BF | 59 | #ifndef OPENSSL_NO_BF |
| 60 | #include <stdio.h> | 60 | #include <stdio.h> |
| 61 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
| 62 | #include <openssl/evp.h> | 62 | #include <openssl/evp.h> |
| 63 | #include "evp_locl.h" | 63 | #include "evp_locl.h" |
| 64 | #include <openssl/objects.h> | 64 | #include <openssl/objects.h> |
| 65 | #include <openssl/blowfish.h> | ||
| 65 | 66 | ||
| 66 | static int bf_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | 67 | static int bf_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, |
| 67 | const unsigned char *iv, int enc); | 68 | const unsigned char *iv, int enc); |
| 68 | 69 | ||
| 69 | IMPLEMENT_BLOCK_CIPHER(bf, bf_ks, BF, bf_ks, NID_bf, 8, 16, 8, | 70 | typedef struct |
| 71 | { | ||
| 72 | BF_KEY ks; | ||
| 73 | } EVP_BF_KEY; | ||
| 74 | |||
| 75 | #define data(ctx) EVP_C_DATA(EVP_BF_KEY,ctx) | ||
| 76 | |||
| 77 | IMPLEMENT_BLOCK_CIPHER(bf, ks, BF, EVP_BF_KEY, NID_bf, 8, 16, 8, 64, | ||
| 70 | EVP_CIPH_VARIABLE_LENGTH, bf_init_key, NULL, | 78 | EVP_CIPH_VARIABLE_LENGTH, bf_init_key, NULL, |
| 71 | EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, NULL) | 79 | EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, NULL) |
| 72 | 80 | ||
| 73 | static int bf_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | 81 | static int bf_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, |
| 74 | const unsigned char *iv, int enc) | 82 | const unsigned char *iv, int enc) |
| 75 | { | 83 | { |
| 76 | BF_set_key(&(ctx->c.bf_ks),EVP_CIPHER_CTX_key_length(ctx),key); | 84 | BF_set_key(&data(ctx)->ks,EVP_CIPHER_CTX_key_length(ctx),key); |
| 77 | return 1; | 85 | return 1; |
| 78 | } | 86 | } |
| 79 | 87 | ||
diff --git a/src/lib/libcrypto/evp/e_cast.c b/src/lib/libcrypto/evp/e_cast.c index e5af7fb4ed..3400fef187 100644 --- a/src/lib/libcrypto/evp/e_cast.c +++ b/src/lib/libcrypto/evp/e_cast.c | |||
| @@ -56,26 +56,34 @@ | |||
| 56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
| 57 | */ | 57 | */ |
| 58 | 58 | ||
| 59 | #ifndef NO_CAST | 59 | #ifndef OPENSSL_NO_CAST |
| 60 | 60 | ||
| 61 | #include <stdio.h> | 61 | #include <stdio.h> |
| 62 | #include "cryptlib.h" | 62 | #include "cryptlib.h" |
| 63 | #include <openssl/evp.h> | 63 | #include <openssl/evp.h> |
| 64 | #include <openssl/objects.h> | 64 | #include <openssl/objects.h> |
| 65 | #include "evp_locl.h" | 65 | #include "evp_locl.h" |
| 66 | #include <openssl/cast.h> | ||
| 66 | 67 | ||
| 67 | static int cast_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | 68 | static int cast_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, |
| 68 | const unsigned char *iv,int enc); | 69 | const unsigned char *iv,int enc); |
| 69 | 70 | ||
| 70 | IMPLEMENT_BLOCK_CIPHER(cast5, cast_ks, CAST, cast_ks, | 71 | typedef struct |
| 71 | NID_cast5, 8, EVP_CAST5_KEY_SIZE, 8, | 72 | { |
| 73 | CAST_KEY ks; | ||
| 74 | } EVP_CAST_KEY; | ||
| 75 | |||
| 76 | #define data(ctx) EVP_C_DATA(EVP_CAST_KEY,ctx) | ||
| 77 | |||
| 78 | IMPLEMENT_BLOCK_CIPHER(cast5, ks, CAST, EVP_CAST_KEY, | ||
| 79 | NID_cast5, 8, CAST_KEY_LENGTH, 8, 64, | ||
| 72 | EVP_CIPH_VARIABLE_LENGTH, cast_init_key, NULL, | 80 | EVP_CIPH_VARIABLE_LENGTH, cast_init_key, NULL, |
| 73 | EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, NULL) | 81 | EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, NULL) |
| 74 | 82 | ||
| 75 | static int cast_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | 83 | static int cast_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, |
| 76 | const unsigned char *iv, int enc) | 84 | const unsigned char *iv, int enc) |
| 77 | { | 85 | { |
| 78 | CAST_set_key(&(ctx->c.cast_ks),EVP_CIPHER_CTX_key_length(ctx),key); | 86 | CAST_set_key(&data(ctx)->ks,EVP_CIPHER_CTX_key_length(ctx),key); |
| 79 | return 1; | 87 | return 1; |
| 80 | } | 88 | } |
| 81 | 89 | ||
diff --git a/src/lib/libcrypto/evp/e_des.c b/src/lib/libcrypto/evp/e_des.c index f4e998b81c..105266a4b3 100644 --- a/src/lib/libcrypto/evp/e_des.c +++ b/src/lib/libcrypto/evp/e_des.c | |||
| @@ -56,12 +56,13 @@ | |||
| 56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
| 57 | */ | 57 | */ |
| 58 | 58 | ||
| 59 | #ifndef NO_DES | 59 | #ifndef OPENSSL_NO_DES |
| 60 | #include <stdio.h> | 60 | #include <stdio.h> |
| 61 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
| 62 | #include <openssl/evp.h> | 62 | #include <openssl/evp.h> |
| 63 | #include <openssl/objects.h> | 63 | #include <openssl/objects.h> |
| 64 | #include "evp_locl.h" | 64 | #include "evp_locl.h" |
| 65 | #include <openssl/des.h> | ||
| 65 | 66 | ||
| 66 | static int des_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | 67 | static int des_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, |
| 67 | const unsigned char *iv, int enc); | 68 | const unsigned char *iv, int enc); |
| @@ -72,34 +73,34 @@ static int des_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | |||
| 72 | const unsigned char *in, unsigned int inl) | 73 | const unsigned char *in, unsigned int inl) |
| 73 | { | 74 | { |
| 74 | BLOCK_CIPHER_ecb_loop() | 75 | BLOCK_CIPHER_ecb_loop() |
| 75 | des_ecb_encrypt((des_cblock *)(in + i), (des_cblock *)(out + i), ctx->c.des_ks, ctx->encrypt); | 76 | DES_ecb_encrypt((DES_cblock *)(in + i), (DES_cblock *)(out + i), ctx->cipher_data, ctx->encrypt); |
| 76 | return 1; | 77 | return 1; |
| 77 | } | 78 | } |
| 78 | 79 | ||
| 79 | static int des_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 80 | static int des_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
| 80 | const unsigned char *in, unsigned int inl) | 81 | const unsigned char *in, unsigned int inl) |
| 81 | { | 82 | { |
| 82 | des_ofb64_encrypt(in, out, (long)inl, ctx->c.des_ks, (des_cblock *)ctx->iv, &ctx->num); | 83 | DES_ofb64_encrypt(in, out, (long)inl, ctx->cipher_data, (DES_cblock *)ctx->iv, &ctx->num); |
| 83 | return 1; | 84 | return 1; |
| 84 | } | 85 | } |
| 85 | 86 | ||
| 86 | static int des_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 87 | static int des_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
| 87 | const unsigned char *in, unsigned int inl) | 88 | const unsigned char *in, unsigned int inl) |
| 88 | { | 89 | { |
| 89 | des_ncbc_encrypt(in, out, (long)inl, ctx->c.des_ks, | 90 | DES_ncbc_encrypt(in, out, (long)inl, ctx->cipher_data, |
| 90 | (des_cblock *)ctx->iv, ctx->encrypt); | 91 | (DES_cblock *)ctx->iv, ctx->encrypt); |
| 91 | return 1; | 92 | return 1; |
| 92 | } | 93 | } |
| 93 | 94 | ||
| 94 | static int des_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 95 | static int des_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
| 95 | const unsigned char *in, unsigned int inl) | 96 | const unsigned char *in, unsigned int inl) |
| 96 | { | 97 | { |
| 97 | des_cfb64_encrypt(in, out, (long)inl, ctx->c.des_ks, | 98 | DES_cfb64_encrypt(in, out, (long)inl, ctx->cipher_data, |
| 98 | (des_cblock *)ctx->iv, &ctx->num, ctx->encrypt); | 99 | (DES_cblock *)ctx->iv, &ctx->num, ctx->encrypt); |
| 99 | return 1; | 100 | return 1; |
| 100 | } | 101 | } |
| 101 | 102 | ||
| 102 | BLOCK_CIPHER_defs(des, des_ks, NID_des, 8, 8, 8, | 103 | BLOCK_CIPHER_defs(des, DES_key_schedule, NID_des, 8, 8, 8, 64, |
| 103 | 0, des_init_key, NULL, | 104 | 0, des_init_key, NULL, |
| 104 | EVP_CIPHER_set_asn1_iv, | 105 | EVP_CIPHER_set_asn1_iv, |
| 105 | EVP_CIPHER_get_asn1_iv, | 106 | EVP_CIPHER_get_asn1_iv, |
| @@ -109,9 +110,9 @@ BLOCK_CIPHER_defs(des, des_ks, NID_des, 8, 8, 8, | |||
| 109 | static int des_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | 110 | static int des_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, |
| 110 | const unsigned char *iv, int enc) | 111 | const unsigned char *iv, int enc) |
| 111 | { | 112 | { |
| 112 | des_cblock *deskey = (des_cblock *)key; | 113 | DES_cblock *deskey = (DES_cblock *)key; |
| 113 | 114 | ||
| 114 | des_set_key_unchecked(deskey,ctx->c.des_ks); | 115 | DES_set_key_unchecked(deskey,ctx->cipher_data); |
| 115 | return 1; | 116 | return 1; |
| 116 | } | 117 | } |
| 117 | 118 | ||
diff --git a/src/lib/libcrypto/evp/e_des3.c b/src/lib/libcrypto/evp/e_des3.c index a9aba4ae70..077860e7b6 100644 --- a/src/lib/libcrypto/evp/e_des3.c +++ b/src/lib/libcrypto/evp/e_des3.c | |||
| @@ -56,12 +56,13 @@ | |||
| 56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
| 57 | */ | 57 | */ |
| 58 | 58 | ||
| 59 | #ifndef NO_DES | 59 | #ifndef OPENSSL_NO_DES |
| 60 | #include <stdio.h> | 60 | #include <stdio.h> |
| 61 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
| 62 | #include <openssl/evp.h> | 62 | #include <openssl/evp.h> |
| 63 | #include <openssl/objects.h> | 63 | #include <openssl/objects.h> |
| 64 | #include "evp_locl.h" | 64 | #include "evp_locl.h" |
| 65 | #include <openssl/des.h> | ||
| 65 | 66 | ||
| 66 | static int des_ede_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | 67 | static int des_ede_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, |
| 67 | const unsigned char *iv,int enc); | 68 | const unsigned char *iv,int enc); |
| @@ -69,60 +70,78 @@ static int des_ede_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | |||
| 69 | static int des_ede3_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | 70 | static int des_ede3_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, |
| 70 | const unsigned char *iv,int enc); | 71 | const unsigned char *iv,int enc); |
| 71 | 72 | ||
| 73 | typedef struct | ||
| 74 | { | ||
| 75 | DES_key_schedule ks1;/* key schedule */ | ||
| 76 | DES_key_schedule ks2;/* key schedule (for ede) */ | ||
| 77 | DES_key_schedule ks3;/* key schedule (for ede3) */ | ||
| 78 | } DES_EDE_KEY; | ||
| 79 | |||
| 80 | #define data(ctx) ((DES_EDE_KEY *)(ctx)->cipher_data) | ||
| 81 | |||
| 72 | /* Because of various casts and different args can't use IMPLEMENT_BLOCK_CIPHER */ | 82 | /* Because of various casts and different args can't use IMPLEMENT_BLOCK_CIPHER */ |
| 73 | 83 | ||
| 74 | static int des_ede_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 84 | static int des_ede_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
| 75 | const unsigned char *in, unsigned int inl) | 85 | const unsigned char *in, unsigned int inl) |
| 76 | { | 86 | { |
| 77 | BLOCK_CIPHER_ecb_loop() | 87 | BLOCK_CIPHER_ecb_loop() |
| 78 | des_ecb3_encrypt((des_cblock *)(in + i), (des_cblock *)(out + i), | 88 | DES_ecb3_encrypt((DES_cblock *)(in + i), (DES_cblock *)(out + i), |
| 79 | ctx->c.des_ede.ks1, ctx->c.des_ede.ks2, ctx->c.des_ede.ks3, | 89 | &data(ctx)->ks1, &data(ctx)->ks2, |
| 80 | ctx->encrypt); | 90 | &data(ctx)->ks3, |
| 91 | ctx->encrypt); | ||
| 81 | return 1; | 92 | return 1; |
| 82 | } | 93 | } |
| 83 | 94 | ||
| 84 | static int des_ede_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 95 | static int des_ede_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
| 85 | const unsigned char *in, unsigned int inl) | 96 | const unsigned char *in, unsigned int inl) |
| 86 | { | 97 | { |
| 87 | des_ede3_ofb64_encrypt(in, out, (long)inl, | 98 | DES_ede3_ofb64_encrypt(in, out, (long)inl, |
| 88 | ctx->c.des_ede.ks1, ctx->c.des_ede.ks2, ctx->c.des_ede.ks3, | 99 | &data(ctx)->ks1, &data(ctx)->ks2, &data(ctx)->ks3, |
| 89 | (des_cblock *)ctx->iv, &ctx->num); | 100 | (DES_cblock *)ctx->iv, &ctx->num); |
| 90 | return 1; | 101 | return 1; |
| 91 | } | 102 | } |
| 92 | 103 | ||
| 93 | static int des_ede_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 104 | static int des_ede_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
| 94 | const unsigned char *in, unsigned int inl) | 105 | const unsigned char *in, unsigned int inl) |
| 95 | { | 106 | { |
| 96 | des_ede3_cbc_encrypt(in, out, (long)inl, | 107 | #ifdef KSSL_DEBUG |
| 97 | ctx->c.des_ede.ks1, ctx->c.des_ede.ks2, ctx->c.des_ede.ks3, | 108 | { |
| 98 | (des_cblock *)ctx->iv, ctx->encrypt); | 109 | int i; |
| 110 | char *cp; | ||
| 111 | printf("des_ede_cbc_cipher(ctx=%lx, buflen=%d)\n", ctx, ctx->buf_len); | ||
| 112 | printf("\t iv= "); | ||
| 113 | for(i=0;i<8;i++) | ||
| 114 | printf("%02X",ctx->iv[i]); | ||
| 115 | printf("\n"); | ||
| 116 | } | ||
| 117 | #endif /* KSSL_DEBUG */ | ||
| 118 | DES_ede3_cbc_encrypt(in, out, (long)inl, | ||
| 119 | &data(ctx)->ks1, &data(ctx)->ks2, &data(ctx)->ks3, | ||
| 120 | (DES_cblock *)ctx->iv, ctx->encrypt); | ||
| 99 | return 1; | 121 | return 1; |
| 100 | } | 122 | } |
| 101 | 123 | ||
| 102 | static int des_ede_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 124 | static int des_ede_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
| 103 | const unsigned char *in, unsigned int inl) | 125 | const unsigned char *in, unsigned int inl) |
| 104 | { | 126 | { |
| 105 | des_ede3_cfb64_encrypt(in, out, (long)inl, | 127 | DES_ede3_cfb64_encrypt(in, out, (long)inl, |
| 106 | ctx->c.des_ede.ks1, ctx->c.des_ede.ks2, ctx->c.des_ede.ks3, | 128 | &data(ctx)->ks1, &data(ctx)->ks2, &data(ctx)->ks3, |
| 107 | (des_cblock *)ctx->iv, &ctx->num, ctx->encrypt); | 129 | (DES_cblock *)ctx->iv, &ctx->num, ctx->encrypt); |
| 108 | return 1; | 130 | return 1; |
| 109 | } | 131 | } |
| 110 | 132 | ||
| 111 | #define NID_des_ede_ecb NID_des_ede | 133 | BLOCK_CIPHER_defs(des_ede, DES_EDE_KEY, NID_des_ede, 8, 16, 8, 64, |
| 112 | |||
| 113 | BLOCK_CIPHER_defs(des_ede, des_ede, NID_des_ede, 8, 16, 8, | ||
| 114 | 0, des_ede_init_key, NULL, | 134 | 0, des_ede_init_key, NULL, |
| 115 | EVP_CIPHER_set_asn1_iv, | 135 | EVP_CIPHER_set_asn1_iv, |
| 116 | EVP_CIPHER_get_asn1_iv, | 136 | EVP_CIPHER_get_asn1_iv, |
| 117 | NULL) | 137 | NULL) |
| 118 | 138 | ||
| 119 | #define NID_des_ede3_ecb NID_des_ede3 | ||
| 120 | #define des_ede3_cfb_cipher des_ede_cfb_cipher | 139 | #define des_ede3_cfb_cipher des_ede_cfb_cipher |
| 121 | #define des_ede3_ofb_cipher des_ede_ofb_cipher | 140 | #define des_ede3_ofb_cipher des_ede_ofb_cipher |
| 122 | #define des_ede3_cbc_cipher des_ede_cbc_cipher | 141 | #define des_ede3_cbc_cipher des_ede_cbc_cipher |
| 123 | #define des_ede3_ecb_cipher des_ede_ecb_cipher | 142 | #define des_ede3_ecb_cipher des_ede_ecb_cipher |
| 124 | 143 | ||
| 125 | BLOCK_CIPHER_defs(des_ede3, des_ede, NID_des_ede3, 8, 24, 8, | 144 | BLOCK_CIPHER_defs(des_ede3, DES_EDE_KEY, NID_des_ede3, 8, 24, 8, 64, |
| 126 | 0, des_ede3_init_key, NULL, | 145 | 0, des_ede3_init_key, NULL, |
| 127 | EVP_CIPHER_set_asn1_iv, | 146 | EVP_CIPHER_set_asn1_iv, |
| 128 | EVP_CIPHER_get_asn1_iv, | 147 | EVP_CIPHER_get_asn1_iv, |
| @@ -131,34 +150,43 @@ BLOCK_CIPHER_defs(des_ede3, des_ede, NID_des_ede3, 8, 24, 8, | |||
| 131 | static int des_ede_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | 150 | static int des_ede_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, |
| 132 | const unsigned char *iv, int enc) | 151 | const unsigned char *iv, int enc) |
| 133 | { | 152 | { |
| 134 | des_cblock *deskey = (des_cblock *)key; | 153 | DES_cblock *deskey = (DES_cblock *)key; |
| 135 | 154 | ||
| 136 | des_set_key_unchecked(&deskey[0],ctx->c.des_ede.ks1); | 155 | DES_set_key_unchecked(&deskey[0],&data(ctx)->ks1); |
| 137 | des_set_key_unchecked(&deskey[1],ctx->c.des_ede.ks2); | 156 | DES_set_key_unchecked(&deskey[1],&data(ctx)->ks2); |
| 138 | memcpy( (char *)ctx->c.des_ede.ks3, | 157 | memcpy(&data(ctx)->ks3,&data(ctx)->ks1, |
| 139 | (char *)ctx->c.des_ede.ks1, | 158 | sizeof(data(ctx)->ks1)); |
| 140 | sizeof(ctx->c.des_ede.ks1)); | ||
| 141 | return 1; | 159 | return 1; |
| 142 | } | 160 | } |
| 143 | 161 | ||
| 144 | static int des_ede3_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | 162 | static int des_ede3_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, |
| 145 | const unsigned char *iv, int enc) | 163 | const unsigned char *iv, int enc) |
| 146 | { | 164 | { |
| 147 | des_cblock *deskey = (des_cblock *)key; | 165 | DES_cblock *deskey = (DES_cblock *)key; |
| 166 | #ifdef KSSL_DEBUG | ||
| 167 | { | ||
| 168 | int i; | ||
| 169 | printf("des_ede3_init_key(ctx=%lx)\n", ctx); | ||
| 170 | printf("\tKEY= "); | ||
| 171 | for(i=0;i<24;i++) printf("%02X",key[i]); printf("\n"); | ||
| 172 | printf("\t IV= "); | ||
| 173 | for(i=0;i<8;i++) printf("%02X",iv[i]); printf("\n"); | ||
| 174 | } | ||
| 175 | #endif /* KSSL_DEBUG */ | ||
| 148 | 176 | ||
| 149 | des_set_key_unchecked(&deskey[0],ctx->c.des_ede.ks1); | 177 | DES_set_key_unchecked(&deskey[0],&data(ctx)->ks1); |
| 150 | des_set_key_unchecked(&deskey[1],ctx->c.des_ede.ks2); | 178 | DES_set_key_unchecked(&deskey[1],&data(ctx)->ks2); |
| 151 | des_set_key_unchecked(&deskey[2],ctx->c.des_ede.ks3); | 179 | DES_set_key_unchecked(&deskey[2],&data(ctx)->ks3); |
| 152 | 180 | ||
| 153 | return 1; | 181 | return 1; |
| 154 | } | 182 | } |
| 155 | 183 | ||
| 156 | EVP_CIPHER *EVP_des_ede(void) | 184 | const EVP_CIPHER *EVP_des_ede(void) |
| 157 | { | 185 | { |
| 158 | return &des_ede_ecb; | 186 | return &des_ede_ecb; |
| 159 | } | 187 | } |
| 160 | 188 | ||
| 161 | EVP_CIPHER *EVP_des_ede3(void) | 189 | const EVP_CIPHER *EVP_des_ede3(void) |
| 162 | { | 190 | { |
| 163 | return &des_ede3_ecb; | 191 | return &des_ede3_ecb; |
| 164 | } | 192 | } |
diff --git a/src/lib/libcrypto/evp/e_idea.c b/src/lib/libcrypto/evp/e_idea.c index 8d3c88deb7..ed838d3e62 100644 --- a/src/lib/libcrypto/evp/e_idea.c +++ b/src/lib/libcrypto/evp/e_idea.c | |||
| @@ -56,13 +56,14 @@ | |||
| 56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
| 57 | */ | 57 | */ |
| 58 | 58 | ||
| 59 | #ifndef NO_IDEA | 59 | #ifndef OPENSSL_NO_IDEA |
| 60 | 60 | ||
| 61 | #include <stdio.h> | 61 | #include <stdio.h> |
| 62 | #include "cryptlib.h" | 62 | #include "cryptlib.h" |
| 63 | #include <openssl/evp.h> | 63 | #include <openssl/evp.h> |
| 64 | #include <openssl/objects.h> | 64 | #include <openssl/objects.h> |
| 65 | #include "evp_locl.h" | 65 | #include "evp_locl.h" |
| 66 | #include <openssl/idea.h> | ||
| 66 | 67 | ||
| 67 | static int idea_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | 68 | static int idea_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, |
| 68 | const unsigned char *iv,int enc); | 69 | const unsigned char *iv,int enc); |
| @@ -75,17 +76,22 @@ static int idea_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | |||
| 75 | const unsigned char *in, unsigned int inl) | 76 | const unsigned char *in, unsigned int inl) |
| 76 | { | 77 | { |
| 77 | BLOCK_CIPHER_ecb_loop() | 78 | BLOCK_CIPHER_ecb_loop() |
| 78 | idea_ecb_encrypt(in + i, out + i, &ctx->c.idea_ks); | 79 | idea_ecb_encrypt(in + i, out + i, ctx->cipher_data); |
| 79 | return 1; | 80 | return 1; |
| 80 | } | 81 | } |
| 81 | 82 | ||
| 82 | /* Can't use IMPLEMENT_BLOCK_CIPHER because idea_ecb_encrypt is different */ | 83 | /* Can't use IMPLEMENT_BLOCK_CIPHER because idea_ecb_encrypt is different */ |
| 83 | 84 | ||
| 84 | BLOCK_CIPHER_func_cbc(idea, idea, idea_ks) | 85 | typedef struct |
| 85 | BLOCK_CIPHER_func_ofb(idea, idea, idea_ks) | 86 | { |
| 86 | BLOCK_CIPHER_func_cfb(idea, idea, idea_ks) | 87 | IDEA_KEY_SCHEDULE ks; |
| 88 | } EVP_IDEA_KEY; | ||
| 89 | |||
| 90 | BLOCK_CIPHER_func_cbc(idea, idea, EVP_IDEA_KEY, ks) | ||
| 91 | BLOCK_CIPHER_func_ofb(idea, idea, 64, EVP_IDEA_KEY, ks) | ||
| 92 | BLOCK_CIPHER_func_cfb(idea, idea, 64, EVP_IDEA_KEY, ks) | ||
| 87 | 93 | ||
| 88 | BLOCK_CIPHER_defs(idea, idea_ks, NID_idea, 8, 16, 8, | 94 | BLOCK_CIPHER_defs(idea, IDEA_KEY_SCHEDULE, NID_idea, 8, 16, 8, 64, |
| 89 | 0, idea_init_key, NULL, | 95 | 0, idea_init_key, NULL, |
| 90 | EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, NULL) | 96 | EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, NULL) |
| 91 | 97 | ||
| @@ -96,13 +102,13 @@ static int idea_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | |||
| 96 | if (EVP_CIPHER_CTX_mode(ctx) == EVP_CIPH_OFB_MODE) enc = 1; | 102 | if (EVP_CIPHER_CTX_mode(ctx) == EVP_CIPH_OFB_MODE) enc = 1; |
| 97 | else if (EVP_CIPHER_CTX_mode(ctx) == EVP_CIPH_CFB_MODE) enc = 1; | 103 | else if (EVP_CIPHER_CTX_mode(ctx) == EVP_CIPH_CFB_MODE) enc = 1; |
| 98 | } | 104 | } |
| 99 | if (enc) idea_set_encrypt_key(key,&(ctx->c.idea_ks)); | 105 | if (enc) idea_set_encrypt_key(key,ctx->cipher_data); |
| 100 | else | 106 | else |
| 101 | { | 107 | { |
| 102 | IDEA_KEY_SCHEDULE tmp; | 108 | IDEA_KEY_SCHEDULE tmp; |
| 103 | 109 | ||
| 104 | idea_set_encrypt_key(key,&tmp); | 110 | idea_set_encrypt_key(key,&tmp); |
| 105 | idea_set_decrypt_key(&tmp,&(ctx->c.idea_ks)); | 111 | idea_set_decrypt_key(&tmp,ctx->cipher_data); |
| 106 | memset((unsigned char *)&tmp,0, | 112 | memset((unsigned char *)&tmp,0, |
| 107 | sizeof(IDEA_KEY_SCHEDULE)); | 113 | sizeof(IDEA_KEY_SCHEDULE)); |
| 108 | } | 114 | } |
diff --git a/src/lib/libcrypto/evp/e_null.c b/src/lib/libcrypto/evp/e_null.c index e0702cf818..2420d7e5af 100644 --- a/src/lib/libcrypto/evp/e_null.c +++ b/src/lib/libcrypto/evp/e_null.c | |||
| @@ -65,7 +65,7 @@ static 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); |
| 66 | static int null_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 66 | static int null_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
| 67 | const unsigned char *in, unsigned int inl); | 67 | const unsigned char *in, unsigned int inl); |
| 68 | static EVP_CIPHER n_cipher= | 68 | static const EVP_CIPHER n_cipher= |
| 69 | { | 69 | { |
| 70 | NID_undef, | 70 | NID_undef, |
| 71 | 1,0,0, | 71 | 1,0,0, |
| @@ -79,7 +79,7 @@ static EVP_CIPHER n_cipher= | |||
| 79 | NULL | 79 | NULL |
| 80 | }; | 80 | }; |
| 81 | 81 | ||
| 82 | EVP_CIPHER *EVP_enc_null(void) | 82 | const EVP_CIPHER *EVP_enc_null(void) |
| 83 | { | 83 | { |
| 84 | return(&n_cipher); | 84 | return(&n_cipher); |
| 85 | } | 85 | } |
| @@ -87,7 +87,7 @@ EVP_CIPHER *EVP_enc_null(void) | |||
| 87 | static int null_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | 87 | static int null_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, |
| 88 | const unsigned char *iv, int enc) | 88 | const unsigned char *iv, int enc) |
| 89 | { | 89 | { |
| 90 | memset(&(ctx->c),0,sizeof(ctx->c)); | 90 | /* memset(&(ctx->c),0,sizeof(ctx->c));*/ |
| 91 | return 1; | 91 | return 1; |
| 92 | } | 92 | } |
| 93 | 93 | ||
diff --git a/src/lib/libcrypto/evp/e_rc2.c b/src/lib/libcrypto/evp/e_rc2.c index 3955c3ef84..4685198e2e 100644 --- a/src/lib/libcrypto/evp/e_rc2.c +++ b/src/lib/libcrypto/evp/e_rc2.c | |||
| @@ -56,13 +56,14 @@ | |||
| 56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
| 57 | */ | 57 | */ |
| 58 | 58 | ||
| 59 | #ifndef NO_RC2 | 59 | #ifndef OPENSSL_NO_RC2 |
| 60 | 60 | ||
| 61 | #include <stdio.h> | 61 | #include <stdio.h> |
| 62 | #include "cryptlib.h" | 62 | #include "cryptlib.h" |
| 63 | #include <openssl/evp.h> | 63 | #include <openssl/evp.h> |
| 64 | #include <openssl/objects.h> | 64 | #include <openssl/objects.h> |
| 65 | #include "evp_locl.h" | 65 | #include "evp_locl.h" |
| 66 | #include <openssl/rc2.h> | ||
| 66 | 67 | ||
| 67 | static int rc2_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | 68 | static int rc2_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, |
| 68 | const unsigned char *iv,int enc); | 69 | const unsigned char *iv,int enc); |
| @@ -72,9 +73,17 @@ static int rc2_set_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type); | |||
| 72 | static int rc2_get_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type); | 73 | static int rc2_get_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type); |
| 73 | static int rc2_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr); | 74 | static int rc2_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr); |
| 74 | 75 | ||
| 75 | IMPLEMENT_BLOCK_CIPHER(rc2, rc2.ks, RC2, rc2, NID_rc2, | 76 | typedef struct |
| 77 | { | ||
| 78 | int key_bits; /* effective key bits */ | ||
| 79 | RC2_KEY ks; /* key schedule */ | ||
| 80 | } EVP_RC2_KEY; | ||
| 81 | |||
| 82 | #define data(ctx) ((EVP_RC2_KEY *)(ctx)->cipher_data) | ||
| 83 | |||
| 84 | IMPLEMENT_BLOCK_CIPHER(rc2, ks, RC2, EVP_RC2_KEY, NID_rc2, | ||
| 76 | 8, | 85 | 8, |
| 77 | EVP_RC2_KEY_SIZE, 8, | 86 | RC2_KEY_LENGTH, 8, 64, |
| 78 | EVP_CIPH_VARIABLE_LENGTH | EVP_CIPH_CTRL_INIT, | 87 | EVP_CIPH_VARIABLE_LENGTH | EVP_CIPH_CTRL_INIT, |
| 79 | rc2_init_key, NULL, | 88 | rc2_init_key, NULL, |
| 80 | rc2_set_asn1_type_and_iv, rc2_get_asn1_type_and_iv, | 89 | rc2_set_asn1_type_and_iv, rc2_get_asn1_type_and_iv, |
| @@ -84,7 +93,7 @@ IMPLEMENT_BLOCK_CIPHER(rc2, rc2.ks, RC2, rc2, NID_rc2, | |||
| 84 | #define RC2_64_MAGIC 0x78 | 93 | #define RC2_64_MAGIC 0x78 |
| 85 | #define RC2_128_MAGIC 0x3a | 94 | #define RC2_128_MAGIC 0x3a |
| 86 | 95 | ||
| 87 | static EVP_CIPHER r2_64_cbc_cipher= | 96 | static const EVP_CIPHER r2_64_cbc_cipher= |
| 88 | { | 97 | { |
| 89 | NID_rc2_64_cbc, | 98 | NID_rc2_64_cbc, |
| 90 | 8,8 /* 64 bit */,8, | 99 | 8,8 /* 64 bit */,8, |
| @@ -92,15 +101,14 @@ static EVP_CIPHER r2_64_cbc_cipher= | |||
| 92 | rc2_init_key, | 101 | rc2_init_key, |
| 93 | rc2_cbc_cipher, | 102 | rc2_cbc_cipher, |
| 94 | NULL, | 103 | NULL, |
| 95 | sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ | 104 | sizeof(EVP_RC2_KEY), |
| 96 | sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc2)), | ||
| 97 | rc2_set_asn1_type_and_iv, | 105 | rc2_set_asn1_type_and_iv, |
| 98 | rc2_get_asn1_type_and_iv, | 106 | rc2_get_asn1_type_and_iv, |
| 99 | rc2_ctrl, | 107 | rc2_ctrl, |
| 100 | NULL | 108 | NULL |
| 101 | }; | 109 | }; |
| 102 | 110 | ||
| 103 | static EVP_CIPHER r2_40_cbc_cipher= | 111 | static const EVP_CIPHER r2_40_cbc_cipher= |
| 104 | { | 112 | { |
| 105 | NID_rc2_40_cbc, | 113 | NID_rc2_40_cbc, |
| 106 | 8,5 /* 40 bit */,8, | 114 | 8,5 /* 40 bit */,8, |
| @@ -108,20 +116,19 @@ static EVP_CIPHER r2_40_cbc_cipher= | |||
| 108 | rc2_init_key, | 116 | rc2_init_key, |
| 109 | rc2_cbc_cipher, | 117 | rc2_cbc_cipher, |
| 110 | NULL, | 118 | NULL, |
| 111 | sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ | 119 | sizeof(EVP_RC2_KEY), |
| 112 | sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc2)), | ||
| 113 | rc2_set_asn1_type_and_iv, | 120 | rc2_set_asn1_type_and_iv, |
| 114 | rc2_get_asn1_type_and_iv, | 121 | rc2_get_asn1_type_and_iv, |
| 115 | rc2_ctrl, | 122 | rc2_ctrl, |
| 116 | NULL | 123 | NULL |
| 117 | }; | 124 | }; |
| 118 | 125 | ||
| 119 | EVP_CIPHER *EVP_rc2_64_cbc(void) | 126 | const EVP_CIPHER *EVP_rc2_64_cbc(void) |
| 120 | { | 127 | { |
| 121 | return(&r2_64_cbc_cipher); | 128 | return(&r2_64_cbc_cipher); |
| 122 | } | 129 | } |
| 123 | 130 | ||
| 124 | EVP_CIPHER *EVP_rc2_40_cbc(void) | 131 | const EVP_CIPHER *EVP_rc2_40_cbc(void) |
| 125 | { | 132 | { |
| 126 | return(&r2_40_cbc_cipher); | 133 | return(&r2_40_cbc_cipher); |
| 127 | } | 134 | } |
| @@ -129,8 +136,8 @@ EVP_CIPHER *EVP_rc2_40_cbc(void) | |||
| 129 | static int rc2_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | 136 | static int rc2_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, |
| 130 | const unsigned char *iv, int enc) | 137 | const unsigned char *iv, int enc) |
| 131 | { | 138 | { |
| 132 | RC2_set_key(&(ctx->c.rc2.ks),EVP_CIPHER_CTX_key_length(ctx), | 139 | RC2_set_key(&data(ctx)->ks,EVP_CIPHER_CTX_key_length(ctx), |
| 133 | key,ctx->c.rc2.key_bits); | 140 | key,data(ctx)->key_bits); |
| 134 | return 1; | 141 | return 1; |
| 135 | } | 142 | } |
| 136 | 143 | ||
| @@ -173,7 +180,7 @@ static int rc2_get_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type) | |||
| 173 | key_bits =rc2_magic_to_meth((int)num); | 180 | key_bits =rc2_magic_to_meth((int)num); |
| 174 | if (!key_bits) | 181 | if (!key_bits) |
| 175 | return(-1); | 182 | return(-1); |
| 176 | if(i > 0) EVP_CipherInit(c, NULL, NULL, iv, -1); | 183 | if(i > 0) EVP_CipherInit_ex(c, NULL, NULL, NULL, iv, -1); |
| 177 | EVP_CIPHER_CTX_ctrl(c, EVP_CTRL_SET_RC2_KEY_BITS, key_bits, NULL); | 184 | EVP_CIPHER_CTX_ctrl(c, EVP_CTRL_SET_RC2_KEY_BITS, key_bits, NULL); |
| 178 | EVP_CIPHER_CTX_set_key_length(c, key_bits / 8); | 185 | EVP_CIPHER_CTX_set_key_length(c, key_bits / 8); |
| 179 | } | 186 | } |
| @@ -196,26 +203,26 @@ static int rc2_set_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type) | |||
| 196 | 203 | ||
| 197 | static int rc2_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr) | 204 | static int rc2_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr) |
| 198 | { | 205 | { |
| 199 | switch(type) { | 206 | switch(type) |
| 200 | 207 | { | |
| 201 | case EVP_CTRL_INIT: | 208 | case EVP_CTRL_INIT: |
| 202 | c->c.rc2.key_bits = EVP_CIPHER_CTX_key_length(c) * 8; | 209 | data(c)->key_bits = EVP_CIPHER_CTX_key_length(c) * 8; |
| 203 | return 1; | 210 | return 1; |
| 204 | 211 | ||
| 205 | case EVP_CTRL_GET_RC2_KEY_BITS: | 212 | case EVP_CTRL_GET_RC2_KEY_BITS: |
| 206 | *(int *)ptr = c->c.rc2.key_bits; | 213 | *(int *)ptr = data(c)->key_bits; |
| 207 | return 1; | 214 | return 1; |
| 208 | 215 | ||
| 209 | 216 | case EVP_CTRL_SET_RC2_KEY_BITS: | |
| 210 | case EVP_CTRL_SET_RC2_KEY_BITS: | 217 | if(arg > 0) |
| 211 | if(arg > 0) { | 218 | { |
| 212 | c->c.rc2.key_bits = arg; | 219 | data(c)->key_bits = arg; |
| 213 | return 1; | 220 | return 1; |
| 214 | } | 221 | } |
| 215 | return 0; | 222 | return 0; |
| 216 | 223 | ||
| 217 | default: | 224 | default: |
| 218 | return -1; | 225 | return -1; |
| 219 | } | 226 | } |
| 220 | } | 227 | } |
| 221 | 228 | ||
diff --git a/src/lib/libcrypto/evp/e_rc4.c b/src/lib/libcrypto/evp/e_rc4.c index 1c1e3b3857..4064cc5fa0 100644 --- a/src/lib/libcrypto/evp/e_rc4.c +++ b/src/lib/libcrypto/evp/e_rc4.c | |||
| @@ -56,18 +56,31 @@ | |||
| 56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
| 57 | */ | 57 | */ |
| 58 | 58 | ||
| 59 | #ifndef NO_RC4 | 59 | #ifndef OPENSSL_NO_RC4 |
| 60 | 60 | ||
| 61 | #include <stdio.h> | 61 | #include <stdio.h> |
| 62 | #include "cryptlib.h" | 62 | #include "cryptlib.h" |
| 63 | #include <openssl/evp.h> | 63 | #include <openssl/evp.h> |
| 64 | #include <openssl/objects.h> | 64 | #include <openssl/objects.h> |
| 65 | #include <openssl/rc4.h> | ||
| 66 | |||
| 67 | /* FIXME: surely this is available elsewhere? */ | ||
| 68 | #define EVP_RC4_KEY_SIZE 16 | ||
| 69 | |||
| 70 | typedef struct | ||
| 71 | { | ||
| 72 | /* FIXME: what is the key for? */ | ||
| 73 | unsigned char key[EVP_RC4_KEY_SIZE]; | ||
| 74 | RC4_KEY ks; /* working key */ | ||
| 75 | } EVP_RC4_KEY; | ||
| 76 | |||
| 77 | #define data(ctx) ((EVP_RC4_KEY *)(ctx)->cipher_data) | ||
| 65 | 78 | ||
| 66 | static int rc4_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | 79 | static int rc4_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, |
| 67 | const unsigned char *iv,int enc); | 80 | const unsigned char *iv,int enc); |
| 68 | static int rc4_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 81 | static int rc4_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
| 69 | const unsigned char *in, unsigned int inl); | 82 | const unsigned char *in, unsigned int inl); |
| 70 | static EVP_CIPHER r4_cipher= | 83 | static const EVP_CIPHER r4_cipher= |
| 71 | { | 84 | { |
| 72 | NID_rc4, | 85 | NID_rc4, |
| 73 | 1,EVP_RC4_KEY_SIZE,0, | 86 | 1,EVP_RC4_KEY_SIZE,0, |
| @@ -75,14 +88,13 @@ static EVP_CIPHER r4_cipher= | |||
| 75 | rc4_init_key, | 88 | rc4_init_key, |
| 76 | rc4_cipher, | 89 | rc4_cipher, |
| 77 | NULL, | 90 | NULL, |
| 78 | sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ | 91 | sizeof(EVP_RC4_KEY), |
| 79 | sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc4)), | ||
| 80 | NULL, | 92 | NULL, |
| 81 | NULL, | 93 | NULL, |
| 82 | NULL | 94 | NULL |
| 83 | }; | 95 | }; |
| 84 | 96 | ||
| 85 | static EVP_CIPHER r4_40_cipher= | 97 | static const EVP_CIPHER r4_40_cipher= |
| 86 | { | 98 | { |
| 87 | NID_rc4_40, | 99 | NID_rc4_40, |
| 88 | 1,5 /* 40 bit */,0, | 100 | 1,5 /* 40 bit */,0, |
| @@ -90,19 +102,18 @@ static EVP_CIPHER r4_40_cipher= | |||
| 90 | rc4_init_key, | 102 | rc4_init_key, |
| 91 | rc4_cipher, | 103 | rc4_cipher, |
| 92 | NULL, | 104 | NULL, |
| 93 | sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ | 105 | sizeof(EVP_RC4_KEY), |
| 94 | sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc4)), | ||
| 95 | NULL, | 106 | NULL, |
| 96 | NULL, | 107 | NULL, |
| 97 | NULL | 108 | NULL |
| 98 | }; | 109 | }; |
| 99 | 110 | ||
| 100 | EVP_CIPHER *EVP_rc4(void) | 111 | const EVP_CIPHER *EVP_rc4(void) |
| 101 | { | 112 | { |
| 102 | return(&r4_cipher); | 113 | return(&r4_cipher); |
| 103 | } | 114 | } |
| 104 | 115 | ||
| 105 | EVP_CIPHER *EVP_rc4_40(void) | 116 | const EVP_CIPHER *EVP_rc4_40(void) |
| 106 | { | 117 | { |
| 107 | return(&r4_40_cipher); | 118 | return(&r4_40_cipher); |
| 108 | } | 119 | } |
| @@ -110,16 +121,16 @@ EVP_CIPHER *EVP_rc4_40(void) | |||
| 110 | static int rc4_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | 121 | static int rc4_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, |
| 111 | const unsigned char *iv, int enc) | 122 | const unsigned char *iv, int enc) |
| 112 | { | 123 | { |
| 113 | memcpy(&(ctx->c.rc4.key[0]),key,EVP_CIPHER_CTX_key_length(ctx)); | 124 | memcpy(&data(ctx)->key[0],key,EVP_CIPHER_CTX_key_length(ctx)); |
| 114 | RC4_set_key(&(ctx->c.rc4.ks),EVP_CIPHER_CTX_key_length(ctx), | 125 | RC4_set_key(&data(ctx)->ks,EVP_CIPHER_CTX_key_length(ctx), |
| 115 | ctx->c.rc4.key); | 126 | data(ctx)->key); |
| 116 | return 1; | 127 | return 1; |
| 117 | } | 128 | } |
| 118 | 129 | ||
| 119 | static int rc4_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 130 | static int rc4_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
| 120 | const unsigned char *in, unsigned int inl) | 131 | const unsigned char *in, unsigned int inl) |
| 121 | { | 132 | { |
| 122 | RC4(&(ctx->c.rc4.ks),inl,in,out); | 133 | RC4(&data(ctx)->ks,inl,in,out); |
| 123 | return 1; | 134 | return 1; |
| 124 | } | 135 | } |
| 125 | #endif | 136 | #endif |
diff --git a/src/lib/libcrypto/evp/e_rc5.c b/src/lib/libcrypto/evp/e_rc5.c index 5885f1826b..3c7713b181 100644 --- a/src/lib/libcrypto/evp/e_rc5.c +++ b/src/lib/libcrypto/evp/e_rc5.c | |||
| @@ -56,62 +56,69 @@ | |||
| 56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
| 57 | */ | 57 | */ |
| 58 | 58 | ||
| 59 | #ifndef NO_RC5 | 59 | #ifndef OPENSSL_NO_RC5 |
| 60 | 60 | ||
| 61 | #include <stdio.h> | 61 | #include <stdio.h> |
| 62 | #include "cryptlib.h" | 62 | #include "cryptlib.h" |
| 63 | #include <openssl/evp.h> | 63 | #include <openssl/evp.h> |
| 64 | #include <openssl/objects.h> | 64 | #include <openssl/objects.h> |
| 65 | #include "evp_locl.h" | 65 | #include "evp_locl.h" |
| 66 | #include <openssl/rc5.h> | ||
| 66 | 67 | ||
| 67 | static int r_32_12_16_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | 68 | static int r_32_12_16_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, |
| 68 | const unsigned char *iv,int enc); | 69 | const unsigned char *iv,int enc); |
| 69 | static int rc5_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr); | 70 | static int rc5_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr); |
| 70 | 71 | ||
| 71 | IMPLEMENT_BLOCK_CIPHER(rc5_32_12_16, rc5.ks, RC5_32, rc5, NID_rc5, | 72 | typedef struct |
| 72 | 8, EVP_RC5_32_12_16_KEY_SIZE, 8, | 73 | { |
| 73 | EVP_CIPH_VARIABLE_LENGTH | EVP_CIPH_CTRL_INIT, | 74 | int rounds; /* number of rounds */ |
| 74 | r_32_12_16_init_key, NULL, | 75 | RC5_32_KEY ks; /* key schedule */ |
| 75 | NULL, NULL, rc5_ctrl) | 76 | } EVP_RC5_KEY; |
| 76 | 77 | ||
| 78 | #define data(ctx) EVP_C_DATA(EVP_RC5_KEY,ctx) | ||
| 77 | 79 | ||
| 80 | IMPLEMENT_BLOCK_CIPHER(rc5_32_12_16, ks, RC5_32, EVP_RC5_KEY, NID_rc5, | ||
| 81 | 8, RC5_32_KEY_LENGTH, 8, 64, | ||
| 82 | EVP_CIPH_VARIABLE_LENGTH | EVP_CIPH_CTRL_INIT, | ||
| 83 | r_32_12_16_init_key, NULL, | ||
| 84 | NULL, NULL, rc5_ctrl) | ||
| 78 | 85 | ||
| 79 | static int rc5_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr) | 86 | static int rc5_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr) |
| 80 | { | 87 | { |
| 81 | switch(type) { | 88 | switch(type) |
| 82 | 89 | { | |
| 83 | case EVP_CTRL_INIT: | 90 | case EVP_CTRL_INIT: |
| 84 | c->c.rc5.rounds = RC5_12_ROUNDS; | 91 | data(c)->rounds = RC5_12_ROUNDS; |
| 85 | return 1; | 92 | return 1; |
| 86 | 93 | ||
| 87 | case EVP_CTRL_GET_RC5_ROUNDS: | 94 | case EVP_CTRL_GET_RC5_ROUNDS: |
| 88 | *(int *)ptr = c->c.rc5.rounds; | 95 | *(int *)ptr = data(c)->rounds; |
| 89 | return 1; | 96 | return 1; |
| 90 | |||
| 91 | 97 | ||
| 92 | case EVP_CTRL_SET_RC5_ROUNDS: | 98 | case EVP_CTRL_SET_RC5_ROUNDS: |
| 93 | switch(arg) { | 99 | switch(arg) |
| 94 | case RC5_8_ROUNDS: | 100 | { |
| 95 | case RC5_12_ROUNDS: | 101 | case RC5_8_ROUNDS: |
| 96 | case RC5_16_ROUNDS: | 102 | case RC5_12_ROUNDS: |
| 97 | c->c.rc5.rounds = arg; | 103 | case RC5_16_ROUNDS: |
| 98 | return 1; | 104 | data(c)->rounds = arg; |
| 105 | return 1; | ||
| 99 | 106 | ||
| 100 | default: | 107 | default: |
| 101 | EVPerr(EVP_F_RC5_CTRL, EVP_R_UNSUPORTED_NUMBER_OF_ROUNDS); | 108 | EVPerr(EVP_F_RC5_CTRL, EVP_R_UNSUPORTED_NUMBER_OF_ROUNDS); |
| 102 | return 0; | 109 | return 0; |
| 103 | } | 110 | } |
| 104 | 111 | ||
| 105 | default: | 112 | default: |
| 106 | return -1; | 113 | return -1; |
| 107 | } | 114 | } |
| 108 | } | 115 | } |
| 109 | 116 | ||
| 110 | static int r_32_12_16_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | 117 | static int r_32_12_16_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, |
| 111 | const unsigned char *iv, int enc) | 118 | const unsigned char *iv, int enc) |
| 112 | { | 119 | { |
| 113 | RC5_32_set_key(&(ctx->c.rc5.ks),EVP_CIPHER_CTX_key_length(ctx), | 120 | RC5_32_set_key(&data(ctx)->ks,EVP_CIPHER_CTX_key_length(ctx), |
| 114 | key,ctx->c.rc5.rounds); | 121 | key,data(ctx)->rounds); |
| 115 | return 1; | 122 | return 1; |
| 116 | } | 123 | } |
| 117 | 124 | ||
diff --git a/src/lib/libcrypto/evp/e_xcbc_d.c b/src/lib/libcrypto/evp/e_xcbc_d.c index e5b15acc7d..a6f849e93d 100644 --- a/src/lib/libcrypto/evp/e_xcbc_d.c +++ b/src/lib/libcrypto/evp/e_xcbc_d.c | |||
| @@ -56,17 +56,29 @@ | |||
| 56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
| 57 | */ | 57 | */ |
| 58 | 58 | ||
| 59 | #ifndef NO_DES | 59 | #ifndef OPENSSL_NO_DES |
| 60 | #include <stdio.h> | 60 | #include <stdio.h> |
| 61 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
| 62 | #include <openssl/evp.h> | 62 | #include <openssl/evp.h> |
| 63 | #include <openssl/objects.h> | 63 | #include <openssl/objects.h> |
| 64 | #include <openssl/des.h> | ||
| 64 | 65 | ||
| 65 | static int desx_cbc_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | 66 | static int desx_cbc_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, |
| 66 | const unsigned char *iv,int enc); | 67 | const unsigned char *iv,int enc); |
| 67 | static int desx_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 68 | static int desx_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
| 68 | const unsigned char *in, unsigned int inl); | 69 | const unsigned char *in, unsigned int inl); |
| 69 | static EVP_CIPHER d_xcbc_cipher= | 70 | |
| 71 | |||
| 72 | typedef struct | ||
| 73 | { | ||
| 74 | DES_key_schedule ks;/* key schedule */ | ||
| 75 | DES_cblock inw; | ||
| 76 | DES_cblock outw; | ||
| 77 | } DESX_CBC_KEY; | ||
| 78 | |||
| 79 | #define data(ctx) ((DESX_CBC_KEY *)(ctx)->cipher_data) | ||
| 80 | |||
| 81 | static const EVP_CIPHER d_xcbc_cipher= | ||
| 70 | { | 82 | { |
| 71 | NID_desx_cbc, | 83 | NID_desx_cbc, |
| 72 | 8,24,8, | 84 | 8,24,8, |
| @@ -74,14 +86,13 @@ static EVP_CIPHER d_xcbc_cipher= | |||
| 74 | desx_cbc_init_key, | 86 | desx_cbc_init_key, |
| 75 | desx_cbc_cipher, | 87 | desx_cbc_cipher, |
| 76 | NULL, | 88 | NULL, |
| 77 | sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ | 89 | sizeof(DESX_CBC_KEY), |
| 78 | sizeof((((EVP_CIPHER_CTX *)NULL)->c.desx_cbc)), | ||
| 79 | EVP_CIPHER_set_asn1_iv, | 90 | EVP_CIPHER_set_asn1_iv, |
| 80 | EVP_CIPHER_get_asn1_iv, | 91 | EVP_CIPHER_get_asn1_iv, |
| 81 | NULL | 92 | NULL |
| 82 | }; | 93 | }; |
| 83 | 94 | ||
| 84 | EVP_CIPHER *EVP_desx_cbc(void) | 95 | const EVP_CIPHER *EVP_desx_cbc(void) |
| 85 | { | 96 | { |
| 86 | return(&d_xcbc_cipher); | 97 | return(&d_xcbc_cipher); |
| 87 | } | 98 | } |
| @@ -89,11 +100,11 @@ EVP_CIPHER *EVP_desx_cbc(void) | |||
| 89 | static int desx_cbc_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | 100 | static int desx_cbc_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, |
| 90 | const unsigned char *iv, int enc) | 101 | const unsigned char *iv, int enc) |
| 91 | { | 102 | { |
| 92 | des_cblock *deskey = (des_cblock *)key; | 103 | DES_cblock *deskey = (DES_cblock *)key; |
| 93 | 104 | ||
| 94 | des_set_key_unchecked(deskey,ctx->c.desx_cbc.ks); | 105 | DES_set_key_unchecked(deskey,&data(ctx)->ks); |
| 95 | memcpy(&(ctx->c.desx_cbc.inw[0]),&(key[8]),8); | 106 | memcpy(&data(ctx)->inw[0],&key[8],8); |
| 96 | memcpy(&(ctx->c.desx_cbc.outw[0]),&(key[16]),8); | 107 | memcpy(&data(ctx)->outw[0],&key[16],8); |
| 97 | 108 | ||
| 98 | return 1; | 109 | return 1; |
| 99 | } | 110 | } |
| @@ -101,11 +112,11 @@ static int desx_cbc_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | |||
| 101 | static int desx_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 112 | static int desx_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
| 102 | const unsigned char *in, unsigned int inl) | 113 | const unsigned char *in, unsigned int inl) |
| 103 | { | 114 | { |
| 104 | des_xcbc_encrypt(in,out,inl,ctx->c.desx_cbc.ks, | 115 | DES_xcbc_encrypt(in,out,inl,&data(ctx)->ks, |
| 105 | (des_cblock *)&(ctx->iv[0]), | 116 | (DES_cblock *)&(ctx->iv[0]), |
| 106 | &ctx->c.desx_cbc.inw, | 117 | &data(ctx)->inw, |
| 107 | &ctx->c.desx_cbc.outw, | 118 | &data(ctx)->outw, |
| 108 | ctx->encrypt); | 119 | ctx->encrypt); |
| 109 | return 1; | 120 | return 1; |
| 110 | } | 121 | } |
| 111 | #endif | 122 | #endif |
diff --git a/src/lib/libcrypto/evp/encode.c b/src/lib/libcrypto/evp/encode.c index 6ff9c1783c..12c6379df1 100644 --- a/src/lib/libcrypto/evp/encode.c +++ b/src/lib/libcrypto/evp/encode.c | |||
| @@ -277,6 +277,13 @@ int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, | |||
| 277 | eof++; | 277 | eof++; |
| 278 | } | 278 | } |
| 279 | 279 | ||
| 280 | if (v == B64_CR) | ||
| 281 | { | ||
| 282 | ln = 0; | ||
| 283 | if (exp_nl) | ||
| 284 | continue; | ||
| 285 | } | ||
| 286 | |||
| 280 | /* eoln */ | 287 | /* eoln */ |
| 281 | if (v == B64_EOLN) | 288 | if (v == B64_EOLN) |
| 282 | { | 289 | { |
diff --git a/src/lib/libcrypto/evp/evp.h b/src/lib/libcrypto/evp/evp.h index fd43127092..915fe62341 100644 --- a/src/lib/libcrypto/evp/evp.h +++ b/src/lib/libcrypto/evp/evp.h | |||
| @@ -67,74 +67,30 @@ | |||
| 67 | # undef OPENSSL_ALGORITHM_DEFINES | 67 | # undef OPENSSL_ALGORITHM_DEFINES |
| 68 | #endif | 68 | #endif |
| 69 | 69 | ||
| 70 | #ifndef NO_BIO | 70 | #include <openssl/ossl_typ.h> |
| 71 | |||
| 72 | #include <openssl/symhacks.h> | ||
| 73 | |||
| 74 | #ifndef OPENSSL_NO_BIO | ||
| 71 | #include <openssl/bio.h> | 75 | #include <openssl/bio.h> |
| 72 | #endif | 76 | #endif |
| 73 | #ifndef NO_MD2 | ||
| 74 | #include <openssl/md2.h> | ||
| 75 | #endif | ||
| 76 | #ifndef NO_MD4 | ||
| 77 | #include <openssl/md4.h> | ||
| 78 | #endif | ||
| 79 | #ifndef NO_MD5 | ||
| 80 | #include <openssl/md5.h> | ||
| 81 | #endif | ||
| 82 | #ifndef NO_SHA | ||
| 83 | #include <openssl/sha.h> | ||
| 84 | #endif | ||
| 85 | #ifndef NO_RIPEMD | ||
| 86 | #include <openssl/ripemd.h> | ||
| 87 | #endif | ||
| 88 | #ifndef NO_DES | ||
| 89 | #include <openssl/des.h> | ||
| 90 | #endif | ||
| 91 | #ifndef NO_RC4 | ||
| 92 | #include <openssl/rc4.h> | ||
| 93 | #endif | ||
| 94 | #ifndef NO_RC2 | ||
| 95 | #include <openssl/rc2.h> | ||
| 96 | #endif | ||
| 97 | #ifndef NO_RC5 | ||
| 98 | #include <openssl/rc5.h> | ||
| 99 | #endif | ||
| 100 | #ifndef NO_BF | ||
| 101 | #include <openssl/blowfish.h> | ||
| 102 | #endif | ||
| 103 | #ifndef NO_CAST | ||
| 104 | #include <openssl/cast.h> | ||
| 105 | #endif | ||
| 106 | #ifndef NO_IDEA | ||
| 107 | #include <openssl/idea.h> | ||
| 108 | #endif | ||
| 109 | #ifndef NO_MDC2 | ||
| 110 | #include <openssl/mdc2.h> | ||
| 111 | #endif | ||
| 112 | 77 | ||
| 78 | /* | ||
| 113 | #define EVP_RC2_KEY_SIZE 16 | 79 | #define EVP_RC2_KEY_SIZE 16 |
| 114 | #define EVP_RC4_KEY_SIZE 16 | 80 | #define EVP_RC4_KEY_SIZE 16 |
| 115 | #define EVP_BLOWFISH_KEY_SIZE 16 | 81 | #define EVP_BLOWFISH_KEY_SIZE 16 |
| 116 | #define EVP_CAST5_KEY_SIZE 16 | 82 | #define EVP_CAST5_KEY_SIZE 16 |
| 117 | #define EVP_RC5_32_12_16_KEY_SIZE 16 | 83 | #define EVP_RC5_32_12_16_KEY_SIZE 16 |
| 84 | */ | ||
| 118 | #define EVP_MAX_MD_SIZE (16+20) /* The SSLv3 md5+sha1 type */ | 85 | #define EVP_MAX_MD_SIZE (16+20) /* The SSLv3 md5+sha1 type */ |
| 119 | #define EVP_MAX_KEY_LENGTH 24 | 86 | #define EVP_MAX_KEY_LENGTH 32 |
| 120 | #define EVP_MAX_IV_LENGTH 8 | 87 | #define EVP_MAX_IV_LENGTH 16 |
| 88 | #define EVP_MAX_BLOCK_LENGTH 32 | ||
| 121 | 89 | ||
| 122 | #define PKCS5_SALT_LEN 8 | 90 | #define PKCS5_SALT_LEN 8 |
| 123 | /* Default PKCS#5 iteration count */ | 91 | /* Default PKCS#5 iteration count */ |
| 124 | #define PKCS5_DEFAULT_ITER 2048 | 92 | #define PKCS5_DEFAULT_ITER 2048 |
| 125 | 93 | ||
| 126 | #ifndef NO_RSA | ||
| 127 | #include <openssl/rsa.h> | ||
| 128 | #endif | ||
| 129 | |||
| 130 | #ifndef NO_DSA | ||
| 131 | #include <openssl/dsa.h> | ||
| 132 | #endif | ||
| 133 | |||
| 134 | #ifndef NO_DH | ||
| 135 | #include <openssl/dh.h> | ||
| 136 | #endif | ||
| 137 | |||
| 138 | #include <openssl/objects.h> | 94 | #include <openssl/objects.h> |
| 139 | 95 | ||
| 140 | #define EVP_PK_RSA 0x0001 | 96 | #define EVP_PK_RSA 0x0001 |
| @@ -164,26 +120,26 @@ extern "C" { | |||
| 164 | /* Type needs to be a bit field | 120 | /* Type needs to be a bit field |
| 165 | * Sub-type needs to be for variations on the method, as in, can it do | 121 | * Sub-type needs to be for variations on the method, as in, can it do |
| 166 | * arbitrary encryption.... */ | 122 | * arbitrary encryption.... */ |
| 167 | typedef struct evp_pkey_st | 123 | struct evp_pkey_st |
| 168 | { | 124 | { |
| 169 | int type; | 125 | int type; |
| 170 | int save_type; | 126 | int save_type; |
| 171 | int references; | 127 | int references; |
| 172 | union { | 128 | union { |
| 173 | char *ptr; | 129 | char *ptr; |
| 174 | #ifndef NO_RSA | 130 | #ifndef OPENSSL_NO_RSA |
| 175 | struct rsa_st *rsa; /* RSA */ | 131 | struct rsa_st *rsa; /* RSA */ |
| 176 | #endif | 132 | #endif |
| 177 | #ifndef NO_DSA | 133 | #ifndef OPENSSL_NO_DSA |
| 178 | struct dsa_st *dsa; /* DSA */ | 134 | struct dsa_st *dsa; /* DSA */ |
| 179 | #endif | 135 | #endif |
| 180 | #ifndef NO_DH | 136 | #ifndef OPENSSL_NO_DH |
| 181 | struct dh_st *dh; /* DH */ | 137 | struct dh_st *dh; /* DH */ |
| 182 | #endif | 138 | #endif |
| 183 | } pkey; | 139 | } pkey; |
| 184 | int save_parameters; | 140 | int save_parameters; |
| 185 | STACK_OF(X509_ATTRIBUTE) *attributes; /* [ 0 ] */ | 141 | STACK_OF(X509_ATTRIBUTE) *attributes; /* [ 0 ] */ |
| 186 | } EVP_PKEY; | 142 | } /* EVP_PKEY */; |
| 187 | 143 | ||
| 188 | #define EVP_PKEY_MO_SIGN 0x0001 | 144 | #define EVP_PKEY_MO_SIGN 0x0001 |
| 189 | #define EVP_PKEY_MO_VERIFY 0x0002 | 145 | #define EVP_PKEY_MO_VERIFY 0x0002 |
| @@ -258,27 +214,32 @@ typedef struct evp_pkey_method_st | |||
| 258 | #endif | 214 | #endif |
| 259 | 215 | ||
| 260 | #ifndef EVP_MD | 216 | #ifndef EVP_MD |
| 261 | typedef struct env_md_st | 217 | struct env_md_st |
| 262 | { | 218 | { |
| 263 | int type; | 219 | int type; |
| 264 | int pkey_type; | 220 | int pkey_type; |
| 265 | int md_size; | 221 | int md_size; |
| 266 | void (*init)(); | 222 | unsigned long flags; |
| 267 | void (*update)(); | 223 | int (*init)(EVP_MD_CTX *ctx); |
| 268 | void (*final)(); | 224 | int (*update)(EVP_MD_CTX *ctx,const void *data,unsigned long count); |
| 269 | 225 | int (*final)(EVP_MD_CTX *ctx,unsigned char *md); | |
| 226 | int (*copy)(EVP_MD_CTX *to,const EVP_MD_CTX *from); | ||
| 227 | int (*cleanup)(EVP_MD_CTX *ctx); | ||
| 228 | |||
| 229 | /* FIXME: prototype these some day */ | ||
| 270 | int (*sign)(); | 230 | int (*sign)(); |
| 271 | int (*verify)(); | 231 | int (*verify)(); |
| 272 | int required_pkey_type[5]; /*EVP_PKEY_xxx */ | 232 | int required_pkey_type[5]; /*EVP_PKEY_xxx */ |
| 273 | int block_size; | 233 | int block_size; |
| 274 | int ctx_size; /* how big does the ctx need to be */ | 234 | int ctx_size; /* how big does the ctx->md_data need to be */ |
| 275 | } EVP_MD; | 235 | } /* EVP_MD */; |
| 276 | |||
| 277 | 236 | ||
| 237 | #define EVP_MD_FLAG_ONESHOT 0x0001 /* digest can only handle a single | ||
| 238 | * block */ | ||
| 278 | 239 | ||
| 279 | #define EVP_PKEY_NULL_method NULL,NULL,{0,0,0,0} | 240 | #define EVP_PKEY_NULL_method NULL,NULL,{0,0,0,0} |
| 280 | 241 | ||
| 281 | #ifndef NO_DSA | 242 | #ifndef OPENSSL_NO_DSA |
| 282 | #define EVP_PKEY_DSA_method DSA_sign,DSA_verify, \ | 243 | #define EVP_PKEY_DSA_method DSA_sign,DSA_verify, \ |
| 283 | {EVP_PKEY_DSA,EVP_PKEY_DSA2,EVP_PKEY_DSA3, \ | 244 | {EVP_PKEY_DSA,EVP_PKEY_DSA2,EVP_PKEY_DSA3, \ |
| 284 | EVP_PKEY_DSA4,0} | 245 | EVP_PKEY_DSA4,0} |
| @@ -286,7 +247,7 @@ typedef struct env_md_st | |||
| 286 | #define EVP_PKEY_DSA_method EVP_PKEY_NULL_method | 247 | #define EVP_PKEY_DSA_method EVP_PKEY_NULL_method |
| 287 | #endif | 248 | #endif |
| 288 | 249 | ||
| 289 | #ifndef NO_RSA | 250 | #ifndef OPENSSL_NO_RSA |
| 290 | #define EVP_PKEY_RSA_method RSA_sign,RSA_verify, \ | 251 | #define EVP_PKEY_RSA_method RSA_sign,RSA_verify, \ |
| 291 | {EVP_PKEY_RSA,EVP_PKEY_RSA2,0,0} | 252 | {EVP_PKEY_RSA,EVP_PKEY_RSA2,0,0} |
| 292 | #define EVP_PKEY_RSA_ASN1_OCTET_STRING_method \ | 253 | #define EVP_PKEY_RSA_ASN1_OCTET_STRING_method \ |
| @@ -300,34 +261,20 @@ typedef struct env_md_st | |||
| 300 | 261 | ||
| 301 | #endif /* !EVP_MD */ | 262 | #endif /* !EVP_MD */ |
| 302 | 263 | ||
| 303 | typedef struct env_md_ctx_st | 264 | struct env_md_ctx_st |
| 304 | { | 265 | { |
| 305 | const EVP_MD *digest; | 266 | const EVP_MD *digest; |
| 306 | union { | 267 | ENGINE *engine; /* functional reference if 'digest' is ENGINE-provided */ |
| 307 | unsigned char base[4]; | 268 | unsigned long flags; |
| 308 | #ifndef NO_MD2 | 269 | void *md_data; |
| 309 | MD2_CTX md2; | 270 | } /* EVP_MD_CTX */; |
| 310 | #endif | 271 | |
| 311 | #ifndef NO_MD5 | 272 | /* values for EVP_MD_CTX flags */ |
| 312 | MD5_CTX md5; | ||
| 313 | #endif | ||
| 314 | #ifndef NO_MD4 | ||
| 315 | MD4_CTX md4; | ||
| 316 | #endif | ||
| 317 | #ifndef NO_RIPEMD | ||
| 318 | RIPEMD160_CTX ripemd160; | ||
| 319 | #endif | ||
| 320 | #ifndef NO_SHA | ||
| 321 | SHA_CTX sha; | ||
| 322 | #endif | ||
| 323 | #ifndef NO_MDC2 | ||
| 324 | MDC2_CTX mdc2; | ||
| 325 | #endif | ||
| 326 | } md; | ||
| 327 | } EVP_MD_CTX; | ||
| 328 | 273 | ||
| 329 | typedef struct evp_cipher_st EVP_CIPHER; | 274 | #define EVP_MD_CTX_FLAG_ONESHOT 0x0001 /* digest update will be called |
| 330 | typedef struct evp_cipher_ctx_st EVP_CIPHER_CTX; | 275 | * once only */ |
| 276 | #define EVP_MD_CTX_FLAG_CLEANED 0x0002 /* context has already been | ||
| 277 | * cleaned */ | ||
| 331 | 278 | ||
| 332 | struct evp_cipher_st | 279 | struct evp_cipher_st |
| 333 | { | 280 | { |
| @@ -341,12 +288,12 @@ struct evp_cipher_st | |||
| 341 | int (*do_cipher)(EVP_CIPHER_CTX *ctx, unsigned char *out, | 288 | int (*do_cipher)(EVP_CIPHER_CTX *ctx, unsigned char *out, |
| 342 | const unsigned char *in, unsigned int inl);/* encrypt/decrypt data */ | 289 | const unsigned char *in, unsigned int inl);/* encrypt/decrypt data */ |
| 343 | int (*cleanup)(EVP_CIPHER_CTX *); /* cleanup ctx */ | 290 | int (*cleanup)(EVP_CIPHER_CTX *); /* cleanup ctx */ |
| 344 | int ctx_size; /* how big the ctx needs to be */ | 291 | 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 */ | 292 | int (*set_asn1_parameters)(EVP_CIPHER_CTX *, ASN1_TYPE *); /* Populate a ASN1_TYPE with parameters */ |
| 346 | int (*get_asn1_parameters)(EVP_CIPHER_CTX *, ASN1_TYPE *); /* Get parameters from a ASN1_TYPE */ | 293 | int (*get_asn1_parameters)(EVP_CIPHER_CTX *, ASN1_TYPE *); /* Get parameters from a ASN1_TYPE */ |
| 347 | int (*ctrl)(EVP_CIPHER_CTX *, int type, int arg, void *ptr); /* Miscellaneous operations */ | 294 | int (*ctrl)(EVP_CIPHER_CTX *, int type, int arg, void *ptr); /* Miscellaneous operations */ |
| 348 | void *app_data; /* Application data */ | 295 | void *app_data; /* Application data */ |
| 349 | }; | 296 | } /* EVP_CIPHER */; |
| 350 | 297 | ||
| 351 | /* Values for cipher flags */ | 298 | /* Values for cipher flags */ |
| 352 | 299 | ||
| @@ -368,6 +315,8 @@ struct evp_cipher_st | |||
| 368 | #define EVP_CIPH_CTRL_INIT 0x40 | 315 | #define EVP_CIPH_CTRL_INIT 0x40 |
| 369 | /* Don't use standard key length function */ | 316 | /* Don't use standard key length function */ |
| 370 | #define EVP_CIPH_CUSTOM_KEY_LENGTH 0x80 | 317 | #define EVP_CIPH_CUSTOM_KEY_LENGTH 0x80 |
| 318 | /* Don't use standard block padding */ | ||
| 319 | #define EVP_CIPH_NO_PADDING 0x100 | ||
| 371 | 320 | ||
| 372 | /* ctrl() values */ | 321 | /* ctrl() values */ |
| 373 | 322 | ||
| @@ -387,62 +336,23 @@ typedef struct evp_cipher_info_st | |||
| 387 | struct evp_cipher_ctx_st | 336 | struct evp_cipher_ctx_st |
| 388 | { | 337 | { |
| 389 | const EVP_CIPHER *cipher; | 338 | const EVP_CIPHER *cipher; |
| 339 | ENGINE *engine; /* functional reference if 'cipher' is ENGINE-provided */ | ||
| 390 | int encrypt; /* encrypt or decrypt */ | 340 | int encrypt; /* encrypt or decrypt */ |
| 391 | int buf_len; /* number we have left */ | 341 | int buf_len; /* number we have left */ |
| 392 | 342 | ||
| 393 | unsigned char oiv[EVP_MAX_IV_LENGTH]; /* original iv */ | 343 | unsigned char oiv[EVP_MAX_IV_LENGTH]; /* original iv */ |
| 394 | unsigned char iv[EVP_MAX_IV_LENGTH]; /* working iv */ | 344 | unsigned char iv[EVP_MAX_IV_LENGTH]; /* working iv */ |
| 395 | unsigned char buf[EVP_MAX_IV_LENGTH]; /* saved partial block */ | 345 | unsigned char buf[EVP_MAX_BLOCK_LENGTH];/* saved partial block */ |
| 396 | int num; /* used by cfb/ofb mode */ | 346 | int num; /* used by cfb/ofb mode */ |
| 397 | 347 | ||
| 398 | void *app_data; /* application stuff */ | 348 | void *app_data; /* application stuff */ |
| 399 | int key_len; /* May change for variable length cipher */ | 349 | int key_len; /* May change for variable length cipher */ |
| 400 | union { | 350 | unsigned long flags; /* Various flags */ |
| 401 | #ifndef NO_RC4 | 351 | void *cipher_data; /* per EVP data */ |
| 402 | struct | 352 | int final_used; |
| 403 | { | 353 | int block_mask; |
| 404 | unsigned char key[EVP_RC4_KEY_SIZE]; | 354 | unsigned char final[EVP_MAX_BLOCK_LENGTH];/* possible final block */ |
| 405 | RC4_KEY ks; /* working key */ | 355 | } /* EVP_CIPHER_CTX */; |
| 406 | } rc4; | ||
| 407 | #endif | ||
| 408 | #ifndef NO_DES | ||
| 409 | des_key_schedule des_ks;/* key schedule */ | ||
| 410 | struct | ||
| 411 | { | ||
| 412 | des_key_schedule ks;/* key schedule */ | ||
| 413 | des_cblock inw; | ||
| 414 | des_cblock outw; | ||
| 415 | } desx_cbc; | ||
| 416 | struct | ||
| 417 | { | ||
| 418 | des_key_schedule ks1;/* key schedule */ | ||
| 419 | des_key_schedule ks2;/* key schedule (for ede) */ | ||
| 420 | des_key_schedule ks3;/* key schedule (for ede3) */ | ||
| 421 | } des_ede; | ||
| 422 | #endif | ||
| 423 | #ifndef NO_IDEA | ||
| 424 | IDEA_KEY_SCHEDULE idea_ks;/* key schedule */ | ||
| 425 | #endif | ||
| 426 | #ifndef NO_RC2 | ||
| 427 | struct { | ||
| 428 | int key_bits; /* effective key bits */ | ||
| 429 | RC2_KEY ks;/* key schedule */ | ||
| 430 | } rc2; | ||
| 431 | #endif | ||
| 432 | #ifndef NO_RC5 | ||
| 433 | struct { | ||
| 434 | int rounds; /* number of rounds */ | ||
| 435 | RC5_32_KEY ks;/* key schedule */ | ||
| 436 | } rc5; | ||
| 437 | #endif | ||
| 438 | #ifndef NO_BF | ||
| 439 | BF_KEY bf_ks;/* key schedule */ | ||
| 440 | #endif | ||
| 441 | #ifndef NO_CAST | ||
| 442 | CAST_KEY cast_ks;/* key schedule */ | ||
| 443 | #endif | ||
| 444 | } c; | ||
| 445 | }; | ||
| 446 | 356 | ||
| 447 | typedef struct evp_Encode_Ctx_st | 357 | typedef struct evp_Encode_Ctx_st |
| 448 | { | 358 | { |
| @@ -459,20 +369,20 @@ typedef struct evp_Encode_Ctx_st | |||
| 459 | 369 | ||
| 460 | /* Password based encryption function */ | 370 | /* Password based encryption function */ |
| 461 | typedef int (EVP_PBE_KEYGEN)(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, | 371 | typedef int (EVP_PBE_KEYGEN)(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, |
| 462 | ASN1_TYPE *param, EVP_CIPHER *cipher, | 372 | ASN1_TYPE *param, const EVP_CIPHER *cipher, |
| 463 | EVP_MD *md, int en_de); | 373 | const EVP_MD *md, int en_de); |
| 464 | 374 | ||
| 465 | #ifndef NO_RSA | 375 | #ifndef OPENSSL_NO_RSA |
| 466 | #define EVP_PKEY_assign_RSA(pkey,rsa) EVP_PKEY_assign((pkey),EVP_PKEY_RSA,\ | 376 | #define EVP_PKEY_assign_RSA(pkey,rsa) EVP_PKEY_assign((pkey),EVP_PKEY_RSA,\ |
| 467 | (char *)(rsa)) | 377 | (char *)(rsa)) |
| 468 | #endif | 378 | #endif |
| 469 | 379 | ||
| 470 | #ifndef NO_DSA | 380 | #ifndef OPENSSL_NO_DSA |
| 471 | #define EVP_PKEY_assign_DSA(pkey,dsa) EVP_PKEY_assign((pkey),EVP_PKEY_DSA,\ | 381 | #define EVP_PKEY_assign_DSA(pkey,dsa) EVP_PKEY_assign((pkey),EVP_PKEY_DSA,\ |
| 472 | (char *)(dsa)) | 382 | (char *)(dsa)) |
| 473 | #endif | 383 | #endif |
| 474 | 384 | ||
| 475 | #ifndef NO_DH | 385 | #ifndef OPENSSL_NO_DH |
| 476 | #define EVP_PKEY_assign_DH(pkey,dh) EVP_PKEY_assign((pkey),EVP_PKEY_DH,\ | 386 | #define EVP_PKEY_assign_DH(pkey,dh) EVP_PKEY_assign((pkey),EVP_PKEY_DH,\ |
| 477 | (char *)(dh)) | 387 | (char *)(dh)) |
| 478 | #endif | 388 | #endif |
| @@ -484,6 +394,8 @@ typedef int (EVP_PBE_KEYGEN)(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, | |||
| 484 | #define EVP_get_cipherbyobj(a) EVP_get_cipherbynid(OBJ_obj2nid(a)) | 394 | #define EVP_get_cipherbyobj(a) EVP_get_cipherbynid(OBJ_obj2nid(a)) |
| 485 | 395 | ||
| 486 | #define EVP_MD_type(e) ((e)->type) | 396 | #define EVP_MD_type(e) ((e)->type) |
| 397 | #define EVP_MD_nid(e) EVP_MD_type(e) | ||
| 398 | #define EVP_MD_name(e) OBJ_nid2sn(EVP_MD_nid(e)) | ||
| 487 | #define EVP_MD_pkey_type(e) ((e)->pkey_type) | 399 | #define EVP_MD_pkey_type(e) ((e)->pkey_type) |
| 488 | #define EVP_MD_size(e) ((e)->md_size) | 400 | #define EVP_MD_size(e) ((e)->md_size) |
| 489 | #define EVP_MD_block_size(e) ((e)->block_size) | 401 | #define EVP_MD_block_size(e) ((e)->block_size) |
| @@ -494,11 +406,12 @@ typedef int (EVP_PBE_KEYGEN)(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, | |||
| 494 | #define EVP_MD_CTX_type(e) EVP_MD_type((e)->digest) | 406 | #define EVP_MD_CTX_type(e) EVP_MD_type((e)->digest) |
| 495 | 407 | ||
| 496 | #define EVP_CIPHER_nid(e) ((e)->nid) | 408 | #define EVP_CIPHER_nid(e) ((e)->nid) |
| 409 | #define EVP_CIPHER_name(e) OBJ_nid2sn(EVP_CIPHER_nid(e)) | ||
| 497 | #define EVP_CIPHER_block_size(e) ((e)->block_size) | 410 | #define EVP_CIPHER_block_size(e) ((e)->block_size) |
| 498 | #define EVP_CIPHER_key_length(e) ((e)->key_len) | 411 | #define EVP_CIPHER_key_length(e) ((e)->key_len) |
| 499 | #define EVP_CIPHER_iv_length(e) ((e)->iv_len) | 412 | #define EVP_CIPHER_iv_length(e) ((e)->iv_len) |
| 500 | #define EVP_CIPHER_flags(e) ((e)->flags) | 413 | #define EVP_CIPHER_flags(e) ((e)->flags) |
| 501 | #define EVP_CIPHER_mode(e) ((e)->flags) & EVP_CIPH_MODE) | 414 | #define EVP_CIPHER_mode(e) (((e)->flags) & EVP_CIPH_MODE) |
| 502 | 415 | ||
| 503 | #define EVP_CIPHER_CTX_cipher(e) ((e)->cipher) | 416 | #define EVP_CIPHER_CTX_cipher(e) ((e)->cipher) |
| 504 | #define EVP_CIPHER_CTX_nid(e) ((e)->cipher->nid) | 417 | #define EVP_CIPHER_CTX_nid(e) ((e)->cipher->nid) |
| @@ -514,8 +427,10 @@ typedef int (EVP_PBE_KEYGEN)(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, | |||
| 514 | #define EVP_ENCODE_LENGTH(l) (((l+2)/3*4)+(l/48+1)*2+80) | 427 | #define EVP_ENCODE_LENGTH(l) (((l+2)/3*4)+(l/48+1)*2+80) |
| 515 | #define EVP_DECODE_LENGTH(l) ((l+3)/4*3+80) | 428 | #define EVP_DECODE_LENGTH(l) ((l+3)/4*3+80) |
| 516 | 429 | ||
| 430 | #define EVP_SignInit_ex(a,b,c) EVP_DigestInit_ex(a,b,c) | ||
| 517 | #define EVP_SignInit(a,b) EVP_DigestInit(a,b) | 431 | #define EVP_SignInit(a,b) EVP_DigestInit(a,b) |
| 518 | #define EVP_SignUpdate(a,b,c) EVP_DigestUpdate(a,b,c) | 432 | #define EVP_SignUpdate(a,b,c) EVP_DigestUpdate(a,b,c) |
| 433 | #define EVP_VerifyInit_ex(a,b,c) EVP_DigestInit_ex(a,b,c) | ||
| 519 | #define EVP_VerifyInit(a,b) EVP_DigestInit(a,b) | 434 | #define EVP_VerifyInit(a,b) EVP_DigestInit(a,b) |
| 520 | #define EVP_VerifyUpdate(a,b,c) EVP_DigestUpdate(a,b,c) | 435 | #define EVP_VerifyUpdate(a,b,c) EVP_DigestUpdate(a,b,c) |
| 521 | #define EVP_OpenUpdate(a,b,c,d,e) EVP_DecryptUpdate(a,b,c,d,e) | 436 | #define EVP_OpenUpdate(a,b,c,d,e) EVP_DecryptUpdate(a,b,c,d,e) |
| @@ -542,38 +457,61 @@ void BIO_set_md(BIO *,const EVP_MD *md); | |||
| 542 | #define EVP_delete_digest_alias(alias) \ | 457 | #define EVP_delete_digest_alias(alias) \ |
| 543 | OBJ_NAME_remove(alias,OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS); | 458 | OBJ_NAME_remove(alias,OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS); |
| 544 | 459 | ||
| 545 | 460 | void EVP_MD_CTX_init(EVP_MD_CTX *ctx); | |
| 546 | int EVP_MD_CTX_copy(EVP_MD_CTX *out,EVP_MD_CTX *in); | 461 | int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx); |
| 547 | void EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type); | 462 | EVP_MD_CTX *EVP_MD_CTX_create(void); |
| 548 | void EVP_DigestUpdate(EVP_MD_CTX *ctx,const void *d, | 463 | void EVP_MD_CTX_destroy(EVP_MD_CTX *ctx); |
| 464 | int EVP_MD_CTX_copy_ex(EVP_MD_CTX *out,const EVP_MD_CTX *in); | ||
| 465 | #define EVP_MD_CTX_set_flags(ctx,flgs) ((ctx)->flags|=(flgs)) | ||
| 466 | #define EVP_MD_CTX_clear_flags(ctx,flgs) ((ctx)->flags&=~(flgs)) | ||
| 467 | #define EVP_MD_CTX_test_flags(ctx,flgs) ((ctx)->flags&(flgs)) | ||
| 468 | int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl); | ||
| 469 | int EVP_DigestUpdate(EVP_MD_CTX *ctx,const void *d, | ||
| 549 | unsigned int cnt); | 470 | unsigned int cnt); |
| 550 | void EVP_DigestFinal(EVP_MD_CTX *ctx,unsigned char *md,unsigned int *s); | 471 | int EVP_DigestFinal_ex(EVP_MD_CTX *ctx,unsigned char *md,unsigned int *s); |
| 472 | int EVP_Digest(void *data, unsigned int count, | ||
| 473 | unsigned char *md, unsigned int *size, const EVP_MD *type, ENGINE *impl); | ||
| 474 | |||
| 475 | int EVP_MD_CTX_copy(EVP_MD_CTX *out,const EVP_MD_CTX *in); | ||
| 476 | int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type); | ||
| 477 | int EVP_DigestFinal(EVP_MD_CTX *ctx,unsigned char *md,unsigned int *s); | ||
| 551 | 478 | ||
| 552 | int EVP_read_pw_string(char *buf,int length,const char *prompt,int verify); | 479 | int EVP_read_pw_string(char *buf,int length,const char *prompt,int verify); |
| 553 | void EVP_set_pw_prompt(char *prompt); | 480 | void EVP_set_pw_prompt(char *prompt); |
| 554 | char * EVP_get_pw_prompt(void); | 481 | char * EVP_get_pw_prompt(void); |
| 555 | 482 | ||
| 556 | int EVP_BytesToKey(const EVP_CIPHER *type, EVP_MD *md, | 483 | int EVP_BytesToKey(const EVP_CIPHER *type,const EVP_MD *md, |
| 557 | const unsigned char *salt, const unsigned char *data, int datal, | 484 | const unsigned char *salt, const unsigned char *data, |
| 558 | int count, unsigned char *key, unsigned char *iv); | 485 | int datal, int count, unsigned char *key,unsigned char *iv); |
| 559 | 486 | ||
| 560 | int EVP_EncryptInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *type, | 487 | int EVP_EncryptInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, |
| 561 | unsigned char *key, unsigned char *iv); | 488 | const unsigned char *key, const unsigned char *iv); |
| 489 | int EVP_EncryptInit_ex(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, ENGINE *impl, | ||
| 490 | const unsigned char *key, const unsigned char *iv); | ||
| 562 | int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, | 491 | int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, |
| 563 | int *outl, unsigned char *in, int inl); | 492 | int *outl, const unsigned char *in, int inl); |
| 493 | int EVP_EncryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); | ||
| 564 | int EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); | 494 | int EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); |
| 565 | 495 | ||
| 566 | int EVP_DecryptInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *type, | 496 | int EVP_DecryptInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, |
| 567 | unsigned char *key, unsigned char *iv); | 497 | const unsigned char *key, const unsigned char *iv); |
| 498 | int EVP_DecryptInit_ex(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, ENGINE *impl, | ||
| 499 | const unsigned char *key, const unsigned char *iv); | ||
| 568 | int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, | 500 | int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, |
| 569 | int *outl, unsigned char *in, int inl); | 501 | int *outl, const unsigned char *in, int inl); |
| 570 | int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); | 502 | int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); |
| 571 | 503 | int EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); | |
| 572 | int EVP_CipherInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *type, | 504 | |
| 573 | unsigned char *key,unsigned char *iv,int enc); | 505 | int EVP_CipherInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, |
| 506 | const unsigned char *key,const unsigned char *iv, | ||
| 507 | int enc); | ||
| 508 | int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, ENGINE *impl, | ||
| 509 | const unsigned char *key,const unsigned char *iv, | ||
| 510 | int enc); | ||
| 574 | int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, | 511 | int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, |
| 575 | int *outl, unsigned char *in, int inl); | 512 | int *outl, const unsigned char *in, int inl); |
| 576 | int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); | 513 | int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); |
| 514 | int EVP_CipherFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); | ||
| 577 | 515 | ||
| 578 | int EVP_SignFinal(EVP_MD_CTX *ctx,unsigned char *md,unsigned int *s, | 516 | int EVP_SignFinal(EVP_MD_CTX *ctx,unsigned char *md,unsigned int *s, |
| 579 | EVP_PKEY *pkey); | 517 | EVP_PKEY *pkey); |
| @@ -581,11 +519,11 @@ int EVP_SignFinal(EVP_MD_CTX *ctx,unsigned char *md,unsigned int *s, | |||
| 581 | int EVP_VerifyFinal(EVP_MD_CTX *ctx,unsigned char *sigbuf, | 519 | int EVP_VerifyFinal(EVP_MD_CTX *ctx,unsigned char *sigbuf, |
| 582 | unsigned int siglen,EVP_PKEY *pkey); | 520 | unsigned int siglen,EVP_PKEY *pkey); |
| 583 | 521 | ||
| 584 | int EVP_OpenInit(EVP_CIPHER_CTX *ctx,EVP_CIPHER *type,unsigned char *ek, | 522 | int EVP_OpenInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *type,unsigned char *ek, |
| 585 | int ekl,unsigned char *iv,EVP_PKEY *priv); | 523 | int ekl,unsigned char *iv,EVP_PKEY *priv); |
| 586 | int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); | 524 | int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); |
| 587 | 525 | ||
| 588 | int EVP_SealInit(EVP_CIPHER_CTX *ctx, EVP_CIPHER *type, unsigned char **ek, | 526 | int EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, unsigned char **ek, |
| 589 | int *ekl, unsigned char *iv,EVP_PKEY **pubk, int npubk); | 527 | int *ekl, unsigned char *iv,EVP_PKEY **pubk, int npubk); |
| 590 | void EVP_SealFinal(EVP_CIPHER_CTX *ctx,unsigned char *out,int *outl); | 528 | void EVP_SealFinal(EVP_CIPHER_CTX *ctx,unsigned char *out,int *outl); |
| 591 | 529 | ||
| @@ -602,14 +540,13 @@ int EVP_DecodeFinal(EVP_ENCODE_CTX *ctx, unsigned | |||
| 602 | char *out, int *outl); | 540 | char *out, int *outl); |
| 603 | int EVP_DecodeBlock(unsigned char *t, const unsigned char *f, int n); | 541 | int EVP_DecodeBlock(unsigned char *t, const unsigned char *f, int n); |
| 604 | 542 | ||
| 605 | void ERR_load_EVP_strings(void ); | ||
| 606 | |||
| 607 | void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *a); | 543 | void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *a); |
| 608 | int EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *a); | 544 | int EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *a); |
| 609 | int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *x, int keylen); | 545 | int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *x, int keylen); |
| 546 | int EVP_CIPHER_CTX_set_padding(EVP_CIPHER_CTX *c, int pad); | ||
| 610 | int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr); | 547 | int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr); |
| 611 | 548 | ||
| 612 | #ifndef NO_BIO | 549 | #ifndef OPENSSL_NO_BIO |
| 613 | BIO_METHOD *BIO_f_md(void); | 550 | BIO_METHOD *BIO_f_md(void); |
| 614 | BIO_METHOD *BIO_f_base64(void); | 551 | BIO_METHOD *BIO_f_base64(void); |
| 615 | BIO_METHOD *BIO_f_cipher(void); | 552 | BIO_METHOD *BIO_f_cipher(void); |
| @@ -618,89 +555,117 @@ void BIO_set_cipher(BIO *b,const EVP_CIPHER *c,unsigned char *k, | |||
| 618 | unsigned char *i, int enc); | 555 | unsigned char *i, int enc); |
| 619 | #endif | 556 | #endif |
| 620 | 557 | ||
| 621 | EVP_MD *EVP_md_null(void); | 558 | const EVP_MD *EVP_md_null(void); |
| 622 | #ifndef NO_MD2 | 559 | #ifndef OPENSSL_NO_MD2 |
| 623 | EVP_MD *EVP_md2(void); | 560 | const EVP_MD *EVP_md2(void); |
| 624 | #endif | 561 | #endif |
| 625 | #ifndef NO_MD4 | 562 | #ifndef OPENSSL_NO_MD4 |
| 626 | EVP_MD *EVP_md4(void); | 563 | const EVP_MD *EVP_md4(void); |
| 627 | #endif | 564 | #endif |
| 628 | #ifndef NO_MD5 | 565 | #ifndef OPENSSL_NO_MD5 |
| 629 | EVP_MD *EVP_md5(void); | 566 | const EVP_MD *EVP_md5(void); |
| 630 | #endif | 567 | #endif |
| 631 | #ifndef NO_SHA | 568 | #ifndef OPENSSL_NO_SHA |
| 632 | EVP_MD *EVP_sha(void); | 569 | const EVP_MD *EVP_sha(void); |
| 633 | EVP_MD *EVP_sha1(void); | 570 | const EVP_MD *EVP_sha1(void); |
| 634 | EVP_MD *EVP_dss(void); | 571 | const EVP_MD *EVP_dss(void); |
| 635 | EVP_MD *EVP_dss1(void); | 572 | const EVP_MD *EVP_dss1(void); |
| 636 | #endif | 573 | #endif |
| 637 | #ifndef NO_MDC2 | 574 | #ifndef OPENSSL_NO_MDC2 |
| 638 | EVP_MD *EVP_mdc2(void); | 575 | const EVP_MD *EVP_mdc2(void); |
| 639 | #endif | 576 | #endif |
| 640 | #ifndef NO_RIPEMD | 577 | #ifndef OPENSSL_NO_RIPEMD |
| 641 | EVP_MD *EVP_ripemd160(void); | 578 | const EVP_MD *EVP_ripemd160(void); |
| 642 | #endif | 579 | #endif |
| 643 | EVP_CIPHER *EVP_enc_null(void); /* does nothing :-) */ | 580 | const EVP_CIPHER *EVP_enc_null(void); /* does nothing :-) */ |
| 644 | #ifndef NO_DES | 581 | #ifndef OPENSSL_NO_DES |
| 645 | EVP_CIPHER *EVP_des_ecb(void); | 582 | const EVP_CIPHER *EVP_des_ecb(void); |
| 646 | EVP_CIPHER *EVP_des_ede(void); | 583 | const EVP_CIPHER *EVP_des_ede(void); |
| 647 | EVP_CIPHER *EVP_des_ede3(void); | 584 | const EVP_CIPHER *EVP_des_ede3(void); |
| 648 | EVP_CIPHER *EVP_des_cfb(void); | 585 | const EVP_CIPHER *EVP_des_cfb(void); |
| 649 | EVP_CIPHER *EVP_des_ede_cfb(void); | 586 | const EVP_CIPHER *EVP_des_ede_cfb(void); |
| 650 | EVP_CIPHER *EVP_des_ede3_cfb(void); | 587 | const EVP_CIPHER *EVP_des_ede3_cfb(void); |
| 651 | EVP_CIPHER *EVP_des_ofb(void); | 588 | const EVP_CIPHER *EVP_des_ofb(void); |
| 652 | EVP_CIPHER *EVP_des_ede_ofb(void); | 589 | const EVP_CIPHER *EVP_des_ede_ofb(void); |
| 653 | EVP_CIPHER *EVP_des_ede3_ofb(void); | 590 | const EVP_CIPHER *EVP_des_ede3_ofb(void); |
| 654 | EVP_CIPHER *EVP_des_cbc(void); | 591 | const EVP_CIPHER *EVP_des_cbc(void); |
| 655 | EVP_CIPHER *EVP_des_ede_cbc(void); | 592 | const EVP_CIPHER *EVP_des_ede_cbc(void); |
| 656 | EVP_CIPHER *EVP_des_ede3_cbc(void); | 593 | const EVP_CIPHER *EVP_des_ede3_cbc(void); |
| 657 | EVP_CIPHER *EVP_desx_cbc(void); | 594 | const EVP_CIPHER *EVP_desx_cbc(void); |
| 658 | #endif | 595 | /* This should now be supported through the dev_crypto ENGINE. But also, why are |
| 659 | #ifndef NO_RC4 | 596 | * rc4 and md5 declarations made here inside a "NO_DES" precompiler branch? */ |
| 660 | EVP_CIPHER *EVP_rc4(void); | 597 | #if 0 |
| 661 | EVP_CIPHER *EVP_rc4_40(void); | 598 | # ifdef OPENSSL_OPENBSD_DEV_CRYPTO |
| 662 | #endif | 599 | const EVP_CIPHER *EVP_dev_crypto_des_ede3_cbc(void); |
| 663 | #ifndef NO_IDEA | 600 | const EVP_CIPHER *EVP_dev_crypto_rc4(void); |
| 664 | EVP_CIPHER *EVP_idea_ecb(void); | 601 | const EVP_MD *EVP_dev_crypto_md5(void); |
| 665 | EVP_CIPHER *EVP_idea_cfb(void); | 602 | # endif |
| 666 | EVP_CIPHER *EVP_idea_ofb(void); | 603 | #endif |
| 667 | EVP_CIPHER *EVP_idea_cbc(void); | 604 | #endif |
| 668 | #endif | 605 | #ifndef OPENSSL_NO_RC4 |
| 669 | #ifndef NO_RC2 | 606 | const EVP_CIPHER *EVP_rc4(void); |
| 670 | EVP_CIPHER *EVP_rc2_ecb(void); | 607 | const EVP_CIPHER *EVP_rc4_40(void); |
| 671 | EVP_CIPHER *EVP_rc2_cbc(void); | 608 | #endif |
| 672 | EVP_CIPHER *EVP_rc2_40_cbc(void); | 609 | #ifndef OPENSSL_NO_IDEA |
| 673 | EVP_CIPHER *EVP_rc2_64_cbc(void); | 610 | const EVP_CIPHER *EVP_idea_ecb(void); |
| 674 | EVP_CIPHER *EVP_rc2_cfb(void); | 611 | const EVP_CIPHER *EVP_idea_cfb(void); |
| 675 | EVP_CIPHER *EVP_rc2_ofb(void); | 612 | const EVP_CIPHER *EVP_idea_ofb(void); |
| 676 | #endif | 613 | const EVP_CIPHER *EVP_idea_cbc(void); |
| 677 | #ifndef NO_BF | 614 | #endif |
| 678 | EVP_CIPHER *EVP_bf_ecb(void); | 615 | #ifndef OPENSSL_NO_RC2 |
| 679 | EVP_CIPHER *EVP_bf_cbc(void); | 616 | const EVP_CIPHER *EVP_rc2_ecb(void); |
| 680 | EVP_CIPHER *EVP_bf_cfb(void); | 617 | const EVP_CIPHER *EVP_rc2_cbc(void); |
| 681 | EVP_CIPHER *EVP_bf_ofb(void); | 618 | const EVP_CIPHER *EVP_rc2_40_cbc(void); |
| 682 | #endif | 619 | const EVP_CIPHER *EVP_rc2_64_cbc(void); |
| 683 | #ifndef NO_CAST | 620 | const EVP_CIPHER *EVP_rc2_cfb(void); |
| 684 | EVP_CIPHER *EVP_cast5_ecb(void); | 621 | const EVP_CIPHER *EVP_rc2_ofb(void); |
| 685 | EVP_CIPHER *EVP_cast5_cbc(void); | 622 | #endif |
| 686 | EVP_CIPHER *EVP_cast5_cfb(void); | 623 | #ifndef OPENSSL_NO_BF |
| 687 | EVP_CIPHER *EVP_cast5_ofb(void); | 624 | const EVP_CIPHER *EVP_bf_ecb(void); |
| 688 | #endif | 625 | const EVP_CIPHER *EVP_bf_cbc(void); |
| 689 | #ifndef NO_RC5 | 626 | const EVP_CIPHER *EVP_bf_cfb(void); |
| 690 | EVP_CIPHER *EVP_rc5_32_12_16_cbc(void); | 627 | const EVP_CIPHER *EVP_bf_ofb(void); |
| 691 | EVP_CIPHER *EVP_rc5_32_12_16_ecb(void); | 628 | #endif |
| 692 | EVP_CIPHER *EVP_rc5_32_12_16_cfb(void); | 629 | #ifndef OPENSSL_NO_CAST |
| 693 | EVP_CIPHER *EVP_rc5_32_12_16_ofb(void); | 630 | const EVP_CIPHER *EVP_cast5_ecb(void); |
| 694 | #endif | 631 | const EVP_CIPHER *EVP_cast5_cbc(void); |
| 695 | void OpenSSL_add_all_algorithms(void); | 632 | const EVP_CIPHER *EVP_cast5_cfb(void); |
| 633 | const EVP_CIPHER *EVP_cast5_ofb(void); | ||
| 634 | #endif | ||
| 635 | #ifndef OPENSSL_NO_RC5 | ||
| 636 | const EVP_CIPHER *EVP_rc5_32_12_16_cbc(void); | ||
| 637 | const EVP_CIPHER *EVP_rc5_32_12_16_ecb(void); | ||
| 638 | const EVP_CIPHER *EVP_rc5_32_12_16_cfb(void); | ||
| 639 | const EVP_CIPHER *EVP_rc5_32_12_16_ofb(void); | ||
| 640 | #endif | ||
| 641 | #ifndef OPENSSL_NO_AES | ||
| 642 | const EVP_CIPHER *EVP_aes_128_ecb(void); | ||
| 643 | const EVP_CIPHER *EVP_aes_128_cbc(void); | ||
| 644 | const EVP_CIPHER *EVP_aes_192_ecb(void); | ||
| 645 | const EVP_CIPHER *EVP_aes_192_cbc(void); | ||
| 646 | const EVP_CIPHER *EVP_aes_256_ecb(void); | ||
| 647 | const EVP_CIPHER *EVP_aes_256_cbc(void); | ||
| 648 | #endif | ||
| 649 | |||
| 650 | void OPENSSL_add_all_algorithms_noconf(void); | ||
| 651 | void OPENSSL_add_all_algorithms_conf(void); | ||
| 652 | |||
| 653 | #ifdef OPENSSL_LOAD_CONF | ||
| 654 | #define OpenSSL_add_all_algorithms() \ | ||
| 655 | OPENSSL_add_all_algorithms_conf() | ||
| 656 | #else | ||
| 657 | #define OpenSSL_add_all_algorithms() \ | ||
| 658 | OPENSSL_add_all_algorithms_noconf() | ||
| 659 | #endif | ||
| 660 | |||
| 696 | void OpenSSL_add_all_ciphers(void); | 661 | void OpenSSL_add_all_ciphers(void); |
| 697 | void OpenSSL_add_all_digests(void); | 662 | void OpenSSL_add_all_digests(void); |
| 698 | #define SSLeay_add_all_algorithms() OpenSSL_add_all_algorithms() | 663 | #define SSLeay_add_all_algorithms() OpenSSL_add_all_algorithms() |
| 699 | #define SSLeay_add_all_ciphers() OpenSSL_add_all_ciphers() | 664 | #define SSLeay_add_all_ciphers() OpenSSL_add_all_ciphers() |
| 700 | #define SSLeay_add_all_digests() OpenSSL_add_all_digests() | 665 | #define SSLeay_add_all_digests() OpenSSL_add_all_digests() |
| 701 | 666 | ||
| 702 | int EVP_add_cipher(EVP_CIPHER *cipher); | 667 | int EVP_add_cipher(const EVP_CIPHER *cipher); |
| 703 | int EVP_add_digest(EVP_MD *digest); | 668 | int EVP_add_digest(const EVP_MD *digest); |
| 704 | 669 | ||
| 705 | const EVP_CIPHER *EVP_get_cipherbyname(const char *name); | 670 | const EVP_CIPHER *EVP_get_cipherbyname(const char *name); |
| 706 | const EVP_MD *EVP_get_digestbyname(const char *name); | 671 | const EVP_MD *EVP_get_digestbyname(const char *name); |
| @@ -714,18 +679,24 @@ int EVP_PKEY_type(int type); | |||
| 714 | int EVP_PKEY_bits(EVP_PKEY *pkey); | 679 | int EVP_PKEY_bits(EVP_PKEY *pkey); |
| 715 | int EVP_PKEY_size(EVP_PKEY *pkey); | 680 | int EVP_PKEY_size(EVP_PKEY *pkey); |
| 716 | int EVP_PKEY_assign(EVP_PKEY *pkey,int type,char *key); | 681 | int EVP_PKEY_assign(EVP_PKEY *pkey,int type,char *key); |
| 717 | #ifndef NO_RSA | 682 | |
| 718 | int EVP_PKEY_set1_RSA(EVP_PKEY *pkey,RSA *key); | 683 | #ifndef OPENSSL_NO_RSA |
| 719 | RSA * EVP_PKEY_get1_RSA(EVP_PKEY *pkey); | 684 | struct rsa_st; |
| 685 | int EVP_PKEY_set1_RSA(EVP_PKEY *pkey,struct rsa_st *key); | ||
| 686 | struct rsa_st *EVP_PKEY_get1_RSA(EVP_PKEY *pkey); | ||
| 720 | #endif | 687 | #endif |
| 721 | #ifndef NO_DSA | 688 | #ifndef OPENSSL_NO_DSA |
| 722 | int EVP_PKEY_set1_DSA(EVP_PKEY *pkey,DSA *key); | 689 | struct dsa_st; |
| 723 | DSA * EVP_PKEY_get1_DSA(EVP_PKEY *pkey); | 690 | int EVP_PKEY_set1_DSA(EVP_PKEY *pkey,struct dsa_st *key); |
| 691 | struct dsa_st *EVP_PKEY_get1_DSA(EVP_PKEY *pkey); | ||
| 724 | #endif | 692 | #endif |
| 725 | #ifndef NO_DH | 693 | #ifndef OPENSSL_NO_DH |
| 726 | int EVP_PKEY_set1_DH(EVP_PKEY *pkey,DH *key); | 694 | struct dh_st; |
| 727 | DH * EVP_PKEY_get1_DH(EVP_PKEY *pkey); | 695 | int EVP_PKEY_set1_DH(EVP_PKEY *pkey,struct dh_st *key); |
| 696 | struct dh_st *EVP_PKEY_get1_DH(EVP_PKEY *pkey); | ||
| 728 | #endif | 697 | #endif |
| 698 | |||
| 699 | |||
| 729 | EVP_PKEY * EVP_PKEY_new(void); | 700 | EVP_PKEY * EVP_PKEY_new(void); |
| 730 | void EVP_PKEY_free(EVP_PKEY *pkey); | 701 | void EVP_PKEY_free(EVP_PKEY *pkey); |
| 731 | EVP_PKEY * d2i_PublicKey(int type,EVP_PKEY **a, unsigned char **pp, | 702 | EVP_PKEY * d2i_PublicKey(int type,EVP_PKEY **a, unsigned char **pp, |
| @@ -755,20 +726,20 @@ int EVP_CIPHER_get_asn1_iv(EVP_CIPHER_CTX *c,ASN1_TYPE *type); | |||
| 755 | 726 | ||
| 756 | /* PKCS5 password based encryption */ | 727 | /* PKCS5 password based encryption */ |
| 757 | int PKCS5_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, | 728 | int PKCS5_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, |
| 758 | ASN1_TYPE *param, EVP_CIPHER *cipher, EVP_MD *md, | 729 | ASN1_TYPE *param, const EVP_CIPHER *cipher, const EVP_MD *md, |
| 759 | int en_de); | 730 | int en_de); |
| 760 | int PKCS5_PBKDF2_HMAC_SHA1(const char *pass, int passlen, | 731 | int PKCS5_PBKDF2_HMAC_SHA1(const char *pass, int passlen, |
| 761 | unsigned char *salt, int saltlen, int iter, | 732 | unsigned char *salt, int saltlen, int iter, |
| 762 | int keylen, unsigned char *out); | 733 | int keylen, unsigned char *out); |
| 763 | int PKCS5_v2_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, | 734 | int PKCS5_v2_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, |
| 764 | ASN1_TYPE *param, EVP_CIPHER *cipher, EVP_MD *md, | 735 | ASN1_TYPE *param, const EVP_CIPHER *cipher, const EVP_MD *md, |
| 765 | int en_de); | 736 | int en_de); |
| 766 | 737 | ||
| 767 | void PKCS5_PBE_add(void); | 738 | void PKCS5_PBE_add(void); |
| 768 | 739 | ||
| 769 | int EVP_PBE_CipherInit (ASN1_OBJECT *pbe_obj, const char *pass, int passlen, | 740 | int EVP_PBE_CipherInit (ASN1_OBJECT *pbe_obj, const char *pass, int passlen, |
| 770 | ASN1_TYPE *param, EVP_CIPHER_CTX *ctx, int en_de); | 741 | ASN1_TYPE *param, EVP_CIPHER_CTX *ctx, int en_de); |
| 771 | int EVP_PBE_alg_add(int nid, EVP_CIPHER *cipher, EVP_MD *md, | 742 | int EVP_PBE_alg_add(int nid, const EVP_CIPHER *cipher, const EVP_MD *md, |
| 772 | EVP_PBE_KEYGEN *keygen); | 743 | EVP_PBE_KEYGEN *keygen); |
| 773 | void EVP_PBE_cleanup(void); | 744 | void EVP_PBE_cleanup(void); |
| 774 | 745 | ||
| @@ -776,6 +747,7 @@ void EVP_PBE_cleanup(void); | |||
| 776 | /* The following lines are auto generated by the script mkerr.pl. Any changes | 747 | /* The following lines are auto generated by the script mkerr.pl. Any changes |
| 777 | * made after this point may be overwritten when the script is next run. | 748 | * made after this point may be overwritten when the script is next run. |
| 778 | */ | 749 | */ |
| 750 | void ERR_load_EVP_strings(void); | ||
| 779 | 751 | ||
| 780 | /* Error codes for the EVP functions. */ | 752 | /* Error codes for the EVP functions. */ |
| 781 | 753 | ||
| @@ -785,6 +757,8 @@ void EVP_PBE_cleanup(void); | |||
| 785 | #define EVP_F_EVP_CIPHER_CTX_CTRL 124 | 757 | #define EVP_F_EVP_CIPHER_CTX_CTRL 124 |
| 786 | #define EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH 122 | 758 | #define EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH 122 |
| 787 | #define EVP_F_EVP_DECRYPTFINAL 101 | 759 | #define EVP_F_EVP_DECRYPTFINAL 101 |
| 760 | #define EVP_F_EVP_DIGESTINIT 128 | ||
| 761 | #define EVP_F_EVP_ENCRYPTFINAL 127 | ||
| 788 | #define EVP_F_EVP_MD_CTX_COPY 110 | 762 | #define EVP_F_EVP_MD_CTX_COPY 110 |
| 789 | #define EVP_F_EVP_OPENINIT 102 | 763 | #define EVP_F_EVP_OPENINIT 102 |
| 790 | #define EVP_F_EVP_PBE_ALG_ADD 115 | 764 | #define EVP_F_EVP_PBE_ALG_ADD 115 |
| @@ -799,6 +773,7 @@ void EVP_PBE_cleanup(void); | |||
| 799 | #define EVP_F_EVP_PKEY_GET1_DSA 120 | 773 | #define EVP_F_EVP_PKEY_GET1_DSA 120 |
| 800 | #define EVP_F_EVP_PKEY_GET1_RSA 121 | 774 | #define EVP_F_EVP_PKEY_GET1_RSA 121 |
| 801 | #define EVP_F_EVP_PKEY_NEW 106 | 775 | #define EVP_F_EVP_PKEY_NEW 106 |
| 776 | #define EVP_F_EVP_RIJNDAEL 126 | ||
| 802 | #define EVP_F_EVP_SIGNFINAL 107 | 777 | #define EVP_F_EVP_SIGNFINAL 107 |
| 803 | #define EVP_F_EVP_VERIFYFINAL 108 | 778 | #define EVP_F_EVP_VERIFYFINAL 108 |
| 804 | #define EVP_F_PKCS5_PBE_KEYIVGEN 117 | 779 | #define EVP_F_PKCS5_PBE_KEYIVGEN 117 |
| @@ -807,12 +782,15 @@ void EVP_PBE_cleanup(void); | |||
| 807 | #define EVP_F_RC5_CTRL 125 | 782 | #define EVP_F_RC5_CTRL 125 |
| 808 | 783 | ||
| 809 | /* Reason codes. */ | 784 | /* Reason codes. */ |
| 785 | #define EVP_R_BAD_BLOCK_LENGTH 136 | ||
| 810 | #define EVP_R_BAD_DECRYPT 100 | 786 | #define EVP_R_BAD_DECRYPT 100 |
| 787 | #define EVP_R_BAD_KEY_LENGTH 137 | ||
| 811 | #define EVP_R_BN_DECODE_ERROR 112 | 788 | #define EVP_R_BN_DECODE_ERROR 112 |
| 812 | #define EVP_R_BN_PUBKEY_ERROR 113 | 789 | #define EVP_R_BN_PUBKEY_ERROR 113 |
| 813 | #define EVP_R_CIPHER_PARAMETER_ERROR 122 | 790 | #define EVP_R_CIPHER_PARAMETER_ERROR 122 |
| 814 | #define EVP_R_CTRL_NOT_IMPLEMENTED 132 | 791 | #define EVP_R_CTRL_NOT_IMPLEMENTED 132 |
| 815 | #define EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED 133 | 792 | #define EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED 133 |
| 793 | #define EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH 138 | ||
| 816 | #define EVP_R_DECODE_ERROR 114 | 794 | #define EVP_R_DECODE_ERROR 114 |
| 817 | #define EVP_R_DIFFERENT_KEY_TYPES 101 | 795 | #define EVP_R_DIFFERENT_KEY_TYPES 101 |
| 818 | #define EVP_R_ENCODE_ERROR 115 | 796 | #define EVP_R_ENCODE_ERROR 115 |
| @@ -827,6 +805,7 @@ void EVP_PBE_cleanup(void); | |||
| 827 | #define EVP_R_KEYGEN_FAILURE 120 | 805 | #define EVP_R_KEYGEN_FAILURE 120 |
| 828 | #define EVP_R_MISSING_PARAMETERS 103 | 806 | #define EVP_R_MISSING_PARAMETERS 103 |
| 829 | #define EVP_R_NO_CIPHER_SET 131 | 807 | #define EVP_R_NO_CIPHER_SET 131 |
| 808 | #define EVP_R_NO_DIGEST_SET 139 | ||
| 830 | #define EVP_R_NO_DSA_PARAMETERS 116 | 809 | #define EVP_R_NO_DSA_PARAMETERS 116 |
| 831 | #define EVP_R_NO_SIGN_FUNCTION_CONFIGURED 104 | 810 | #define EVP_R_NO_SIGN_FUNCTION_CONFIGURED 104 |
| 832 | #define EVP_R_NO_VERIFY_FUNCTION_CONFIGURED 105 | 811 | #define EVP_R_NO_VERIFY_FUNCTION_CONFIGURED 105 |
| @@ -848,4 +827,3 @@ void EVP_PBE_cleanup(void); | |||
| 848 | } | 827 | } |
| 849 | #endif | 828 | #endif |
| 850 | #endif | 829 | #endif |
| 851 | |||
diff --git a/src/lib/libcrypto/evp/evp_acnf.c b/src/lib/libcrypto/evp/evp_acnf.c new file mode 100644 index 0000000000..a68b979bdb --- /dev/null +++ b/src/lib/libcrypto/evp/evp_acnf.c | |||
| @@ -0,0 +1,74 @@ | |||
| 1 | /* evp_acnf.c */ | ||
| 2 | /* Written by Stephen Henson (shenson@bigfoot.com) for the OpenSSL | ||
| 3 | * project 2001. | ||
| 4 | */ | ||
| 5 | /* ==================================================================== | ||
| 6 | * Copyright (c) 2001 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 "cryptlib.h" | ||
| 60 | #include <openssl/evp.h> | ||
| 61 | #include <openssl/conf.h> | ||
| 62 | #include <openssl/engine.h> | ||
| 63 | |||
| 64 | |||
| 65 | /* Load all algorithms and configure OpenSSL. | ||
| 66 | * This function is called automatically when | ||
| 67 | * OPENSSL_LOAD_CONF is set. | ||
| 68 | */ | ||
| 69 | |||
| 70 | void OPENSSL_add_all_algorithms_conf(void) | ||
| 71 | { | ||
| 72 | OPENSSL_add_all_algorithms_noconf(); | ||
| 73 | OPENSSL_config(NULL); | ||
| 74 | } | ||
diff --git a/src/lib/libcrypto/evp/evp_enc.c b/src/lib/libcrypto/evp/evp_enc.c index e2687f9879..d28a7d266e 100644 --- a/src/lib/libcrypto/evp/evp_enc.c +++ b/src/lib/libcrypto/evp/evp_enc.c | |||
| @@ -60,8 +60,11 @@ | |||
| 60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
| 61 | #include <openssl/evp.h> | 61 | #include <openssl/evp.h> |
| 62 | #include <openssl/err.h> | 62 | #include <openssl/err.h> |
| 63 | #include <openssl/engine.h> | ||
| 63 | #include "evp_locl.h" | 64 | #include "evp_locl.h" |
| 64 | 65 | ||
| 66 | #include <assert.h> | ||
| 67 | |||
| 65 | const char *EVP_version="EVP" OPENSSL_VERSION_PTEXT; | 68 | const char *EVP_version="EVP" OPENSSL_VERSION_PTEXT; |
| 66 | 69 | ||
| 67 | void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *ctx) | 70 | void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *ctx) |
| @@ -70,23 +73,97 @@ void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *ctx) | |||
| 70 | /* ctx->cipher=NULL; */ | 73 | /* ctx->cipher=NULL; */ |
| 71 | } | 74 | } |
| 72 | 75 | ||
| 76 | |||
| 73 | int EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, | 77 | int EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, |
| 74 | unsigned char *key, unsigned char *iv, int enc) | 78 | const unsigned char *key, const unsigned char *iv, int enc) |
| 75 | { | 79 | { |
| 76 | if(enc && (enc != -1)) enc = 1; | 80 | if (cipher) |
| 77 | if (cipher) { | 81 | EVP_CIPHER_CTX_init(ctx); |
| 82 | return EVP_CipherInit_ex(ctx,cipher,NULL,key,iv,enc); | ||
| 83 | } | ||
| 84 | |||
| 85 | int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, ENGINE *impl, | ||
| 86 | const unsigned char *key, const unsigned char *iv, int enc) | ||
| 87 | { | ||
| 88 | if (enc == -1) | ||
| 89 | enc = ctx->encrypt; | ||
| 90 | else | ||
| 91 | { | ||
| 92 | if (enc) | ||
| 93 | enc = 1; | ||
| 94 | ctx->encrypt = enc; | ||
| 95 | } | ||
| 96 | /* Whether it's nice or not, "Inits" can be used on "Final"'d contexts | ||
| 97 | * so this context may already have an ENGINE! Try to avoid releasing | ||
| 98 | * the previous handle, re-querying for an ENGINE, and having a | ||
| 99 | * reinitialisation, when it may all be unecessary. */ | ||
| 100 | if (ctx->engine && ctx->cipher && (!cipher || | ||
| 101 | (cipher && (cipher->nid == ctx->cipher->nid)))) | ||
| 102 | goto skip_to_init; | ||
| 103 | if (cipher) | ||
| 104 | { | ||
| 105 | /* Ensure an ENGINE left lying around from last time is cleared | ||
| 106 | * (the previous check attempted to avoid this if the same | ||
| 107 | * ENGINE and EVP_CIPHER could be used). */ | ||
| 108 | if(ctx->engine) | ||
| 109 | ENGINE_finish(ctx->engine); | ||
| 110 | if(impl) | ||
| 111 | { | ||
| 112 | if (!ENGINE_init(impl)) | ||
| 113 | { | ||
| 114 | EVPerr(EVP_F_EVP_CIPHERINIT, EVP_R_INITIALIZATION_ERROR); | ||
| 115 | return 0; | ||
| 116 | } | ||
| 117 | } | ||
| 118 | else | ||
| 119 | /* Ask if an ENGINE is reserved for this job */ | ||
| 120 | impl = ENGINE_get_cipher_engine(cipher->nid); | ||
| 121 | if(impl) | ||
| 122 | { | ||
| 123 | /* There's an ENGINE for this job ... (apparently) */ | ||
| 124 | const EVP_CIPHER *c = ENGINE_get_cipher(impl, cipher->nid); | ||
| 125 | if(!c) | ||
| 126 | { | ||
| 127 | /* One positive side-effect of US's export | ||
| 128 | * control history, is that we should at least | ||
| 129 | * be able to avoid using US mispellings of | ||
| 130 | * "initialisation"? */ | ||
| 131 | EVPerr(EVP_F_EVP_CIPHERINIT, EVP_R_INITIALIZATION_ERROR); | ||
| 132 | return 0; | ||
| 133 | } | ||
| 134 | /* We'll use the ENGINE's private cipher definition */ | ||
| 135 | cipher = c; | ||
| 136 | /* Store the ENGINE functional reference so we know | ||
| 137 | * 'cipher' came from an ENGINE and we need to release | ||
| 138 | * it when done. */ | ||
| 139 | ctx->engine = impl; | ||
| 140 | } | ||
| 141 | else | ||
| 142 | ctx->engine = NULL; | ||
| 78 | ctx->cipher=cipher; | 143 | ctx->cipher=cipher; |
| 144 | ctx->cipher_data=OPENSSL_malloc(ctx->cipher->ctx_size); | ||
| 79 | ctx->key_len = cipher->key_len; | 145 | ctx->key_len = cipher->key_len; |
| 80 | if(ctx->cipher->flags & EVP_CIPH_CTRL_INIT) { | 146 | ctx->flags = 0; |
| 81 | if(!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_INIT, 0, NULL)) { | 147 | if(ctx->cipher->flags & EVP_CIPH_CTRL_INIT) |
| 148 | { | ||
| 149 | if(!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_INIT, 0, NULL)) | ||
| 150 | { | ||
| 82 | EVPerr(EVP_F_EVP_CIPHERINIT, EVP_R_INITIALIZATION_ERROR); | 151 | EVPerr(EVP_F_EVP_CIPHERINIT, EVP_R_INITIALIZATION_ERROR); |
| 83 | return 0; | 152 | return 0; |
| 153 | } | ||
| 84 | } | 154 | } |
| 85 | } | 155 | } |
| 86 | } else if(!ctx->cipher) { | 156 | else if(!ctx->cipher) |
| 157 | { | ||
| 87 | EVPerr(EVP_F_EVP_CIPHERINIT, EVP_R_NO_CIPHER_SET); | 158 | EVPerr(EVP_F_EVP_CIPHERINIT, EVP_R_NO_CIPHER_SET); |
| 88 | return 0; | 159 | return 0; |
| 89 | } | 160 | } |
| 161 | skip_to_init: | ||
| 162 | /* we assume block size is a power of 2 in *cryptUpdate */ | ||
| 163 | assert(ctx->cipher->block_size == 1 | ||
| 164 | || ctx->cipher->block_size == 8 | ||
| 165 | || ctx->cipher->block_size == 16); | ||
| 166 | |||
| 90 | if(!(EVP_CIPHER_CTX_flags(ctx) & EVP_CIPH_CUSTOM_IV)) { | 167 | if(!(EVP_CIPHER_CTX_flags(ctx) & EVP_CIPH_CUSTOM_IV)) { |
| 91 | switch(EVP_CIPHER_CTX_mode(ctx)) { | 168 | switch(EVP_CIPHER_CTX_mode(ctx)) { |
| 92 | 169 | ||
| @@ -114,68 +191,101 @@ int EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, | |||
| 114 | if(key || (ctx->cipher->flags & EVP_CIPH_ALWAYS_CALL_INIT)) { | 191 | if(key || (ctx->cipher->flags & EVP_CIPH_ALWAYS_CALL_INIT)) { |
| 115 | if(!ctx->cipher->init(ctx,key,iv,enc)) return 0; | 192 | if(!ctx->cipher->init(ctx,key,iv,enc)) return 0; |
| 116 | } | 193 | } |
| 117 | if(enc != -1) ctx->encrypt=enc; | ||
| 118 | ctx->buf_len=0; | 194 | ctx->buf_len=0; |
| 195 | ctx->final_used=0; | ||
| 196 | ctx->block_mask=ctx->cipher->block_size-1; | ||
| 119 | return 1; | 197 | return 1; |
| 120 | } | 198 | } |
| 121 | 199 | ||
| 122 | int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, | 200 | int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, |
| 123 | unsigned char *in, int inl) | 201 | const unsigned char *in, int inl) |
| 124 | { | 202 | { |
| 125 | if (ctx->encrypt) | 203 | if (ctx->encrypt) |
| 126 | return EVP_EncryptUpdate(ctx,out,outl,in,inl); | 204 | return EVP_EncryptUpdate(ctx,out,outl,in,inl); |
| 127 | else return EVP_DecryptUpdate(ctx,out,outl,in,inl); | 205 | else return EVP_DecryptUpdate(ctx,out,outl,in,inl); |
| 128 | } | 206 | } |
| 129 | 207 | ||
| 208 | int EVP_CipherFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) | ||
| 209 | { | ||
| 210 | if (ctx->encrypt) | ||
| 211 | return EVP_EncryptFinal_ex(ctx,out,outl); | ||
| 212 | else return EVP_DecryptFinal_ex(ctx,out,outl); | ||
| 213 | } | ||
| 214 | |||
| 130 | int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) | 215 | int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) |
| 131 | { | 216 | { |
| 132 | if (ctx->encrypt) | 217 | if (ctx->encrypt) |
| 133 | return EVP_EncryptFinal(ctx,out,outl); | 218 | return EVP_EncryptFinal(ctx,out,outl); |
| 134 | else return(EVP_DecryptFinal(ctx,out,outl)); | 219 | else return EVP_DecryptFinal(ctx,out,outl); |
| 135 | } | 220 | } |
| 136 | 221 | ||
| 137 | int EVP_EncryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, | 222 | int EVP_EncryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, |
| 138 | unsigned char *key, unsigned char *iv) | 223 | const unsigned char *key, const unsigned char *iv) |
| 139 | { | 224 | { |
| 140 | return EVP_CipherInit(ctx, cipher, key, iv, 1); | 225 | return EVP_CipherInit(ctx, cipher, key, iv, 1); |
| 141 | } | 226 | } |
| 142 | 227 | ||
| 228 | int EVP_EncryptInit_ex(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, ENGINE *impl, | ||
| 229 | const unsigned char *key, const unsigned char *iv) | ||
| 230 | { | ||
| 231 | return EVP_CipherInit_ex(ctx, cipher, impl, key, iv, 1); | ||
| 232 | } | ||
| 233 | |||
| 143 | int EVP_DecryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, | 234 | int EVP_DecryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, |
| 144 | unsigned char *key, unsigned char *iv) | 235 | const unsigned char *key, const unsigned char *iv) |
| 145 | { | 236 | { |
| 146 | return EVP_CipherInit(ctx, cipher, key, iv, 0); | 237 | return EVP_CipherInit_ex(ctx, cipher, NULL, key, iv, 0); |
| 147 | } | 238 | } |
| 148 | 239 | ||
| 240 | int EVP_DecryptInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, ENGINE *impl, | ||
| 241 | const unsigned char *key, const unsigned char *iv) | ||
| 242 | { | ||
| 243 | return EVP_CipherInit_ex(ctx, cipher, impl, key, iv, 0); | ||
| 244 | } | ||
| 149 | 245 | ||
| 150 | int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, | 246 | int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, |
| 151 | unsigned char *in, int inl) | 247 | const unsigned char *in, int inl) |
| 152 | { | 248 | { |
| 153 | int i,j,bl; | 249 | int i,j,bl; |
| 154 | 250 | ||
| 251 | if(ctx->buf_len == 0 && (inl&(ctx->block_mask)) == 0) | ||
| 252 | { | ||
| 253 | if(ctx->cipher->do_cipher(ctx,out,in,inl)) | ||
| 254 | { | ||
| 255 | *outl=inl; | ||
| 256 | return 1; | ||
| 257 | } | ||
| 258 | else | ||
| 259 | { | ||
| 260 | *outl=0; | ||
| 261 | return 0; | ||
| 262 | } | ||
| 263 | } | ||
| 155 | i=ctx->buf_len; | 264 | i=ctx->buf_len; |
| 156 | bl=ctx->cipher->block_size; | 265 | bl=ctx->cipher->block_size; |
| 157 | *outl=0; | ||
| 158 | if ((inl == 0) && (i != bl)) return 1; | ||
| 159 | if (i != 0) | 266 | if (i != 0) |
| 160 | { | 267 | { |
| 161 | if (i+inl < bl) | 268 | if (i+inl < bl) |
| 162 | { | 269 | { |
| 163 | memcpy(&(ctx->buf[i]),in,inl); | 270 | memcpy(&(ctx->buf[i]),in,inl); |
| 164 | ctx->buf_len+=inl; | 271 | ctx->buf_len+=inl; |
| 272 | *outl=0; | ||
| 165 | return 1; | 273 | return 1; |
| 166 | } | 274 | } |
| 167 | else | 275 | else |
| 168 | { | 276 | { |
| 169 | j=bl-i; | 277 | j=bl-i; |
| 170 | if (j != 0) memcpy(&(ctx->buf[i]),in,j); | 278 | memcpy(&(ctx->buf[i]),in,j); |
| 171 | if(!ctx->cipher->do_cipher(ctx,out,ctx->buf,bl)) return 0; | 279 | if(!ctx->cipher->do_cipher(ctx,out,ctx->buf,bl)) return 0; |
| 172 | inl-=j; | 280 | inl-=j; |
| 173 | in+=j; | 281 | in+=j; |
| 174 | out+=bl; | 282 | out+=bl; |
| 175 | *outl+=bl; | 283 | *outl=bl; |
| 176 | } | 284 | } |
| 177 | } | 285 | } |
| 178 | i=inl%bl; /* how much is left */ | 286 | else |
| 287 | *outl = 0; | ||
| 288 | i=inl&(bl-1); | ||
| 179 | inl-=i; | 289 | inl-=i; |
| 180 | if (inl > 0) | 290 | if (inl > 0) |
| 181 | { | 291 | { |
| @@ -191,107 +301,153 @@ int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, | |||
| 191 | 301 | ||
| 192 | int EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) | 302 | int EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) |
| 193 | { | 303 | { |
| 194 | int i,n,b,bl; | 304 | int ret; |
| 305 | ret = EVP_EncryptFinal_ex(ctx, out, outl); | ||
| 306 | EVP_CIPHER_CTX_cleanup(ctx); | ||
| 307 | return ret; | ||
| 308 | } | ||
| 309 | |||
| 310 | int EVP_EncryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) | ||
| 311 | { | ||
| 312 | int i,n,b,bl,ret; | ||
| 195 | 313 | ||
| 196 | b=ctx->cipher->block_size; | 314 | b=ctx->cipher->block_size; |
| 197 | if (b == 1) | 315 | if (b == 1) |
| 198 | { | 316 | { |
| 317 | EVP_CIPHER_CTX_cleanup(ctx); | ||
| 199 | *outl=0; | 318 | *outl=0; |
| 200 | return 1; | 319 | return 1; |
| 201 | } | 320 | } |
| 202 | bl=ctx->buf_len; | 321 | bl=ctx->buf_len; |
| 322 | if (ctx->flags & EVP_CIPH_NO_PADDING) | ||
| 323 | { | ||
| 324 | EVP_CIPHER_CTX_cleanup(ctx); | ||
| 325 | if(bl) | ||
| 326 | { | ||
| 327 | EVPerr(EVP_F_EVP_ENCRYPTFINAL,EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH); | ||
| 328 | return 0; | ||
| 329 | } | ||
| 330 | *outl = 0; | ||
| 331 | return 1; | ||
| 332 | } | ||
| 333 | |||
| 203 | n=b-bl; | 334 | n=b-bl; |
| 204 | for (i=bl; i<b; i++) | 335 | for (i=bl; i<b; i++) |
| 205 | ctx->buf[i]=n; | 336 | ctx->buf[i]=n; |
| 206 | if(!ctx->cipher->do_cipher(ctx,out,ctx->buf,b)) return 0; | 337 | ret=ctx->cipher->do_cipher(ctx,out,ctx->buf,b); |
| 207 | *outl=b; | 338 | |
| 208 | return 1; | 339 | EVP_CIPHER_CTX_cleanup(ctx); |
| 340 | |||
| 341 | if(ret) | ||
| 342 | *outl=b; | ||
| 343 | |||
| 344 | return ret; | ||
| 209 | } | 345 | } |
| 210 | 346 | ||
| 211 | int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, | 347 | int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, |
| 212 | unsigned char *in, int inl) | 348 | const unsigned char *in, int inl) |
| 213 | { | 349 | { |
| 214 | int b,bl,n; | 350 | int b, fix_len; |
| 215 | int keep_last=0; | ||
| 216 | 351 | ||
| 217 | *outl=0; | 352 | if (inl == 0) |
| 218 | if (inl == 0) return 1; | 353 | { |
| 354 | *outl=0; | ||
| 355 | return 1; | ||
| 356 | } | ||
| 357 | |||
| 358 | if (ctx->flags & EVP_CIPH_NO_PADDING) | ||
| 359 | return EVP_EncryptUpdate(ctx, out, outl, in, inl); | ||
| 219 | 360 | ||
| 220 | b=ctx->cipher->block_size; | 361 | b=ctx->cipher->block_size; |
| 221 | if (b > 1) | 362 | |
| 363 | if(ctx->final_used) | ||
| 222 | { | 364 | { |
| 223 | /* Is the input a multiple of the block size? */ | 365 | memcpy(out,ctx->final,b); |
| 224 | bl=ctx->buf_len; | 366 | out+=b; |
| 225 | n=inl+bl; | 367 | fix_len = 1; |
| 226 | if (n%b == 0) | ||
| 227 | { | ||
| 228 | if (inl < b) /* must be 'just one' buff */ | ||
| 229 | { | ||
| 230 | memcpy(&(ctx->buf[bl]),in,inl); | ||
| 231 | ctx->buf_len=b; | ||
| 232 | *outl=0; | ||
| 233 | return 1; | ||
| 234 | } | ||
| 235 | keep_last=1; | ||
| 236 | inl-=b; /* don't do the last block */ | ||
| 237 | } | ||
| 238 | } | 368 | } |
| 239 | if(!EVP_EncryptUpdate(ctx,out,outl,in,inl)) return 0; | 369 | else |
| 370 | fix_len = 0; | ||
| 371 | |||
| 372 | |||
| 373 | if(!EVP_EncryptUpdate(ctx,out,outl,in,inl)) | ||
| 374 | return 0; | ||
| 240 | 375 | ||
| 241 | /* if we have 'decrypted' a multiple of block size, make sure | 376 | /* if we have 'decrypted' a multiple of block size, make sure |
| 242 | * we have a copy of this last block */ | 377 | * we have a copy of this last block */ |
| 243 | if (keep_last) | 378 | if (b > 1 && !ctx->buf_len) |
| 244 | { | 379 | { |
| 245 | memcpy(&(ctx->buf[0]),&(in[inl]),b); | 380 | *outl-=b; |
| 246 | #ifdef DEBUG | 381 | ctx->final_used=1; |
| 247 | if (ctx->buf_len != 0) | 382 | memcpy(ctx->final,&out[*outl],b); |
| 248 | { | ||
| 249 | abort(); | ||
| 250 | } | ||
| 251 | #endif | ||
| 252 | ctx->buf_len=b; | ||
| 253 | } | 383 | } |
| 384 | else | ||
| 385 | ctx->final_used = 0; | ||
| 386 | |||
| 387 | if (fix_len) | ||
| 388 | *outl += b; | ||
| 389 | |||
| 254 | return 1; | 390 | return 1; |
| 255 | } | 391 | } |
| 256 | 392 | ||
| 257 | int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) | 393 | int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) |
| 258 | { | 394 | { |
| 395 | int ret; | ||
| 396 | ret = EVP_DecryptFinal_ex(ctx, out, outl); | ||
| 397 | EVP_CIPHER_CTX_cleanup(ctx); | ||
| 398 | return ret; | ||
| 399 | } | ||
| 400 | |||
| 401 | int EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) | ||
| 402 | { | ||
| 259 | int i,b; | 403 | int i,b; |
| 260 | int n; | 404 | int n; |
| 261 | 405 | ||
| 262 | *outl=0; | 406 | *outl=0; |
| 263 | b=ctx->cipher->block_size; | 407 | b=ctx->cipher->block_size; |
| 408 | if (ctx->flags & EVP_CIPH_NO_PADDING) | ||
| 409 | { | ||
| 410 | EVP_CIPHER_CTX_cleanup(ctx); | ||
| 411 | if(ctx->buf_len) | ||
| 412 | { | ||
| 413 | EVPerr(EVP_F_EVP_DECRYPTFINAL,EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH); | ||
| 414 | return 0; | ||
| 415 | } | ||
| 416 | *outl = 0; | ||
| 417 | return 1; | ||
| 418 | } | ||
| 264 | if (b > 1) | 419 | if (b > 1) |
| 265 | { | 420 | { |
| 266 | if (ctx->buf_len != b) | 421 | if (ctx->buf_len || !ctx->final_used) |
| 267 | { | 422 | { |
| 423 | EVP_CIPHER_CTX_cleanup(ctx); | ||
| 268 | EVPerr(EVP_F_EVP_DECRYPTFINAL,EVP_R_WRONG_FINAL_BLOCK_LENGTH); | 424 | EVPerr(EVP_F_EVP_DECRYPTFINAL,EVP_R_WRONG_FINAL_BLOCK_LENGTH); |
| 269 | return(0); | 425 | return(0); |
| 270 | } | 426 | } |
| 271 | if(!EVP_EncryptUpdate(ctx,ctx->buf,&n,ctx->buf,0)) return 0; | 427 | n=ctx->final[b-1]; |
| 272 | if (n != b) | ||
| 273 | return(0); | ||
| 274 | n=ctx->buf[b-1]; | ||
| 275 | if (n > b) | 428 | if (n > b) |
| 276 | { | 429 | { |
| 430 | EVP_CIPHER_CTX_cleanup(ctx); | ||
| 277 | EVPerr(EVP_F_EVP_DECRYPTFINAL,EVP_R_BAD_DECRYPT); | 431 | EVPerr(EVP_F_EVP_DECRYPTFINAL,EVP_R_BAD_DECRYPT); |
| 278 | return(0); | 432 | return(0); |
| 279 | } | 433 | } |
| 280 | for (i=0; i<n; i++) | 434 | for (i=0; i<n; i++) |
| 281 | { | 435 | { |
| 282 | if (ctx->buf[--b] != n) | 436 | if (ctx->final[--b] != n) |
| 283 | { | 437 | { |
| 438 | EVP_CIPHER_CTX_cleanup(ctx); | ||
| 284 | EVPerr(EVP_F_EVP_DECRYPTFINAL,EVP_R_BAD_DECRYPT); | 439 | EVPerr(EVP_F_EVP_DECRYPTFINAL,EVP_R_BAD_DECRYPT); |
| 285 | return(0); | 440 | return(0); |
| 286 | } | 441 | } |
| 287 | } | 442 | } |
| 288 | n=ctx->cipher->block_size-n; | 443 | n=ctx->cipher->block_size-n; |
| 289 | for (i=0; i<n; i++) | 444 | for (i=0; i<n; i++) |
| 290 | out[i]=ctx->buf[i]; | 445 | out[i]=ctx->final[i]; |
| 291 | *outl=n; | 446 | *outl=n; |
| 292 | } | 447 | } |
| 293 | else | 448 | else |
| 294 | *outl=0; | 449 | *outl=0; |
| 450 | EVP_CIPHER_CTX_cleanup(ctx); | ||
| 295 | return(1); | 451 | return(1); |
| 296 | } | 452 | } |
| 297 | 453 | ||
| @@ -301,6 +457,11 @@ int EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *c) | |||
| 301 | { | 457 | { |
| 302 | if(!c->cipher->cleanup(c)) return 0; | 458 | if(!c->cipher->cleanup(c)) return 0; |
| 303 | } | 459 | } |
| 460 | OPENSSL_free(c->cipher_data); | ||
| 461 | if (c->engine) | ||
| 462 | /* The EVP_CIPHER we used belongs to an ENGINE, release the | ||
| 463 | * functional reference we held for this reason. */ | ||
| 464 | ENGINE_finish(c->engine); | ||
| 304 | memset(c,0,sizeof(EVP_CIPHER_CTX)); | 465 | memset(c,0,sizeof(EVP_CIPHER_CTX)); |
| 305 | return 1; | 466 | return 1; |
| 306 | } | 467 | } |
| @@ -319,6 +480,13 @@ int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *c, int keylen) | |||
| 319 | return 0; | 480 | return 0; |
| 320 | } | 481 | } |
| 321 | 482 | ||
| 483 | int EVP_CIPHER_CTX_set_padding(EVP_CIPHER_CTX *ctx, int pad) | ||
| 484 | { | ||
| 485 | if (pad) ctx->flags &= ~EVP_CIPH_NO_PADDING; | ||
| 486 | else ctx->flags |= EVP_CIPH_NO_PADDING; | ||
| 487 | return 1; | ||
| 488 | } | ||
| 489 | |||
| 322 | int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr) | 490 | int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr) |
| 323 | { | 491 | { |
| 324 | int ret; | 492 | int ret; |
diff --git a/src/lib/libcrypto/evp/evp_err.c b/src/lib/libcrypto/evp/evp_err.c index a01412a07c..3a23d21c21 100644 --- a/src/lib/libcrypto/evp/evp_err.c +++ b/src/lib/libcrypto/evp/evp_err.c | |||
| @@ -63,7 +63,7 @@ | |||
| 63 | #include <openssl/evp.h> | 63 | #include <openssl/evp.h> |
| 64 | 64 | ||
| 65 | /* BEGIN ERROR CODES */ | 65 | /* BEGIN ERROR CODES */ |
| 66 | #ifndef NO_ERR | 66 | #ifndef OPENSSL_NO_ERR |
| 67 | static ERR_STRING_DATA EVP_str_functs[]= | 67 | static ERR_STRING_DATA EVP_str_functs[]= |
| 68 | { | 68 | { |
| 69 | {ERR_PACK(0,EVP_F_D2I_PKEY,0), "D2I_PKEY"}, | 69 | {ERR_PACK(0,EVP_F_D2I_PKEY,0), "D2I_PKEY"}, |
| @@ -71,6 +71,8 @@ static ERR_STRING_DATA EVP_str_functs[]= | |||
| 71 | {ERR_PACK(0,EVP_F_EVP_CIPHER_CTX_CTRL,0), "EVP_CIPHER_CTX_ctrl"}, | 71 | {ERR_PACK(0,EVP_F_EVP_CIPHER_CTX_CTRL,0), "EVP_CIPHER_CTX_ctrl"}, |
| 72 | {ERR_PACK(0,EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH,0), "EVP_CIPHER_CTX_set_key_length"}, | 72 | {ERR_PACK(0,EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH,0), "EVP_CIPHER_CTX_set_key_length"}, |
| 73 | {ERR_PACK(0,EVP_F_EVP_DECRYPTFINAL,0), "EVP_DecryptFinal"}, | 73 | {ERR_PACK(0,EVP_F_EVP_DECRYPTFINAL,0), "EVP_DecryptFinal"}, |
| 74 | {ERR_PACK(0,EVP_F_EVP_DIGESTINIT,0), "EVP_DigestInit"}, | ||
| 75 | {ERR_PACK(0,EVP_F_EVP_ENCRYPTFINAL,0), "EVP_EncryptFinal"}, | ||
| 74 | {ERR_PACK(0,EVP_F_EVP_MD_CTX_COPY,0), "EVP_MD_CTX_copy"}, | 76 | {ERR_PACK(0,EVP_F_EVP_MD_CTX_COPY,0), "EVP_MD_CTX_copy"}, |
| 75 | {ERR_PACK(0,EVP_F_EVP_OPENINIT,0), "EVP_OpenInit"}, | 77 | {ERR_PACK(0,EVP_F_EVP_OPENINIT,0), "EVP_OpenInit"}, |
| 76 | {ERR_PACK(0,EVP_F_EVP_PBE_ALG_ADD,0), "EVP_PBE_alg_add"}, | 78 | {ERR_PACK(0,EVP_F_EVP_PBE_ALG_ADD,0), "EVP_PBE_alg_add"}, |
| @@ -85,6 +87,7 @@ static ERR_STRING_DATA EVP_str_functs[]= | |||
| 85 | {ERR_PACK(0,EVP_F_EVP_PKEY_GET1_DSA,0), "EVP_PKEY_get1_DSA"}, | 87 | {ERR_PACK(0,EVP_F_EVP_PKEY_GET1_DSA,0), "EVP_PKEY_get1_DSA"}, |
| 86 | {ERR_PACK(0,EVP_F_EVP_PKEY_GET1_RSA,0), "EVP_PKEY_get1_RSA"}, | 88 | {ERR_PACK(0,EVP_F_EVP_PKEY_GET1_RSA,0), "EVP_PKEY_get1_RSA"}, |
| 87 | {ERR_PACK(0,EVP_F_EVP_PKEY_NEW,0), "EVP_PKEY_new"}, | 89 | {ERR_PACK(0,EVP_F_EVP_PKEY_NEW,0), "EVP_PKEY_new"}, |
| 90 | {ERR_PACK(0,EVP_F_EVP_RIJNDAEL,0), "EVP_RIJNDAEL"}, | ||
| 88 | {ERR_PACK(0,EVP_F_EVP_SIGNFINAL,0), "EVP_SignFinal"}, | 91 | {ERR_PACK(0,EVP_F_EVP_SIGNFINAL,0), "EVP_SignFinal"}, |
| 89 | {ERR_PACK(0,EVP_F_EVP_VERIFYFINAL,0), "EVP_VerifyFinal"}, | 92 | {ERR_PACK(0,EVP_F_EVP_VERIFYFINAL,0), "EVP_VerifyFinal"}, |
| 90 | {ERR_PACK(0,EVP_F_PKCS5_PBE_KEYIVGEN,0), "PKCS5_PBE_keyivgen"}, | 93 | {ERR_PACK(0,EVP_F_PKCS5_PBE_KEYIVGEN,0), "PKCS5_PBE_keyivgen"}, |
| @@ -96,12 +99,15 @@ static ERR_STRING_DATA EVP_str_functs[]= | |||
| 96 | 99 | ||
| 97 | static ERR_STRING_DATA EVP_str_reasons[]= | 100 | static ERR_STRING_DATA EVP_str_reasons[]= |
| 98 | { | 101 | { |
| 102 | {EVP_R_BAD_BLOCK_LENGTH ,"bad block length"}, | ||
| 99 | {EVP_R_BAD_DECRYPT ,"bad decrypt"}, | 103 | {EVP_R_BAD_DECRYPT ,"bad decrypt"}, |
| 104 | {EVP_R_BAD_KEY_LENGTH ,"bad key length"}, | ||
| 100 | {EVP_R_BN_DECODE_ERROR ,"bn decode error"}, | 105 | {EVP_R_BN_DECODE_ERROR ,"bn decode error"}, |
| 101 | {EVP_R_BN_PUBKEY_ERROR ,"bn pubkey error"}, | 106 | {EVP_R_BN_PUBKEY_ERROR ,"bn pubkey error"}, |
| 102 | {EVP_R_CIPHER_PARAMETER_ERROR ,"cipher parameter error"}, | 107 | {EVP_R_CIPHER_PARAMETER_ERROR ,"cipher parameter error"}, |
| 103 | {EVP_R_CTRL_NOT_IMPLEMENTED ,"ctrl not implemented"}, | 108 | {EVP_R_CTRL_NOT_IMPLEMENTED ,"ctrl not implemented"}, |
| 104 | {EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED ,"ctrl operation not implemented"}, | 109 | {EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED ,"ctrl operation not implemented"}, |
| 110 | {EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH ,"data not multiple of block length"}, | ||
| 105 | {EVP_R_DECODE_ERROR ,"decode error"}, | 111 | {EVP_R_DECODE_ERROR ,"decode error"}, |
| 106 | {EVP_R_DIFFERENT_KEY_TYPES ,"different key types"}, | 112 | {EVP_R_DIFFERENT_KEY_TYPES ,"different key types"}, |
| 107 | {EVP_R_ENCODE_ERROR ,"encode error"}, | 113 | {EVP_R_ENCODE_ERROR ,"encode error"}, |
| @@ -116,6 +122,7 @@ static ERR_STRING_DATA EVP_str_reasons[]= | |||
| 116 | {EVP_R_KEYGEN_FAILURE ,"keygen failure"}, | 122 | {EVP_R_KEYGEN_FAILURE ,"keygen failure"}, |
| 117 | {EVP_R_MISSING_PARAMETERS ,"missing parameters"}, | 123 | {EVP_R_MISSING_PARAMETERS ,"missing parameters"}, |
| 118 | {EVP_R_NO_CIPHER_SET ,"no cipher set"}, | 124 | {EVP_R_NO_CIPHER_SET ,"no cipher set"}, |
| 125 | {EVP_R_NO_DIGEST_SET ,"no digest set"}, | ||
| 119 | {EVP_R_NO_DSA_PARAMETERS ,"no dsa parameters"}, | 126 | {EVP_R_NO_DSA_PARAMETERS ,"no dsa parameters"}, |
| 120 | {EVP_R_NO_SIGN_FUNCTION_CONFIGURED ,"no sign function configured"}, | 127 | {EVP_R_NO_SIGN_FUNCTION_CONFIGURED ,"no sign function configured"}, |
| 121 | {EVP_R_NO_VERIFY_FUNCTION_CONFIGURED ,"no verify function configured"}, | 128 | {EVP_R_NO_VERIFY_FUNCTION_CONFIGURED ,"no verify function configured"}, |
| @@ -144,7 +151,7 @@ void ERR_load_EVP_strings(void) | |||
| 144 | if (init) | 151 | if (init) |
| 145 | { | 152 | { |
| 146 | init=0; | 153 | init=0; |
| 147 | #ifndef NO_ERR | 154 | #ifndef OPENSSL_NO_ERR |
| 148 | ERR_load_strings(ERR_LIB_EVP,EVP_str_functs); | 155 | ERR_load_strings(ERR_LIB_EVP,EVP_str_functs); |
| 149 | ERR_load_strings(ERR_LIB_EVP,EVP_str_reasons); | 156 | ERR_load_strings(ERR_LIB_EVP,EVP_str_reasons); |
| 150 | #endif | 157 | #endif |
diff --git a/src/lib/libcrypto/evp/evp_key.c b/src/lib/libcrypto/evp/evp_key.c index e7434ef9b2..4271393069 100644 --- a/src/lib/libcrypto/evp/evp_key.c +++ b/src/lib/libcrypto/evp/evp_key.c | |||
| @@ -61,6 +61,7 @@ | |||
| 61 | #include <openssl/x509.h> | 61 | #include <openssl/x509.h> |
| 62 | #include <openssl/objects.h> | 62 | #include <openssl/objects.h> |
| 63 | #include <openssl/evp.h> | 63 | #include <openssl/evp.h> |
| 64 | #include <openssl/ui.h> | ||
| 64 | 65 | ||
| 65 | /* should be init to zeros. */ | 66 | /* should be init to zeros. */ |
| 66 | static char prompt_string[80]; | 67 | static char prompt_string[80]; |
| @@ -70,7 +71,10 @@ void EVP_set_pw_prompt(char *prompt) | |||
| 70 | if (prompt == NULL) | 71 | if (prompt == NULL) |
| 71 | prompt_string[0]='\0'; | 72 | prompt_string[0]='\0'; |
| 72 | else | 73 | else |
| 74 | { | ||
| 73 | strncpy(prompt_string,prompt,79); | 75 | strncpy(prompt_string,prompt,79); |
| 76 | prompt_string[79]='\0'; | ||
| 77 | } | ||
| 74 | } | 78 | } |
| 75 | 79 | ||
| 76 | char *EVP_get_pw_prompt(void) | 80 | char *EVP_get_pw_prompt(void) |
| @@ -86,18 +90,26 @@ char *EVP_get_pw_prompt(void) | |||
| 86 | * this function will fail */ | 90 | * this function will fail */ |
| 87 | int EVP_read_pw_string(char *buf, int len, const char *prompt, int verify) | 91 | int EVP_read_pw_string(char *buf, int len, const char *prompt, int verify) |
| 88 | { | 92 | { |
| 89 | #ifndef NO_DES | 93 | int ret; |
| 94 | char buff[BUFSIZ]; | ||
| 95 | UI *ui; | ||
| 96 | |||
| 90 | if ((prompt == NULL) && (prompt_string[0] != '\0')) | 97 | if ((prompt == NULL) && (prompt_string[0] != '\0')) |
| 91 | prompt=prompt_string; | 98 | prompt=prompt_string; |
| 92 | return(des_read_pw_string(buf,len,prompt,verify)); | 99 | ui = UI_new(); |
| 93 | #else | 100 | UI_add_input_string(ui,prompt,0,buf,0,(len>=BUFSIZ)?BUFSIZ-1:len); |
| 94 | return -1; | 101 | if (verify) |
| 95 | #endif | 102 | UI_add_verify_string(ui,prompt,0, |
| 103 | buff,0,(len>=BUFSIZ)?BUFSIZ-1:len,buf); | ||
| 104 | ret = UI_process(ui); | ||
| 105 | UI_free(ui); | ||
| 106 | memset(buff,0,BUFSIZ); | ||
| 107 | return ret; | ||
| 96 | } | 108 | } |
| 97 | 109 | ||
| 98 | int EVP_BytesToKey(const EVP_CIPHER *type, EVP_MD *md, | 110 | int EVP_BytesToKey(const EVP_CIPHER *type, const EVP_MD *md, |
| 99 | const unsigned char *salt, const unsigned char *data, int datal, | 111 | const unsigned char *salt, const unsigned char *data, int datal, |
| 100 | int count, unsigned char *key, unsigned char *iv) | 112 | int count, unsigned char *key, unsigned char *iv) |
| 101 | { | 113 | { |
| 102 | EVP_MD_CTX c; | 114 | EVP_MD_CTX c; |
| 103 | unsigned char md_buf[EVP_MAX_MD_SIZE]; | 115 | unsigned char md_buf[EVP_MAX_MD_SIZE]; |
| @@ -109,21 +121,22 @@ int EVP_BytesToKey(const EVP_CIPHER *type, EVP_MD *md, | |||
| 109 | 121 | ||
| 110 | if (data == NULL) return(nkey); | 122 | if (data == NULL) return(nkey); |
| 111 | 123 | ||
| 124 | EVP_MD_CTX_init(&c); | ||
| 112 | for (;;) | 125 | for (;;) |
| 113 | { | 126 | { |
| 114 | EVP_DigestInit(&c,md); | 127 | EVP_DigestInit_ex(&c,md, NULL); |
| 115 | if (addmd++) | 128 | if (addmd++) |
| 116 | EVP_DigestUpdate(&c,&(md_buf[0]),mds); | 129 | EVP_DigestUpdate(&c,&(md_buf[0]),mds); |
| 117 | EVP_DigestUpdate(&c,data,datal); | 130 | EVP_DigestUpdate(&c,data,datal); |
| 118 | if (salt != NULL) | 131 | if (salt != NULL) |
| 119 | EVP_DigestUpdate(&c,salt,PKCS5_SALT_LEN); | 132 | EVP_DigestUpdate(&c,salt,PKCS5_SALT_LEN); |
| 120 | EVP_DigestFinal(&c,&(md_buf[0]),&mds); | 133 | EVP_DigestFinal_ex(&c,&(md_buf[0]),&mds); |
| 121 | 134 | ||
| 122 | for (i=1; i<(unsigned int)count; i++) | 135 | for (i=1; i<(unsigned int)count; i++) |
| 123 | { | 136 | { |
| 124 | EVP_DigestInit(&c,md); | 137 | EVP_DigestInit_ex(&c,md, NULL); |
| 125 | EVP_DigestUpdate(&c,&(md_buf[0]),mds); | 138 | EVP_DigestUpdate(&c,&(md_buf[0]),mds); |
| 126 | EVP_DigestFinal(&c,&(md_buf[0]),&mds); | 139 | EVP_DigestFinal_ex(&c,&(md_buf[0]),&mds); |
| 127 | } | 140 | } |
| 128 | i=0; | 141 | i=0; |
| 129 | if (nkey) | 142 | if (nkey) |
| @@ -152,7 +165,7 @@ int EVP_BytesToKey(const EVP_CIPHER *type, EVP_MD *md, | |||
| 152 | } | 165 | } |
| 153 | if ((nkey == 0) && (niv == 0)) break; | 166 | if ((nkey == 0) && (niv == 0)) break; |
| 154 | } | 167 | } |
| 155 | memset(&c,0,sizeof(c)); | 168 | EVP_MD_CTX_cleanup(&c); |
| 156 | memset(&(md_buf[0]),0,EVP_MAX_MD_SIZE); | 169 | memset(&(md_buf[0]),0,EVP_MAX_MD_SIZE); |
| 157 | return(type->key_len); | 170 | return(type->key_len); |
| 158 | } | 171 | } |
diff --git a/src/lib/libcrypto/evp/evp_locl.h b/src/lib/libcrypto/evp/evp_locl.h index ce49d5b7d8..7b088b4848 100644 --- a/src/lib/libcrypto/evp/evp_locl.h +++ b/src/lib/libcrypto/evp/evp_locl.h | |||
| @@ -61,50 +61,107 @@ | |||
| 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; \ | 64 | unsigned int i, bl; \ |
| 65 | if(inl < 8) return 1;\ | 65 | bl = ctx->cipher->block_size;\ |
| 66 | inl -= 8; \ | 66 | if(inl < bl) return 1;\ |
| 67 | for(i=0; i <= inl; i+=8) \ | 67 | inl -= bl; \ |
| 68 | for(i=0; i <= inl; i+=bl) \ | ||
| 68 | 69 | ||
| 69 | #define BLOCK_CIPHER_func_ecb(cname, cprefix, kname) \ | 70 | #define BLOCK_CIPHER_func_ecb(cname, cprefix, kstruct, ksched) \ |
| 70 | static int cname##_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, unsigned int inl) \ | 71 | static int cname##_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, unsigned int inl) \ |
| 71 | {\ | 72 | {\ |
| 72 | BLOCK_CIPHER_ecb_loop() \ | 73 | BLOCK_CIPHER_ecb_loop() \ |
| 73 | cprefix##_ecb_encrypt(in + i, out + i, &ctx->c.kname, ctx->encrypt);\ | 74 | cprefix##_ecb_encrypt(in + i, out + i, &((kstruct *)ctx->cipher_data)->ksched, ctx->encrypt);\ |
| 74 | return 1;\ | 75 | return 1;\ |
| 75 | } | 76 | } |
| 76 | 77 | ||
| 77 | #define BLOCK_CIPHER_func_ofb(cname, cprefix, kname) \ | 78 | #define BLOCK_CIPHER_func_ofb(cname, cprefix, cbits, kstruct, ksched) \ |
| 78 | static int cname##_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, unsigned int inl) \ | 79 | static int cname##_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, unsigned int inl) \ |
| 79 | {\ | 80 | {\ |
| 80 | cprefix##_ofb64_encrypt(in, out, (long)inl, &ctx->c.kname, ctx->iv, &ctx->num);\ | 81 | cprefix##_ofb##cbits##_encrypt(in, out, (long)inl, &((kstruct *)ctx->cipher_data)->ksched, ctx->iv, &ctx->num);\ |
| 81 | return 1;\ | 82 | return 1;\ |
| 82 | } | 83 | } |
| 83 | 84 | ||
| 84 | #define BLOCK_CIPHER_func_cbc(cname, cprefix, kname) \ | 85 | #define BLOCK_CIPHER_func_cbc(cname, cprefix, kstruct, ksched) \ |
| 85 | static int cname##_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, unsigned int inl) \ | 86 | static int cname##_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, unsigned int inl) \ |
| 86 | {\ | 87 | {\ |
| 87 | cprefix##_cbc_encrypt(in, out, (long)inl, &ctx->c.kname, ctx->iv, ctx->encrypt);\ | 88 | cprefix##_cbc_encrypt(in, out, (long)inl, &((kstruct *)ctx->cipher_data)->ksched, ctx->iv, ctx->encrypt);\ |
| 88 | return 1;\ | 89 | return 1;\ |
| 89 | } | 90 | } |
| 90 | 91 | ||
| 91 | #define BLOCK_CIPHER_func_cfb(cname, cprefix, kname) \ | 92 | #define BLOCK_CIPHER_func_cfb(cname, cprefix, cbits, kstruct, ksched) \ |
| 92 | static int cname##_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, unsigned int inl) \ | 93 | static int cname##_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, unsigned int inl) \ |
| 93 | {\ | 94 | {\ |
| 94 | cprefix##_cfb64_encrypt(in, out, (long)inl, &ctx->c.kname, ctx->iv, &ctx->num, ctx->encrypt);\ | 95 | cprefix##_cfb##cbits##_encrypt(in, out, (long)inl, &((kstruct *)ctx->cipher_data)->ksched, ctx->iv, &ctx->num, ctx->encrypt);\ |
| 95 | return 1;\ | 96 | return 1;\ |
| 96 | } | 97 | } |
| 97 | 98 | ||
| 98 | #define BLOCK_CIPHER_all_funcs(cname, cprefix, kname) \ | 99 | #define BLOCK_CIPHER_all_funcs(cname, cprefix, cbits, kstruct, ksched) \ |
| 99 | BLOCK_CIPHER_func_cbc(cname, cprefix, kname) \ | 100 | BLOCK_CIPHER_func_cbc(cname, cprefix, kstruct, ksched) \ |
| 100 | BLOCK_CIPHER_func_cfb(cname, cprefix, kname) \ | 101 | BLOCK_CIPHER_func_cfb(cname, cprefix, cbits, kstruct, ksched) \ |
| 101 | BLOCK_CIPHER_func_ecb(cname, cprefix, kname) \ | 102 | BLOCK_CIPHER_func_ecb(cname, cprefix, kstruct, ksched) \ |
| 102 | BLOCK_CIPHER_func_ofb(cname, cprefix, kname) | 103 | BLOCK_CIPHER_func_ofb(cname, cprefix, cbits, kstruct, ksched) |
| 103 | 104 | ||
| 105 | #define BLOCK_CIPHER_def1(cname, nmode, mode, MODE, kstruct, nid, block_size, \ | ||
| 106 | key_len, iv_len, flags, init_key, cleanup, \ | ||
| 107 | set_asn1, get_asn1, ctrl) \ | ||
| 108 | static const EVP_CIPHER cname##_##mode = { \ | ||
| 109 | nid##_##nmode, block_size, key_len, iv_len, \ | ||
| 110 | flags | EVP_CIPH_##MODE##_MODE, \ | ||
| 111 | init_key, \ | ||
| 112 | cname##_##mode##_cipher, \ | ||
| 113 | cleanup, \ | ||
| 114 | sizeof(kstruct), \ | ||
| 115 | set_asn1, get_asn1,\ | ||
| 116 | ctrl, \ | ||
| 117 | NULL \ | ||
| 118 | }; \ | ||
| 119 | const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; } | ||
| 120 | |||
| 121 | #define BLOCK_CIPHER_def_cbc(cname, kstruct, nid, block_size, key_len, \ | ||
| 122 | iv_len, flags, init_key, cleanup, set_asn1, \ | ||
| 123 | get_asn1, ctrl) \ | ||
| 124 | BLOCK_CIPHER_def1(cname, cbc, cbc, CBC, kstruct, nid, block_size, key_len, \ | ||
| 125 | iv_len, flags, init_key, cleanup, set_asn1, get_asn1, ctrl) | ||
| 126 | |||
| 127 | #define BLOCK_CIPHER_def_cfb(cname, kstruct, nid, block_size, key_len, \ | ||
| 128 | iv_len, cbits, flags, init_key, cleanup, \ | ||
| 129 | set_asn1, get_asn1, ctrl) \ | ||
| 130 | BLOCK_CIPHER_def1(cname, cfb##cbits, cfb, CFB, kstruct, nid, block_size, \ | ||
| 131 | key_len, iv_len, flags, init_key, cleanup, set_asn1, \ | ||
| 132 | get_asn1, ctrl) | ||
| 133 | |||
| 134 | #define BLOCK_CIPHER_def_ofb(cname, kstruct, nid, block_size, key_len, \ | ||
| 135 | iv_len, cbits, flags, init_key, cleanup, \ | ||
| 136 | set_asn1, get_asn1, ctrl) \ | ||
| 137 | BLOCK_CIPHER_def1(cname, ofb##cbits, ofb, OFB, kstruct, nid, block_size, \ | ||
| 138 | key_len, iv_len, flags, init_key, cleanup, set_asn1, \ | ||
| 139 | get_asn1, ctrl) | ||
| 140 | |||
| 141 | #define BLOCK_CIPHER_def_ecb(cname, kstruct, nid, block_size, key_len, \ | ||
| 142 | iv_len, flags, init_key, cleanup, set_asn1, \ | ||
| 143 | get_asn1, ctrl) \ | ||
| 144 | BLOCK_CIPHER_def1(cname, ecb, ecb, ECB, kstruct, nid, block_size, key_len, \ | ||
| 145 | iv_len, flags, init_key, cleanup, set_asn1, get_asn1, ctrl) | ||
| 146 | |||
| 147 | #define BLOCK_CIPHER_defs(cname, kstruct, \ | ||
| 148 | nid, block_size, key_len, iv_len, cbits, flags, \ | ||
| 149 | init_key, cleanup, set_asn1, get_asn1, ctrl) \ | ||
| 150 | BLOCK_CIPHER_def_cbc(cname, kstruct, nid, block_size, key_len, iv_len, flags, \ | ||
| 151 | init_key, cleanup, set_asn1, get_asn1, ctrl) \ | ||
| 152 | BLOCK_CIPHER_def_cfb(cname, kstruct, nid, block_size, key_len, iv_len, cbits, \ | ||
| 153 | flags, init_key, cleanup, set_asn1, get_asn1, ctrl) \ | ||
| 154 | BLOCK_CIPHER_def_ofb(cname, kstruct, nid, block_size, key_len, iv_len, cbits, \ | ||
| 155 | flags, init_key, cleanup, set_asn1, get_asn1, ctrl) \ | ||
| 156 | BLOCK_CIPHER_def_ecb(cname, kstruct, nid, block_size, key_len, iv_len, flags, \ | ||
| 157 | init_key, cleanup, set_asn1, get_asn1, ctrl) | ||
| 158 | |||
| 159 | |||
| 160 | /* | ||
| 104 | #define BLOCK_CIPHER_defs(cname, kstruct, \ | 161 | #define BLOCK_CIPHER_defs(cname, kstruct, \ |
| 105 | nid, block_size, key_len, iv_len, flags,\ | 162 | nid, block_size, key_len, iv_len, flags,\ |
| 106 | init_key, cleanup, set_asn1, get_asn1, ctrl)\ | 163 | init_key, cleanup, set_asn1, get_asn1, ctrl)\ |
| 107 | static EVP_CIPHER cname##_cbc = {\ | 164 | static const EVP_CIPHER cname##_cbc = {\ |
| 108 | nid##_cbc, block_size, key_len, iv_len, \ | 165 | nid##_cbc, block_size, key_len, iv_len, \ |
| 109 | flags | EVP_CIPH_CBC_MODE,\ | 166 | flags | EVP_CIPH_CBC_MODE,\ |
| 110 | init_key,\ | 167 | init_key,\ |
| @@ -116,8 +173,8 @@ static EVP_CIPHER cname##_cbc = {\ | |||
| 116 | ctrl, \ | 173 | ctrl, \ |
| 117 | NULL \ | 174 | NULL \ |
| 118 | };\ | 175 | };\ |
| 119 | EVP_CIPHER *EVP_##cname##_cbc(void) { return &cname##_cbc; }\ | 176 | const EVP_CIPHER *EVP_##cname##_cbc(void) { return &cname##_cbc; }\ |
| 120 | static EVP_CIPHER cname##_cfb = {\ | 177 | static const EVP_CIPHER cname##_cfb = {\ |
| 121 | nid##_cfb64, 1, key_len, iv_len, \ | 178 | nid##_cfb64, 1, key_len, iv_len, \ |
| 122 | flags | EVP_CIPH_CFB_MODE,\ | 179 | flags | EVP_CIPH_CFB_MODE,\ |
| 123 | init_key,\ | 180 | init_key,\ |
| @@ -129,8 +186,8 @@ static EVP_CIPHER cname##_cfb = {\ | |||
| 129 | ctrl,\ | 186 | ctrl,\ |
| 130 | NULL \ | 187 | NULL \ |
| 131 | };\ | 188 | };\ |
| 132 | EVP_CIPHER *EVP_##cname##_cfb(void) { return &cname##_cfb; }\ | 189 | const EVP_CIPHER *EVP_##cname##_cfb(void) { return &cname##_cfb; }\ |
| 133 | static EVP_CIPHER cname##_ofb = {\ | 190 | static const EVP_CIPHER cname##_ofb = {\ |
| 134 | nid##_ofb64, 1, key_len, iv_len, \ | 191 | nid##_ofb64, 1, key_len, iv_len, \ |
| 135 | flags | EVP_CIPH_OFB_MODE,\ | 192 | flags | EVP_CIPH_OFB_MODE,\ |
| 136 | init_key,\ | 193 | init_key,\ |
| @@ -142,8 +199,8 @@ static EVP_CIPHER cname##_ofb = {\ | |||
| 142 | ctrl,\ | 199 | ctrl,\ |
| 143 | NULL \ | 200 | NULL \ |
| 144 | };\ | 201 | };\ |
| 145 | EVP_CIPHER *EVP_##cname##_ofb(void) { return &cname##_ofb; }\ | 202 | const EVP_CIPHER *EVP_##cname##_ofb(void) { return &cname##_ofb; }\ |
| 146 | static EVP_CIPHER cname##_ecb = {\ | 203 | static const EVP_CIPHER cname##_ecb = {\ |
| 147 | nid##_ecb, block_size, key_len, iv_len, \ | 204 | nid##_ecb, block_size, key_len, iv_len, \ |
| 148 | flags | EVP_CIPH_ECB_MODE,\ | 205 | flags | EVP_CIPH_ECB_MODE,\ |
| 149 | init_key,\ | 206 | init_key,\ |
| @@ -155,14 +212,16 @@ static EVP_CIPHER cname##_ecb = {\ | |||
| 155 | ctrl,\ | 212 | ctrl,\ |
| 156 | NULL \ | 213 | NULL \ |
| 157 | };\ | 214 | };\ |
| 158 | EVP_CIPHER *EVP_##cname##_ecb(void) { return &cname##_ecb; } | 215 | const EVP_CIPHER *EVP_##cname##_ecb(void) { return &cname##_ecb; } |
| 159 | 216 | */ | |
| 160 | |||
| 161 | 217 | ||
| 162 | #define IMPLEMENT_BLOCK_CIPHER(cname, kname, cprefix, kstruct, \ | 218 | #define IMPLEMENT_BLOCK_CIPHER(cname, ksched, cprefix, kstruct, nid, \ |
| 163 | nid, block_size, key_len, iv_len, flags, \ | 219 | block_size, key_len, iv_len, cbits, \ |
| 164 | init_key, cleanup, set_asn1, get_asn1, ctrl) \ | 220 | flags, init_key, \ |
| 165 | BLOCK_CIPHER_all_funcs(cname, cprefix, kname) \ | 221 | cleanup, set_asn1, get_asn1, ctrl) \ |
| 166 | BLOCK_CIPHER_defs(cname, kstruct, nid, block_size, key_len, iv_len, flags,\ | 222 | BLOCK_CIPHER_all_funcs(cname, cprefix, cbits, kstruct, ksched) \ |
| 167 | init_key, cleanup, set_asn1, get_asn1, ctrl) | 223 | BLOCK_CIPHER_defs(cname, kstruct, nid, block_size, key_len, iv_len, \ |
| 224 | cbits, flags, init_key, cleanup, set_asn1, \ | ||
| 225 | get_asn1, ctrl) | ||
| 168 | 226 | ||
| 227 | #define EVP_C_DATA(kstruct, ctx) ((kstruct *)(ctx)->cipher_data) | ||
diff --git a/src/lib/libcrypto/evp/evp_pbe.c b/src/lib/libcrypto/evp/evp_pbe.c index 224a422b12..06afb9d152 100644 --- a/src/lib/libcrypto/evp/evp_pbe.c +++ b/src/lib/libcrypto/evp/evp_pbe.c | |||
| @@ -69,8 +69,8 @@ static STACK *pbe_algs; | |||
| 69 | 69 | ||
| 70 | typedef struct { | 70 | typedef struct { |
| 71 | int pbe_nid; | 71 | int pbe_nid; |
| 72 | EVP_CIPHER *cipher; | 72 | const EVP_CIPHER *cipher; |
| 73 | EVP_MD *md; | 73 | const EVP_MD *md; |
| 74 | EVP_PBE_KEYGEN *keygen; | 74 | EVP_PBE_KEYGEN *keygen; |
| 75 | } EVP_PBE_CTL; | 75 | } EVP_PBE_CTL; |
| 76 | 76 | ||
| @@ -112,7 +112,7 @@ static int pbe_cmp(const char * const *a, const char * const *b) | |||
| 112 | 112 | ||
| 113 | /* Add a PBE algorithm */ | 113 | /* Add a PBE algorithm */ |
| 114 | 114 | ||
| 115 | int EVP_PBE_alg_add (int nid, EVP_CIPHER *cipher, EVP_MD *md, | 115 | int EVP_PBE_alg_add(int nid, const EVP_CIPHER *cipher, const EVP_MD *md, |
| 116 | EVP_PBE_KEYGEN *keygen) | 116 | EVP_PBE_KEYGEN *keygen) |
| 117 | { | 117 | { |
| 118 | EVP_PBE_CTL *pbe_tmp; | 118 | EVP_PBE_CTL *pbe_tmp; |
diff --git a/src/lib/libcrypto/evp/evp_pkey.c b/src/lib/libcrypto/evp/evp_pkey.c index 8df2874f3c..34b5b1d21c 100644 --- a/src/lib/libcrypto/evp/evp_pkey.c +++ b/src/lib/libcrypto/evp/evp_pkey.c | |||
| @@ -62,17 +62,19 @@ | |||
| 62 | #include <openssl/x509.h> | 62 | #include <openssl/x509.h> |
| 63 | #include <openssl/rand.h> | 63 | #include <openssl/rand.h> |
| 64 | 64 | ||
| 65 | #ifndef OPENSSL_NO_DSA | ||
| 65 | static int dsa_pkey2pkcs8(PKCS8_PRIV_KEY_INFO *p8inf, EVP_PKEY *pkey); | 66 | static int dsa_pkey2pkcs8(PKCS8_PRIV_KEY_INFO *p8inf, EVP_PKEY *pkey); |
| 67 | #endif | ||
| 66 | 68 | ||
| 67 | /* Extract a private key from a PKCS8 structure */ | 69 | /* Extract a private key from a PKCS8 structure */ |
| 68 | 70 | ||
| 69 | EVP_PKEY *EVP_PKCS82PKEY (PKCS8_PRIV_KEY_INFO *p8) | 71 | EVP_PKEY *EVP_PKCS82PKEY (PKCS8_PRIV_KEY_INFO *p8) |
| 70 | { | 72 | { |
| 71 | EVP_PKEY *pkey = NULL; | 73 | EVP_PKEY *pkey = NULL; |
| 72 | #ifndef NO_RSA | 74 | #ifndef OPENSSL_NO_RSA |
| 73 | RSA *rsa = NULL; | 75 | RSA *rsa = NULL; |
| 74 | #endif | 76 | #endif |
| 75 | #ifndef NO_DSA | 77 | #ifndef OPENSSL_NO_DSA |
| 76 | DSA *dsa = NULL; | 78 | DSA *dsa = NULL; |
| 77 | ASN1_INTEGER *privkey; | 79 | ASN1_INTEGER *privkey; |
| 78 | ASN1_TYPE *t1, *t2, *param = NULL; | 80 | ASN1_TYPE *t1, *t2, *param = NULL; |
| @@ -82,6 +84,7 @@ EVP_PKEY *EVP_PKCS82PKEY (PKCS8_PRIV_KEY_INFO *p8) | |||
| 82 | #endif | 84 | #endif |
| 83 | X509_ALGOR *a; | 85 | X509_ALGOR *a; |
| 84 | unsigned char *p; | 86 | unsigned char *p; |
| 87 | const unsigned char *cp; | ||
| 85 | int pkeylen; | 88 | int pkeylen; |
| 86 | char obj_tmp[80]; | 89 | char obj_tmp[80]; |
| 87 | 90 | ||
| @@ -101,16 +104,17 @@ EVP_PKEY *EVP_PKCS82PKEY (PKCS8_PRIV_KEY_INFO *p8) | |||
| 101 | a = p8->pkeyalg; | 104 | a = p8->pkeyalg; |
| 102 | switch (OBJ_obj2nid(a->algorithm)) | 105 | switch (OBJ_obj2nid(a->algorithm)) |
| 103 | { | 106 | { |
| 104 | #ifndef NO_RSA | 107 | #ifndef OPENSSL_NO_RSA |
| 105 | case NID_rsaEncryption: | 108 | case NID_rsaEncryption: |
| 106 | if (!(rsa = d2i_RSAPrivateKey (NULL, &p, pkeylen))) { | 109 | cp = p; |
| 110 | if (!(rsa = d2i_RSAPrivateKey (NULL,&cp, pkeylen))) { | ||
| 107 | EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR); | 111 | EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR); |
| 108 | return NULL; | 112 | return NULL; |
| 109 | } | 113 | } |
| 110 | EVP_PKEY_assign_RSA (pkey, rsa); | 114 | EVP_PKEY_assign_RSA (pkey, rsa); |
| 111 | break; | 115 | break; |
| 112 | #endif | 116 | #endif |
| 113 | #ifndef NO_DSA | 117 | #ifndef OPENSSL_NO_DSA |
| 114 | case NID_dsa: | 118 | case NID_dsa: |
| 115 | /* PKCS#8 DSA is weird: you just get a private key integer | 119 | /* PKCS#8 DSA is weird: you just get a private key integer |
| 116 | * and parameters in the AlgorithmIdentifier the pubkey must | 120 | * and parameters in the AlgorithmIdentifier the pubkey must |
| @@ -163,9 +167,9 @@ EVP_PKEY *EVP_PKCS82PKEY (PKCS8_PRIV_KEY_INFO *p8) | |||
| 163 | EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR); | 167 | EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR); |
| 164 | goto dsaerr; | 168 | goto dsaerr; |
| 165 | } | 169 | } |
| 166 | p = param->value.sequence->data; | 170 | cp = p = param->value.sequence->data; |
| 167 | plen = param->value.sequence->length; | 171 | plen = param->value.sequence->length; |
| 168 | if (!(dsa = d2i_DSAparams (NULL, &p, plen))) { | 172 | if (!(dsa = d2i_DSAparams (NULL, &cp, plen))) { |
| 169 | EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR); | 173 | EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR); |
| 170 | goto dsaerr; | 174 | goto dsaerr; |
| 171 | } | 175 | } |
| @@ -239,7 +243,7 @@ PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8_broken(EVP_PKEY *pkey, int broken) | |||
| 239 | } | 243 | } |
| 240 | p8->pkey->type = V_ASN1_OCTET_STRING; | 244 | p8->pkey->type = V_ASN1_OCTET_STRING; |
| 241 | switch (EVP_PKEY_type(pkey->type)) { | 245 | switch (EVP_PKEY_type(pkey->type)) { |
| 242 | #ifndef NO_RSA | 246 | #ifndef OPENSSL_NO_RSA |
| 243 | case EVP_PKEY_RSA: | 247 | case EVP_PKEY_RSA: |
| 244 | 248 | ||
| 245 | if(p8->broken == PKCS8_NO_OCTET) p8->pkey->type = V_ASN1_SEQUENCE; | 249 | if(p8->broken == PKCS8_NO_OCTET) p8->pkey->type = V_ASN1_SEQUENCE; |
| @@ -254,7 +258,7 @@ PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8_broken(EVP_PKEY *pkey, int broken) | |||
| 254 | } | 258 | } |
| 255 | break; | 259 | break; |
| 256 | #endif | 260 | #endif |
| 257 | #ifndef NO_DSA | 261 | #ifndef OPENSSL_NO_DSA |
| 258 | case EVP_PKEY_DSA: | 262 | case EVP_PKEY_DSA: |
| 259 | if(!dsa_pkey2pkcs8(p8, pkey)) { | 263 | if(!dsa_pkey2pkcs8(p8, pkey)) { |
| 260 | PKCS8_PRIV_KEY_INFO_free (p8); | 264 | PKCS8_PRIV_KEY_INFO_free (p8); |
| @@ -296,7 +300,7 @@ PKCS8_PRIV_KEY_INFO *PKCS8_set_broken(PKCS8_PRIV_KEY_INFO *p8, int broken) | |||
| 296 | } | 300 | } |
| 297 | } | 301 | } |
| 298 | 302 | ||
| 299 | #ifndef NO_DSA | 303 | #ifndef OPENSSL_NO_DSA |
| 300 | static int dsa_pkey2pkcs8(PKCS8_PRIV_KEY_INFO *p8, EVP_PKEY *pkey) | 304 | static int dsa_pkey2pkcs8(PKCS8_PRIV_KEY_INFO *p8, EVP_PKEY *pkey) |
| 301 | { | 305 | { |
| 302 | ASN1_STRING *params; | 306 | ASN1_STRING *params; |
diff --git a/src/lib/libcrypto/evp/evp_test.c b/src/lib/libcrypto/evp/evp_test.c new file mode 100644 index 0000000000..3607fe7776 --- /dev/null +++ b/src/lib/libcrypto/evp/evp_test.c | |||
| @@ -0,0 +1,365 @@ | |||
| 1 | /* Written by Ben Laurie, 2001 */ | ||
| 2 | /* | ||
| 3 | * Copyright (c) 2001 The OpenSSL Project. All rights reserved. | ||
| 4 | * | ||
| 5 | * Redistribution and use in source and binary forms, with or without | ||
| 6 | * modification, are permitted provided that the following conditions | ||
| 7 | * are met: | ||
| 8 | * | ||
| 9 | * 1. Redistributions of source code must retain the above copyright | ||
| 10 | * notice, this list of conditions and the following disclaimer. | ||
| 11 | * | ||
| 12 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 13 | * notice, this list of conditions and the following disclaimer in | ||
| 14 | * the documentation and/or other materials provided with the | ||
| 15 | * distribution. | ||
| 16 | * | ||
| 17 | * 3. All advertising materials mentioning features or use of this | ||
| 18 | * software must display the following acknowledgment: | ||
| 19 | * "This product includes software developed by the OpenSSL Project | ||
| 20 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
| 21 | * | ||
| 22 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
| 23 | * endorse or promote products derived from this software without | ||
| 24 | * prior written permission. For written permission, please contact | ||
| 25 | * openssl-core@openssl.org. | ||
| 26 | * | ||
| 27 | * 5. Products derived from this software may not be called "OpenSSL" | ||
| 28 | * nor may "OpenSSL" appear in their names without prior written | ||
| 29 | * permission of the OpenSSL Project. | ||
| 30 | * | ||
| 31 | * 6. Redistributions of any form whatsoever must retain the following | ||
| 32 | * acknowledgment: | ||
| 33 | * "This product includes software developed by the OpenSSL Project | ||
| 34 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
| 35 | * | ||
| 36 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
| 37 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 38 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
| 39 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
| 40 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| 41 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
| 42 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
| 43 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 44 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
| 45 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
| 46 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
| 47 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 48 | */ | ||
| 49 | |||
| 50 | #include <stdio.h> | ||
| 51 | #include <string.h> | ||
| 52 | #include <openssl/evp.h> | ||
| 53 | #include <openssl/engine.h> | ||
| 54 | #include <openssl/conf.h> | ||
| 55 | |||
| 56 | static void hexdump(FILE *f,const char *title,const unsigned char *s,int l) | ||
| 57 | { | ||
| 58 | int n=0; | ||
| 59 | |||
| 60 | fprintf(f,"%s",title); | ||
| 61 | for( ; n < l ; ++n) | ||
| 62 | { | ||
| 63 | if((n%16) == 0) | ||
| 64 | fprintf(f,"\n%04x",n); | ||
| 65 | fprintf(f," %02x",s[n]); | ||
| 66 | } | ||
| 67 | fprintf(f,"\n"); | ||
| 68 | } | ||
| 69 | |||
| 70 | static int convert(unsigned char *s) | ||
| 71 | { | ||
| 72 | unsigned char *d; | ||
| 73 | |||
| 74 | for(d=s ; *s ; s+=2,++d) | ||
| 75 | { | ||
| 76 | unsigned int n; | ||
| 77 | |||
| 78 | if(!s[1]) | ||
| 79 | { | ||
| 80 | fprintf(stderr,"Odd number of hex digits!"); | ||
| 81 | exit(4); | ||
| 82 | } | ||
| 83 | sscanf((char *)s,"%2x",&n); | ||
| 84 | *d=(unsigned char)n; | ||
| 85 | } | ||
| 86 | return s-d; | ||
| 87 | } | ||
| 88 | |||
| 89 | static char *sstrsep(char **string, const char *delim) | ||
| 90 | { | ||
| 91 | char isdelim[256]; | ||
| 92 | char *token = *string; | ||
| 93 | |||
| 94 | if (**string == 0) | ||
| 95 | return NULL; | ||
| 96 | |||
| 97 | memset(isdelim, 0, 256); | ||
| 98 | isdelim[0] = 1; | ||
| 99 | |||
| 100 | while (*delim) | ||
| 101 | { | ||
| 102 | isdelim[(unsigned char)(*delim)] = 1; | ||
| 103 | delim++; | ||
| 104 | } | ||
| 105 | |||
| 106 | while (!isdelim[(unsigned char)(**string)]) | ||
| 107 | { | ||
| 108 | (*string)++; | ||
| 109 | } | ||
| 110 | |||
| 111 | if (**string) | ||
| 112 | { | ||
| 113 | **string = 0; | ||
| 114 | (*string)++; | ||
| 115 | } | ||
| 116 | |||
| 117 | return token; | ||
| 118 | } | ||
| 119 | |||
| 120 | static unsigned char *ustrsep(char **p,const char *sep) | ||
| 121 | { return (unsigned char *)sstrsep((char **)p,sep); } | ||
| 122 | |||
| 123 | static void test1(const EVP_CIPHER *c,const unsigned char *key,int kn, | ||
| 124 | const unsigned char *iv,int in, | ||
| 125 | const unsigned char *plaintext,int pn, | ||
| 126 | const unsigned char *ciphertext,int cn) | ||
| 127 | { | ||
| 128 | EVP_CIPHER_CTX ctx; | ||
| 129 | unsigned char out[4096]; | ||
| 130 | int outl,outl2; | ||
| 131 | |||
| 132 | printf("Testing cipher %s\n",EVP_CIPHER_name(c)); | ||
| 133 | hexdump(stdout,"Key",key,kn); | ||
| 134 | if(in) | ||
| 135 | hexdump(stdout,"IV",iv,in); | ||
| 136 | hexdump(stdout,"Plaintext",plaintext,pn); | ||
| 137 | hexdump(stdout,"Ciphertext",ciphertext,cn); | ||
| 138 | |||
| 139 | if(kn != c->key_len) | ||
| 140 | { | ||
| 141 | fprintf(stderr,"Key length doesn't match, got %d expected %d\n",kn, | ||
| 142 | c->key_len); | ||
| 143 | exit(5); | ||
| 144 | } | ||
| 145 | EVP_CIPHER_CTX_init(&ctx); | ||
| 146 | if(!EVP_EncryptInit_ex(&ctx,c,NULL,key,iv)) | ||
| 147 | { | ||
| 148 | fprintf(stderr,"EncryptInit failed\n"); | ||
| 149 | exit(10); | ||
| 150 | } | ||
| 151 | EVP_CIPHER_CTX_set_padding(&ctx,0); | ||
| 152 | |||
| 153 | if(!EVP_EncryptUpdate(&ctx,out,&outl,plaintext,pn)) | ||
| 154 | { | ||
| 155 | fprintf(stderr,"Encrypt failed\n"); | ||
| 156 | exit(6); | ||
| 157 | } | ||
| 158 | if(!EVP_EncryptFinal_ex(&ctx,out+outl,&outl2)) | ||
| 159 | { | ||
| 160 | fprintf(stderr,"EncryptFinal failed\n"); | ||
| 161 | exit(7); | ||
| 162 | } | ||
| 163 | |||
| 164 | if(outl+outl2 != cn) | ||
| 165 | { | ||
| 166 | fprintf(stderr,"Ciphertext length mismatch got %d expected %d\n", | ||
| 167 | outl+outl2,cn); | ||
| 168 | exit(8); | ||
| 169 | } | ||
| 170 | |||
| 171 | if(memcmp(out,ciphertext,cn)) | ||
| 172 | { | ||
| 173 | fprintf(stderr,"Ciphertext mismatch\n"); | ||
| 174 | hexdump(stderr,"Got",out,cn); | ||
| 175 | hexdump(stderr,"Expected",ciphertext,cn); | ||
| 176 | exit(9); | ||
| 177 | } | ||
| 178 | |||
| 179 | if(!EVP_DecryptInit_ex(&ctx,c,NULL,key,iv)) | ||
| 180 | { | ||
| 181 | fprintf(stderr,"DecryptInit failed\n"); | ||
| 182 | exit(11); | ||
| 183 | } | ||
| 184 | EVP_CIPHER_CTX_set_padding(&ctx,0); | ||
| 185 | |||
| 186 | if(!EVP_DecryptUpdate(&ctx,out,&outl,ciphertext,pn)) | ||
| 187 | { | ||
| 188 | fprintf(stderr,"Decrypt failed\n"); | ||
| 189 | exit(6); | ||
| 190 | } | ||
| 191 | if(!EVP_DecryptFinal_ex(&ctx,out+outl,&outl2)) | ||
| 192 | { | ||
| 193 | fprintf(stderr,"DecryptFinal failed\n"); | ||
| 194 | exit(7); | ||
| 195 | } | ||
| 196 | |||
| 197 | if(outl+outl2 != cn) | ||
| 198 | { | ||
| 199 | fprintf(stderr,"Plaintext length mismatch got %d expected %d\n", | ||
| 200 | outl+outl2,cn); | ||
| 201 | exit(8); | ||
| 202 | } | ||
| 203 | |||
| 204 | if(memcmp(out,plaintext,cn)) | ||
| 205 | { | ||
| 206 | fprintf(stderr,"Plaintext mismatch\n"); | ||
| 207 | hexdump(stderr,"Got",out,cn); | ||
| 208 | hexdump(stderr,"Expected",plaintext,cn); | ||
| 209 | exit(9); | ||
| 210 | } | ||
| 211 | |||
| 212 | printf("\n"); | ||
| 213 | } | ||
| 214 | |||
| 215 | static int test_cipher(const char *cipher,const unsigned char *key,int kn, | ||
| 216 | const unsigned char *iv,int in, | ||
| 217 | const unsigned char *plaintext,int pn, | ||
| 218 | const unsigned char *ciphertext,int cn) | ||
| 219 | { | ||
| 220 | const EVP_CIPHER *c; | ||
| 221 | |||
| 222 | c=EVP_get_cipherbyname(cipher); | ||
| 223 | if(!c) | ||
| 224 | return 0; | ||
| 225 | |||
| 226 | test1(c,key,kn,iv,in,plaintext,pn,ciphertext,cn); | ||
| 227 | |||
| 228 | return 1; | ||
| 229 | } | ||
| 230 | |||
| 231 | static int test_digest(const char *digest, | ||
| 232 | const unsigned char *plaintext,int pn, | ||
| 233 | const unsigned char *ciphertext, unsigned int cn) | ||
| 234 | { | ||
| 235 | const EVP_MD *d; | ||
| 236 | EVP_MD_CTX ctx; | ||
| 237 | unsigned char md[EVP_MAX_MD_SIZE]; | ||
| 238 | unsigned int mdn; | ||
| 239 | |||
| 240 | d=EVP_get_digestbyname(digest); | ||
| 241 | if(!d) | ||
| 242 | return 0; | ||
| 243 | |||
| 244 | printf("Testing digest %s\n",EVP_MD_name(d)); | ||
| 245 | hexdump(stdout,"Plaintext",plaintext,pn); | ||
| 246 | hexdump(stdout,"Digest",ciphertext,cn); | ||
| 247 | |||
| 248 | EVP_MD_CTX_init(&ctx); | ||
| 249 | if(!EVP_DigestInit_ex(&ctx,d, NULL)) | ||
| 250 | { | ||
| 251 | fprintf(stderr,"DigestInit failed\n"); | ||
| 252 | exit(100); | ||
| 253 | } | ||
| 254 | if(!EVP_DigestUpdate(&ctx,plaintext,pn)) | ||
| 255 | { | ||
| 256 | fprintf(stderr,"DigestUpdate failed\n"); | ||
| 257 | exit(101); | ||
| 258 | } | ||
| 259 | if(!EVP_DigestFinal_ex(&ctx,md,&mdn)) | ||
| 260 | { | ||
| 261 | fprintf(stderr,"DigestFinal failed\n"); | ||
| 262 | exit(101); | ||
| 263 | } | ||
| 264 | EVP_MD_CTX_cleanup(&ctx); | ||
| 265 | |||
| 266 | if(mdn != cn) | ||
| 267 | { | ||
| 268 | fprintf(stderr,"Digest length mismatch, got %d expected %d\n",mdn,cn); | ||
| 269 | exit(102); | ||
| 270 | } | ||
| 271 | |||
| 272 | if(memcmp(md,ciphertext,cn)) | ||
| 273 | { | ||
| 274 | fprintf(stderr,"Digest mismatch\n"); | ||
| 275 | hexdump(stderr,"Got",md,cn); | ||
| 276 | hexdump(stderr,"Expected",ciphertext,cn); | ||
| 277 | exit(103); | ||
| 278 | } | ||
| 279 | |||
| 280 | printf("\n"); | ||
| 281 | |||
| 282 | return 1; | ||
| 283 | } | ||
| 284 | |||
| 285 | int main(int argc,char **argv) | ||
| 286 | { | ||
| 287 | const char *szTestFile; | ||
| 288 | FILE *f; | ||
| 289 | |||
| 290 | if(argc != 2) | ||
| 291 | { | ||
| 292 | fprintf(stderr,"%s <test file>\n",argv[0]); | ||
| 293 | exit(1); | ||
| 294 | } | ||
| 295 | CRYPTO_malloc_debug_init(); | ||
| 296 | CRYPTO_set_mem_debug_options(V_CRYPTO_MDEBUG_ALL); | ||
| 297 | CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON); | ||
| 298 | |||
| 299 | szTestFile=argv[1]; | ||
| 300 | |||
| 301 | f=fopen(szTestFile,"r"); | ||
| 302 | if(!f) | ||
| 303 | { | ||
| 304 | perror(szTestFile); | ||
| 305 | exit(2); | ||
| 306 | } | ||
| 307 | |||
| 308 | /* Load up the software EVP_CIPHER and EVP_MD definitions */ | ||
| 309 | OpenSSL_add_all_ciphers(); | ||
| 310 | OpenSSL_add_all_digests(); | ||
| 311 | /* Load all compiled-in ENGINEs */ | ||
| 312 | ENGINE_load_builtin_engines(); | ||
| 313 | #if 0 | ||
| 314 | OPENSSL_config(); | ||
| 315 | #endif | ||
| 316 | /* Register all available ENGINE implementations of ciphers and digests. | ||
| 317 | * This could perhaps be changed to "ENGINE_register_all_complete()"? */ | ||
| 318 | ENGINE_register_all_ciphers(); | ||
| 319 | ENGINE_register_all_digests(); | ||
| 320 | /* If we add command-line options, this statement should be switchable. | ||
| 321 | * It'll prevent ENGINEs being ENGINE_init()ialised for cipher/digest use if | ||
| 322 | * they weren't already initialised. */ | ||
| 323 | /* ENGINE_set_cipher_flags(ENGINE_CIPHER_FLAG_NOINIT); */ | ||
| 324 | |||
| 325 | for( ; ; ) | ||
| 326 | { | ||
| 327 | char line[4096]; | ||
| 328 | char *p; | ||
| 329 | char *cipher; | ||
| 330 | unsigned char *iv,*key,*plaintext,*ciphertext; | ||
| 331 | int kn,in,pn,cn; | ||
| 332 | |||
| 333 | if(!fgets((char *)line,sizeof line,f)) | ||
| 334 | break; | ||
| 335 | if(line[0] == '#' || line[0] == '\n') | ||
| 336 | continue; | ||
| 337 | p=line; | ||
| 338 | cipher=sstrsep(&p,":"); | ||
| 339 | key=ustrsep(&p,":"); | ||
| 340 | iv=ustrsep(&p,":"); | ||
| 341 | plaintext=ustrsep(&p,":"); | ||
| 342 | ciphertext=ustrsep(&p,"\n"); | ||
| 343 | |||
| 344 | kn=convert(key); | ||
| 345 | in=convert(iv); | ||
| 346 | pn=convert(plaintext); | ||
| 347 | cn=convert(ciphertext); | ||
| 348 | |||
| 349 | if(!test_cipher(cipher,key,kn,iv,in,plaintext,pn,ciphertext,cn) | ||
| 350 | && !test_digest(cipher,plaintext,pn,ciphertext,cn)) | ||
| 351 | { | ||
| 352 | fprintf(stderr,"Can't find %s\n",cipher); | ||
| 353 | exit(3); | ||
| 354 | } | ||
| 355 | } | ||
| 356 | |||
| 357 | ENGINE_cleanup(); | ||
| 358 | EVP_cleanup(); | ||
| 359 | CRYPTO_cleanup_all_ex_data(); | ||
| 360 | ERR_remove_state(0); | ||
| 361 | ERR_free_strings(); | ||
| 362 | CRYPTO_mem_leaks_fp(stderr); | ||
| 363 | |||
| 364 | return 0; | ||
| 365 | } | ||
diff --git a/src/lib/libcrypto/evp/evptests.txt b/src/lib/libcrypto/evp/evptests.txt new file mode 100644 index 0000000000..6c1529db37 --- /dev/null +++ b/src/lib/libcrypto/evp/evptests.txt | |||
| @@ -0,0 +1,82 @@ | |||
| 1 | #cipher:key:iv:input:output | ||
| 2 | #digest:::input:output | ||
| 3 | |||
| 4 | # SHA(1) tests (from shatest.c) | ||
| 5 | SHA1:::616263:a9993e364706816aba3e25717850c26c9cd0d89d | ||
| 6 | |||
| 7 | # MD5 tests (from md5test.c) | ||
| 8 | MD5::::d41d8cd98f00b204e9800998ecf8427e | ||
| 9 | MD5:::61:0cc175b9c0f1b6a831c399e269772661 | ||
| 10 | MD5:::616263:900150983cd24fb0d6963f7d28e17f72 | ||
| 11 | MD5:::6d65737361676520646967657374:f96b697d7cb7938d525a2f31aaf161d0 | ||
| 12 | MD5:::6162636465666768696a6b6c6d6e6f707172737475767778797a:c3fcd3d76192e4007dfb496cca67e13b | ||
| 13 | MD5:::4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a30313233343536373839:d174ab98d277d9f5a5611c2c9f419d9f | ||
| 14 | MD5:::3132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930:57edf4a22be3c955ac49da2e2107b67a | ||
| 15 | |||
| 16 | # AES 128 ECB tests (from FIPS-197 test vectors, encrypt) | ||
| 17 | |||
| 18 | AES-128-ECB:000102030405060708090A0B0C0D0E0F::00112233445566778899AABBCCDDEEFF:69C4E0D86A7B0430D8CDB78070B4C55A | ||
| 19 | |||
| 20 | # AES 192 ECB tests (from FIPS-197 test vectors, encrypt) | ||
| 21 | |||
| 22 | AES-192-ECB:000102030405060708090A0B0C0D0E0F1011121314151617::00112233445566778899AABBCCDDEEFF:DDA97CA4864CDFE06EAF70A0EC0D7191 | ||
| 23 | |||
| 24 | # AES 256 ECB tests (from FIPS-197 test vectors, encrypt) | ||
| 25 | |||
| 26 | AES-256-ECB:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F::00112233445566778899AABBCCDDEEFF:8EA2B7CA516745BFEAFC49904B496089 | ||
| 27 | |||
| 28 | # AES 128 ECB tests (from NIST test vectors, encrypt) | ||
| 29 | |||
| 30 | #AES-128-ECB:00000000000000000000000000000000::00000000000000000000000000000000:C34C052CC0DA8D73451AFE5F03BE297F | ||
| 31 | |||
| 32 | # AES 128 ECB tests (from NIST test vectors, decrypt) | ||
| 33 | |||
| 34 | #AES-128-ECB:00000000000000000000000000000000::44416AC2D1F53C583303917E6BE9EBE0:00000000000000000000000000000000 | ||
| 35 | |||
| 36 | # AES 192 ECB tests (from NIST test vectors, decrypt) | ||
| 37 | |||
| 38 | #AES-192-ECB:000000000000000000000000000000000000000000000000::48E31E9E256718F29229319C19F15BA4:00000000000000000000000000000000 | ||
| 39 | |||
| 40 | # AES 256 ECB tests (from NIST test vectors, decrypt) | ||
| 41 | |||
| 42 | #AES-256-ECB:0000000000000000000000000000000000000000000000000000000000000000::058CCFFDBBCB382D1F6F56585D8A4ADE:00000000000000000000000000000000 | ||
| 43 | |||
| 44 | # AES 128 CBC tests (from NIST test vectors, encrypt) | ||
| 45 | |||
| 46 | #AES-128-CBC:00000000000000000000000000000000:00000000000000000000000000000000:00000000000000000000000000000000:8A05FC5E095AF4848A08D328D3688E3D | ||
| 47 | |||
| 48 | # AES 192 CBC tests (from NIST test vectors, encrypt) | ||
| 49 | |||
| 50 | #AES-192-CBC:000000000000000000000000000000000000000000000000:00000000000000000000000000000000:00000000000000000000000000000000:7BD966D53AD8C1BB85D2ADFAE87BB104 | ||
| 51 | |||
| 52 | # AES 256 CBC tests (from NIST test vectors, encrypt) | ||
| 53 | |||
| 54 | #AES-256-CBC:0000000000000000000000000000000000000000000000000000000000000000:00000000000000000000000000000000:00000000000000000000000000000000:FE3C53653E2F45B56FCD88B2CC898FF0 | ||
| 55 | |||
| 56 | # AES 128 CBC tests (from NIST test vectors, decrypt) | ||
| 57 | |||
| 58 | #AES-128-CBC:00000000000000000000000000000000:00000000000000000000000000000000:FACA37E0B0C85373DF706E73F7C9AF86:00000000000000000000000000000000 | ||
| 59 | |||
| 60 | # DES ECB tests (from destest) | ||
| 61 | |||
| 62 | DES-ECB:0000000000000000::0000000000000000:8CA64DE9C1B123A7 | ||
| 63 | DES-ECB:FFFFFFFFFFFFFFFF::FFFFFFFFFFFFFFFF:7359B2163E4EDC58 | ||
| 64 | DES-ECB:3000000000000000::1000000000000001:958E6E627A05557B | ||
| 65 | DES-ECB:1111111111111111::1111111111111111:F40379AB9E0EC533 | ||
| 66 | DES-ECB:0123456789ABCDEF::1111111111111111:17668DFC7292532D | ||
| 67 | DES-ECB:1111111111111111::0123456789ABCDEF:8A5AE1F81AB8F2DD | ||
| 68 | DES-ECB:FEDCBA9876543210::0123456789ABCDEF:ED39D950FA74BCC4 | ||
| 69 | |||
| 70 | # DESX-CBC tests (from destest) | ||
| 71 | DESX-CBC:0123456789abcdeff1e0d3c2b5a49786fedcba9876543210:fedcba9876543210:37363534333231204E6F77206973207468652074696D6520666F722000000000:846B2914851E9A2954732F8AA0A611C115CDC2D7951B1053A63C5E03B21AA3C4 | ||
| 72 | |||
| 73 | # DES EDE3 CBC tests (from destest) | ||
| 74 | DES-EDE3-CBC:0123456789abcdeff1e0d3c2b5a49786fedcba9876543210:fedcba9876543210:37363534333231204E6F77206973207468652074696D6520666F722000000000:3FE301C962AC01D02213763C1CBD4CDC799657C064ECF5D41C673812CFDE9675 | ||
| 75 | |||
| 76 | # RC4 tests (from rc4test) | ||
| 77 | RC4:0123456789abcdef0123456789abcdef::0123456789abcdef:75b7878099e0c596 | ||
| 78 | RC4:0123456789abcdef0123456789abcdef::0000000000000000:7494c2e7104b0879 | ||
| 79 | RC4:00000000000000000000000000000000::0000000000000000:de188941a3375d3a | ||
| 80 | RC4:ef012345ef012345ef012345ef012345::0000000000000000000000000000000000000000:d6a141a7ec3c38dfbd615a1162e1c7ba36b67858 | ||
| 81 | RC4:0123456789abcdef0123456789abcdef::123456789ABCDEF0123456789ABCDEF0123456789ABCDEF012345678:66a0949f8af7d6891f7f832ba833c00c892ebe30143ce28740011ecf | ||
| 82 | RC4:ef012345ef012345ef012345ef012345::00000000000000000000:d6a141a7ec3c38dfbd61 | ||
diff --git a/src/lib/libcrypto/evp/m_dss.c b/src/lib/libcrypto/evp/m_dss.c index 8ea826868e..beb8d7fc5c 100644 --- a/src/lib/libcrypto/evp/m_dss.c +++ b/src/lib/libcrypto/evp/m_dss.c | |||
| @@ -62,21 +62,33 @@ | |||
| 62 | #include <openssl/objects.h> | 62 | #include <openssl/objects.h> |
| 63 | #include <openssl/x509.h> | 63 | #include <openssl/x509.h> |
| 64 | 64 | ||
| 65 | #ifndef NO_SHA | 65 | #ifndef OPENSSL_NO_SHA |
| 66 | static EVP_MD dsa_md= | 66 | static int init(EVP_MD_CTX *ctx) |
| 67 | { return SHA1_Init(ctx->md_data); } | ||
| 68 | |||
| 69 | static int update(EVP_MD_CTX *ctx,const void *data,unsigned long count) | ||
| 70 | { return SHA1_Update(ctx->md_data,data,count); } | ||
| 71 | |||
| 72 | static int final(EVP_MD_CTX *ctx,unsigned char *md) | ||
| 73 | { return SHA1_Final(md,ctx->md_data); } | ||
| 74 | |||
| 75 | static const EVP_MD dsa_md= | ||
| 67 | { | 76 | { |
| 68 | NID_dsaWithSHA, | 77 | NID_dsaWithSHA, |
| 69 | NID_dsaWithSHA, | 78 | NID_dsaWithSHA, |
| 70 | SHA_DIGEST_LENGTH, | 79 | SHA_DIGEST_LENGTH, |
| 71 | SHA1_Init, | 80 | 0, |
| 72 | SHA1_Update, | 81 | init, |
| 73 | SHA1_Final, | 82 | update, |
| 83 | final, | ||
| 84 | NULL, | ||
| 85 | NULL, | ||
| 74 | EVP_PKEY_DSA_method, | 86 | EVP_PKEY_DSA_method, |
| 75 | SHA_CBLOCK, | 87 | SHA_CBLOCK, |
| 76 | sizeof(EVP_MD *)+sizeof(SHA_CTX), | 88 | sizeof(EVP_MD *)+sizeof(SHA_CTX), |
| 77 | }; | 89 | }; |
| 78 | 90 | ||
| 79 | EVP_MD *EVP_dss(void) | 91 | const EVP_MD *EVP_dss(void) |
| 80 | { | 92 | { |
| 81 | return(&dsa_md); | 93 | return(&dsa_md); |
| 82 | } | 94 | } |
diff --git a/src/lib/libcrypto/evp/m_dss1.c b/src/lib/libcrypto/evp/m_dss1.c index 9d8d1ce23e..f5668ebda0 100644 --- a/src/lib/libcrypto/evp/m_dss1.c +++ b/src/lib/libcrypto/evp/m_dss1.c | |||
| @@ -56,27 +56,39 @@ | |||
| 56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
| 57 | */ | 57 | */ |
| 58 | 58 | ||
| 59 | #ifndef NO_SHA | 59 | #ifndef OPENSSL_NO_SHA |
| 60 | #include <stdio.h> | 60 | #include <stdio.h> |
| 61 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
| 62 | #include <openssl/evp.h> | 62 | #include <openssl/evp.h> |
| 63 | #include <openssl/objects.h> | 63 | #include <openssl/objects.h> |
| 64 | #include <openssl/x509.h> | 64 | #include <openssl/x509.h> |
| 65 | 65 | ||
| 66 | static EVP_MD dss1_md= | 66 | static int init(EVP_MD_CTX *ctx) |
| 67 | { return SHA1_Init(ctx->md_data); } | ||
| 68 | |||
| 69 | static int update(EVP_MD_CTX *ctx,const void *data,unsigned long count) | ||
| 70 | { return SHA1_Update(ctx->md_data,data,count); } | ||
| 71 | |||
| 72 | static int final(EVP_MD_CTX *ctx,unsigned char *md) | ||
| 73 | { return SHA1_Final(md,ctx->md_data); } | ||
| 74 | |||
| 75 | static const EVP_MD dss1_md= | ||
| 67 | { | 76 | { |
| 68 | NID_dsa, | 77 | NID_dsa, |
| 69 | NID_dsaWithSHA1, | 78 | NID_dsaWithSHA1, |
| 70 | SHA_DIGEST_LENGTH, | 79 | SHA_DIGEST_LENGTH, |
| 71 | SHA1_Init, | 80 | 0, |
| 72 | SHA1_Update, | 81 | init, |
| 73 | SHA1_Final, | 82 | update, |
| 83 | final, | ||
| 84 | NULL, | ||
| 85 | NULL, | ||
| 74 | EVP_PKEY_DSA_method, | 86 | EVP_PKEY_DSA_method, |
| 75 | SHA_CBLOCK, | 87 | SHA_CBLOCK, |
| 76 | sizeof(EVP_MD *)+sizeof(SHA_CTX), | 88 | sizeof(EVP_MD *)+sizeof(SHA_CTX), |
| 77 | }; | 89 | }; |
| 78 | 90 | ||
| 79 | EVP_MD *EVP_dss1(void) | 91 | const EVP_MD *EVP_dss1(void) |
| 80 | { | 92 | { |
| 81 | return(&dss1_md); | 93 | return(&dss1_md); |
| 82 | } | 94 | } |
diff --git a/src/lib/libcrypto/evp/m_md2.c b/src/lib/libcrypto/evp/m_md2.c index 3281e91809..50914c83b3 100644 --- a/src/lib/libcrypto/evp/m_md2.c +++ b/src/lib/libcrypto/evp/m_md2.c | |||
| @@ -56,27 +56,40 @@ | |||
| 56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
| 57 | */ | 57 | */ |
| 58 | 58 | ||
| 59 | #ifndef NO_MD2 | 59 | #ifndef OPENSSL_NO_MD2 |
| 60 | #include <stdio.h> | 60 | #include <stdio.h> |
| 61 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
| 62 | #include <openssl/evp.h> | 62 | #include <openssl/evp.h> |
| 63 | #include <openssl/objects.h> | 63 | #include <openssl/objects.h> |
| 64 | #include <openssl/x509.h> | 64 | #include <openssl/x509.h> |
| 65 | #include <openssl/md2.h> | ||
| 65 | 66 | ||
| 66 | static EVP_MD md2_md= | 67 | static int init(EVP_MD_CTX *ctx) |
| 68 | { return MD2_Init(ctx->md_data); } | ||
| 69 | |||
| 70 | static int update(EVP_MD_CTX *ctx,const void *data,unsigned long count) | ||
| 71 | { return MD2_Update(ctx->md_data,data,count); } | ||
| 72 | |||
| 73 | static int final(EVP_MD_CTX *ctx,unsigned char *md) | ||
| 74 | { return MD2_Final(md,ctx->md_data); } | ||
| 75 | |||
| 76 | static const EVP_MD md2_md= | ||
| 67 | { | 77 | { |
| 68 | NID_md2, | 78 | NID_md2, |
| 69 | NID_md2WithRSAEncryption, | 79 | NID_md2WithRSAEncryption, |
| 70 | MD2_DIGEST_LENGTH, | 80 | MD2_DIGEST_LENGTH, |
| 71 | MD2_Init, | 81 | 0, |
| 72 | MD2_Update, | 82 | init, |
| 73 | MD2_Final, | 83 | update, |
| 84 | final, | ||
| 85 | NULL, | ||
| 86 | NULL, | ||
| 74 | EVP_PKEY_RSA_method, | 87 | EVP_PKEY_RSA_method, |
| 75 | MD2_BLOCK, | 88 | MD2_BLOCK, |
| 76 | sizeof(EVP_MD *)+sizeof(MD2_CTX), | 89 | sizeof(EVP_MD *)+sizeof(MD2_CTX), |
| 77 | }; | 90 | }; |
| 78 | 91 | ||
| 79 | EVP_MD *EVP_md2(void) | 92 | const EVP_MD *EVP_md2(void) |
| 80 | { | 93 | { |
| 81 | return(&md2_md); | 94 | return(&md2_md); |
| 82 | } | 95 | } |
diff --git a/src/lib/libcrypto/evp/m_md4.c b/src/lib/libcrypto/evp/m_md4.c index 6a24ceb86d..e19b663754 100644 --- a/src/lib/libcrypto/evp/m_md4.c +++ b/src/lib/libcrypto/evp/m_md4.c | |||
| @@ -56,27 +56,40 @@ | |||
| 56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
| 57 | */ | 57 | */ |
| 58 | 58 | ||
| 59 | #ifndef NO_MD4 | 59 | #ifndef OPENSSL_NO_MD4 |
| 60 | #include <stdio.h> | 60 | #include <stdio.h> |
| 61 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
| 62 | #include <openssl/evp.h> | 62 | #include <openssl/evp.h> |
| 63 | #include <openssl/objects.h> | 63 | #include <openssl/objects.h> |
| 64 | #include <openssl/x509.h> | 64 | #include <openssl/x509.h> |
| 65 | #include <openssl/md4.h> | ||
| 65 | 66 | ||
| 66 | static EVP_MD md4_md= | 67 | static int init(EVP_MD_CTX *ctx) |
| 68 | { return MD4_Init(ctx->md_data); } | ||
| 69 | |||
| 70 | static int update(EVP_MD_CTX *ctx,const void *data,unsigned long count) | ||
| 71 | { return MD4_Update(ctx->md_data,data,count); } | ||
| 72 | |||
| 73 | static int final(EVP_MD_CTX *ctx,unsigned char *md) | ||
| 74 | { return MD4_Final(md,ctx->md_data); } | ||
| 75 | |||
| 76 | static const EVP_MD md4_md= | ||
| 67 | { | 77 | { |
| 68 | NID_md4, | 78 | NID_md4, |
| 69 | 0, | 79 | NID_md4WithRSAEncryption, |
| 70 | MD4_DIGEST_LENGTH, | 80 | MD4_DIGEST_LENGTH, |
| 71 | MD4_Init, | 81 | 0, |
| 72 | MD4_Update, | 82 | init, |
| 73 | MD4_Final, | 83 | update, |
| 84 | final, | ||
| 85 | NULL, | ||
| 86 | NULL, | ||
| 74 | EVP_PKEY_RSA_method, | 87 | EVP_PKEY_RSA_method, |
| 75 | MD4_CBLOCK, | 88 | MD4_CBLOCK, |
| 76 | sizeof(EVP_MD *)+sizeof(MD4_CTX), | 89 | sizeof(EVP_MD *)+sizeof(MD4_CTX), |
| 77 | }; | 90 | }; |
| 78 | 91 | ||
| 79 | EVP_MD *EVP_md4(void) | 92 | const EVP_MD *EVP_md4(void) |
| 80 | { | 93 | { |
| 81 | return(&md4_md); | 94 | return(&md4_md); |
| 82 | } | 95 | } |
diff --git a/src/lib/libcrypto/evp/m_md5.c b/src/lib/libcrypto/evp/m_md5.c index 9fc9530127..b00a03e048 100644 --- a/src/lib/libcrypto/evp/m_md5.c +++ b/src/lib/libcrypto/evp/m_md5.c | |||
| @@ -56,27 +56,40 @@ | |||
| 56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
| 57 | */ | 57 | */ |
| 58 | 58 | ||
| 59 | #ifndef NO_MD5 | 59 | #ifndef OPENSSL_NO_MD5 |
| 60 | #include <stdio.h> | 60 | #include <stdio.h> |
| 61 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
| 62 | #include <openssl/evp.h> | 62 | #include <openssl/evp.h> |
| 63 | #include <openssl/objects.h> | 63 | #include <openssl/objects.h> |
| 64 | #include <openssl/x509.h> | 64 | #include <openssl/x509.h> |
| 65 | #include <openssl/md5.h> | ||
| 65 | 66 | ||
| 66 | static EVP_MD md5_md= | 67 | static int init(EVP_MD_CTX *ctx) |
| 68 | { return MD5_Init(ctx->md_data); } | ||
| 69 | |||
| 70 | static int update(EVP_MD_CTX *ctx,const void *data,unsigned long count) | ||
| 71 | { return MD5_Update(ctx->md_data,data,count); } | ||
| 72 | |||
| 73 | static int final(EVP_MD_CTX *ctx,unsigned char *md) | ||
| 74 | { return MD5_Final(md,ctx->md_data); } | ||
| 75 | |||
| 76 | static const EVP_MD md5_md= | ||
| 67 | { | 77 | { |
| 68 | NID_md5, | 78 | NID_md5, |
| 69 | NID_md5WithRSAEncryption, | 79 | NID_md5WithRSAEncryption, |
| 70 | MD5_DIGEST_LENGTH, | 80 | MD5_DIGEST_LENGTH, |
| 71 | MD5_Init, | 81 | 0, |
| 72 | MD5_Update, | 82 | init, |
| 73 | MD5_Final, | 83 | update, |
| 84 | final, | ||
| 85 | NULL, | ||
| 86 | NULL, | ||
| 74 | EVP_PKEY_RSA_method, | 87 | EVP_PKEY_RSA_method, |
| 75 | MD5_CBLOCK, | 88 | MD5_CBLOCK, |
| 76 | sizeof(EVP_MD *)+sizeof(MD5_CTX), | 89 | sizeof(EVP_MD *)+sizeof(MD5_CTX), |
| 77 | }; | 90 | }; |
| 78 | 91 | ||
| 79 | EVP_MD *EVP_md5(void) | 92 | const EVP_MD *EVP_md5(void) |
| 80 | { | 93 | { |
| 81 | return(&md5_md); | 94 | return(&md5_md); |
| 82 | } | 95 | } |
diff --git a/src/lib/libcrypto/evp/m_mdc2.c b/src/lib/libcrypto/evp/m_mdc2.c index 2c7f1ae515..9f6467c931 100644 --- a/src/lib/libcrypto/evp/m_mdc2.c +++ b/src/lib/libcrypto/evp/m_mdc2.c | |||
| @@ -56,27 +56,40 @@ | |||
| 56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
| 57 | */ | 57 | */ |
| 58 | 58 | ||
| 59 | #ifndef NO_MDC2 | 59 | #ifndef OPENSSL_NO_MDC2 |
| 60 | #include <stdio.h> | 60 | #include <stdio.h> |
| 61 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
| 62 | #include <openssl/evp.h> | 62 | #include <openssl/evp.h> |
| 63 | #include <openssl/objects.h> | 63 | #include <openssl/objects.h> |
| 64 | #include <openssl/x509.h> | 64 | #include <openssl/x509.h> |
| 65 | #include <openssl/mdc2.h> | ||
| 65 | 66 | ||
| 66 | static EVP_MD mdc2_md= | 67 | static int init(EVP_MD_CTX *ctx) |
| 68 | { return MDC2_Init(ctx->md_data); } | ||
| 69 | |||
| 70 | static int update(EVP_MD_CTX *ctx,const void *data,unsigned long count) | ||
| 71 | { return MDC2_Update(ctx->md_data,data,count); } | ||
| 72 | |||
| 73 | static int final(EVP_MD_CTX *ctx,unsigned char *md) | ||
| 74 | { return MDC2_Final(md,ctx->md_data); } | ||
| 75 | |||
| 76 | static const EVP_MD mdc2_md= | ||
| 67 | { | 77 | { |
| 68 | NID_mdc2, | 78 | NID_mdc2, |
| 69 | NID_mdc2WithRSA, | 79 | NID_mdc2WithRSA, |
| 70 | MDC2_DIGEST_LENGTH, | 80 | MDC2_DIGEST_LENGTH, |
| 71 | MDC2_Init, | 81 | 0, |
| 72 | MDC2_Update, | 82 | init, |
| 73 | MDC2_Final, | 83 | update, |
| 84 | final, | ||
| 85 | NULL, | ||
| 86 | NULL, | ||
| 74 | EVP_PKEY_RSA_ASN1_OCTET_STRING_method, | 87 | EVP_PKEY_RSA_ASN1_OCTET_STRING_method, |
| 75 | MDC2_BLOCK, | 88 | MDC2_BLOCK, |
| 76 | sizeof(EVP_MD *)+sizeof(MDC2_CTX), | 89 | sizeof(EVP_MD *)+sizeof(MDC2_CTX), |
| 77 | }; | 90 | }; |
| 78 | 91 | ||
| 79 | EVP_MD *EVP_mdc2(void) | 92 | const EVP_MD *EVP_mdc2(void) |
| 80 | { | 93 | { |
| 81 | return(&mdc2_md); | 94 | return(&mdc2_md); |
| 82 | } | 95 | } |
diff --git a/src/lib/libcrypto/evp/m_null.c b/src/lib/libcrypto/evp/m_null.c index e2dadf3dab..f6f0a1d2c0 100644 --- a/src/lib/libcrypto/evp/m_null.c +++ b/src/lib/libcrypto/evp/m_null.c | |||
| @@ -62,25 +62,32 @@ | |||
| 62 | #include <openssl/objects.h> | 62 | #include <openssl/objects.h> |
| 63 | #include <openssl/x509.h> | 63 | #include <openssl/x509.h> |
| 64 | 64 | ||
| 65 | static void function(void) | 65 | static int init(EVP_MD_CTX *ctx) |
| 66 | { | 66 | { return 1; } |
| 67 | } | 67 | |
| 68 | static int update(EVP_MD_CTX *ctx,const void *data,unsigned long count) | ||
| 69 | { return 1; } | ||
| 68 | 70 | ||
| 69 | static EVP_MD null_md= | 71 | static int final(EVP_MD_CTX *ctx,unsigned char *md) |
| 72 | { return 1; } | ||
| 73 | |||
| 74 | static const EVP_MD null_md= | ||
| 70 | { | 75 | { |
| 71 | NID_undef, | 76 | NID_undef, |
| 72 | NID_undef, | 77 | NID_undef, |
| 73 | 0, | 78 | 0, |
| 74 | function, | 79 | 0, |
| 75 | function, | 80 | init, |
| 76 | function, | 81 | update, |
| 77 | 82 | final, | |
| 83 | NULL, | ||
| 84 | NULL, | ||
| 78 | EVP_PKEY_NULL_method, | 85 | EVP_PKEY_NULL_method, |
| 79 | 0, | 86 | 0, |
| 80 | sizeof(EVP_MD *), | 87 | sizeof(EVP_MD *), |
| 81 | }; | 88 | }; |
| 82 | 89 | ||
| 83 | EVP_MD *EVP_md_null(void) | 90 | const EVP_MD *EVP_md_null(void) |
| 84 | { | 91 | { |
| 85 | return(&null_md); | 92 | return(&null_md); |
| 86 | } | 93 | } |
diff --git a/src/lib/libcrypto/evp/m_ripemd.c b/src/lib/libcrypto/evp/m_ripemd.c index 3d781a4e8d..64725528dc 100644 --- a/src/lib/libcrypto/evp/m_ripemd.c +++ b/src/lib/libcrypto/evp/m_ripemd.c | |||
| @@ -56,7 +56,7 @@ | |||
| 56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
| 57 | */ | 57 | */ |
| 58 | 58 | ||
| 59 | #ifndef NO_RIPEMD | 59 | #ifndef OPENSSL_NO_RIPEMD |
| 60 | #include <stdio.h> | 60 | #include <stdio.h> |
| 61 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
| 62 | #include <openssl/ripemd.h> | 62 | #include <openssl/ripemd.h> |
| @@ -64,20 +64,32 @@ | |||
| 64 | #include <openssl/objects.h> | 64 | #include <openssl/objects.h> |
| 65 | #include <openssl/x509.h> | 65 | #include <openssl/x509.h> |
| 66 | 66 | ||
| 67 | static EVP_MD ripemd160_md= | 67 | static int init(EVP_MD_CTX *ctx) |
| 68 | { return RIPEMD160_Init(ctx->md_data); } | ||
| 69 | |||
| 70 | static int update(EVP_MD_CTX *ctx,const void *data,unsigned long count) | ||
| 71 | { return RIPEMD160_Update(ctx->md_data,data,count); } | ||
| 72 | |||
| 73 | static int final(EVP_MD_CTX *ctx,unsigned char *md) | ||
| 74 | { return RIPEMD160_Final(md,ctx->md_data); } | ||
| 75 | |||
| 76 | static const EVP_MD ripemd160_md= | ||
| 68 | { | 77 | { |
| 69 | NID_ripemd160, | 78 | NID_ripemd160, |
| 70 | NID_ripemd160WithRSA, | 79 | NID_ripemd160WithRSA, |
| 71 | RIPEMD160_DIGEST_LENGTH, | 80 | RIPEMD160_DIGEST_LENGTH, |
| 72 | RIPEMD160_Init, | 81 | 0, |
| 73 | RIPEMD160_Update, | 82 | init, |
| 74 | RIPEMD160_Final, | 83 | update, |
| 84 | final, | ||
| 85 | NULL, | ||
| 86 | NULL, | ||
| 75 | EVP_PKEY_RSA_method, | 87 | EVP_PKEY_RSA_method, |
| 76 | RIPEMD160_CBLOCK, | 88 | RIPEMD160_CBLOCK, |
| 77 | sizeof(EVP_MD *)+sizeof(RIPEMD160_CTX), | 89 | sizeof(EVP_MD *)+sizeof(RIPEMD160_CTX), |
| 78 | }; | 90 | }; |
| 79 | 91 | ||
| 80 | EVP_MD *EVP_ripemd160(void) | 92 | const EVP_MD *EVP_ripemd160(void) |
| 81 | { | 93 | { |
| 82 | return(&ripemd160_md); | 94 | return(&ripemd160_md); |
| 83 | } | 95 | } |
diff --git a/src/lib/libcrypto/evp/m_sha.c b/src/lib/libcrypto/evp/m_sha.c index 6d35b71b85..10697c7ed3 100644 --- a/src/lib/libcrypto/evp/m_sha.c +++ b/src/lib/libcrypto/evp/m_sha.c | |||
| @@ -56,27 +56,39 @@ | |||
| 56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
| 57 | */ | 57 | */ |
| 58 | 58 | ||
| 59 | #ifndef NO_SHA | 59 | #ifndef OPENSSL_NO_SHA |
| 60 | #include <stdio.h> | 60 | #include <stdio.h> |
| 61 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
| 62 | #include <openssl/evp.h> | 62 | #include <openssl/evp.h> |
| 63 | #include <openssl/objects.h> | 63 | #include <openssl/objects.h> |
| 64 | #include <openssl/x509.h> | 64 | #include <openssl/x509.h> |
| 65 | 65 | ||
| 66 | static EVP_MD sha_md= | 66 | static int init(EVP_MD_CTX *ctx) |
| 67 | { return SHA_Init(ctx->md_data); } | ||
| 68 | |||
| 69 | static int update(EVP_MD_CTX *ctx,const void *data,unsigned long count) | ||
| 70 | { return SHA_Update(ctx->md_data,data,count); } | ||
| 71 | |||
| 72 | static int final(EVP_MD_CTX *ctx,unsigned char *md) | ||
| 73 | { return SHA_Final(md,ctx->md_data); } | ||
| 74 | |||
| 75 | static const EVP_MD sha_md= | ||
| 67 | { | 76 | { |
| 68 | NID_sha, | 77 | NID_sha, |
| 69 | NID_shaWithRSAEncryption, | 78 | NID_shaWithRSAEncryption, |
| 70 | SHA_DIGEST_LENGTH, | 79 | SHA_DIGEST_LENGTH, |
| 71 | SHA_Init, | 80 | 0, |
| 72 | SHA_Update, | 81 | init, |
| 73 | SHA_Final, | 82 | update, |
| 83 | final, | ||
| 84 | NULL, | ||
| 85 | NULL, | ||
| 74 | EVP_PKEY_RSA_method, | 86 | EVP_PKEY_RSA_method, |
| 75 | SHA_CBLOCK, | 87 | SHA_CBLOCK, |
| 76 | sizeof(EVP_MD *)+sizeof(SHA_CTX), | 88 | sizeof(EVP_MD *)+sizeof(SHA_CTX), |
| 77 | }; | 89 | }; |
| 78 | 90 | ||
| 79 | EVP_MD *EVP_sha(void) | 91 | const EVP_MD *EVP_sha(void) |
| 80 | { | 92 | { |
| 81 | return(&sha_md); | 93 | return(&sha_md); |
| 82 | } | 94 | } |
diff --git a/src/lib/libcrypto/evp/m_sha1.c b/src/lib/libcrypto/evp/m_sha1.c index 57a1ab0cce..d6be3502f0 100644 --- a/src/lib/libcrypto/evp/m_sha1.c +++ b/src/lib/libcrypto/evp/m_sha1.c | |||
| @@ -56,27 +56,39 @@ | |||
| 56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
| 57 | */ | 57 | */ |
| 58 | 58 | ||
| 59 | #ifndef NO_SHA | 59 | #ifndef OPENSSL_NO_SHA |
| 60 | #include <stdio.h> | 60 | #include <stdio.h> |
| 61 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
| 62 | #include <openssl/evp.h> | 62 | #include <openssl/evp.h> |
| 63 | #include <openssl/objects.h> | 63 | #include <openssl/objects.h> |
| 64 | #include <openssl/x509.h> | 64 | #include <openssl/x509.h> |
| 65 | 65 | ||
| 66 | static EVP_MD sha1_md= | 66 | static int init(EVP_MD_CTX *ctx) |
| 67 | { return SHA1_Init(ctx->md_data); } | ||
| 68 | |||
| 69 | static int update(EVP_MD_CTX *ctx,const void *data,unsigned long count) | ||
| 70 | { return SHA1_Update(ctx->md_data,data,count); } | ||
| 71 | |||
| 72 | static int final(EVP_MD_CTX *ctx,unsigned char *md) | ||
| 73 | { return SHA1_Final(md,ctx->md_data); } | ||
| 74 | |||
| 75 | static const EVP_MD sha1_md= | ||
| 67 | { | 76 | { |
| 68 | NID_sha1, | 77 | NID_sha1, |
| 69 | NID_sha1WithRSAEncryption, | 78 | NID_sha1WithRSAEncryption, |
| 70 | SHA_DIGEST_LENGTH, | 79 | SHA_DIGEST_LENGTH, |
| 71 | SHA1_Init, | 80 | 0, |
| 72 | SHA1_Update, | 81 | init, |
| 73 | SHA1_Final, | 82 | update, |
| 83 | final, | ||
| 84 | NULL, | ||
| 85 | NULL, | ||
| 74 | EVP_PKEY_RSA_method, | 86 | EVP_PKEY_RSA_method, |
| 75 | SHA_CBLOCK, | 87 | SHA_CBLOCK, |
| 76 | sizeof(EVP_MD *)+sizeof(SHA_CTX), | 88 | sizeof(EVP_MD *)+sizeof(SHA_CTX), |
| 77 | }; | 89 | }; |
| 78 | 90 | ||
| 79 | EVP_MD *EVP_sha1(void) | 91 | const EVP_MD *EVP_sha1(void) |
| 80 | { | 92 | { |
| 81 | return(&sha1_md); | 93 | return(&sha1_md); |
| 82 | } | 94 | } |
diff --git a/src/lib/libcrypto/evp/names.c b/src/lib/libcrypto/evp/names.c index 620f43feaa..eb9f4329cd 100644 --- a/src/lib/libcrypto/evp/names.c +++ b/src/lib/libcrypto/evp/names.c | |||
| @@ -62,7 +62,7 @@ | |||
| 62 | #include <openssl/objects.h> | 62 | #include <openssl/objects.h> |
| 63 | #include <openssl/x509.h> | 63 | #include <openssl/x509.h> |
| 64 | 64 | ||
| 65 | int EVP_add_cipher(EVP_CIPHER *c) | 65 | int EVP_add_cipher(const EVP_CIPHER *c) |
| 66 | { | 66 | { |
| 67 | int r; | 67 | int r; |
| 68 | 68 | ||
| @@ -72,7 +72,7 @@ int EVP_add_cipher(EVP_CIPHER *c) | |||
| 72 | return(r); | 72 | return(r); |
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | int EVP_add_digest(EVP_MD *md) | 75 | int EVP_add_digest(const EVP_MD *md) |
| 76 | { | 76 | { |
| 77 | int r; | 77 | int r; |
| 78 | const char *name; | 78 | const char *name; |
diff --git a/src/lib/libcrypto/evp/openbsd_hw.c b/src/lib/libcrypto/evp/openbsd_hw.c new file mode 100644 index 0000000000..3831a5731e --- /dev/null +++ b/src/lib/libcrypto/evp/openbsd_hw.c | |||
| @@ -0,0 +1,446 @@ | |||
| 1 | /* Written by Ben Laurie, 2001 */ | ||
| 2 | /* | ||
| 3 | * Copyright (c) 2001 The OpenSSL Project. All rights reserved. | ||
| 4 | * | ||
| 5 | * Redistribution and use in source and binary forms, with or without | ||
| 6 | * modification, are permitted provided that the following conditions | ||
| 7 | * are met: | ||
| 8 | * | ||
| 9 | * 1. Redistributions of source code must retain the above copyright | ||
| 10 | * notice, this list of conditions and the following disclaimer. | ||
| 11 | * | ||
| 12 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 13 | * notice, this list of conditions and the following disclaimer in | ||
| 14 | * the documentation and/or other materials provided with the | ||
| 15 | * distribution. | ||
| 16 | * | ||
| 17 | * 3. All advertising materials mentioning features or use of this | ||
| 18 | * software must display the following acknowledgment: | ||
| 19 | * "This product includes software developed by the OpenSSL Project | ||
| 20 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
| 21 | * | ||
| 22 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
| 23 | * endorse or promote products derived from this software without | ||
| 24 | * prior written permission. For written permission, please contact | ||
| 25 | * openssl-core@openssl.org. | ||
| 26 | * | ||
| 27 | * 5. Products derived from this software may not be called "OpenSSL" | ||
| 28 | * nor may "OpenSSL" appear in their names without prior written | ||
| 29 | * permission of the OpenSSL Project. | ||
| 30 | * | ||
| 31 | * 6. Redistributions of any form whatsoever must retain the following | ||
| 32 | * acknowledgment: | ||
| 33 | * "This product includes software developed by the OpenSSL Project | ||
| 34 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
| 35 | * | ||
| 36 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
| 37 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 38 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
| 39 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
| 40 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| 41 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
| 42 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
| 43 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 44 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
| 45 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
| 46 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
| 47 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 48 | */ | ||
| 49 | |||
| 50 | #include <openssl/evp.h> | ||
| 51 | #include <openssl/objects.h> | ||
| 52 | #include <openssl/rsa.h> | ||
| 53 | #include "evp_locl.h" | ||
| 54 | |||
| 55 | /* This stuff should now all be supported through | ||
| 56 | * crypto/engine/hw_openbsd_dev_crypto.c unless I botched it up */ | ||
| 57 | static void *dummy=&dummy; | ||
| 58 | |||
| 59 | #if 0 | ||
| 60 | |||
| 61 | /* check flag after OpenSSL headers to ensure make depend works */ | ||
| 62 | #ifdef OPENSSL_OPENBSD_DEV_CRYPTO | ||
| 63 | |||
| 64 | #include <fcntl.h> | ||
| 65 | #include <stdio.h> | ||
| 66 | #include <errno.h> | ||
| 67 | #include <sys/ioctl.h> | ||
| 68 | #include <crypto/cryptodev.h> | ||
| 69 | #include <unistd.h> | ||
| 70 | #include <assert.h> | ||
| 71 | |||
| 72 | /* longest key supported in hardware */ | ||
| 73 | #define MAX_HW_KEY 24 | ||
| 74 | #define MAX_HW_IV 8 | ||
| 75 | |||
| 76 | #define MD5_DIGEST_LENGTH 16 | ||
| 77 | #define MD5_CBLOCK 64 | ||
| 78 | |||
| 79 | static int fd; | ||
| 80 | static int dev_failed; | ||
| 81 | |||
| 82 | typedef struct session_op session_op; | ||
| 83 | |||
| 84 | #define CDATA(ctx) EVP_C_DATA(session_op,ctx) | ||
| 85 | |||
| 86 | static void err(const char *str) | ||
| 87 | { | ||
| 88 | fprintf(stderr,"%s: errno %d\n",str,errno); | ||
| 89 | } | ||
| 90 | |||
| 91 | static int dev_crypto_init(session_op *ses) | ||
| 92 | { | ||
| 93 | if(dev_failed) | ||
| 94 | return 0; | ||
| 95 | if(!fd) | ||
| 96 | { | ||
| 97 | int cryptodev_fd; | ||
| 98 | |||
| 99 | if ((cryptodev_fd=open("/dev/crypto",O_RDWR,0)) < 0) | ||
| 100 | { | ||
| 101 | err("/dev/crypto"); | ||
| 102 | dev_failed=1; | ||
| 103 | return 0; | ||
| 104 | } | ||
| 105 | if (ioctl(cryptodev_fd,CRIOGET,&fd) == -1) | ||
| 106 | { | ||
| 107 | err("CRIOGET failed"); | ||
| 108 | close(cryptodev_fd); | ||
| 109 | dev_failed=1; | ||
| 110 | return 0; | ||
| 111 | } | ||
| 112 | close(cryptodev_fd); | ||
| 113 | } | ||
| 114 | assert(ses); | ||
| 115 | memset(ses,'\0',sizeof *ses); | ||
| 116 | |||
| 117 | return 1; | ||
| 118 | } | ||
| 119 | |||
| 120 | static int dev_crypto_cleanup(EVP_CIPHER_CTX *ctx) | ||
| 121 | { | ||
| 122 | if(ioctl(fd,CIOCFSESSION,&CDATA(ctx)->ses) == -1) | ||
| 123 | err("CIOCFSESSION failed"); | ||
| 124 | |||
| 125 | OPENSSL_free(CDATA(ctx)->key); | ||
| 126 | |||
| 127 | return 1; | ||
| 128 | } | ||
| 129 | |||
| 130 | static int dev_crypto_init_key(EVP_CIPHER_CTX *ctx,int cipher, | ||
| 131 | const unsigned char *key,int klen) | ||
| 132 | { | ||
| 133 | if(!dev_crypto_init(CDATA(ctx))) | ||
| 134 | return 0; | ||
| 135 | |||
| 136 | CDATA(ctx)->key=OPENSSL_malloc(MAX_HW_KEY); | ||
| 137 | |||
| 138 | assert(ctx->cipher->iv_len <= MAX_HW_IV); | ||
| 139 | |||
| 140 | memcpy(CDATA(ctx)->key,key,klen); | ||
| 141 | |||
| 142 | CDATA(ctx)->cipher=cipher; | ||
| 143 | CDATA(ctx)->keylen=klen; | ||
| 144 | |||
| 145 | if (ioctl(fd,CIOCGSESSION,CDATA(ctx)) == -1) | ||
| 146 | { | ||
| 147 | err("CIOCGSESSION failed"); | ||
| 148 | return 0; | ||
| 149 | } | ||
| 150 | return 1; | ||
| 151 | } | ||
| 152 | |||
| 153 | static int dev_crypto_cipher(EVP_CIPHER_CTX *ctx,unsigned char *out, | ||
| 154 | const unsigned char *in,unsigned int inl) | ||
| 155 | { | ||
| 156 | struct crypt_op cryp; | ||
| 157 | unsigned char lb[MAX_HW_IV]; | ||
| 158 | |||
| 159 | if(!inl) | ||
| 160 | return 1; | ||
| 161 | |||
| 162 | assert(CDATA(ctx)); | ||
| 163 | assert(!dev_failed); | ||
| 164 | |||
| 165 | memset(&cryp,'\0',sizeof cryp); | ||
| 166 | cryp.ses=CDATA(ctx)->ses; | ||
| 167 | cryp.op=ctx->encrypt ? COP_ENCRYPT : COP_DECRYPT; | ||
| 168 | cryp.flags=0; | ||
| 169 | cryp.len=inl; | ||
| 170 | assert((inl&(ctx->cipher->block_size-1)) == 0); | ||
| 171 | cryp.src=(caddr_t)in; | ||
| 172 | cryp.dst=(caddr_t)out; | ||
| 173 | cryp.mac=0; | ||
| 174 | if(ctx->cipher->iv_len) | ||
| 175 | cryp.iv=(caddr_t)ctx->iv; | ||
| 176 | |||
| 177 | if(!ctx->encrypt) | ||
| 178 | memcpy(lb,&in[cryp.len-ctx->cipher->iv_len],ctx->cipher->iv_len); | ||
| 179 | |||
| 180 | if(ioctl(fd, CIOCCRYPT, &cryp) == -1) | ||
| 181 | { | ||
| 182 | if(errno == EINVAL) /* buffers are misaligned */ | ||
| 183 | { | ||
| 184 | unsigned int cinl=0; | ||
| 185 | char *cin=NULL; | ||
| 186 | char *cout=NULL; | ||
| 187 | |||
| 188 | /* NB: this can only make cinl != inl with stream ciphers */ | ||
| 189 | cinl=(inl+3)/4*4; | ||
| 190 | |||
| 191 | if(((unsigned long)in&3) || cinl != inl) | ||
| 192 | { | ||
| 193 | cin=OPENSSL_malloc(cinl); | ||
| 194 | memcpy(cin,in,inl); | ||
| 195 | cryp.src=cin; | ||
| 196 | } | ||
| 197 | |||
| 198 | if(((unsigned long)out&3) || cinl != inl) | ||
| 199 | { | ||
| 200 | cout=OPENSSL_malloc(cinl); | ||
| 201 | cryp.dst=cout; | ||
| 202 | } | ||
| 203 | |||
| 204 | cryp.len=cinl; | ||
| 205 | |||
| 206 | if(ioctl(fd, CIOCCRYPT, &cryp) == -1) | ||
| 207 | { | ||
| 208 | err("CIOCCRYPT(2) failed"); | ||
| 209 | printf("src=%p dst=%p\n",cryp.src,cryp.dst); | ||
| 210 | abort(); | ||
| 211 | return 0; | ||
| 212 | } | ||
| 213 | |||
| 214 | if(cout) | ||
| 215 | { | ||
| 216 | memcpy(out,cout,inl); | ||
| 217 | OPENSSL_free(cout); | ||
| 218 | } | ||
| 219 | if(cin) | ||
| 220 | OPENSSL_free(cin); | ||
| 221 | } | ||
| 222 | else | ||
| 223 | { | ||
| 224 | err("CIOCCRYPT failed"); | ||
| 225 | abort(); | ||
| 226 | return 0; | ||
| 227 | } | ||
| 228 | } | ||
| 229 | |||
| 230 | if(ctx->encrypt) | ||
| 231 | memcpy(ctx->iv,&out[cryp.len-ctx->cipher->iv_len],ctx->cipher->iv_len); | ||
| 232 | else | ||
| 233 | memcpy(ctx->iv,lb,ctx->cipher->iv_len); | ||
| 234 | |||
| 235 | return 1; | ||
| 236 | } | ||
| 237 | |||
| 238 | static int dev_crypto_des_ede3_init_key(EVP_CIPHER_CTX *ctx, | ||
| 239 | const unsigned char *key, | ||
| 240 | const unsigned char *iv, int enc) | ||
| 241 | { return dev_crypto_init_key(ctx,CRYPTO_3DES_CBC,key,24); } | ||
| 242 | |||
| 243 | #define dev_crypto_des_ede3_cbc_cipher dev_crypto_cipher | ||
| 244 | |||
| 245 | BLOCK_CIPHER_def_cbc(dev_crypto_des_ede3, session_op, NID_des_ede3, 8, 24, 8, | ||
| 246 | 0, dev_crypto_des_ede3_init_key, | ||
| 247 | dev_crypto_cleanup, | ||
| 248 | EVP_CIPHER_set_asn1_iv, | ||
| 249 | EVP_CIPHER_get_asn1_iv, | ||
| 250 | NULL) | ||
| 251 | |||
| 252 | static int dev_crypto_rc4_init_key(EVP_CIPHER_CTX *ctx, | ||
| 253 | const unsigned char *key, | ||
| 254 | const unsigned char *iv, int enc) | ||
| 255 | { return dev_crypto_init_key(ctx,CRYPTO_ARC4,key,16); } | ||
| 256 | |||
| 257 | static const EVP_CIPHER r4_cipher= | ||
| 258 | { | ||
| 259 | NID_rc4, | ||
| 260 | 1,16,0, /* FIXME: key should be up to 256 bytes */ | ||
| 261 | EVP_CIPH_VARIABLE_LENGTH, | ||
| 262 | dev_crypto_rc4_init_key, | ||
| 263 | dev_crypto_cipher, | ||
| 264 | dev_crypto_cleanup, | ||
| 265 | sizeof(session_op), | ||
| 266 | NULL, | ||
| 267 | NULL, | ||
| 268 | NULL | ||
| 269 | }; | ||
| 270 | |||
| 271 | const EVP_CIPHER *EVP_dev_crypto_rc4(void) | ||
| 272 | { return &r4_cipher; } | ||
| 273 | |||
| 274 | typedef struct | ||
| 275 | { | ||
| 276 | session_op sess; | ||
| 277 | char *data; | ||
| 278 | int len; | ||
| 279 | unsigned char md[EVP_MAX_MD_SIZE]; | ||
| 280 | } MD_DATA; | ||
| 281 | |||
| 282 | static int dev_crypto_init_digest(MD_DATA *md_data,int mac) | ||
| 283 | { | ||
| 284 | if(!dev_crypto_init(&md_data->sess)) | ||
| 285 | return 0; | ||
| 286 | |||
| 287 | md_data->len=0; | ||
| 288 | md_data->data=NULL; | ||
| 289 | |||
| 290 | md_data->sess.mac=mac; | ||
| 291 | |||
| 292 | if (ioctl(fd,CIOCGSESSION,&md_data->sess) == -1) | ||
| 293 | { | ||
| 294 | err("CIOCGSESSION failed"); | ||
| 295 | return 0; | ||
| 296 | } | ||
| 297 | return 1; | ||
| 298 | } | ||
| 299 | |||
| 300 | static int dev_crypto_cleanup_digest(MD_DATA *md_data) | ||
| 301 | { | ||
| 302 | if (ioctl(fd,CIOCFSESSION,&md_data->sess.ses) == -1) | ||
| 303 | { | ||
| 304 | err("CIOCFSESSION failed"); | ||
| 305 | return 0; | ||
| 306 | } | ||
| 307 | |||
| 308 | return 1; | ||
| 309 | } | ||
| 310 | |||
| 311 | /* FIXME: if device can do chained MACs, then don't accumulate */ | ||
| 312 | /* FIXME: move accumulation to the framework */ | ||
| 313 | static int dev_crypto_md5_init(EVP_MD_CTX *ctx) | ||
| 314 | { return dev_crypto_init_digest(ctx->md_data,CRYPTO_MD5); } | ||
| 315 | |||
| 316 | static int do_digest(int ses,unsigned char *md,const void *data,int len) | ||
| 317 | { | ||
| 318 | struct crypt_op cryp; | ||
| 319 | static unsigned char md5zero[16]= | ||
| 320 | { | ||
| 321 | 0xd4,0x1d,0x8c,0xd9,0x8f,0x00,0xb2,0x04, | ||
| 322 | 0xe9,0x80,0x09,0x98,0xec,0xf8,0x42,0x7e | ||
| 323 | }; | ||
| 324 | |||
| 325 | /* some cards can't do zero length */ | ||
| 326 | if(!len) | ||
| 327 | { | ||
| 328 | memcpy(md,md5zero,16); | ||
| 329 | return 1; | ||
| 330 | } | ||
| 331 | |||
| 332 | memset(&cryp,'\0',sizeof cryp); | ||
| 333 | cryp.ses=ses; | ||
| 334 | cryp.op=COP_ENCRYPT;/* required to do the MAC rather than check it */ | ||
| 335 | cryp.len=len; | ||
| 336 | cryp.src=(caddr_t)data; | ||
| 337 | cryp.dst=(caddr_t)data; // FIXME!!! | ||
| 338 | cryp.mac=(caddr_t)md; | ||
| 339 | |||
| 340 | if(ioctl(fd, CIOCCRYPT, &cryp) == -1) | ||
| 341 | { | ||
| 342 | if(errno == EINVAL) /* buffer is misaligned */ | ||
| 343 | { | ||
| 344 | char *dcopy; | ||
| 345 | |||
| 346 | dcopy=OPENSSL_malloc(len); | ||
| 347 | memcpy(dcopy,data,len); | ||
| 348 | cryp.src=dcopy; | ||
| 349 | cryp.dst=cryp.src; // FIXME!!! | ||
| 350 | |||
| 351 | if(ioctl(fd, CIOCCRYPT, &cryp) == -1) | ||
| 352 | { | ||
| 353 | err("CIOCCRYPT(MAC2) failed"); | ||
| 354 | abort(); | ||
| 355 | return 0; | ||
| 356 | } | ||
| 357 | OPENSSL_free(dcopy); | ||
| 358 | } | ||
| 359 | else | ||
| 360 | { | ||
| 361 | err("CIOCCRYPT(MAC) failed"); | ||
| 362 | abort(); | ||
| 363 | return 0; | ||
| 364 | } | ||
| 365 | } | ||
| 366 | // printf("done\n"); | ||
| 367 | |||
| 368 | return 1; | ||
| 369 | } | ||
| 370 | |||
| 371 | static int dev_crypto_md5_update(EVP_MD_CTX *ctx,const void *data, | ||
| 372 | unsigned long len) | ||
| 373 | { | ||
| 374 | MD_DATA *md_data=ctx->md_data; | ||
| 375 | |||
| 376 | if(ctx->flags&EVP_MD_CTX_FLAG_ONESHOT) | ||
| 377 | return do_digest(md_data->sess.ses,md_data->md,data,len); | ||
| 378 | |||
| 379 | md_data->data=OPENSSL_realloc(md_data->data,md_data->len+len); | ||
| 380 | memcpy(md_data->data+md_data->len,data,len); | ||
| 381 | md_data->len+=len; | ||
| 382 | |||
| 383 | return 1; | ||
| 384 | } | ||
| 385 | |||
| 386 | static int dev_crypto_md5_final(EVP_MD_CTX *ctx,unsigned char *md) | ||
| 387 | { | ||
| 388 | int ret; | ||
| 389 | MD_DATA *md_data=ctx->md_data; | ||
| 390 | |||
| 391 | if(ctx->flags&EVP_MD_CTX_FLAG_ONESHOT) | ||
| 392 | { | ||
| 393 | memcpy(md,md_data->md,MD5_DIGEST_LENGTH); | ||
| 394 | ret=1; | ||
| 395 | } | ||
| 396 | else | ||
| 397 | { | ||
| 398 | ret=do_digest(md_data->sess.ses,md,md_data->data,md_data->len); | ||
| 399 | OPENSSL_free(md_data->data); | ||
| 400 | md_data->data=NULL; | ||
| 401 | md_data->len=0; | ||
| 402 | } | ||
| 403 | |||
| 404 | return ret; | ||
| 405 | } | ||
| 406 | |||
| 407 | static int dev_crypto_md5_copy(EVP_MD_CTX *to,const EVP_MD_CTX *from) | ||
| 408 | { | ||
| 409 | const MD_DATA *from_md=from->md_data; | ||
| 410 | MD_DATA *to_md=to->md_data; | ||
| 411 | |||
| 412 | // How do we copy sessions? | ||
| 413 | assert(from->digest->flags&EVP_MD_FLAG_ONESHOT); | ||
| 414 | |||
| 415 | to_md->data=OPENSSL_malloc(from_md->len); | ||
| 416 | memcpy(to_md->data,from_md->data,from_md->len); | ||
| 417 | |||
| 418 | return 1; | ||
| 419 | } | ||
| 420 | |||
| 421 | static int dev_crypto_md5_cleanup(EVP_MD_CTX *ctx) | ||
| 422 | { | ||
| 423 | return dev_crypto_cleanup_digest(ctx->md_data); | ||
| 424 | } | ||
| 425 | |||
| 426 | static const EVP_MD md5_md= | ||
| 427 | { | ||
| 428 | NID_md5, | ||
| 429 | NID_md5WithRSAEncryption, | ||
| 430 | MD5_DIGEST_LENGTH, | ||
| 431 | EVP_MD_FLAG_ONESHOT, // XXX: set according to device info... | ||
| 432 | dev_crypto_md5_init, | ||
| 433 | dev_crypto_md5_update, | ||
| 434 | dev_crypto_md5_final, | ||
| 435 | dev_crypto_md5_copy, | ||
| 436 | dev_crypto_md5_cleanup, | ||
| 437 | EVP_PKEY_RSA_method, | ||
| 438 | MD5_CBLOCK, | ||
| 439 | sizeof(MD_DATA), | ||
| 440 | }; | ||
| 441 | |||
| 442 | const EVP_MD *EVP_dev_crypto_md5(void) | ||
| 443 | { return &md5_md; } | ||
| 444 | |||
| 445 | #endif | ||
| 446 | #endif | ||
diff --git a/src/lib/libcrypto/evp/p5_crpt.c b/src/lib/libcrypto/evp/p5_crpt.c index 6bfa2c5acb..113c60fedb 100644 --- a/src/lib/libcrypto/evp/p5_crpt.c +++ b/src/lib/libcrypto/evp/p5_crpt.c | |||
| @@ -67,41 +67,41 @@ | |||
| 67 | 67 | ||
| 68 | void PKCS5_PBE_add(void) | 68 | void PKCS5_PBE_add(void) |
| 69 | { | 69 | { |
| 70 | #ifndef NO_DES | 70 | #ifndef OPENSSL_NO_DES |
| 71 | # ifndef NO_MD5 | 71 | # ifndef OPENSSL_NO_MD5 |
| 72 | EVP_PBE_alg_add(NID_pbeWithMD5AndDES_CBC, EVP_des_cbc(), EVP_md5(), | 72 | EVP_PBE_alg_add(NID_pbeWithMD5AndDES_CBC, EVP_des_cbc(), EVP_md5(), |
| 73 | PKCS5_PBE_keyivgen); | 73 | PKCS5_PBE_keyivgen); |
| 74 | # endif | 74 | # endif |
| 75 | # ifndef NO_MD2 | 75 | # ifndef OPENSSL_NO_MD2 |
| 76 | EVP_PBE_alg_add(NID_pbeWithMD2AndDES_CBC, EVP_des_cbc(), EVP_md2(), | 76 | EVP_PBE_alg_add(NID_pbeWithMD2AndDES_CBC, EVP_des_cbc(), EVP_md2(), |
| 77 | PKCS5_PBE_keyivgen); | 77 | PKCS5_PBE_keyivgen); |
| 78 | # endif | 78 | # endif |
| 79 | # ifndef NO_SHA | 79 | # ifndef OPENSSL_NO_SHA |
| 80 | EVP_PBE_alg_add(NID_pbeWithSHA1AndDES_CBC, EVP_des_cbc(), EVP_sha1(), | 80 | EVP_PBE_alg_add(NID_pbeWithSHA1AndDES_CBC, EVP_des_cbc(), EVP_sha1(), |
| 81 | PKCS5_PBE_keyivgen); | 81 | PKCS5_PBE_keyivgen); |
| 82 | # endif | 82 | # endif |
| 83 | #endif | 83 | #endif |
| 84 | #ifndef NO_RC2 | 84 | #ifndef OPENSSL_NO_RC2 |
| 85 | # ifndef NO_MD5 | 85 | # ifndef OPENSSL_NO_MD5 |
| 86 | EVP_PBE_alg_add(NID_pbeWithMD5AndRC2_CBC, EVP_rc2_64_cbc(), EVP_md5(), | 86 | EVP_PBE_alg_add(NID_pbeWithMD5AndRC2_CBC, EVP_rc2_64_cbc(), EVP_md5(), |
| 87 | PKCS5_PBE_keyivgen); | 87 | PKCS5_PBE_keyivgen); |
| 88 | # endif | 88 | # endif |
| 89 | # ifndef NO_MD2 | 89 | # ifndef OPENSSL_NO_MD2 |
| 90 | EVP_PBE_alg_add(NID_pbeWithMD2AndRC2_CBC, EVP_rc2_64_cbc(), EVP_md2(), | 90 | EVP_PBE_alg_add(NID_pbeWithMD2AndRC2_CBC, EVP_rc2_64_cbc(), EVP_md2(), |
| 91 | PKCS5_PBE_keyivgen); | 91 | PKCS5_PBE_keyivgen); |
| 92 | # endif | 92 | # endif |
| 93 | # ifndef NO_SHA | 93 | # ifndef OPENSSL_NO_SHA |
| 94 | EVP_PBE_alg_add(NID_pbeWithSHA1AndRC2_CBC, EVP_rc2_64_cbc(), EVP_sha1(), | 94 | EVP_PBE_alg_add(NID_pbeWithSHA1AndRC2_CBC, EVP_rc2_64_cbc(), EVP_sha1(), |
| 95 | PKCS5_PBE_keyivgen); | 95 | PKCS5_PBE_keyivgen); |
| 96 | # endif | 96 | # endif |
| 97 | #endif | 97 | #endif |
| 98 | #ifndef NO_HMAC | 98 | #ifndef OPENSSL_NO_HMAC |
| 99 | EVP_PBE_alg_add(NID_pbes2, NULL, NULL, PKCS5_v2_PBE_keyivgen); | 99 | EVP_PBE_alg_add(NID_pbes2, NULL, NULL, PKCS5_v2_PBE_keyivgen); |
| 100 | #endif | 100 | #endif |
| 101 | } | 101 | } |
| 102 | 102 | ||
| 103 | int PKCS5_PBE_keyivgen(EVP_CIPHER_CTX *cctx, const char *pass, int passlen, | 103 | int PKCS5_PBE_keyivgen(EVP_CIPHER_CTX *cctx, const char *pass, int passlen, |
| 104 | ASN1_TYPE *param, EVP_CIPHER *cipher, EVP_MD *md, | 104 | ASN1_TYPE *param, const EVP_CIPHER *cipher, const EVP_MD *md, |
| 105 | int en_de) | 105 | int en_de) |
| 106 | { | 106 | { |
| 107 | EVP_MD_CTX ctx; | 107 | EVP_MD_CTX ctx; |
| @@ -128,20 +128,22 @@ int PKCS5_PBE_keyivgen(EVP_CIPHER_CTX *cctx, const char *pass, int passlen, | |||
| 128 | if(!pass) passlen = 0; | 128 | if(!pass) passlen = 0; |
| 129 | else if(passlen == -1) passlen = strlen(pass); | 129 | else if(passlen == -1) passlen = strlen(pass); |
| 130 | 130 | ||
| 131 | EVP_DigestInit (&ctx, md); | 131 | EVP_MD_CTX_init(&ctx); |
| 132 | EVP_DigestUpdate (&ctx, pass, passlen); | 132 | EVP_DigestInit_ex(&ctx, md, NULL); |
| 133 | EVP_DigestUpdate (&ctx, salt, saltlen); | 133 | EVP_DigestUpdate(&ctx, pass, passlen); |
| 134 | EVP_DigestUpdate(&ctx, salt, saltlen); | ||
| 134 | PBEPARAM_free(pbe); | 135 | PBEPARAM_free(pbe); |
| 135 | EVP_DigestFinal (&ctx, md_tmp, NULL); | 136 | EVP_DigestFinal_ex(&ctx, md_tmp, NULL); |
| 136 | for (i = 1; i < iter; i++) { | 137 | for (i = 1; i < iter; i++) { |
| 137 | EVP_DigestInit(&ctx, md); | 138 | EVP_DigestInit_ex(&ctx, md, NULL); |
| 138 | EVP_DigestUpdate(&ctx, md_tmp, EVP_MD_size(md)); | 139 | EVP_DigestUpdate(&ctx, md_tmp, EVP_MD_size(md)); |
| 139 | EVP_DigestFinal (&ctx, md_tmp, NULL); | 140 | EVP_DigestFinal_ex (&ctx, md_tmp, NULL); |
| 140 | } | 141 | } |
| 141 | memcpy (key, md_tmp, EVP_CIPHER_key_length(cipher)); | 142 | EVP_MD_CTX_cleanup(&ctx); |
| 142 | memcpy (iv, md_tmp + (16 - EVP_CIPHER_iv_length(cipher)), | 143 | memcpy(key, md_tmp, EVP_CIPHER_key_length(cipher)); |
| 144 | memcpy(iv, md_tmp + (16 - EVP_CIPHER_iv_length(cipher)), | ||
| 143 | EVP_CIPHER_iv_length(cipher)); | 145 | EVP_CIPHER_iv_length(cipher)); |
| 144 | EVP_CipherInit(cctx, cipher, key, iv, en_de); | 146 | EVP_CipherInit_ex(cctx, cipher, NULL, key, iv, en_de); |
| 145 | memset(md_tmp, 0, EVP_MAX_MD_SIZE); | 147 | memset(md_tmp, 0, EVP_MAX_MD_SIZE); |
| 146 | memset(key, 0, EVP_MAX_KEY_LENGTH); | 148 | memset(key, 0, EVP_MAX_KEY_LENGTH); |
| 147 | memset(iv, 0, EVP_MAX_IV_LENGTH); | 149 | memset(iv, 0, EVP_MAX_IV_LENGTH); |
diff --git a/src/lib/libcrypto/evp/p5_crpt2.c b/src/lib/libcrypto/evp/p5_crpt2.c index 717fad68ca..7881860b53 100644 --- a/src/lib/libcrypto/evp/p5_crpt2.c +++ b/src/lib/libcrypto/evp/p5_crpt2.c | |||
| @@ -55,7 +55,7 @@ | |||
| 55 | * Hudson (tjh@cryptsoft.com). | 55 | * Hudson (tjh@cryptsoft.com). |
| 56 | * | 56 | * |
| 57 | */ | 57 | */ |
| 58 | #if !defined(NO_HMAC) && !defined(NO_SHA) | 58 | #if !defined(OPENSSL_NO_HMAC) && !defined(OPENSSL_NO_SHA) |
| 59 | #include <stdio.h> | 59 | #include <stdio.h> |
| 60 | #include <stdlib.h> | 60 | #include <stdlib.h> |
| 61 | #include <openssl/x509.h> | 61 | #include <openssl/x509.h> |
| @@ -84,6 +84,8 @@ int PKCS5_PBKDF2_HMAC_SHA1(const char *pass, int passlen, | |||
| 84 | int cplen, j, k, tkeylen; | 84 | int cplen, j, k, tkeylen; |
| 85 | unsigned long i = 1; | 85 | unsigned long i = 1; |
| 86 | HMAC_CTX hctx; | 86 | HMAC_CTX hctx; |
| 87 | |||
| 88 | HMAC_CTX_init(&hctx); | ||
| 87 | p = out; | 89 | p = out; |
| 88 | tkeylen = keylen; | 90 | tkeylen = keylen; |
| 89 | if(!pass) passlen = 0; | 91 | if(!pass) passlen = 0; |
| @@ -98,7 +100,7 @@ int PKCS5_PBKDF2_HMAC_SHA1(const char *pass, int passlen, | |||
| 98 | itmp[1] = (unsigned char)((i >> 16) & 0xff); | 100 | itmp[1] = (unsigned char)((i >> 16) & 0xff); |
| 99 | itmp[2] = (unsigned char)((i >> 8) & 0xff); | 101 | itmp[2] = (unsigned char)((i >> 8) & 0xff); |
| 100 | itmp[3] = (unsigned char)(i & 0xff); | 102 | itmp[3] = (unsigned char)(i & 0xff); |
| 101 | HMAC_Init(&hctx, pass, passlen, EVP_sha1()); | 103 | HMAC_Init_ex(&hctx, pass, passlen, EVP_sha1(), NULL); |
| 102 | HMAC_Update(&hctx, salt, saltlen); | 104 | HMAC_Update(&hctx, salt, saltlen); |
| 103 | HMAC_Update(&hctx, itmp, 4); | 105 | HMAC_Update(&hctx, itmp, 4); |
| 104 | HMAC_Final(&hctx, digtmp, NULL); | 106 | HMAC_Final(&hctx, digtmp, NULL); |
| @@ -112,7 +114,7 @@ int PKCS5_PBKDF2_HMAC_SHA1(const char *pass, int passlen, | |||
| 112 | i++; | 114 | i++; |
| 113 | p+= cplen; | 115 | p+= cplen; |
| 114 | } | 116 | } |
| 115 | HMAC_cleanup(&hctx); | 117 | HMAC_CTX_cleanup(&hctx); |
| 116 | #ifdef DEBUG_PKCS5V2 | 118 | #ifdef DEBUG_PKCS5V2 |
| 117 | fprintf(stderr, "Password:\n"); | 119 | fprintf(stderr, "Password:\n"); |
| 118 | h__dump (pass, passlen); | 120 | h__dump (pass, passlen); |
| @@ -143,7 +145,7 @@ main() | |||
| 143 | */ | 145 | */ |
| 144 | 146 | ||
| 145 | int PKCS5_v2_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, | 147 | int PKCS5_v2_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, |
| 146 | ASN1_TYPE *param, EVP_CIPHER *c, EVP_MD *md, | 148 | ASN1_TYPE *param, const EVP_CIPHER *c, const EVP_MD *md, |
| 147 | int en_de) | 149 | int en_de) |
| 148 | { | 150 | { |
| 149 | unsigned char *pbuf, *salt, key[EVP_MAX_KEY_LENGTH]; | 151 | unsigned char *pbuf, *salt, key[EVP_MAX_KEY_LENGTH]; |
| @@ -181,7 +183,7 @@ int PKCS5_v2_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, | |||
| 181 | } | 183 | } |
| 182 | 184 | ||
| 183 | /* Fixup cipher based on AlgorithmIdentifier */ | 185 | /* Fixup cipher based on AlgorithmIdentifier */ |
| 184 | EVP_CipherInit(ctx, cipher, NULL, NULL, en_de); | 186 | EVP_CipherInit_ex(ctx, cipher, NULL, NULL, NULL, en_de); |
| 185 | if(EVP_CIPHER_asn1_to_param(ctx, pbe2->encryption->parameter) < 0) { | 187 | if(EVP_CIPHER_asn1_to_param(ctx, pbe2->encryption->parameter) < 0) { |
| 186 | EVPerr(EVP_F_PKCS5_V2_PBE_KEYIVGEN, | 188 | EVPerr(EVP_F_PKCS5_V2_PBE_KEYIVGEN, |
| 187 | EVP_R_CIPHER_PARAMETER_ERROR); | 189 | EVP_R_CIPHER_PARAMETER_ERROR); |
| @@ -227,7 +229,7 @@ int PKCS5_v2_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, | |||
| 227 | saltlen = kdf->salt->value.octet_string->length; | 229 | saltlen = kdf->salt->value.octet_string->length; |
| 228 | iter = ASN1_INTEGER_get(kdf->iter); | 230 | iter = ASN1_INTEGER_get(kdf->iter); |
| 229 | PKCS5_PBKDF2_HMAC_SHA1(pass, passlen, salt, saltlen, iter, keylen, key); | 231 | PKCS5_PBKDF2_HMAC_SHA1(pass, passlen, salt, saltlen, iter, keylen, key); |
| 230 | EVP_CipherInit(ctx, NULL, key, NULL, en_de); | 232 | EVP_CipherInit_ex(ctx, NULL, NULL, key, NULL, en_de); |
| 231 | memset(key, 0, keylen); | 233 | memset(key, 0, keylen); |
| 232 | PBKDF2PARAM_free(kdf); | 234 | PBKDF2PARAM_free(kdf); |
| 233 | return 1; | 235 | return 1; |
diff --git a/src/lib/libcrypto/evp/p_dec.c b/src/lib/libcrypto/evp/p_dec.c index 57b5daa453..8af620400e 100644 --- a/src/lib/libcrypto/evp/p_dec.c +++ b/src/lib/libcrypto/evp/p_dec.c | |||
| @@ -59,7 +59,7 @@ | |||
| 59 | #include <stdio.h> | 59 | #include <stdio.h> |
| 60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
| 61 | #include <openssl/rand.h> | 61 | #include <openssl/rand.h> |
| 62 | #ifndef NO_RSA | 62 | #ifndef OPENSSL_NO_RSA |
| 63 | #include <openssl/rsa.h> | 63 | #include <openssl/rsa.h> |
| 64 | #endif | 64 | #endif |
| 65 | #include <openssl/evp.h> | 65 | #include <openssl/evp.h> |
| @@ -71,12 +71,12 @@ int EVP_PKEY_decrypt(unsigned char *key, unsigned char *ek, int ekl, | |||
| 71 | { | 71 | { |
| 72 | int ret= -1; | 72 | int ret= -1; |
| 73 | 73 | ||
| 74 | #ifndef NO_RSA | 74 | #ifndef OPENSSL_NO_RSA |
| 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,EVP_R_PUBLIC_KEY_NOT_RSA); |
| 79 | #ifndef NO_RSA | 79 | #ifndef OPENSSL_NO_RSA |
| 80 | goto err; | 80 | goto err; |
| 81 | } | 81 | } |
| 82 | 82 | ||
diff --git a/src/lib/libcrypto/evp/p_enc.c b/src/lib/libcrypto/evp/p_enc.c index 4cf6acaf5d..656883b996 100644 --- a/src/lib/libcrypto/evp/p_enc.c +++ b/src/lib/libcrypto/evp/p_enc.c | |||
| @@ -59,7 +59,7 @@ | |||
| 59 | #include <stdio.h> | 59 | #include <stdio.h> |
| 60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
| 61 | #include <openssl/rand.h> | 61 | #include <openssl/rand.h> |
| 62 | #ifndef NO_RSA | 62 | #ifndef OPENSSL_NO_RSA |
| 63 | #include <openssl/rsa.h> | 63 | #include <openssl/rsa.h> |
| 64 | #endif | 64 | #endif |
| 65 | #include <openssl/evp.h> | 65 | #include <openssl/evp.h> |
| @@ -71,12 +71,12 @@ int EVP_PKEY_encrypt(unsigned char *ek, unsigned char *key, int key_len, | |||
| 71 | { | 71 | { |
| 72 | int ret=0; | 72 | int ret=0; |
| 73 | 73 | ||
| 74 | #ifndef NO_RSA | 74 | #ifndef OPENSSL_NO_RSA |
| 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,EVP_R_PUBLIC_KEY_NOT_RSA); |
| 79 | #ifndef NO_RSA | 79 | #ifndef OPENSSL_NO_RSA |
| 80 | goto err; | 80 | goto err; |
| 81 | } | 81 | } |
| 82 | ret=RSA_public_encrypt(key_len,key,ek,pubk->pkey.rsa,RSA_PKCS1_PADDING); | 82 | ret=RSA_public_encrypt(key_len,key,ek,pubk->pkey.rsa,RSA_PKCS1_PADDING); |
diff --git a/src/lib/libcrypto/evp/p_lib.c b/src/lib/libcrypto/evp/p_lib.c index 62398ed74d..215b94292a 100644 --- a/src/lib/libcrypto/evp/p_lib.c +++ b/src/lib/libcrypto/evp/p_lib.c | |||
| @@ -64,14 +64,15 @@ | |||
| 64 | #include <openssl/x509.h> | 64 | #include <openssl/x509.h> |
| 65 | 65 | ||
| 66 | static void EVP_PKEY_free_it(EVP_PKEY *x); | 66 | static void EVP_PKEY_free_it(EVP_PKEY *x); |
| 67 | |||
| 67 | int EVP_PKEY_bits(EVP_PKEY *pkey) | 68 | int EVP_PKEY_bits(EVP_PKEY *pkey) |
| 68 | { | 69 | { |
| 69 | #ifndef NO_RSA | 70 | #ifndef OPENSSL_NO_RSA |
| 70 | if (pkey->type == EVP_PKEY_RSA) | 71 | if (pkey->type == EVP_PKEY_RSA) |
| 71 | return(BN_num_bits(pkey->pkey.rsa->n)); | 72 | return(BN_num_bits(pkey->pkey.rsa->n)); |
| 72 | else | 73 | else |
| 73 | #endif | 74 | #endif |
| 74 | #ifndef NO_DSA | 75 | #ifndef OPENSSL_NO_DSA |
| 75 | if (pkey->type == EVP_PKEY_DSA) | 76 | if (pkey->type == EVP_PKEY_DSA) |
| 76 | return(BN_num_bits(pkey->pkey.dsa->p)); | 77 | return(BN_num_bits(pkey->pkey.dsa->p)); |
| 77 | #endif | 78 | #endif |
| @@ -82,12 +83,12 @@ int EVP_PKEY_size(EVP_PKEY *pkey) | |||
| 82 | { | 83 | { |
| 83 | if (pkey == NULL) | 84 | if (pkey == NULL) |
| 84 | return(0); | 85 | return(0); |
| 85 | #ifndef NO_RSA | 86 | #ifndef OPENSSL_NO_RSA |
| 86 | if (pkey->type == EVP_PKEY_RSA) | 87 | if (pkey->type == EVP_PKEY_RSA) |
| 87 | return(RSA_size(pkey->pkey.rsa)); | 88 | return(RSA_size(pkey->pkey.rsa)); |
| 88 | else | 89 | else |
| 89 | #endif | 90 | #endif |
| 90 | #ifndef NO_DSA | 91 | #ifndef OPENSSL_NO_DSA |
| 91 | if (pkey->type == EVP_PKEY_DSA) | 92 | if (pkey->type == EVP_PKEY_DSA) |
| 92 | return(DSA_size(pkey->pkey.dsa)); | 93 | return(DSA_size(pkey->pkey.dsa)); |
| 93 | #endif | 94 | #endif |
| @@ -96,10 +97,10 @@ int EVP_PKEY_size(EVP_PKEY *pkey) | |||
| 96 | 97 | ||
| 97 | int EVP_PKEY_save_parameters(EVP_PKEY *pkey, int mode) | 98 | int EVP_PKEY_save_parameters(EVP_PKEY *pkey, int mode) |
| 98 | { | 99 | { |
| 99 | #ifndef NO_DSA | 100 | #ifndef OPENSSL_NO_DSA |
| 100 | if (pkey->type == EVP_PKEY_DSA) | 101 | if (pkey->type == EVP_PKEY_DSA) |
| 101 | { | 102 | { |
| 102 | int ret=pkey->save_parameters=mode; | 103 | int ret=pkey->save_parameters; |
| 103 | 104 | ||
| 104 | if (mode >= 0) | 105 | if (mode >= 0) |
| 105 | pkey->save_parameters=mode; | 106 | pkey->save_parameters=mode; |
| @@ -122,7 +123,7 @@ int EVP_PKEY_copy_parameters(EVP_PKEY *to, EVP_PKEY *from) | |||
| 122 | EVPerr(EVP_F_EVP_PKEY_COPY_PARAMETERS,EVP_R_MISSING_PARAMETERS); | 123 | EVPerr(EVP_F_EVP_PKEY_COPY_PARAMETERS,EVP_R_MISSING_PARAMETERS); |
| 123 | goto err; | 124 | goto err; |
| 124 | } | 125 | } |
| 125 | #ifndef NO_DSA | 126 | #ifndef OPENSSL_NO_DSA |
| 126 | if (to->type == EVP_PKEY_DSA) | 127 | if (to->type == EVP_PKEY_DSA) |
| 127 | { | 128 | { |
| 128 | BIGNUM *a; | 129 | BIGNUM *a; |
| @@ -147,7 +148,7 @@ err: | |||
| 147 | 148 | ||
| 148 | int EVP_PKEY_missing_parameters(EVP_PKEY *pkey) | 149 | int EVP_PKEY_missing_parameters(EVP_PKEY *pkey) |
| 149 | { | 150 | { |
| 150 | #ifndef NO_DSA | 151 | #ifndef OPENSSL_NO_DSA |
| 151 | if (pkey->type == EVP_PKEY_DSA) | 152 | if (pkey->type == EVP_PKEY_DSA) |
| 152 | { | 153 | { |
| 153 | DSA *dsa; | 154 | DSA *dsa; |
| @@ -162,7 +163,7 @@ int EVP_PKEY_missing_parameters(EVP_PKEY *pkey) | |||
| 162 | 163 | ||
| 163 | int EVP_PKEY_cmp_parameters(EVP_PKEY *a, EVP_PKEY *b) | 164 | int EVP_PKEY_cmp_parameters(EVP_PKEY *a, EVP_PKEY *b) |
| 164 | { | 165 | { |
| 165 | #ifndef NO_DSA | 166 | #ifndef OPENSSL_NO_DSA |
| 166 | if ((a->type == EVP_PKEY_DSA) && (b->type == EVP_PKEY_DSA)) | 167 | if ((a->type == EVP_PKEY_DSA) && (b->type == EVP_PKEY_DSA)) |
| 167 | { | 168 | { |
| 168 | if ( BN_cmp(a->pkey.dsa->p,b->pkey.dsa->p) || | 169 | if ( BN_cmp(a->pkey.dsa->p,b->pkey.dsa->p) || |
| @@ -205,11 +206,12 @@ int EVP_PKEY_assign(EVP_PKEY *pkey, int type, char *key) | |||
| 205 | return(key != NULL); | 206 | return(key != NULL); |
| 206 | } | 207 | } |
| 207 | 208 | ||
| 208 | #ifndef NO_RSA | 209 | #ifndef OPENSSL_NO_RSA |
| 209 | int EVP_PKEY_set1_RSA(EVP_PKEY *pkey, RSA *key) | 210 | int EVP_PKEY_set1_RSA(EVP_PKEY *pkey, RSA *key) |
| 210 | { | 211 | { |
| 211 | int ret = EVP_PKEY_assign_RSA(pkey, key); | 212 | int ret = EVP_PKEY_assign_RSA(pkey, key); |
| 212 | if(ret) CRYPTO_add(&key->references, 1, CRYPTO_LOCK_RSA); | 213 | if(ret) |
| 214 | RSA_up_ref(key); | ||
| 213 | return ret; | 215 | return ret; |
| 214 | } | 216 | } |
| 215 | 217 | ||
| @@ -219,16 +221,17 @@ RSA *EVP_PKEY_get1_RSA(EVP_PKEY *pkey) | |||
| 219 | EVPerr(EVP_F_EVP_PKEY_GET1_RSA, EVP_R_EXPECTING_AN_RSA_KEY); | 221 | EVPerr(EVP_F_EVP_PKEY_GET1_RSA, EVP_R_EXPECTING_AN_RSA_KEY); |
| 220 | return NULL; | 222 | return NULL; |
| 221 | } | 223 | } |
| 222 | CRYPTO_add(&pkey->pkey.rsa->references, 1, CRYPTO_LOCK_RSA); | 224 | RSA_up_ref(pkey->pkey.rsa); |
| 223 | return pkey->pkey.rsa; | 225 | return pkey->pkey.rsa; |
| 224 | } | 226 | } |
| 225 | #endif | 227 | #endif |
| 226 | 228 | ||
| 227 | #ifndef NO_DSA | 229 | #ifndef OPENSSL_NO_DSA |
| 228 | int EVP_PKEY_set1_DSA(EVP_PKEY *pkey, DSA *key) | 230 | int EVP_PKEY_set1_DSA(EVP_PKEY *pkey, DSA *key) |
| 229 | { | 231 | { |
| 230 | int ret = EVP_PKEY_assign_DSA(pkey, key); | 232 | int ret = EVP_PKEY_assign_DSA(pkey, key); |
| 231 | if(ret) CRYPTO_add(&key->references, 1, CRYPTO_LOCK_DSA); | 233 | if(ret) |
| 234 | DSA_up_ref(key); | ||
| 232 | return ret; | 235 | return ret; |
| 233 | } | 236 | } |
| 234 | 237 | ||
| @@ -238,17 +241,18 @@ DSA *EVP_PKEY_get1_DSA(EVP_PKEY *pkey) | |||
| 238 | EVPerr(EVP_F_EVP_PKEY_GET1_DSA, EVP_R_EXPECTING_A_DSA_KEY); | 241 | EVPerr(EVP_F_EVP_PKEY_GET1_DSA, EVP_R_EXPECTING_A_DSA_KEY); |
| 239 | return NULL; | 242 | return NULL; |
| 240 | } | 243 | } |
| 241 | CRYPTO_add(&pkey->pkey.dsa->references, 1, CRYPTO_LOCK_DSA); | 244 | DSA_up_ref(pkey->pkey.dsa); |
| 242 | return pkey->pkey.dsa; | 245 | return pkey->pkey.dsa; |
| 243 | } | 246 | } |
| 244 | #endif | 247 | #endif |
| 245 | 248 | ||
| 246 | #ifndef NO_DH | 249 | #ifndef OPENSSL_NO_DH |
| 247 | 250 | ||
| 248 | int EVP_PKEY_set1_DH(EVP_PKEY *pkey, DH *key) | 251 | int EVP_PKEY_set1_DH(EVP_PKEY *pkey, DH *key) |
| 249 | { | 252 | { |
| 250 | int ret = EVP_PKEY_assign_DH(pkey, key); | 253 | int ret = EVP_PKEY_assign_DH(pkey, key); |
| 251 | if(ret) CRYPTO_add(&key->references, 1, CRYPTO_LOCK_DH); | 254 | if(ret) |
| 255 | DH_up_ref(key); | ||
| 252 | return ret; | 256 | return ret; |
| 253 | } | 257 | } |
| 254 | 258 | ||
| @@ -258,7 +262,7 @@ DH *EVP_PKEY_get1_DH(EVP_PKEY *pkey) | |||
| 258 | EVPerr(EVP_F_EVP_PKEY_GET1_DH, EVP_R_EXPECTING_A_DH_KEY); | 262 | EVPerr(EVP_F_EVP_PKEY_GET1_DH, EVP_R_EXPECTING_A_DH_KEY); |
| 259 | return NULL; | 263 | return NULL; |
| 260 | } | 264 | } |
| 261 | CRYPTO_add(&pkey->pkey.dh->references, 1, CRYPTO_LOCK_DH); | 265 | DH_up_ref(pkey->pkey.dh); |
| 262 | return pkey->pkey.dh; | 266 | return pkey->pkey.dh; |
| 263 | } | 267 | } |
| 264 | #endif | 268 | #endif |
| @@ -309,13 +313,13 @@ static void EVP_PKEY_free_it(EVP_PKEY *x) | |||
| 309 | { | 313 | { |
| 310 | switch (x->type) | 314 | switch (x->type) |
| 311 | { | 315 | { |
| 312 | #ifndef NO_RSA | 316 | #ifndef OPENSSL_NO_RSA |
| 313 | case EVP_PKEY_RSA: | 317 | case EVP_PKEY_RSA: |
| 314 | case EVP_PKEY_RSA2: | 318 | case EVP_PKEY_RSA2: |
| 315 | RSA_free(x->pkey.rsa); | 319 | RSA_free(x->pkey.rsa); |
| 316 | break; | 320 | break; |
| 317 | #endif | 321 | #endif |
| 318 | #ifndef NO_DSA | 322 | #ifndef OPENSSL_NO_DSA |
| 319 | case EVP_PKEY_DSA: | 323 | case EVP_PKEY_DSA: |
| 320 | case EVP_PKEY_DSA2: | 324 | case EVP_PKEY_DSA2: |
| 321 | case EVP_PKEY_DSA3: | 325 | case EVP_PKEY_DSA3: |
| @@ -323,7 +327,7 @@ static void EVP_PKEY_free_it(EVP_PKEY *x) | |||
| 323 | DSA_free(x->pkey.dsa); | 327 | DSA_free(x->pkey.dsa); |
| 324 | break; | 328 | break; |
| 325 | #endif | 329 | #endif |
| 326 | #ifndef NO_DH | 330 | #ifndef OPENSSL_NO_DH |
| 327 | case EVP_PKEY_DH: | 331 | case EVP_PKEY_DH: |
| 328 | DH_free(x->pkey.dh); | 332 | DH_free(x->pkey.dh); |
| 329 | break; | 333 | break; |
diff --git a/src/lib/libcrypto/evp/p_open.c b/src/lib/libcrypto/evp/p_open.c index 2760c00fec..6976f2a867 100644 --- a/src/lib/libcrypto/evp/p_open.c +++ b/src/lib/libcrypto/evp/p_open.c | |||
| @@ -56,14 +56,14 @@ | |||
| 56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
| 57 | */ | 57 | */ |
| 58 | 58 | ||
| 59 | #ifndef NO_RSA | 59 | #ifndef OPENSSL_NO_RSA |
| 60 | #include <stdio.h> | 60 | #include <stdio.h> |
| 61 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
| 62 | #include <openssl/evp.h> | 62 | #include <openssl/evp.h> |
| 63 | #include <openssl/objects.h> | 63 | #include <openssl/objects.h> |
| 64 | #include <openssl/x509.h> | 64 | #include <openssl/x509.h> |
| 65 | 65 | ||
| 66 | int EVP_OpenInit(EVP_CIPHER_CTX *ctx, EVP_CIPHER *type, unsigned char *ek, | 66 | int EVP_OpenInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, unsigned char *ek, |
| 67 | int ekl, unsigned char *iv, EVP_PKEY *priv) | 67 | int ekl, unsigned char *iv, EVP_PKEY *priv) |
| 68 | { | 68 | { |
| 69 | unsigned char *key=NULL; | 69 | unsigned char *key=NULL; |
| @@ -71,7 +71,7 @@ int EVP_OpenInit(EVP_CIPHER_CTX *ctx, EVP_CIPHER *type, unsigned char *ek, | |||
| 71 | 71 | ||
| 72 | if(type) { | 72 | if(type) { |
| 73 | EVP_CIPHER_CTX_init(ctx); | 73 | EVP_CIPHER_CTX_init(ctx); |
| 74 | if(!EVP_DecryptInit(ctx,type,NULL,NULL)) return 0; | 74 | if(!EVP_DecryptInit_ex(ctx,type,NULL, NULL,NULL)) return 0; |
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | if(!priv) return 1; | 77 | if(!priv) return 1; |
| @@ -97,7 +97,7 @@ int EVP_OpenInit(EVP_CIPHER_CTX *ctx, EVP_CIPHER *type, unsigned char *ek, | |||
| 97 | /* ERROR */ | 97 | /* ERROR */ |
| 98 | goto err; | 98 | goto err; |
| 99 | } | 99 | } |
| 100 | if(!EVP_DecryptInit(ctx,NULL,key,iv)) goto err; | 100 | if(!EVP_DecryptInit_ex(ctx,NULL,NULL,key,iv)) goto err; |
| 101 | 101 | ||
| 102 | ret=1; | 102 | ret=1; |
| 103 | err: | 103 | err: |
| @@ -110,11 +110,11 @@ int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) | |||
| 110 | { | 110 | { |
| 111 | int i; | 111 | int i; |
| 112 | 112 | ||
| 113 | i=EVP_DecryptFinal(ctx,out,outl); | 113 | i=EVP_DecryptFinal_ex(ctx,out,outl); |
| 114 | EVP_DecryptInit(ctx,NULL,NULL,NULL); | 114 | EVP_DecryptInit_ex(ctx,NULL,NULL,NULL,NULL); |
| 115 | return(i); | 115 | return(i); |
| 116 | } | 116 | } |
| 117 | #else /* !NO_RSA */ | 117 | #else /* !OPENSSL_NO_RSA */ |
| 118 | 118 | ||
| 119 | # ifdef PEDANTIC | 119 | # ifdef PEDANTIC |
| 120 | static void *dummy=&dummy; | 120 | static void *dummy=&dummy; |
diff --git a/src/lib/libcrypto/evp/p_seal.c b/src/lib/libcrypto/evp/p_seal.c index 2fd1d7e0c2..5570ca3745 100644 --- a/src/lib/libcrypto/evp/p_seal.c +++ b/src/lib/libcrypto/evp/p_seal.c | |||
| @@ -59,14 +59,14 @@ | |||
| 59 | #include <stdio.h> | 59 | #include <stdio.h> |
| 60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
| 61 | #include <openssl/rand.h> | 61 | #include <openssl/rand.h> |
| 62 | #ifndef NO_RSA | 62 | #ifndef OPENSSL_NO_RSA |
| 63 | #include <openssl/rsa.h> | 63 | #include <openssl/rsa.h> |
| 64 | #endif | 64 | #endif |
| 65 | #include <openssl/evp.h> | 65 | #include <openssl/evp.h> |
| 66 | #include <openssl/objects.h> | 66 | #include <openssl/objects.h> |
| 67 | #include <openssl/x509.h> | 67 | #include <openssl/x509.h> |
| 68 | 68 | ||
| 69 | int EVP_SealInit(EVP_CIPHER_CTX *ctx, EVP_CIPHER *type, unsigned char **ek, | 69 | int EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, unsigned char **ek, |
| 70 | int *ekl, unsigned char *iv, EVP_PKEY **pubk, int npubk) | 70 | int *ekl, unsigned char *iv, EVP_PKEY **pubk, int npubk) |
| 71 | { | 71 | { |
| 72 | unsigned char key[EVP_MAX_KEY_LENGTH]; | 72 | unsigned char key[EVP_MAX_KEY_LENGTH]; |
| @@ -74,15 +74,16 @@ int EVP_SealInit(EVP_CIPHER_CTX *ctx, EVP_CIPHER *type, unsigned char **ek, | |||
| 74 | 74 | ||
| 75 | if(type) { | 75 | if(type) { |
| 76 | EVP_CIPHER_CTX_init(ctx); | 76 | EVP_CIPHER_CTX_init(ctx); |
| 77 | if(!EVP_EncryptInit(ctx,type,NULL,NULL)) return 0; | 77 | if(!EVP_EncryptInit_ex(ctx,type,NULL,NULL,NULL)) return 0; |
| 78 | } | 78 | } |
| 79 | if (npubk <= 0) return(0); | 79 | if ((npubk <= 0) || !pubk) |
| 80 | return 1; | ||
| 80 | if (RAND_bytes(key,EVP_MAX_KEY_LENGTH) <= 0) | 81 | if (RAND_bytes(key,EVP_MAX_KEY_LENGTH) <= 0) |
| 81 | return(0); | 82 | return 0; |
| 82 | if (EVP_CIPHER_CTX_iv_length(ctx)) | 83 | if (EVP_CIPHER_CTX_iv_length(ctx)) |
| 83 | RAND_pseudo_bytes(iv,EVP_CIPHER_CTX_iv_length(ctx)); | 84 | RAND_pseudo_bytes(iv,EVP_CIPHER_CTX_iv_length(ctx)); |
| 84 | 85 | ||
| 85 | if(!EVP_EncryptInit(ctx,NULL,key,iv)) return 0; | 86 | if(!EVP_EncryptInit_ex(ctx,NULL,NULL,key,iv)) return 0; |
| 86 | 87 | ||
| 87 | for (i=0; i<npubk; i++) | 88 | for (i=0; i<npubk; i++) |
| 88 | { | 89 | { |
| @@ -107,6 +108,6 @@ int inl; | |||
| 107 | 108 | ||
| 108 | void EVP_SealFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) | 109 | void EVP_SealFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) |
| 109 | { | 110 | { |
| 110 | EVP_EncryptFinal(ctx,out,outl); | 111 | EVP_EncryptFinal_ex(ctx,out,outl); |
| 111 | EVP_EncryptInit(ctx,NULL,NULL,NULL); | 112 | EVP_EncryptInit_ex(ctx,NULL,NULL,NULL,NULL); |
| 112 | } | 113 | } |
diff --git a/src/lib/libcrypto/evp/p_sign.c b/src/lib/libcrypto/evp/p_sign.c index 1fa32ac17e..e4ae5906f5 100644 --- a/src/lib/libcrypto/evp/p_sign.c +++ b/src/lib/libcrypto/evp/p_sign.c | |||
| @@ -65,7 +65,7 @@ | |||
| 65 | #ifdef undef | 65 | #ifdef undef |
| 66 | void EVP_SignInit(EVP_MD_CTX *ctx, EVP_MD *type) | 66 | void EVP_SignInit(EVP_MD_CTX *ctx, EVP_MD *type) |
| 67 | { | 67 | { |
| 68 | EVP_DigestInit(ctx,type); | 68 | EVP_DigestInit_ex(ctx,type); |
| 69 | } | 69 | } |
| 70 | 70 | ||
| 71 | void EVP_SignUpdate(EVP_MD_CTX *ctx, unsigned char *data, | 71 | void EVP_SignUpdate(EVP_MD_CTX *ctx, unsigned char *data, |
| @@ -84,8 +84,10 @@ 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_copy(&tmp_ctx,ctx); | 87 | EVP_MD_CTX_init(&tmp_ctx); |
| 88 | EVP_DigestFinal(&tmp_ctx,&(m[0]),&m_len); | 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); | ||
| 89 | for (i=0; i<4; i++) | 91 | for (i=0; i<4; i++) |
| 90 | { | 92 | { |
| 91 | v=ctx->digest->required_pkey_type[i]; | 93 | v=ctx->digest->required_pkey_type[i]; |
diff --git a/src/lib/libcrypto/evp/p_verify.c b/src/lib/libcrypto/evp/p_verify.c index dcb54f3abb..d854d743a5 100644 --- a/src/lib/libcrypto/evp/p_verify.c +++ b/src/lib/libcrypto/evp/p_verify.c | |||
| @@ -85,8 +85,10 @@ int EVP_VerifyFinal(EVP_MD_CTX *ctx, unsigned char *sigbuf, | |||
| 85 | EVPerr(EVP_F_EVP_VERIFYFINAL,EVP_R_WRONG_PUBLIC_KEY_TYPE); | 85 | EVPerr(EVP_F_EVP_VERIFYFINAL,EVP_R_WRONG_PUBLIC_KEY_TYPE); |
| 86 | return(-1); | 86 | return(-1); |
| 87 | } | 87 | } |
| 88 | EVP_MD_CTX_copy(&tmp_ctx,ctx); | 88 | EVP_MD_CTX_init(&tmp_ctx); |
| 89 | EVP_DigestFinal(&tmp_ctx,&(m[0]),&m_len); | 89 | EVP_MD_CTX_copy_ex(&tmp_ctx,ctx); |
| 90 | EVP_DigestFinal_ex(&tmp_ctx,&(m[0]),&m_len); | ||
| 91 | EVP_MD_CTX_cleanup(&tmp_ctx); | ||
| 90 | if (ctx->digest->verify == NULL) | 92 | if (ctx->digest->verify == NULL) |
| 91 | { | 93 | { |
| 92 | EVPerr(EVP_F_EVP_VERIFYFINAL,EVP_R_NO_VERIFY_FUNCTION_CONFIGURED); | 94 | EVPerr(EVP_F_EVP_VERIFYFINAL,EVP_R_NO_VERIFY_FUNCTION_CONFIGURED); |
