diff options
author | Richard Levitte <levitte@openssl.org> | 2000-05-30 07:16:56 +0000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2000-05-30 07:16:56 +0000 |
commit | 6a1129837ab4b803202a910b707f776f39206705 (patch) | |
tree | 40837ba6741441cd5374951dc4742993c88d3306 | |
parent | 20ca3d49e76dab44e1a418cb83024b4f77d2299e (diff) | |
download | openssl-6a1129837ab4b803202a910b707f776f39206705.tar.gz |
Main trunk changes merged into BRANCH_engine. There were no
conflicts, which is a good thing. Propper tagging of merge point
done.
48 files changed, 365 insertions, 3958 deletions
@@ -4,6 +4,41 @@ Changes between 0.9.5a and 0.9.6 [xx XXX 2000] + *) Remove lots of duplicated code from the EVP library. For example *every* + cipher init() function handles the 'iv' in the same way according to the + cipher mode. They also all do nothing if the 'key' parameter is NULL and + for CFB and OFB modes they zero ctx->num. + + Most of the routines have the same form and so can be declared in terms + of macros. + + By shifting this to the top level EVP_CipherInit() it can be removed from + all individual ciphers. If the cipher wants to handle IVs or keys + differently it can set the EVP_CIPH_CUSTOM_IV or EVP_CIPH_ALWAYS_CALL_INIT + flags. + [Steve Henson] + + *) In ssl/s2_clnt.c and ssl/s3_clnt.c, call ERR_clear_error() when + the handshake is continued after ssl_verify_cert_chain(); + otherwise, if SSL_VERIFY_NONE is set, remaining error codes + can lead to 'unexplainable' connection aborts later. + [Bodo Moeller; problem tracked down by Lutz Jaenicke] + + *) EVP cipher enhancement. Add hooks for extra EVP features. This will allow + various cipher parameters to be set in the EVP interface. Initially + support added for variable key length ciphers via the + EVP_CIPHER_CTX_set_key_length() function. Other cipher specific + parameters will be added later via the new catchall 'ctrl' function. + New functionality allows removal of S/MIME code RC2 hack. + + Still needs support in other library functions, and allow parameter + setting for algorithms like RC2, RC5. + + Change lots of functions like EVP_EncryptUpdate() to now return a + value: although software versions of the algorithms cannot fail + any installed hardware versions can. + [Steve Henson] + *) Implement SSL_OP_TLS_ROLLBACK_BUG: In ssl3_get_client_key_exchange, if this option is set, tolerate broken clients that send the negotiated protocol version number instead of the requested protocol version @@ -295,6 +295,9 @@ my %table=( # NCR MP-RAS UNIX ver 02.03.01 "ncr-scde","cc:-O6 -Xa -Hoff=BEHAVED -686 -Hwide -Hiw::(unknown):-lsocket -lnsl:${x86_gcc_des} ${x86_gcc_opts}:::", +# Linux on ARM +"linux-elf-arm","gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::BN_LLONG::dlfcn", + # UnixWare 2.0 "unixware-2.0","cc:-O -DFILIO_H::(unknown):-lsocket -lnsl:${x86_gcc_des} ${x86_gcc_opts}:::", "unixware-2.0-pentium","cc:-O -DFILIO_H -Kpentium -Kthread::(unknown):-lsocket -lnsl:MD2_CHAR RC4_INDEX ${x86_gcc_des}::", @@ -1,6 +1,6 @@ OpenSSL STATUS Last modified at - ______________ $Date: 2000/04/14 23:35:50 $ + ______________ $Date: 2000/05/30 07:16:55 $ DEVELOPMENT STATE @@ -22,11 +22,11 @@ IN PROGRESS o Steve is currently working on (in no particular order): + EVP cipher enhancement. Proper (or at least usable) certificate chain verification. Private key, certificate and CRL API and implementation. Developing and bugfixing PKCS#7 (S/MIME code). Various X509 issues: character sets, certificate request extensions. - Documentation for the openssl utility. NEEDS PATCH @@ -79,16 +79,6 @@ to date. Paul +1 - o The EVP and ASN1 stuff is a mess. Currently you have one EVP_CIPHER - structure for each cipher. This may make sense for things like DES but - for variable length ciphers like RC2 and RC4 it is NBG. Need a way to - use the EVP interface and set up the cipher parameters. The ASN1 stuff - is also foo wrt ciphers whose AlgorithmIdentifier has more than just - an IV in it (e.g. RC2, RC5). This also means that EVP_Seal and EVP_Open - don't work unless the key length matches the fixed value (some vendors - use a key length decided by the size of the RSA encrypted key and expect - RC2 to adapt). - WISHES o diff --git a/crypto/asn1/a_utctm.c b/crypto/asn1/a_utctm.c index f6652e7081..b855867dc1 100644 --- a/crypto/asn1/a_utctm.c +++ b/crypto/asn1/a_utctm.c @@ -291,10 +291,5 @@ time_t ASN1_UTCTIME_get(const ASN1_UTCTIME *s) } #undef g2 - return timegm(&tm)-offset*60; /* FIXME: timegm is non-standard, - * typically we only have mktime (which - * interprets the struct tm according to - * the current time zone setting). - * Also time_t is inappropriate for general - * UTC times because it may a 32 bit type. */ + return mktime(&tm)-offset*60; } diff --git a/crypto/conf/conf.h b/crypto/conf/conf.h index 56b5f5c216..2f70634455 100644 --- a/crypto/conf/conf.h +++ b/crypto/conf/conf.h @@ -106,7 +106,6 @@ STACK_OF(CONF_VALUE) *CONF_get_section(LHASH *conf,char *section); char *CONF_get_string(LHASH *conf,char *group,char *name); long CONF_get_number(LHASH *conf,char *group,char *name); void CONF_free(LHASH *conf); -void CONF_dump(LHASH *conf, BIO *out); int CONF_dump_fp(LHASH *conf, FILE *out); int CONF_dump_bio(LHASH *conf, BIO *out); void ERR_load_CONF_strings(void ); diff --git a/crypto/dso/dso_win32.c b/crypto/dso/dso_win32.c index c495840bd2..212a255b4b 100644 --- a/crypto/dso/dso_win32.c +++ b/crypto/dso/dso_win32.c @@ -119,8 +119,8 @@ static int win32_load(DSO *dso, const char *filename) len = strlen(filename); if((dso->flags & DSO_FLAG_NAME_TRANSLATION) && (len + 4 < DSO_MAX_TRANSLATED_SIZE) && - (strstr(filename, "/") == NULL) - (strstr(filename, "\\") == NULL) + (strstr(filename, "/") == NULL) && + (strstr(filename, "\\") == NULL) && (strstr(filename, ":") == NULL)) { sprintf(translated, "%s.dll", filename); @@ -211,7 +211,7 @@ static int win32_bind(DSO *dso, const char *symname, void **symptr) return(1); } -static int win32_ctrl(DSO *dso, int cmd, long larg, void *parg) +static long win32_ctrl(DSO *dso, int cmd, long larg, void *parg) { if(dso == NULL) { diff --git a/crypto/evp/Makefile.ssl b/crypto/evp/Makefile.ssl index 1150e88929..de43060eaf 100644 --- a/crypto/evp/Makefile.ssl +++ b/crypto/evp/Makefile.ssl @@ -23,14 +23,9 @@ APPS= LIB=$(TOP)/libcrypto.a LIBSRC= encode.c digest.c evp_enc.c evp_key.c \ - e_ecb_d.c e_cbc_d.c e_cfb_d.c e_ofb_d.c \ - e_ecb_i.c e_cbc_i.c e_cfb_i.c e_ofb_i.c \ - e_ecb_3d.c e_cbc_3d.c e_rc4.c names.c \ - e_cfb_3d.c e_ofb_3d.c e_xcbc_d.c \ - e_ecb_r2.c e_cbc_r2.c e_cfb_r2.c e_ofb_r2.c \ - e_ecb_bf.c e_cbc_bf.c e_cfb_bf.c e_ofb_bf.c \ - e_ecb_c.c e_cbc_c.c e_cfb_c.c e_ofb_c.c \ - e_ecb_r5.c e_cbc_r5.c e_cfb_r5.c e_ofb_r5.c \ + e_des.c e_bf.c e_idea.c e_des3.c \ + e_rc4.c names.c \ + e_xcbc_d.c e_rc2.c e_cast.c e_rc5.c \ m_null.c m_md2.c m_md5.c m_sha.c m_sha1.c m_dss.c m_dss1.c m_mdc2.c \ m_ripemd.c \ p_open.c p_seal.c p_sign.c p_verify.c p_lib.c p_enc.c p_dec.c \ @@ -39,14 +34,9 @@ LIBSRC= encode.c digest.c evp_enc.c evp_key.c \ evp_pkey.c evp_pbe.c p5_crpt.c p5_crpt2.c LIBOBJ= encode.o digest.o evp_enc.o evp_key.o \ - e_ecb_d.o e_cbc_d.o e_cfb_d.o e_ofb_d.o \ - e_ecb_i.o e_cbc_i.o e_cfb_i.o e_ofb_i.o \ - e_ecb_3d.o e_cbc_3d.o e_rc4.o names.o \ - e_cfb_3d.o e_ofb_3d.o e_xcbc_d.o \ - e_ecb_r2.o e_cbc_r2.o e_cfb_r2.o e_ofb_r2.o \ - e_ecb_bf.o e_cbc_bf.o e_cfb_bf.o e_ofb_bf.o \ - e_ecb_c.o e_cbc_c.o e_cfb_c.o e_ofb_c.o \ - e_ecb_r5.o e_cbc_r5.o e_cfb_r5.o e_ofb_r5.o \ + e_des.o e_bf.o e_idea.o e_des3.o \ + e_rc4.o names.o \ + e_xcbc_d.o e_rc2.o e_cast.o e_rc5.o \ m_null.o m_md2.o m_md5.o m_sha.o m_sha1.o m_dss.o m_dss1.o m_mdc2.o \ m_ripemd.o \ p_open.o p_seal.o p_sign.o p_verify.o p_lib.o p_enc.o p_dec.o \ @@ -232,321 +222,81 @@ digest.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h digest.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h digest.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h digest.o: ../../include/openssl/stack.h ../cryptlib.h -e_cbc_3d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h -e_cbc_3d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h -e_cbc_3d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h -e_cbc_3d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h -e_cbc_3d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h -e_cbc_3d.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h -e_cbc_3d.o: ../../include/openssl/err.h ../../include/openssl/evp.h -e_cbc_3d.o: ../../include/openssl/idea.h ../../include/openssl/md2.h -e_cbc_3d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h -e_cbc_3d.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h -e_cbc_3d.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h -e_cbc_3d.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h -e_cbc_3d.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h -e_cbc_3d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h -e_cbc_3d.o: ../../include/openssl/stack.h ../cryptlib.h -e_cbc_bf.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h -e_cbc_bf.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h -e_cbc_bf.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h -e_cbc_bf.o: ../../include/openssl/crypto.h ../../include/openssl/des.h -e_cbc_bf.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h -e_cbc_bf.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h -e_cbc_bf.o: ../../include/openssl/err.h ../../include/openssl/evp.h -e_cbc_bf.o: ../../include/openssl/idea.h ../../include/openssl/md2.h -e_cbc_bf.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h -e_cbc_bf.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h -e_cbc_bf.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h -e_cbc_bf.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h -e_cbc_bf.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h -e_cbc_bf.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h -e_cbc_bf.o: ../../include/openssl/stack.h ../cryptlib.h -e_cbc_c.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h -e_cbc_c.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h -e_cbc_c.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h -e_cbc_c.o: ../../include/openssl/crypto.h ../../include/openssl/des.h -e_cbc_c.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h -e_cbc_c.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h -e_cbc_c.o: ../../include/openssl/err.h ../../include/openssl/evp.h -e_cbc_c.o: ../../include/openssl/idea.h ../../include/openssl/md2.h -e_cbc_c.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h -e_cbc_c.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h -e_cbc_c.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h -e_cbc_c.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h -e_cbc_c.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h -e_cbc_c.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h -e_cbc_c.o: ../../include/openssl/stack.h ../cryptlib.h -e_cbc_d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h -e_cbc_d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h -e_cbc_d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h -e_cbc_d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h -e_cbc_d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h -e_cbc_d.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h -e_cbc_d.o: ../../include/openssl/err.h ../../include/openssl/evp.h -e_cbc_d.o: ../../include/openssl/idea.h ../../include/openssl/md2.h -e_cbc_d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h -e_cbc_d.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h -e_cbc_d.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h -e_cbc_d.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h -e_cbc_d.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h -e_cbc_d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h -e_cbc_d.o: ../../include/openssl/stack.h ../cryptlib.h -e_cbc_i.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h -e_cbc_i.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h -e_cbc_i.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h -e_cbc_i.o: ../../include/openssl/crypto.h ../../include/openssl/des.h -e_cbc_i.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h -e_cbc_i.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h -e_cbc_i.o: ../../include/openssl/err.h ../../include/openssl/evp.h -e_cbc_i.o: ../../include/openssl/idea.h ../../include/openssl/md2.h -e_cbc_i.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h -e_cbc_i.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h -e_cbc_i.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h -e_cbc_i.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h -e_cbc_i.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h -e_cbc_i.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h -e_cbc_i.o: ../../include/openssl/stack.h ../cryptlib.h -e_cbc_r2.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h -e_cbc_r2.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h -e_cbc_r2.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h -e_cbc_r2.o: ../../include/openssl/crypto.h ../../include/openssl/des.h -e_cbc_r2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h -e_cbc_r2.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h -e_cbc_r2.o: ../../include/openssl/err.h ../../include/openssl/evp.h -e_cbc_r2.o: ../../include/openssl/idea.h ../../include/openssl/md2.h -e_cbc_r2.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h -e_cbc_r2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h -e_cbc_r2.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h -e_cbc_r2.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h -e_cbc_r2.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h -e_cbc_r2.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h -e_cbc_r2.o: ../../include/openssl/stack.h ../cryptlib.h -e_cbc_r5.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h -e_cbc_r5.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h -e_cbc_r5.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h -e_cbc_r5.o: ../../include/openssl/crypto.h ../../include/openssl/des.h -e_cbc_r5.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h -e_cbc_r5.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h -e_cbc_r5.o: ../../include/openssl/err.h ../../include/openssl/evp.h -e_cbc_r5.o: ../../include/openssl/idea.h ../../include/openssl/md2.h -e_cbc_r5.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h -e_cbc_r5.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h -e_cbc_r5.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h -e_cbc_r5.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h -e_cbc_r5.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h -e_cbc_r5.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h -e_cbc_r5.o: ../../include/openssl/stack.h ../cryptlib.h -e_cfb_3d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h -e_cfb_3d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h -e_cfb_3d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h -e_cfb_3d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h -e_cfb_3d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h -e_cfb_3d.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h -e_cfb_3d.o: ../../include/openssl/err.h ../../include/openssl/evp.h -e_cfb_3d.o: ../../include/openssl/idea.h ../../include/openssl/md2.h -e_cfb_3d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h -e_cfb_3d.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h -e_cfb_3d.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h -e_cfb_3d.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h -e_cfb_3d.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h -e_cfb_3d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h -e_cfb_3d.o: ../../include/openssl/stack.h ../cryptlib.h -e_cfb_bf.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h -e_cfb_bf.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h -e_cfb_bf.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h -e_cfb_bf.o: ../../include/openssl/crypto.h ../../include/openssl/des.h -e_cfb_bf.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h -e_cfb_bf.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h -e_cfb_bf.o: ../../include/openssl/err.h ../../include/openssl/evp.h -e_cfb_bf.o: ../../include/openssl/idea.h ../../include/openssl/md2.h -e_cfb_bf.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h -e_cfb_bf.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h -e_cfb_bf.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h -e_cfb_bf.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h -e_cfb_bf.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h -e_cfb_bf.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h -e_cfb_bf.o: ../../include/openssl/stack.h ../cryptlib.h -e_cfb_c.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h -e_cfb_c.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h -e_cfb_c.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h -e_cfb_c.o: ../../include/openssl/crypto.h ../../include/openssl/des.h -e_cfb_c.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h -e_cfb_c.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h -e_cfb_c.o: ../../include/openssl/err.h ../../include/openssl/evp.h -e_cfb_c.o: ../../include/openssl/idea.h ../../include/openssl/md2.h -e_cfb_c.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h -e_cfb_c.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h -e_cfb_c.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h -e_cfb_c.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h -e_cfb_c.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h -e_cfb_c.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h -e_cfb_c.o: ../../include/openssl/stack.h ../cryptlib.h -e_cfb_d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h -e_cfb_d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h -e_cfb_d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h -e_cfb_d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h -e_cfb_d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h -e_cfb_d.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h -e_cfb_d.o: ../../include/openssl/err.h ../../include/openssl/evp.h -e_cfb_d.o: ../../include/openssl/idea.h ../../include/openssl/md2.h -e_cfb_d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h -e_cfb_d.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h -e_cfb_d.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h -e_cfb_d.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h -e_cfb_d.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h -e_cfb_d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h -e_cfb_d.o: ../../include/openssl/stack.h ../cryptlib.h -e_cfb_i.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h -e_cfb_i.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h -e_cfb_i.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h -e_cfb_i.o: ../../include/openssl/crypto.h ../../include/openssl/des.h -e_cfb_i.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h -e_cfb_i.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h -e_cfb_i.o: ../../include/openssl/err.h ../../include/openssl/evp.h -e_cfb_i.o: ../../include/openssl/idea.h ../../include/openssl/md2.h -e_cfb_i.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h -e_cfb_i.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h -e_cfb_i.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h -e_cfb_i.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h -e_cfb_i.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h -e_cfb_i.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h -e_cfb_i.o: ../../include/openssl/stack.h ../cryptlib.h -e_cfb_r2.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h -e_cfb_r2.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h -e_cfb_r2.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h -e_cfb_r2.o: ../../include/openssl/crypto.h ../../include/openssl/des.h -e_cfb_r2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h -e_cfb_r2.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h -e_cfb_r2.o: ../../include/openssl/err.h ../../include/openssl/evp.h -e_cfb_r2.o: ../../include/openssl/idea.h ../../include/openssl/md2.h -e_cfb_r2.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h -e_cfb_r2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h -e_cfb_r2.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h -e_cfb_r2.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h -e_cfb_r2.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h -e_cfb_r2.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h -e_cfb_r2.o: ../../include/openssl/stack.h ../cryptlib.h -e_cfb_r5.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h -e_cfb_r5.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h -e_cfb_r5.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h -e_cfb_r5.o: ../../include/openssl/crypto.h ../../include/openssl/des.h -e_cfb_r5.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h -e_cfb_r5.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h -e_cfb_r5.o: ../../include/openssl/err.h ../../include/openssl/evp.h -e_cfb_r5.o: ../../include/openssl/idea.h ../../include/openssl/md2.h -e_cfb_r5.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h -e_cfb_r5.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h -e_cfb_r5.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h -e_cfb_r5.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h -e_cfb_r5.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h -e_cfb_r5.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h -e_cfb_r5.o: ../../include/openssl/stack.h ../cryptlib.h -e_ecb_3d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h -e_ecb_3d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h -e_ecb_3d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h -e_ecb_3d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h -e_ecb_3d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h -e_ecb_3d.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h -e_ecb_3d.o: ../../include/openssl/err.h ../../include/openssl/evp.h -e_ecb_3d.o: ../../include/openssl/idea.h ../../include/openssl/md2.h -e_ecb_3d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h -e_ecb_3d.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h -e_ecb_3d.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h -e_ecb_3d.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h -e_ecb_3d.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h -e_ecb_3d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h -e_ecb_3d.o: ../../include/openssl/stack.h ../cryptlib.h -e_ecb_bf.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h -e_ecb_bf.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h -e_ecb_bf.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h -e_ecb_bf.o: ../../include/openssl/crypto.h ../../include/openssl/des.h -e_ecb_bf.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h -e_ecb_bf.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h -e_ecb_bf.o: ../../include/openssl/err.h ../../include/openssl/evp.h -e_ecb_bf.o: ../../include/openssl/idea.h ../../include/openssl/md2.h -e_ecb_bf.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h -e_ecb_bf.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h -e_ecb_bf.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h -e_ecb_bf.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h -e_ecb_bf.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h -e_ecb_bf.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h -e_ecb_bf.o: ../../include/openssl/stack.h ../cryptlib.h -e_ecb_c.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h -e_ecb_c.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h -e_ecb_c.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h -e_ecb_c.o: ../../include/openssl/crypto.h ../../include/openssl/des.h -e_ecb_c.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h -e_ecb_c.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h -e_ecb_c.o: ../../include/openssl/err.h ../../include/openssl/evp.h -e_ecb_c.o: ../../include/openssl/idea.h ../../include/openssl/md2.h -e_ecb_c.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h -e_ecb_c.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h -e_ecb_c.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h -e_ecb_c.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h -e_ecb_c.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h -e_ecb_c.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h -e_ecb_c.o: ../../include/openssl/stack.h ../cryptlib.h -e_ecb_d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h -e_ecb_d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h -e_ecb_d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h -e_ecb_d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h -e_ecb_d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h -e_ecb_d.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h -e_ecb_d.o: ../../include/openssl/err.h ../../include/openssl/evp.h -e_ecb_d.o: ../../include/openssl/idea.h ../../include/openssl/md2.h -e_ecb_d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h -e_ecb_d.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h -e_ecb_d.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h -e_ecb_d.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h -e_ecb_d.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h -e_ecb_d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h -e_ecb_d.o: ../../include/openssl/stack.h ../cryptlib.h -e_ecb_i.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h -e_ecb_i.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h -e_ecb_i.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h -e_ecb_i.o: ../../include/openssl/crypto.h ../../include/openssl/des.h -e_ecb_i.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h -e_ecb_i.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h -e_ecb_i.o: ../../include/openssl/err.h ../../include/openssl/evp.h -e_ecb_i.o: ../../include/openssl/idea.h ../../include/openssl/md2.h -e_ecb_i.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h -e_ecb_i.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h -e_ecb_i.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h -e_ecb_i.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h -e_ecb_i.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h -e_ecb_i.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h -e_ecb_i.o: ../../include/openssl/stack.h ../cryptlib.h -e_ecb_r2.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h -e_ecb_r2.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h -e_ecb_r2.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h -e_ecb_r2.o: ../../include/openssl/crypto.h ../../include/openssl/des.h -e_ecb_r2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h -e_ecb_r2.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h -e_ecb_r2.o: ../../include/openssl/err.h ../../include/openssl/evp.h -e_ecb_r2.o: ../../include/openssl/idea.h ../../include/openssl/md2.h -e_ecb_r2.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h -e_ecb_r2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h -e_ecb_r2.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h -e_ecb_r2.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h -e_ecb_r2.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h -e_ecb_r2.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h -e_ecb_r2.o: ../../include/openssl/stack.h ../cryptlib.h -e_ecb_r5.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h -e_ecb_r5.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h -e_ecb_r5.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h -e_ecb_r5.o: ../../include/openssl/crypto.h ../../include/openssl/des.h -e_ecb_r5.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h -e_ecb_r5.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h -e_ecb_r5.o: ../../include/openssl/err.h ../../include/openssl/evp.h -e_ecb_r5.o: ../../include/openssl/idea.h ../../include/openssl/md2.h -e_ecb_r5.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h -e_ecb_r5.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h -e_ecb_r5.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h -e_ecb_r5.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h -e_ecb_r5.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h -e_ecb_r5.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h -e_ecb_r5.o: ../../include/openssl/stack.h ../cryptlib.h +e_bf.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h +e_bf.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h +e_bf.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h +e_bf.o: ../../include/openssl/crypto.h ../../include/openssl/des.h +e_bf.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h +e_bf.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h +e_bf.o: ../../include/openssl/err.h ../../include/openssl/evp.h +e_bf.o: ../../include/openssl/idea.h ../../include/openssl/md2.h +e_bf.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h +e_bf.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h +e_bf.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h +e_bf.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h +e_bf.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h +e_bf.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h +e_bf.o: ../../include/openssl/stack.h ../cryptlib.h evp_locl.h +e_cast.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h +e_cast.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h +e_cast.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h +e_cast.o: ../../include/openssl/crypto.h ../../include/openssl/des.h +e_cast.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h +e_cast.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h +e_cast.o: ../../include/openssl/err.h ../../include/openssl/evp.h +e_cast.o: ../../include/openssl/idea.h ../../include/openssl/md2.h +e_cast.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h +e_cast.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h +e_cast.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h +e_cast.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h +e_cast.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h +e_cast.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h +e_cast.o: ../../include/openssl/stack.h ../cryptlib.h evp_locl.h +e_des.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h +e_des.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h +e_des.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h +e_des.o: ../../include/openssl/crypto.h ../../include/openssl/des.h +e_des.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h +e_des.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h +e_des.o: ../../include/openssl/err.h ../../include/openssl/evp.h +e_des.o: ../../include/openssl/idea.h ../../include/openssl/md2.h +e_des.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h +e_des.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h +e_des.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h +e_des.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h +e_des.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h +e_des.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h +e_des.o: ../../include/openssl/stack.h ../cryptlib.h evp_locl.h +e_des3.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h +e_des3.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h +e_des3.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h +e_des3.o: ../../include/openssl/crypto.h ../../include/openssl/des.h +e_des3.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h +e_des3.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h +e_des3.o: ../../include/openssl/err.h ../../include/openssl/evp.h +e_des3.o: ../../include/openssl/idea.h ../../include/openssl/md2.h +e_des3.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h +e_des3.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h +e_des3.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h +e_des3.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h +e_des3.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h +e_des3.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h +e_des3.o: ../../include/openssl/stack.h ../cryptlib.h evp_locl.h +e_idea.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h +e_idea.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h +e_idea.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h +e_idea.o: ../../include/openssl/crypto.h ../../include/openssl/des.h +e_idea.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h +e_idea.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h +e_idea.o: ../../include/openssl/err.h ../../include/openssl/evp.h +e_idea.o: ../../include/openssl/idea.h ../../include/openssl/md2.h +e_idea.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h +e_idea.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h +e_idea.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h +e_idea.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h +e_idea.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h +e_idea.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h +e_idea.o: ../../include/openssl/stack.h ../cryptlib.h evp_locl.h e_null.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h e_null.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h e_null.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h @@ -562,111 +312,21 @@ e_null.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h e_null.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h e_null.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h e_null.o: ../../include/openssl/stack.h ../cryptlib.h -e_ofb_3d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h -e_ofb_3d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h -e_ofb_3d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h -e_ofb_3d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h -e_ofb_3d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h -e_ofb_3d.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h -e_ofb_3d.o: ../../include/openssl/err.h ../../include/openssl/evp.h -e_ofb_3d.o: ../../include/openssl/idea.h ../../include/openssl/md2.h -e_ofb_3d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h -e_ofb_3d.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h -e_ofb_3d.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h -e_ofb_3d.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h -e_ofb_3d.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h -e_ofb_3d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h -e_ofb_3d.o: ../../include/openssl/stack.h ../cryptlib.h -e_ofb_bf.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h -e_ofb_bf.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h -e_ofb_bf.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h -e_ofb_bf.o: ../../include/openssl/crypto.h ../../include/openssl/des.h -e_ofb_bf.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h -e_ofb_bf.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h -e_ofb_bf.o: ../../include/openssl/err.h ../../include/openssl/evp.h -e_ofb_bf.o: ../../include/openssl/idea.h ../../include/openssl/md2.h -e_ofb_bf.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h -e_ofb_bf.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h -e_ofb_bf.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h -e_ofb_bf.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h -e_ofb_bf.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h -e_ofb_bf.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h -e_ofb_bf.o: ../../include/openssl/stack.h ../cryptlib.h -e_ofb_c.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h -e_ofb_c.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h -e_ofb_c.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h -e_ofb_c.o: ../../include/openssl/crypto.h ../../include/openssl/des.h -e_ofb_c.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h -e_ofb_c.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h -e_ofb_c.o: ../../include/openssl/err.h ../../include/openssl/evp.h -e_ofb_c.o: ../../include/openssl/idea.h ../../include/openssl/md2.h -e_ofb_c.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h -e_ofb_c.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h -e_ofb_c.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h -e_ofb_c.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h -e_ofb_c.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h -e_ofb_c.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h -e_ofb_c.o: ../../include/openssl/stack.h ../cryptlib.h -e_ofb_d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h -e_ofb_d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h -e_ofb_d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h -e_ofb_d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h -e_ofb_d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h -e_ofb_d.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h -e_ofb_d.o: ../../include/openssl/err.h ../../include/openssl/evp.h -e_ofb_d.o: ../../include/openssl/idea.h ../../include/openssl/md2.h -e_ofb_d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h -e_ofb_d.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h -e_ofb_d.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h -e_ofb_d.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h -e_ofb_d.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h -e_ofb_d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h -e_ofb_d.o: ../../include/openssl/stack.h ../cryptlib.h -e_ofb_i.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h -e_ofb_i.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h -e_ofb_i.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h -e_ofb_i.o: ../../include/openssl/crypto.h ../../include/openssl/des.h -e_ofb_i.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h -e_ofb_i.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h -e_ofb_i.o: ../../include/openssl/err.h ../../include/openssl/evp.h -e_ofb_i.o: ../../include/openssl/idea.h ../../include/openssl/md2.h -e_ofb_i.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h -e_ofb_i.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h -e_ofb_i.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h -e_ofb_i.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h -e_ofb_i.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h -e_ofb_i.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h -e_ofb_i.o: ../../include/openssl/stack.h ../cryptlib.h -e_ofb_r2.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h -e_ofb_r2.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h -e_ofb_r2.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h -e_ofb_r2.o: ../../include/openssl/crypto.h ../../include/openssl/des.h -e_ofb_r2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h -e_ofb_r2.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h -e_ofb_r2.o: ../../include/openssl/err.h ../../include/openssl/evp.h -e_ofb_r2.o: ../../include/openssl/idea.h ../../include/openssl/md2.h -e_ofb_r2.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h -e_ofb_r2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h -e_ofb_r2.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h -e_ofb_r2.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h -e_ofb_r2.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h -e_ofb_r2.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h -e_ofb_r2.o: ../../include/openssl/stack.h ../cryptlib.h -e_ofb_r5.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h -e_ofb_r5.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h -e_ofb_r5.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h -e_ofb_r5.o: ../../include/openssl/crypto.h ../../include/openssl/des.h -e_ofb_r5.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h -e_ofb_r5.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h -e_ofb_r5.o: ../../include/openssl/err.h ../../include/openssl/evp.h -e_ofb_r5.o: ../../include/openssl/idea.h ../../include/openssl/md2.h -e_ofb_r5.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h -e_ofb_r5.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h -e_ofb_r5.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h -e_ofb_r5.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h -e_ofb_r5.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h -e_ofb_r5.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h -e_ofb_r5.o: ../../include/openssl/stack.h ../cryptlib.h +e_rc2.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h +e_rc2.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h +e_rc2.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h +e_rc2.o: ../../include/openssl/crypto.h ../../include/openssl/des.h +e_rc2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h +e_rc2.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h +e_rc2.o: ../../include/openssl/err.h ../../include/openssl/evp.h +e_rc2.o: ../../include/openssl/idea.h ../../include/openssl/md2.h +e_rc2.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h +e_rc2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h +e_rc2.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h +e_rc2.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h +e_rc2.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h +e_rc2.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h +e_rc2.o: ../../include/openssl/stack.h ../cryptlib.h evp_locl.h e_rc4.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h e_rc4.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h e_rc4.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h @@ -682,6 +342,21 @@ e_rc4.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h e_rc4.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h e_rc4.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h e_rc4.o: ../../include/openssl/stack.h ../cryptlib.h +e_rc5.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h +e_rc5.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h +e_rc5.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h +e_rc5.o: ../../include/openssl/crypto.h ../../include/openssl/des.h +e_rc5.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h +e_rc5.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h +e_rc5.o: ../../include/openssl/err.h ../../include/openssl/evp.h +e_rc5.o: ../../include/openssl/idea.h ../../include/openssl/md2.h +e_rc5.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h +e_rc5.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h +e_rc5.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h +e_rc5.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h +e_rc5.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h +e_rc5.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h +e_rc5.o: ../../include/openssl/stack.h ../cryptlib.h evp_locl.h e_xcbc_d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h e_xcbc_d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h e_xcbc_d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h @@ -726,7 +401,7 @@ evp_enc.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h evp_enc.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h evp_enc.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h evp_enc.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h -evp_enc.o: ../../include/openssl/stack.h ../cryptlib.h +evp_enc.o: ../../include/openssl/stack.h ../cryptlib.h evp_locl.h evp_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h evp_err.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h evp_err.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h diff --git a/crypto/evp/e_cbc_3d.c b/crypto/evp/e_cbc_3d.c deleted file mode 100644 index 5d16b865c5..0000000000 --- a/crypto/evp/e_cbc_3d.c +++ /dev/null @@ -1,151 +0,0 @@ -/* crypto/evp/e_cbc_3d.c */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef NO_DES -#include <stdio.h> -#include "cryptlib.h" -#include <openssl/evp.h> -#include <openssl/objects.h> - -static void des_cbc_ede_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv,int enc); -static void des_cbc_ede3_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv,int enc); -static void des_cbc_ede_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl); -static EVP_CIPHER d_cbc_ede_cipher2= - { - NID_des_ede_cbc, - 8,16,8, - des_cbc_ede_init_key, - des_cbc_ede_cipher, - NULL, - sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ - sizeof((((EVP_CIPHER_CTX *)NULL)->c.des_ede)), - EVP_CIPHER_set_asn1_iv, - EVP_CIPHER_get_asn1_iv, - }; - -static EVP_CIPHER d_cbc_ede_cipher3= - { - NID_des_ede3_cbc, - 8,24,8, - des_cbc_ede3_init_key, - des_cbc_ede_cipher, - NULL, - sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ - sizeof((((EVP_CIPHER_CTX *)NULL)->c.des_ede)), - EVP_CIPHER_set_asn1_iv, - EVP_CIPHER_get_asn1_iv, - }; - -EVP_CIPHER *EVP_des_ede_cbc(void) - { - return(&d_cbc_ede_cipher2); - } - -EVP_CIPHER *EVP_des_ede3_cbc(void) - { - return(&d_cbc_ede_cipher3); - } - -static void des_cbc_ede_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv, int enc) - { - des_cblock *deskey = (des_cblock *)key; - - if (iv != NULL) - memcpy(&(ctx->oiv[0]),iv,8); - memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); - - if (deskey != NULL) - { - des_set_key_unchecked(&deskey[0],ctx->c.des_ede.ks1); - des_set_key_unchecked(&deskey[1],ctx->c.des_ede.ks2); - memcpy( (char *)ctx->c.des_ede.ks3, - (char *)ctx->c.des_ede.ks1, - sizeof(ctx->c.des_ede.ks1)); - } - } - -static void des_cbc_ede3_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv, int enc) - { - des_cblock *deskey = (des_cblock *)key; - - if (iv != NULL) - memcpy(&(ctx->oiv[0]),iv,8); - memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); - - if (deskey != NULL) - { - des_set_key_unchecked(&deskey[0],ctx->c.des_ede.ks1); - des_set_key_unchecked(&deskey[1],ctx->c.des_ede.ks2); - des_set_key_unchecked(&deskey[2],ctx->c.des_ede.ks3); - } - } - -static void des_cbc_ede_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl) - { - des_ede3_cbc_encrypt(in,out,inl, ctx->c.des_ede.ks1, - ctx->c.des_ede.ks2,ctx->c.des_ede.ks3, - (des_cblock *) &(ctx->iv[0]), - ctx->encrypt); - } -#endif diff --git a/crypto/evp/e_cbc_bf.c b/crypto/evp/e_cbc_bf.c deleted file mode 100644 index 9bcba3c516..0000000000 --- a/crypto/evp/e_cbc_bf.c +++ /dev/null @@ -1,106 +0,0 @@ -/* crypto/evp/e_cbc_bf.c */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef NO_BF -#include <stdio.h> -#include "cryptlib.h" -#include <openssl/evp.h> -#include <openssl/objects.h> - -static void bf_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv,int enc); -static void bf_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl); -static EVP_CIPHER bfish_cbc_cipher= - { - NID_bf_cbc, - 8,EVP_BLOWFISH_KEY_SIZE,8, - bf_cbc_init_key, - bf_cbc_cipher, - NULL, - sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ - sizeof((((EVP_CIPHER_CTX *)NULL)->c.bf_ks)), - EVP_CIPHER_set_asn1_iv, - EVP_CIPHER_get_asn1_iv, - }; - -EVP_CIPHER *EVP_bf_cbc(void) - { - return(&bfish_cbc_cipher); - } - -static void bf_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv, int enc) - { - if (iv != NULL) - memcpy(&(ctx->oiv[0]),iv,8); - memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); - if (key != NULL) - BF_set_key(&(ctx->c.bf_ks),EVP_BLOWFISH_KEY_SIZE,key); - } - -static void bf_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl) - { - BF_cbc_encrypt( - in,out,(long)inl, - &(ctx->c.bf_ks),&(ctx->iv[0]), - ctx->encrypt); - } - -#endif diff --git a/crypto/evp/e_cbc_c.c b/crypto/evp/e_cbc_c.c deleted file mode 100644 index 6845b0b44c..0000000000 --- a/crypto/evp/e_cbc_c.c +++ /dev/null @@ -1,107 +0,0 @@ -/* crypto/evp/e_cbc_c.c */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef NO_CAST - -#include <stdio.h> -#include "cryptlib.h" -#include <openssl/evp.h> -#include <openssl/objects.h> - -static void cast_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv,int enc); -static void cast_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl); -static EVP_CIPHER cast5_cbc_cipher= - { - NID_cast5_cbc, - 8,EVP_CAST5_KEY_SIZE,8, - cast_cbc_init_key, - cast_cbc_cipher, - NULL, - sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ - sizeof((((EVP_CIPHER_CTX *)NULL)->c.cast_ks)), - EVP_CIPHER_set_asn1_iv, - EVP_CIPHER_get_asn1_iv, - }; - -EVP_CIPHER *EVP_cast5_cbc(void) - { - return(&cast5_cbc_cipher); - } - -static void cast_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv, int enc) - { - if (iv != NULL) - memcpy(&(ctx->oiv[0]),iv,8); - memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); - if (key != NULL) - CAST_set_key(&(ctx->c.cast_ks),EVP_CAST5_KEY_SIZE,key); - } - -static void cast_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl) - { - CAST_cbc_encrypt( - in,out,(long)inl, - &(ctx->c.cast_ks),&(ctx->iv[0]), - ctx->encrypt); - } - -#endif diff --git a/crypto/evp/e_cbc_d.c b/crypto/evp/e_cbc_d.c deleted file mode 100644 index 5b4e5b8601..0000000000 --- a/crypto/evp/e_cbc_d.c +++ /dev/null @@ -1,106 +0,0 @@ -/* crypto/evp/e_cbc_d.c */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef NO_DES -#include <stdio.h> -#include "cryptlib.h" -#include <openssl/evp.h> -#include <openssl/objects.h> - -static void des_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv,int enc); -static void des_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl); -static EVP_CIPHER d_cbc_cipher= - { - NID_des_cbc, - 8,8,8, - des_cbc_init_key, - des_cbc_cipher, - NULL, - sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ - sizeof((((EVP_CIPHER_CTX *)NULL)->c.des_ks)), - EVP_CIPHER_set_asn1_iv, - EVP_CIPHER_get_asn1_iv, - }; - -EVP_CIPHER *EVP_des_cbc(void) - { - return(&d_cbc_cipher); - } - -static void des_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv, int enc) - { - des_cblock *deskey = (des_cblock *)key; - - if (iv != NULL) - memcpy(&(ctx->oiv[0]),iv,8); - memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); - if (deskey != NULL) - des_set_key_unchecked(deskey,ctx->c.des_ks); - } - -static void des_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl) - { - des_ncbc_encrypt(in,out,inl,ctx->c.des_ks, - (des_cblock *)&(ctx->iv[0]), - ctx->encrypt); - } -#endif diff --git a/crypto/evp/e_cbc_i.c b/crypto/evp/e_cbc_i.c deleted file mode 100644 index 34b44aa21f..0000000000 --- a/crypto/evp/e_cbc_i.c +++ /dev/null @@ -1,119 +0,0 @@ -/* crypto/evp/e_cbc_i.c */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef NO_IDEA - -#include <stdio.h> -#include "cryptlib.h" -#include <openssl/evp.h> -#include <openssl/objects.h> - -static void idea_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv,int enc); -static void idea_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl); -static EVP_CIPHER i_cbc_cipher= - { - NID_idea_cbc, - 8,16,8, - idea_cbc_init_key, - idea_cbc_cipher, - NULL, - sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ - sizeof((((EVP_CIPHER_CTX *)NULL)->c.idea_ks)), - EVP_CIPHER_set_asn1_iv, - EVP_CIPHER_get_asn1_iv, - }; - -EVP_CIPHER *EVP_idea_cbc(void) - { - return(&i_cbc_cipher); - } - -static void idea_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv, int enc) - { - if (iv != NULL) - memcpy(&(ctx->oiv[0]),iv,8); - memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); - if (key != NULL) - { - if (enc) - idea_set_encrypt_key(key,&(ctx->c.idea_ks)); - else - { - IDEA_KEY_SCHEDULE tmp; - - idea_set_encrypt_key(key,&tmp); - idea_set_decrypt_key(&tmp,&(ctx->c.idea_ks)); - memset((unsigned char *)&tmp,0, - sizeof(IDEA_KEY_SCHEDULE)); - } - } - } - -static void idea_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl) - { - idea_cbc_encrypt( - in,out,(long)inl, - &(ctx->c.idea_ks),&(ctx->iv[0]), - ctx->encrypt); - } - -#endif diff --git a/crypto/evp/e_cbc_r2.c b/crypto/evp/e_cbc_r2.c deleted file mode 100644 index 9dfada4ea6..0000000000 --- a/crypto/evp/e_cbc_r2.c +++ /dev/null @@ -1,216 +0,0 @@ -/* crypto/evp/e_cbc_r2.c */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef NO_RC2 - -#include <stdio.h> -#include "cryptlib.h" -#include <openssl/evp.h> -#include <openssl/objects.h> - -static void rc2_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv,int enc); -static void rc2_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl); -static int rc2_meth_to_magic(const EVP_CIPHER *e); -static EVP_CIPHER *rc2_magic_to_meth(int i); -static int rc2_set_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type); -static int rc2_get_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type); - -#define RC2_40_MAGIC 0xa0 -#define RC2_64_MAGIC 0x78 -#define RC2_128_MAGIC 0x3a - -static EVP_CIPHER r2_cbc_cipher= - { - NID_rc2_cbc, - 8,EVP_RC2_KEY_SIZE,8, - rc2_cbc_init_key, - rc2_cbc_cipher, - NULL, - sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ - sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc2_ks)), - rc2_set_asn1_type_and_iv, - rc2_get_asn1_type_and_iv, - }; - -static EVP_CIPHER r2_64_cbc_cipher= - { - NID_rc2_64_cbc, - 8,8 /* 64 bit */,8, - rc2_cbc_init_key, - rc2_cbc_cipher, - NULL, - sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ - sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc2_ks)), - rc2_set_asn1_type_and_iv, - rc2_get_asn1_type_and_iv, - }; - -static EVP_CIPHER r2_40_cbc_cipher= - { - NID_rc2_40_cbc, - 8,5 /* 40 bit */,8, - rc2_cbc_init_key, - rc2_cbc_cipher, - NULL, - sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ - sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc2_ks)), - rc2_set_asn1_type_and_iv, - rc2_get_asn1_type_and_iv, - }; - -EVP_CIPHER *EVP_rc2_cbc(void) - { - return(&r2_cbc_cipher); - } - -EVP_CIPHER *EVP_rc2_64_cbc(void) - { - return(&r2_64_cbc_cipher); - } - -EVP_CIPHER *EVP_rc2_40_cbc(void) - { - return(&r2_40_cbc_cipher); - } - -static void rc2_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv, int enc) - { - if (iv != NULL) - memcpy(&(ctx->oiv[0]),iv,8); - memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); - if (key != NULL) - RC2_set_key(&(ctx->c.rc2_ks),EVP_CIPHER_CTX_key_length(ctx), - key,EVP_CIPHER_CTX_key_length(ctx)*8); - } - -static void rc2_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl) - { - RC2_cbc_encrypt( - in,out,(long)inl, - &(ctx->c.rc2_ks),&(ctx->iv[0]), - ctx->encrypt); - } - -static int rc2_meth_to_magic(const EVP_CIPHER *e) - { - int i; - - i=EVP_CIPHER_key_length(e); - if (i == 16) return(RC2_128_MAGIC); - else if (i == 8) return(RC2_64_MAGIC); - else if (i == 5) return(RC2_40_MAGIC); - else return(0); - } - -static EVP_CIPHER *rc2_magic_to_meth(int i) - { - if (i == RC2_128_MAGIC) return(EVP_rc2_cbc()); - else if (i == RC2_64_MAGIC) return(EVP_rc2_64_cbc()); - else if (i == RC2_40_MAGIC) return(EVP_rc2_40_cbc()); - else - { - EVPerr(EVP_F_RC2_MAGIC_TO_METH,EVP_R_UNSUPPORTED_KEY_SIZE); - return(NULL); - } - } - -static int rc2_get_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type) - { - long num=0; - int i=0,l; - EVP_CIPHER *e; - - if (type != NULL) - { - l=EVP_CIPHER_CTX_iv_length(c); - i=ASN1_TYPE_get_int_octetstring(type,&num,c->oiv,l); - if (i != l) - return(-1); - else if (i > 0) - memcpy(c->iv,c->oiv,l); - e=rc2_magic_to_meth((int)num); - if (e == NULL) - return(-1); - if (e != EVP_CIPHER_CTX_cipher(c)) - { - EVP_CIPHER_CTX_cipher(c)=e; - rc2_cbc_init_key(c,NULL,NULL,1); - } - } - return(i); - } - -static int rc2_set_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type) - { - long num; - int i=0,j; - - if (type != NULL) - { - num=rc2_meth_to_magic(EVP_CIPHER_CTX_cipher(c)); - j=EVP_CIPHER_CTX_iv_length(c); - i=ASN1_TYPE_set_int_octetstring(type,num,c->oiv,j); - } - return(i); - } - -#endif diff --git a/crypto/evp/e_cbc_r5.c b/crypto/evp/e_cbc_r5.c deleted file mode 100644 index cea3fe333a..0000000000 --- a/crypto/evp/e_cbc_r5.c +++ /dev/null @@ -1,108 +0,0 @@ -/* crypto/evp/e_cbc_r5.c */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef NO_RC5 - -#include <stdio.h> -#include "cryptlib.h" -#include <openssl/evp.h> -#include <openssl/objects.h> - -static void r_32_12_16_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv,int enc); -static void r_32_12_16_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl); -static EVP_CIPHER rc5_32_12_16_cbc_cipher= - { - NID_rc5_cbc, - 8,EVP_RC5_32_12_16_KEY_SIZE,8, - r_32_12_16_cbc_init_key, - r_32_12_16_cbc_cipher, - NULL, - sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ - sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc5_ks)), - NULL, - NULL, - }; - -EVP_CIPHER *EVP_rc5_32_12_16_cbc(void) - { - return(&rc5_32_12_16_cbc_cipher); - } - -static void r_32_12_16_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv, int enc) - { - if (iv != NULL) - memcpy(&(ctx->oiv[0]),iv,8); - memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); - if (key != NULL) - RC5_32_set_key(&(ctx->c.rc5_ks),EVP_RC5_32_12_16_KEY_SIZE, - key,RC5_12_ROUNDS); - } - -static void r_32_12_16_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl) - { - RC5_32_cbc_encrypt( - in,out,(long)inl, - &(ctx->c.rc5_ks),&(ctx->iv[0]), - ctx->encrypt); - } - -#endif diff --git a/crypto/evp/e_cfb_3d.c b/crypto/evp/e_cfb_3d.c deleted file mode 100644 index b364bd4e31..0000000000 --- a/crypto/evp/e_cfb_3d.c +++ /dev/null @@ -1,155 +0,0 @@ -/* crypto/evp/e_cfb_3d.c */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef NO_DES -#include <stdio.h> -#include "cryptlib.h" -#include <openssl/evp.h> -#include <openssl/objects.h> - -static void des_ede_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv,int enc); -static void des_ede3_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv,int enc); -static void des_ede_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl); -static EVP_CIPHER d_ede_cfb_cipher2= - { - NID_des_ede_cfb64, - 1,16,8, - des_ede_cfb_init_key, - des_ede_cfb_cipher, - NULL, - sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ - sizeof((((EVP_CIPHER_CTX *)NULL)->c.des_ede)), - EVP_CIPHER_set_asn1_iv, - EVP_CIPHER_get_asn1_iv, - }; - -static EVP_CIPHER d_ede3_cfb_cipher3= - { - NID_des_ede3_cfb64, - 1,24,8, - des_ede3_cfb_init_key, - des_ede_cfb_cipher, - NULL, - sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ - sizeof((((EVP_CIPHER_CTX *)NULL)->c.des_ede)), - EVP_CIPHER_set_asn1_iv, - EVP_CIPHER_get_asn1_iv, - }; - -EVP_CIPHER *EVP_des_ede_cfb(void) - { - return(&d_ede_cfb_cipher2); - } - -EVP_CIPHER *EVP_des_ede3_cfb(void) - { - return(&d_ede3_cfb_cipher3); - } - -static void des_ede_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv, int enc) - { - des_cblock *deskey = (des_cblock *)key; - - ctx->num=0; - - if (iv != NULL) - memcpy(&(ctx->oiv[0]),iv,8); - memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); - if (deskey != NULL) - { - des_set_key_unchecked(&deskey[0],ctx->c.des_ede.ks1); - des_set_key_unchecked(&deskey[1],ctx->c.des_ede.ks2); - memcpy( (char *)ctx->c.des_ede.ks3, - (char *)ctx->c.des_ede.ks1, - sizeof(ctx->c.des_ede.ks1)); - } - } - -static void des_ede3_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv, int enc) - { - des_cblock *deskey = (des_cblock *)key; - - ctx->num=0; - - if (iv != NULL) - memcpy(&(ctx->oiv[0]),iv,8); - memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); - if (deskey != NULL) - { - des_set_key_unchecked(&deskey[0],ctx->c.des_ede.ks1); - des_set_key_unchecked(&deskey[1],ctx->c.des_ede.ks2); - des_set_key_unchecked(&deskey[2],ctx->c.des_ede.ks3); - } - } - -static void des_ede_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl) - { - des_ede3_cfb64_encrypt(in,out,(long)inl, - ctx->c.des_ede.ks1, - ctx->c.des_ede.ks2, - ctx->c.des_ede.ks3, - (des_cblock*)&(ctx->iv[0]), - &ctx->num,ctx->encrypt); - } -#endif diff --git a/crypto/evp/e_cfb_bf.c b/crypto/evp/e_cfb_bf.c deleted file mode 100644 index 63e1e624ea..0000000000 --- a/crypto/evp/e_cfb_bf.c +++ /dev/null @@ -1,108 +0,0 @@ -/* crypto/evp/e_cfb_bf.c */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef NO_BF -#include <stdio.h> -#include "cryptlib.h" -#include <openssl/evp.h> -#include <openssl/objects.h> - -static void bf_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv,int enc); -static void bf_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl); -static EVP_CIPHER bfish_cfb_cipher= - { - NID_bf_cfb64, - 1,EVP_BLOWFISH_KEY_SIZE,8, - bf_cfb_init_key, - bf_cfb_cipher, - NULL, - sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ - sizeof((((EVP_CIPHER_CTX *)NULL)->c.bf_ks)), - EVP_CIPHER_set_asn1_iv, - EVP_CIPHER_get_asn1_iv, - }; - -EVP_CIPHER *EVP_bf_cfb(void) - { - return(&bfish_cfb_cipher); - } - -static void bf_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv, int enc) - { - ctx->num=0; - - if (iv != NULL) - memcpy(&(ctx->oiv[0]),iv,8); - memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); - if (key != NULL) - BF_set_key(&(ctx->c.bf_ks),EVP_BLOWFISH_KEY_SIZE,key); - } - -static void bf_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl) - { - BF_cfb64_encrypt( - in,out, - (long)inl, &(ctx->c.bf_ks), - &(ctx->iv[0]), - &ctx->num,ctx->encrypt); - } -#endif diff --git a/crypto/evp/e_cfb_c.c b/crypto/evp/e_cfb_c.c deleted file mode 100644 index f04bac034b..0000000000 --- a/crypto/evp/e_cfb_c.c +++ /dev/null @@ -1,109 +0,0 @@ -/* crypto/evp/e_cfb_c.c */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef NO_CAST - -#include <stdio.h> -#include "cryptlib.h" -#include <openssl/evp.h> -#include <openssl/objects.h> - -static void cast_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv,int enc); -static void cast_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl); -static EVP_CIPHER cast5_cfb_cipher= - { - NID_cast5_cfb64, - 1,EVP_CAST5_KEY_SIZE,8, - cast_cfb_init_key, - cast_cfb_cipher, - NULL, - sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ - sizeof((((EVP_CIPHER_CTX *)NULL)->c.cast_ks)), - EVP_CIPHER_set_asn1_iv, - EVP_CIPHER_get_asn1_iv, - }; - -EVP_CIPHER *EVP_cast5_cfb(void) - { - return(&cast5_cfb_cipher); - } - -static void cast_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv, int enc) - { - ctx->num=0; - - if (iv != NULL) - memcpy(&(ctx->oiv[0]),iv,8); - memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); - if (key != NULL) - CAST_set_key(&(ctx->c.cast_ks),EVP_CAST5_KEY_SIZE,key); - } - -static void cast_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl) - { - CAST_cfb64_encrypt( - in,out, - (long)inl, &(ctx->c.cast_ks), - &(ctx->iv[0]), - &ctx->num,ctx->encrypt); - } -#endif diff --git a/crypto/evp/e_cfb_d.c b/crypto/evp/e_cfb_d.c deleted file mode 100644 index 9e1714bd15..0000000000 --- a/crypto/evp/e_cfb_d.c +++ /dev/null @@ -1,110 +0,0 @@ -/* crypto/evp/e_cfb_d.c */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#include <stdio.h> -#include "cryptlib.h" -#include <openssl/evp.h> -#include <openssl/objects.h> - -#ifndef NO_DES -static void des_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv,int enc); -static void des_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl); -static EVP_CIPHER d_cfb_cipher= - { - NID_des_cfb64, - 1,8,8, - des_cfb_init_key, - des_cfb_cipher, - NULL, - sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ - sizeof((((EVP_CIPHER_CTX *)NULL)->c.des_ks)), - EVP_CIPHER_set_asn1_iv, - EVP_CIPHER_get_asn1_iv, - }; - -EVP_CIPHER *EVP_des_cfb(void) - { - return(&d_cfb_cipher); - } - -static void des_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv, int enc) - { - des_cblock *deskey = (des_cblock *)key; - - ctx->num=0; - - if (iv != NULL) - memcpy(&(ctx->oiv[0]),iv,8); - memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); - if (deskey != NULL) - des_set_key_unchecked(deskey,ctx->c.des_ks); - } - -static void des_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl) - { - des_cfb64_encrypt( - in,out, - (long)inl, ctx->c.des_ks, - (des_cblock *)&(ctx->iv[0]), - &ctx->num,ctx->encrypt); - } -#endif diff --git a/crypto/evp/e_cfb_i.c b/crypto/evp/e_cfb_i.c deleted file mode 100644 index 31c76c6dac..0000000000 --- a/crypto/evp/e_cfb_i.c +++ /dev/null @@ -1,109 +0,0 @@ -/* crypto/evp/e_cfb_i.c */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef NO_IDEA - -#include <stdio.h> -#include "cryptlib.h" -#include <openssl/evp.h> -#include <openssl/objects.h> - -static void idea_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv,int enc); -static void idea_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl); -static EVP_CIPHER i_cfb_cipher= - { - NID_idea_cfb64, - 1,IDEA_KEY_LENGTH,IDEA_BLOCK, - idea_cfb_init_key, - idea_cfb_cipher, - NULL, - sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ - sizeof((((EVP_CIPHER_CTX *)NULL)->c.idea_ks)), - EVP_CIPHER_set_asn1_iv, - EVP_CIPHER_get_asn1_iv, - }; - -EVP_CIPHER *EVP_idea_cfb(void) - { - return(&i_cfb_cipher); - } - -static void idea_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv, int enc) - { - ctx->num=0; - - if (iv != NULL) - memcpy(&(ctx->oiv[0]),iv,8); - memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); - if (key != NULL) - idea_set_encrypt_key(key,&(ctx->c.idea_ks)); - } - -static void idea_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl) - { - idea_cfb64_encrypt( - in,out,(long)inl, - &(ctx->c.idea_ks),&(ctx->iv[0]), - &ctx->num,ctx->encrypt); - } - -#endif diff --git a/crypto/evp/e_cfb_r2.c b/crypto/evp/e_cfb_r2.c deleted file mode 100644 index 32dd77eb7c..0000000000 --- a/crypto/evp/e_cfb_r2.c +++ /dev/null @@ -1,110 +0,0 @@ -/* crypto/evp/e_cfb_r2.c */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef NO_RC2 - -#include <stdio.h> -#include "cryptlib.h" -#include <openssl/evp.h> -#include <openssl/objects.h> - -static void rc2_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv,int enc); -static void rc2_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl); -static EVP_CIPHER r2_cfb_cipher= - { - NID_rc2_cfb64, - 1,EVP_RC2_KEY_SIZE,8, - rc2_cfb_init_key, - rc2_cfb_cipher, - NULL, - sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ - sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc2_ks)), - EVP_CIPHER_set_asn1_iv, - EVP_CIPHER_get_asn1_iv, - }; - -EVP_CIPHER *EVP_rc2_cfb(void) - { - return(&r2_cfb_cipher); - } - -static void rc2_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv, int enc) - { - ctx->num=0; - - if (iv != NULL) - memcpy(&(ctx->oiv[0]),iv,8); - memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); - if (key != NULL) - RC2_set_key(&(ctx->c.rc2_ks),EVP_CIPHER_CTX_key_length(ctx), - key,EVP_CIPHER_CTX_key_length(ctx)*8); - } - -static void rc2_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl) - { - RC2_cfb64_encrypt( - in,out, - (long)inl, &(ctx->c.rc2_ks), - &(ctx->iv[0]), - &ctx->num,ctx->encrypt); - } -#endif diff --git a/crypto/evp/e_cfb_r5.c b/crypto/evp/e_cfb_r5.c deleted file mode 100644 index 8e79728946..0000000000 --- a/crypto/evp/e_cfb_r5.c +++ /dev/null @@ -1,110 +0,0 @@ -/* crypto/evp/e_cfb_r5.c */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef NO_RC5 - -#include <stdio.h> -#include "cryptlib.h" -#include <openssl/evp.h> -#include <openssl/objects.h> - -static void rc5_32_12_16_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv,int enc); -static void rc5_32_12_16_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl); -static EVP_CIPHER rc5_cfb_cipher= - { - NID_rc5_cfb64, - 1,EVP_RC5_32_12_16_KEY_SIZE,8, - rc5_32_12_16_cfb_init_key, - rc5_32_12_16_cfb_cipher, - NULL, - sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ - sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc5_ks)), - EVP_CIPHER_set_asn1_iv, - EVP_CIPHER_get_asn1_iv, - }; - -EVP_CIPHER *EVP_rc5_32_12_16_cfb(void) - { - return(&rc5_cfb_cipher); - } - -static void rc5_32_12_16_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv, int enc) - { - ctx->num=0; - - if (iv != NULL) - memcpy(&(ctx->oiv[0]),iv,8); - memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); - if (key != NULL) - RC5_32_set_key(&(ctx->c.rc5_ks),EVP_RC5_32_12_16_KEY_SIZE,key, - RC5_12_ROUNDS); - } - -static void rc5_32_12_16_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl) - { - RC5_32_cfb64_encrypt( - in,out, - (long)inl, &(ctx->c.rc5_ks), - &(ctx->iv[0]), - &ctx->num,ctx->encrypt); - } -#endif diff --git a/crypto/evp/e_ecb_3d.c b/crypto/evp/e_ecb_3d.c deleted file mode 100644 index 806e971d36..0000000000 --- a/crypto/evp/e_ecb_3d.c +++ /dev/null @@ -1,158 +0,0 @@ -/* crypto/evp/e_ecb_3d.c */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef NO_DES -#include <stdio.h> -#include "cryptlib.h" -#include <openssl/evp.h> -#include <openssl/objects.h> - -static void des_ede_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv,int enc); -static void des_ede3_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv,int enc); -static void des_ede_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl); -static EVP_CIPHER d_ede_cipher2= - { - NID_des_ede, - 8,16,0, - des_ede_init_key, - des_ede_cipher, - NULL, - sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ - sizeof((((EVP_CIPHER_CTX *)NULL)->c.des_ede)), - NULL, - NULL, - }; - -static EVP_CIPHER d_ede3_cipher3= - { - NID_des_ede3, - 8,24,0, - des_ede3_init_key, - des_ede_cipher, - NULL, - sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ - sizeof((((EVP_CIPHER_CTX *)NULL)->c.des_ede)), - NULL, - }; - -EVP_CIPHER *EVP_des_ede(void) - { - return(&d_ede_cipher2); - } - -EVP_CIPHER *EVP_des_ede3(void) - { - return(&d_ede3_cipher3); - } - -static void des_ede_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv, int enc) - { - des_cblock *deskey = (des_cblock *)key; - - if (deskey != NULL) - { - des_set_key_unchecked(&deskey[0],ctx->c.des_ede.ks1); - des_set_key_unchecked(&deskey[1],ctx->c.des_ede.ks2); - memcpy( (char *)ctx->c.des_ede.ks3, - (char *)ctx->c.des_ede.ks1, - sizeof(ctx->c.des_ede.ks1)); - } - } - -static void des_ede3_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv, int enc) - { - des_cblock *deskey = (des_cblock *)key; - - if (deskey != NULL) - { - des_set_key_unchecked(&deskey[0],ctx->c.des_ede.ks1); - des_set_key_unchecked(&deskey[1],ctx->c.des_ede.ks2); - des_set_key_unchecked(&deskey[2],ctx->c.des_ede.ks3); - } - } - -static void des_ede_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl) - { - unsigned int i; - des_cblock *output /* = (des_cblock *)out */; - des_cblock *input /* = (des_cblock *)in */; - - if (inl < 8) return; - inl-=8; - for (i=0; i<=inl; i+=8) - { - output = (des_cblock *)(out + i); - input = (des_cblock *)(in + i); - - des_ecb3_encrypt(input,output, - ctx->c.des_ede.ks1, - ctx->c.des_ede.ks2, - ctx->c.des_ede.ks3, - ctx->encrypt); - - /* output++; */ - /* input++; */ - } - } -#endif diff --git a/crypto/evp/e_ecb_bf.c b/crypto/evp/e_ecb_bf.c deleted file mode 100644 index 334736d253..0000000000 --- a/crypto/evp/e_ecb_bf.c +++ /dev/null @@ -1,109 +0,0 @@ -/* crypto/evp/e_ecb_bf.c */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef NO_BF -#include <stdio.h> -#include "cryptlib.h" -#include <openssl/evp.h> -#include <openssl/objects.h> - -static void bf_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv,int enc); -static void bf_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl); -static EVP_CIPHER bfish_ecb_cipher= - { - NID_bf_ecb, - 8,EVP_BLOWFISH_KEY_SIZE,0, - bf_ecb_init_key, - bf_ecb_cipher, - NULL, - sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ - sizeof((((EVP_CIPHER_CTX *)NULL)->c.bf_ks)), - NULL, - NULL, - }; - -EVP_CIPHER *EVP_bf_ecb(void) - { - return(&bfish_ecb_cipher); - } - -static void bf_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv, int enc) - { - if (key != NULL) - BF_set_key(&(ctx->c.bf_ks),EVP_BLOWFISH_KEY_SIZE,key); - } - -static void bf_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl) - { - unsigned int i; - - if (inl < 8) return; - inl-=8; - for (i=0; i<=inl; i+=8) - { - BF_ecb_encrypt( - &(in[i]),&(out[i]), - &(ctx->c.bf_ks),ctx->encrypt); - } - } - -#endif diff --git a/crypto/evp/e_ecb_c.c b/crypto/evp/e_ecb_c.c deleted file mode 100644 index ad14e203cb..0000000000 --- a/crypto/evp/e_ecb_c.c +++ /dev/null @@ -1,110 +0,0 @@ -/* crypto/evp/e_ecb_c.c */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef NO_CAST - -#include <stdio.h> -#include "cryptlib.h" -#include <openssl/evp.h> -#include <openssl/objects.h> - -static void cast_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv,int enc); -static void cast_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl); -static EVP_CIPHER cast5_ecb_cipher= - { - NID_cast5_ecb, - 8,EVP_CAST5_KEY_SIZE,0, - cast_ecb_init_key, - cast_ecb_cipher, - NULL, - sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ - sizeof((((EVP_CIPHER_CTX *)NULL)->c.cast_ks)), - NULL, - NULL, - }; - -EVP_CIPHER *EVP_cast5_ecb(void) - { - return(&cast5_ecb_cipher); - } - -static void cast_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv, int enc) - { - if (key != NULL) - CAST_set_key(&(ctx->c.cast_ks),EVP_CAST5_KEY_SIZE,key); - } - -static void cast_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl) - { - unsigned int i; - - if (inl < 8) return; - inl-=8; - for (i=0; i<=inl; i+=8) - { - CAST_ecb_encrypt( - &(in[i]),&(out[i]), - &(ctx->c.cast_ks),ctx->encrypt); - } - } - -#endif diff --git a/crypto/evp/e_ecb_d.c b/crypto/evp/e_ecb_d.c deleted file mode 100644 index c11bef55ef..0000000000 --- a/crypto/evp/e_ecb_d.c +++ /dev/null @@ -1,118 +0,0 @@ -/* crypto/evp/e_ecb_d.c */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef NO_DES -#include <stdio.h> -#include "cryptlib.h" -#include <openssl/evp.h> -#include <openssl/objects.h> - -static void des_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv,int enc); -static void des_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl); -static EVP_CIPHER d_ecb_cipher= - { - NID_des_ecb, - 8,8,0, - des_ecb_init_key, - des_ecb_cipher, - NULL, - sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ - sizeof((((EVP_CIPHER_CTX *)NULL)->c.des_ks)), - NULL, - NULL, - }; - -EVP_CIPHER *EVP_des_ecb(void) - { - return(&d_ecb_cipher); - } - -static void des_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv, int enc) - { - des_cblock *deskey = (des_cblock *)key; - - if (deskey != NULL) - des_set_key_unchecked(deskey,ctx->c.des_ks); - } - -static void des_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl) - { - unsigned int i; - des_cblock *output /* = (des_cblock *)out */; - des_cblock *input /* = (des_cblock *)in */; - - if (inl < 8) return; - inl-=8; - for (i=0; i<=inl; i+=8) - { - /* Either this ... */ - output = (des_cblock *)(out + i); - input = (des_cblock *)(in + i); - - des_ecb_encrypt(input,output,ctx->c.des_ks,ctx->encrypt); - - /* ... or this. */ - /* output++; */ - /* input++; */ - } - } -#endif diff --git a/crypto/evp/e_ecb_i.c b/crypto/evp/e_ecb_i.c deleted file mode 100644 index 50a3da1bba..0000000000 --- a/crypto/evp/e_ecb_i.c +++ /dev/null @@ -1,121 +0,0 @@ -/* crypto/evp/e_ecb_i.c */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef NO_IDEA - -#include <stdio.h> -#include "cryptlib.h" -#include <openssl/evp.h> -#include <openssl/objects.h> - -static void idea_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv,int enc); -static void idea_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl); -static EVP_CIPHER i_ecb_cipher= - { - NID_idea_ecb, - 8,16,0, - idea_ecb_init_key, - idea_ecb_cipher, - NULL, - sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ - sizeof((((EVP_CIPHER_CTX *)NULL)->c.idea_ks)), - NULL, - NULL, - }; - -EVP_CIPHER *EVP_idea_ecb(void) - { - return(&i_ecb_cipher); - } - -static void idea_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv, int enc) - { - if (key != NULL) - { - if (enc) - idea_set_encrypt_key(key,&(ctx->c.idea_ks)); - else - { - IDEA_KEY_SCHEDULE tmp; - - idea_set_encrypt_key(key,&tmp); - idea_set_decrypt_key(&tmp, &(ctx->c.idea_ks)); - memset((unsigned char *)&tmp,0, - sizeof(IDEA_KEY_SCHEDULE)); - } - } - } - -static void idea_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl) - { - unsigned int i; - - if (inl < 8) return; - inl-=8; - for (i=0; i<=inl; i+=8) - { - idea_ecb_encrypt( - &(in[i]),&(out[i]),&(ctx->c.idea_ks)); - } - } - -#endif diff --git a/crypto/evp/e_ecb_r2.c b/crypto/evp/e_ecb_r2.c deleted file mode 100644 index 3c2330130d..0000000000 --- a/crypto/evp/e_ecb_r2.c +++ /dev/null @@ -1,111 +0,0 @@ -/* crypto/evp/e_ecb_r2.c */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef NO_RC2 - -#include <stdio.h> -#include "cryptlib.h" -#include <openssl/evp.h> -#include <openssl/objects.h> - -static void rc2_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv,int enc); -static void rc2_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl); -static EVP_CIPHER r2_ecb_cipher= - { - NID_rc2_ecb, - 8,EVP_RC2_KEY_SIZE,0, - rc2_ecb_init_key, - rc2_ecb_cipher, - NULL, - sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ - sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc2_ks)), - NULL, - NULL, - }; - -EVP_CIPHER *EVP_rc2_ecb(void) - { - return(&r2_ecb_cipher); - } - -static void rc2_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv, int enc) - { - if (key != NULL) - RC2_set_key(&(ctx->c.rc2_ks),EVP_CIPHER_CTX_key_length(ctx), - key,EVP_CIPHER_CTX_key_length(ctx)*8); - } - -static void rc2_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl) - { - unsigned int i; - - if (inl < 8) return; - inl-=8; - for (i=0; i<=inl; i+=8) - { - RC2_ecb_encrypt( - &(in[i]),&(out[i]), - &(ctx->c.rc2_ks),ctx->encrypt); - } - } - -#endif diff --git a/crypto/evp/e_ecb_r5.c b/crypto/evp/e_ecb_r5.c deleted file mode 100644 index ef43ce34bf..0000000000 --- a/crypto/evp/e_ecb_r5.c +++ /dev/null @@ -1,111 +0,0 @@ -/* crypto/evp/e_ecb_r5.c */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef NO_RC5 - -#include <stdio.h> -#include "cryptlib.h" -#include <openssl/evp.h> -#include <openssl/objects.h> - -static void rc5_32_12_16_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv,int enc); -static void rc5_32_12_16_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl); -static EVP_CIPHER rc5_ecb_cipher= - { - NID_rc5_ecb, - 8,EVP_RC5_32_12_16_KEY_SIZE,0, - rc5_32_12_16_ecb_init_key, - rc5_32_12_16_ecb_cipher, - NULL, - sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ - sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc5_ks)), - NULL, - NULL, - }; - -EVP_CIPHER *EVP_rc5_32_12_16_ecb(void) - { - return(&rc5_ecb_cipher); - } - -static void rc5_32_12_16_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv, int enc) - { - if (key != NULL) - RC5_32_set_key(&(ctx->c.rc5_ks),EVP_RC5_32_12_16_KEY_SIZE,key, - RC5_12_ROUNDS); - } - -static void rc5_32_12_16_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl) - { - unsigned int i; - - if (inl < 8) return; - inl-=8; - for (i=0; i<=inl; i+=8) - { - RC5_32_ecb_encrypt( - &(in[i]),&(out[i]), - &(ctx->c.rc5_ks),ctx->encrypt); - } - } - -#endif diff --git a/crypto/evp/e_null.c b/crypto/evp/e_null.c index 0a62c10aa9..d507337df6 100644 --- a/crypto/evp/e_null.c +++ b/crypto/evp/e_null.c @@ -61,20 +61,22 @@ #include <openssl/evp.h> #include <openssl/objects.h> -static void null_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, +static int null_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, unsigned char *iv,int enc); -static void null_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, +static int null_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, unsigned char *in, unsigned int inl); static EVP_CIPHER n_cipher= { NID_undef, 1,0,0, + 0, null_init_key, null_cipher, NULL, 0, NULL, NULL, + NULL }; EVP_CIPHER *EVP_enc_null(void) @@ -82,16 +84,18 @@ EVP_CIPHER *EVP_enc_null(void) return(&n_cipher); } -static void null_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, +static int null_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, unsigned char *iv, int enc) { memset(&(ctx->c),0,sizeof(ctx->c)); + return 1; } -static void null_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, +static int null_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, unsigned char *in, unsigned int inl) { if (in != out) memcpy((char *)out,(char *)in,(int)inl); + return 1; } diff --git a/crypto/evp/e_ofb_3d.c b/crypto/evp/e_ofb_3d.c deleted file mode 100644 index d1a33e2ecd..0000000000 --- a/crypto/evp/e_ofb_3d.c +++ /dev/null @@ -1,152 +0,0 @@ -/* crypto/evp/e_ofb_3d.c */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef NO_DES -#include <stdio.h> -#include "cryptlib.h" -#include <openssl/evp.h> -#include <openssl/objects.h> - -static void des_ede_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv,int enc); -static void des_ede3_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv,int enc); -static void des_ede_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl); -static EVP_CIPHER d_ede_ofb_cipher2= - { - NID_des_ede_ofb64, - 1,16,8, - des_ede_ofb_init_key, - des_ede_ofb_cipher, - NULL, - sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ - sizeof((((EVP_CIPHER_CTX *)NULL)->c.des_ede)), - EVP_CIPHER_set_asn1_iv, - EVP_CIPHER_get_asn1_iv, - }; - -static EVP_CIPHER d_ede3_ofb_cipher3= - { - NID_des_ede3_ofb64, - 1,24,8, - des_ede3_ofb_init_key, - des_ede_ofb_cipher, - NULL, - sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ - sizeof((((EVP_CIPHER_CTX *)NULL)->c.des_ede)), - EVP_CIPHER_set_asn1_iv, - EVP_CIPHER_get_asn1_iv, - }; - -EVP_CIPHER *EVP_des_ede_ofb(void) - { - return(&d_ede_ofb_cipher2); - } - -EVP_CIPHER *EVP_des_ede3_ofb(void) - { - return(&d_ede3_ofb_cipher3); - } - -static void des_ede_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv, int enc) - { - des_cblock *deskey = (des_cblock *)key; - - ctx->num=0; - - if (iv != NULL) - memcpy(&(ctx->oiv[0]),iv,8); - memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); - if (deskey != NULL) - { - des_set_key_unchecked(&deskey[0],ctx->c.des_ede.ks1); - des_set_key_unchecked(&deskey[1],ctx->c.des_ede.ks2); - memcpy( (char *)ctx->c.des_ede.ks3, - (char *)ctx->c.des_ede.ks1, - sizeof(ctx->c.des_ede.ks1)); - } - } - -static void des_ede3_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv, int enc) - { - des_cblock *deskey = (des_cblock *)key; - - ctx->num=0; - - if (iv != NULL) - memcpy(&(ctx->oiv[0]),iv,8); - memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); - if (deskey != NULL) - { - des_set_key_unchecked(&deskey[0],ctx->c.des_ede.ks1); - des_set_key_unchecked(&deskey[1],ctx->c.des_ede.ks2); - des_set_key_unchecked(&deskey[2],ctx->c.des_ede.ks3); - } - } - -static void des_ede_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl) - { - des_ede3_ofb64_encrypt(in,out,inl,ctx->c.des_ede.ks1, - ctx->c.des_ede.ks2, ctx->c.des_ede.ks3, - (des_cblock *)&(ctx->iv[0]),&ctx->num); - } -#endif diff --git a/crypto/evp/e_ofb_bf.c b/crypto/evp/e_ofb_bf.c deleted file mode 100644 index c82154b549..0000000000 --- a/crypto/evp/e_ofb_bf.c +++ /dev/null @@ -1,109 +0,0 @@ -/* crypto/evp/e_ofb_bf.c */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef NO_BF -#include <stdio.h> -#include "cryptlib.h" -#include <openssl/evp.h> -#include <openssl/objects.h> - -static void bf_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv,int enc); -static void bf_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl); -static EVP_CIPHER bfish_ofb_cipher= - { - NID_bf_ofb64, - 1,EVP_BLOWFISH_KEY_SIZE,8, - bf_ofb_init_key, - bf_ofb_cipher, - NULL, - sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ - sizeof((((EVP_CIPHER_CTX *)NULL)->c.bf_ks)), - EVP_CIPHER_set_asn1_iv, - EVP_CIPHER_get_asn1_iv, - }; - -EVP_CIPHER *EVP_bf_ofb(void) - { - return(&bfish_ofb_cipher); - } - -static void bf_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv, int enc) - { - ctx->num=0; - - if (iv != NULL) - memcpy(&(ctx->oiv[0]),iv,8); - memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); - if (key != NULL) - BF_set_key(&(ctx->c.bf_ks),EVP_BLOWFISH_KEY_SIZE,key); - } - -static void bf_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl) - { - BF_ofb64_encrypt( - in,out, - (long)inl, &(ctx->c.bf_ks), - &(ctx->iv[0]), - &ctx->num); - } - -#endif diff --git a/crypto/evp/e_ofb_c.c b/crypto/evp/e_ofb_c.c deleted file mode 100644 index 971043de4c..0000000000 --- a/crypto/evp/e_ofb_c.c +++ /dev/null @@ -1,110 +0,0 @@ -/* crypto/evp/e_ofb_c.c */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef NO_CAST - -#include <stdio.h> -#include "cryptlib.h" -#include <openssl/evp.h> -#include <openssl/objects.h> - -static void cast_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv,int enc); -static void cast_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl); -static EVP_CIPHER cast5_ofb_cipher= - { - NID_cast5_ofb64, - 1,EVP_CAST5_KEY_SIZE,8, - cast_ofb_init_key, - cast_ofb_cipher, - NULL, - sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ - sizeof((((EVP_CIPHER_CTX *)NULL)->c.cast_ks)), - EVP_CIPHER_set_asn1_iv, - EVP_CIPHER_get_asn1_iv, - }; - -EVP_CIPHER *EVP_cast5_ofb(void) - { - return(&cast5_ofb_cipher); - } - -static void cast_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv, int enc) - { - ctx->num=0; - - if (iv != NULL) - memcpy(&(ctx->oiv[0]),iv,8); - memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); - if (key != NULL) - CAST_set_key(&(ctx->c.cast_ks),EVP_CAST5_KEY_SIZE,key); - } - -static void cast_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl) - { - CAST_ofb64_encrypt( - in,out, - (long)inl, &(ctx->c.cast_ks), - &(ctx->iv[0]), - &ctx->num); - } - -#endif diff --git a/crypto/evp/e_ofb_d.c b/crypto/evp/e_ofb_d.c deleted file mode 100644 index d51ce230f4..0000000000 --- a/crypto/evp/e_ofb_d.c +++ /dev/null @@ -1,107 +0,0 @@ -/* crypto/evp/e_ofb_d.c */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef NO_DES -#include <stdio.h> -#include "cryptlib.h" -#include <openssl/evp.h> -#include <openssl/objects.h> - -static void des_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv,int enc); -static void des_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl); -static EVP_CIPHER d_ofb_cipher= - { - NID_des_ofb64, - 1,8,8, - des_ofb_init_key, - des_ofb_cipher, - NULL, - sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ - sizeof((((EVP_CIPHER_CTX *)NULL)->c.des_ks)), - EVP_CIPHER_set_asn1_iv, - EVP_CIPHER_get_asn1_iv, - }; - -EVP_CIPHER *EVP_des_ofb(void) - { - return(&d_ofb_cipher); - } - -static void des_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv, int enc) - { - des_cblock *deskey = (des_cblock *)key; - - ctx->num=0; - - if (iv != NULL) - memcpy(&(ctx->oiv[0]),iv,8); - memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); - if (deskey != NULL) - des_set_key_unchecked(deskey,ctx->c.des_ks); - } - -static void des_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl) - { - des_ofb64_encrypt(in,out,inl,ctx->c.des_ks, - (des_cblock *)&(ctx->iv[0]),&ctx->num); - } -#endif diff --git a/crypto/evp/e_ofb_i.c b/crypto/evp/e_ofb_i.c deleted file mode 100644 index 389206ef36..0000000000 --- a/crypto/evp/e_ofb_i.c +++ /dev/null @@ -1,109 +0,0 @@ -/* crypto/evp/e_ofb_i.c */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef NO_IDEA - -#include <stdio.h> -#include "cryptlib.h" -#include <openssl/evp.h> -#include <openssl/objects.h> - -static void idea_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv,int enc); -static void idea_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl); -static EVP_CIPHER i_ofb_cipher= - { - NID_idea_ofb64, - 1,IDEA_KEY_LENGTH,IDEA_BLOCK, - idea_ofb_init_key, - idea_ofb_cipher, - NULL, - sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ - sizeof((((EVP_CIPHER_CTX *)NULL)->c.idea_ks)), - EVP_CIPHER_set_asn1_iv, - EVP_CIPHER_get_asn1_iv, - }; - -EVP_CIPHER *EVP_idea_ofb(void) - { - return(&i_ofb_cipher); - } - -static void idea_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv, int enc) - { - ctx->num=0; - - if (iv != NULL) - memcpy(&(ctx->oiv[0]),iv,8); - memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); - if (key != NULL) - idea_set_encrypt_key(key,&(ctx->c.idea_ks)); - } - -static void idea_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl) - { - idea_ofb64_encrypt( - in,out,(long)inl, - &(ctx->c.idea_ks),&(ctx->iv[0]), - &ctx->num); - } - -#endif diff --git a/crypto/evp/e_ofb_r2.c b/crypto/evp/e_ofb_r2.c deleted file mode 100644 index 60ae3d4507..0000000000 --- a/crypto/evp/e_ofb_r2.c +++ /dev/null @@ -1,111 +0,0 @@ -/* crypto/evp/e_ofb_r2.c */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef NO_RC2 - -#include <stdio.h> -#include "cryptlib.h" -#include <openssl/evp.h> -#include <openssl/objects.h> - -static void rc2_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv,int enc); -static void rc2_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl); -static EVP_CIPHER r2_ofb_cipher= - { - NID_rc2_ofb64, - 1,EVP_RC2_KEY_SIZE,8, - rc2_ofb_init_key, - rc2_ofb_cipher, - NULL, - sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ - sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc2_ks)), - EVP_CIPHER_set_asn1_iv, - EVP_CIPHER_get_asn1_iv, - }; - -EVP_CIPHER *EVP_rc2_ofb(void) - { - return(&r2_ofb_cipher); - } - -static void rc2_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv, int enc) - { - ctx->num=0; - - if (iv != NULL) - memcpy(&(ctx->oiv[0]),iv,8); - memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); - if (key != NULL) - RC2_set_key(&(ctx->c.rc2_ks),EVP_CIPHER_CTX_key_length(ctx), - key,EVP_CIPHER_CTX_key_length(ctx)*8); - } - -static void rc2_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl) - { - RC2_ofb64_encrypt( - in,out, - (long)inl, &(ctx->c.rc2_ks), - &(ctx->iv[0]), - &ctx->num); - } - -#endif diff --git a/crypto/evp/e_ofb_r5.c b/crypto/evp/e_ofb_r5.c deleted file mode 100644 index 30136824eb..0000000000 --- a/crypto/evp/e_ofb_r5.c +++ /dev/null @@ -1,111 +0,0 @@ -/* crypto/evp/e_ofb_r5.c */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef NO_RC5 - -#include <stdio.h> -#include "cryptlib.h" -#include <openssl/evp.h> -#include <openssl/objects.h> - -static void rc5_32_12_16_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv,int enc); -static void rc5_32_12_16_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl); -static EVP_CIPHER rc5_ofb_cipher= - { - NID_rc5_ofb64, - 1,EVP_RC5_32_12_16_KEY_SIZE,8, - rc5_32_12_16_ofb_init_key, - rc5_32_12_16_ofb_cipher, - NULL, - sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ - sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc5_ks)), - EVP_CIPHER_set_asn1_iv, - EVP_CIPHER_get_asn1_iv, - }; - -EVP_CIPHER *EVP_rc5_32_12_16_ofb(void) - { - return(&rc5_ofb_cipher); - } - -static void rc5_32_12_16_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, - unsigned char *iv, int enc) - { - ctx->num=0; - - if (iv != NULL) - memcpy(&(ctx->oiv[0]),iv,8); - memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); - if (key != NULL) - RC5_32_set_key(&(ctx->c.rc5_ks),EVP_RC5_32_12_16_KEY_SIZE,key, - RC5_12_ROUNDS); - } - -static void rc5_32_12_16_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - unsigned char *in, unsigned int inl) - { - RC5_32_ofb64_encrypt( - in,out, - (long)inl, &(ctx->c.rc5_ks), - &(ctx->iv[0]), - &ctx->num); - } - -#endif diff --git a/crypto/evp/e_rc4.c b/crypto/evp/e_rc4.c index c7e58a75cc..42839aef6b 100644 --- a/crypto/evp/e_rc4.c +++ b/crypto/evp/e_rc4.c @@ -63,14 +63,15 @@ #include <openssl/evp.h> #include <openssl/objects.h> -static void rc4_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, +static int rc4_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, unsigned char *iv,int enc); -static void rc4_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, +static int rc4_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, unsigned char *in, unsigned int inl); static EVP_CIPHER r4_cipher= { NID_rc4, 1,EVP_RC4_KEY_SIZE,0, + EVP_CIPH_VARIABLE_LENGTH, rc4_init_key, rc4_cipher, NULL, @@ -78,14 +79,22 @@ static EVP_CIPHER r4_cipher= sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc4)), NULL, NULL, + NULL }; static EVP_CIPHER r4_40_cipher= { NID_rc4_40, 1,5 /* 40 bit */,0, + EVP_CIPH_VARIABLE_LENGTH, rc4_init_key, rc4_cipher, + NULL, + sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ + sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc4)), + NULL, + NULL, + NULL }; EVP_CIPHER *EVP_rc4(void) @@ -98,18 +107,19 @@ EVP_CIPHER *EVP_rc4_40(void) return(&r4_40_cipher); } -static void rc4_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, +static int rc4_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, unsigned char *iv, int enc) { - if (key != NULL) - memcpy(&(ctx->c.rc4.key[0]),key,EVP_CIPHER_CTX_key_length(ctx)); + memcpy(&(ctx->c.rc4.key[0]),key,EVP_CIPHER_CTX_key_length(ctx)); RC4_set_key(&(ctx->c.rc4.ks),EVP_CIPHER_CTX_key_length(ctx), ctx->c.rc4.key); + return 1; } -static void rc4_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, +static int rc4_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, unsigned char *in, unsigned int inl) { RC4(&(ctx->c.rc4.ks),inl,in,out); + return 1; } #endif diff --git a/crypto/evp/e_xcbc_d.c b/crypto/evp/e_xcbc_d.c index 7568fad4ff..e5dcdebe16 100644 --- a/crypto/evp/e_xcbc_d.c +++ b/crypto/evp/e_xcbc_d.c @@ -62,14 +62,15 @@ #include <openssl/evp.h> #include <openssl/objects.h> -static void desx_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, +static int desx_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, unsigned char *iv,int enc); -static void desx_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, +static int desx_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, unsigned char *in, unsigned int inl); static EVP_CIPHER d_xcbc_cipher= { NID_desx_cbc, 8,24,8, + EVP_CIPH_CBC_MODE, desx_cbc_init_key, desx_cbc_cipher, NULL, @@ -77,6 +78,7 @@ static EVP_CIPHER d_xcbc_cipher= sizeof((((EVP_CIPHER_CTX *)NULL)->c.desx_cbc)), EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, + NULL }; EVP_CIPHER *EVP_desx_cbc(void) @@ -84,23 +86,19 @@ EVP_CIPHER *EVP_desx_cbc(void) return(&d_xcbc_cipher); } -static void desx_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, +static int desx_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, unsigned char *iv, int enc) { des_cblock *deskey = (des_cblock *)key; - if (iv != NULL) - memcpy(&(ctx->oiv[0]),iv,8); - memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); - if (deskey != NULL) - { - des_set_key_unchecked(deskey,ctx->c.desx_cbc.ks); - memcpy(&(ctx->c.desx_cbc.inw[0]),&(key[8]),8); - memcpy(&(ctx->c.desx_cbc.outw[0]),&(key[16]),8); - } + des_set_key_unchecked(deskey,ctx->c.desx_cbc.ks); + memcpy(&(ctx->c.desx_cbc.inw[0]),&(key[8]),8); + memcpy(&(ctx->c.desx_cbc.outw[0]),&(key[16]),8); + + return 1; } -static void desx_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, +static int desx_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, unsigned char *in, unsigned int inl) { des_xcbc_encrypt(in,out,inl,ctx->c.desx_cbc.ks, @@ -108,5 +106,6 @@ static void desx_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, &ctx->c.desx_cbc.inw, &ctx->c.desx_cbc.outw, ctx->encrypt); + return 1; } #endif diff --git a/crypto/evp/evp.h b/crypto/evp/evp.h index c0f982afb1..abb1490b81 100644 --- a/crypto/evp/evp.h +++ b/crypto/evp/evp.h @@ -318,21 +318,55 @@ typedef struct env_md_ctx_st } md; } EVP_MD_CTX; -typedef struct evp_cipher_st +typedef struct evp_cipher_st EVP_CIPHER; +typedef struct evp_cipher_ctx_st EVP_CIPHER_CTX; + +struct evp_cipher_st { int nid; int block_size; - int key_len; + int key_len; /* Default value for variable length ciphers */ int iv_len; - void (*init)(); /* init for encryption */ - void (*do_cipher)(); /* encrypt data */ - void (*cleanup)(); /* used by cipher method */ + unsigned long flags; /* Various flags */ + int (*init)(EVP_CIPHER_CTX *, unsigned char *, unsigned char *, int); /* init key */ + int (*do_cipher)(EVP_CIPHER_CTX *, unsigned char *, unsigned char *, unsigned int);/* encrypt/decrypt data */ + int (*cleanup)(EVP_CIPHER_CTX *); /* cleanup ctx */ int ctx_size; /* how big the ctx needs to be */ - /* int set_asn1_parameters(EVP_CIPHER_CTX,ASN1_TYPE *); */ - int (*set_asn1_parameters)(); /* Populate a ASN1_TYPE with parameters */ - /* int get_asn1_parameters(EVP_CIPHER_CTX,ASN1_TYPE *); */ - int (*get_asn1_parameters)(); /* Get parameters from a ASN1_TYPE */ - } EVP_CIPHER; + int (*set_asn1_parameters)(EVP_CIPHER_CTX *, ASN1_TYPE *); /* Populate a ASN1_TYPE with parameters */ + int (*get_asn1_parameters)(EVP_CIPHER_CTX *, ASN1_TYPE *); /* Get parameters from a ASN1_TYPE */ + int (*ctrl)(EVP_CIPHER_CTX *, int type, int arg, void *ptr); /* Miscellaneous operations */ + void *app_data; /* Application data */ + }; + +/* Values for cipher flags */ + +/* Modes for ciphers */ + +#define EVP_CIPH_STREAM_CIPHER 0x0 +#define EVP_CIPH_ECB_MODE 0x1 +#define EVP_CIPH_CBC_MODE 0x2 +#define EVP_CIPH_CFB_MODE 0x3 +#define EVP_CIPH_OFB_MODE 0x4 +#define EVP_CIPH_MODE 0x7 +/* Set if variable length cipher */ +#define EVP_CIPH_VARIABLE_LENGTH 0x8 +/* Set if the iv handling should be done by the cipher itself */ +#define EVP_CIPH_CUSTOM_IV 0x10 +/* Set if the cipher's init() function should be called if key is NULL */ +#define EVP_CIPH_ALWAYS_CALL_INIT 0x20 +/* Call ctrl() to init cipher parameters */ +#define EVP_CIPH_CTRL_INIT 0x40 +/* Don't use standard key length function */ +#define EVP_CIPH_CUSTOM_KEY_LENGTH 0x80 + +/* ctrl() values */ + +#define EVP_CTRL_INIT 0x0 +#define EVP_CTRL_SET_KEY_LENGTH 0x1 +#define EVP_CTRL_GET_RC2_KEY_BITS 0x2 +#define EVP_CTRL_SET_RC2_KEY_BITS 0x3 +#define EVP_CTRL_GET_RC5_ROUNDS 0x4 +#define EVP_CTRL_SET_RC5_ROUNDS 0x5 typedef struct evp_cipher_info_st { @@ -340,7 +374,7 @@ typedef struct evp_cipher_info_st unsigned char iv[EVP_MAX_IV_LENGTH]; } EVP_CIPHER_INFO; -typedef struct evp_cipher_ctx_st +struct evp_cipher_ctx_st { const EVP_CIPHER *cipher; int encrypt; /* encrypt or decrypt */ @@ -351,7 +385,8 @@ typedef struct evp_cipher_ctx_st unsigned char buf[EVP_MAX_IV_LENGTH]; /* saved partial block */ int num; /* used by cfb/ofb mode */ - char *app_data; /* application stuff */ + void *app_data; /* application stuff */ + int key_len; /* May change for variable length cipher */ union { #ifndef NO_RC4 struct @@ -379,10 +414,16 @@ typedef struct evp_cipher_ctx_st IDEA_KEY_SCHEDULE idea_ks;/* key schedule */ #endif #ifndef NO_RC2 - RC2_KEY rc2_ks;/* key schedule */ + struct { + int key_bits; /* effective key bits */ + RC2_KEY ks;/* key schedule */ + } rc2; #endif #ifndef NO_RC5 - RC5_32_KEY rc5_ks;/* key schedule */ + struct { + int rounds; /* number of rounds */ + RC5_32_KEY ks;/* key schedule */ + } rc5; #endif #ifndef NO_BF BF_KEY bf_ks;/* key schedule */ @@ -391,7 +432,7 @@ typedef struct evp_cipher_ctx_st CAST_KEY cast_ks;/* key schedule */ #endif } c; - } EVP_CIPHER_CTX; + }; typedef struct evp_Encode_Ctx_st { @@ -438,15 +479,19 @@ typedef int (EVP_PBE_KEYGEN)(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, #define EVP_CIPHER_block_size(e) ((e)->block_size) #define EVP_CIPHER_key_length(e) ((e)->key_len) #define EVP_CIPHER_iv_length(e) ((e)->iv_len) +#define EVP_CIPHER_flags(e) ((e)->flags) +#define EVP_CIPHER_mode(e) ((e)->flags) & EVP_CIPH_MODE) #define EVP_CIPHER_CTX_cipher(e) ((e)->cipher) #define EVP_CIPHER_CTX_nid(e) ((e)->cipher->nid) #define EVP_CIPHER_CTX_block_size(e) ((e)->cipher->block_size) -#define EVP_CIPHER_CTX_key_length(e) ((e)->cipher->key_len) +#define EVP_CIPHER_CTX_key_length(e) ((e)->key_len) #define EVP_CIPHER_CTX_iv_length(e) ((e)->cipher->iv_len) #define EVP_CIPHER_CTX_get_app_data(e) ((e)->app_data) #define EVP_CIPHER_CTX_set_app_data(e,d) ((e)->app_data=(char *)(d)) #define EVP_CIPHER_CTX_type(c) EVP_CIPHER_type(EVP_CIPHER_CTX_cipher(c)) +#define EVP_CIPHER_CTX_flags(e) ((e)->cipher->flags) +#define EVP_CIPHER_CTX_mode(e) ((e)->cipher->flags & EVP_CIPH_MODE) #define EVP_ENCODE_LENGTH(l) (((l+2)/3*4)+(l/48+1)*2+80) #define EVP_DECODE_LENGTH(l) ((l+3)/4*3+80) @@ -494,21 +539,21 @@ int EVP_BytesToKey(const EVP_CIPHER *type,EVP_MD *md,unsigned char *salt, unsigned char *data, int datal, int count, unsigned char *key,unsigned char *iv); -void EVP_EncryptInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *type, +int EVP_EncryptInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *type, unsigned char *key, unsigned char *iv); -void EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, +int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, unsigned char *in, int inl); -void EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); +int EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); -void EVP_DecryptInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *type, +int EVP_DecryptInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *type, unsigned char *key, unsigned char *iv); -void EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, +int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, unsigned char *in, int inl); int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); -void EVP_CipherInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *type, +int EVP_CipherInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *type, unsigned char *key,unsigned char *iv,int enc); -void EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, +int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, unsigned char *in, int inl); int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); @@ -542,7 +587,8 @@ int EVP_DecodeBlock(unsigned char *t, const unsigned char *f, int n); void ERR_load_EVP_strings(void ); void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *a); -void EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *a); +int EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *a); +int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *x, int keylen); #ifdef HEADER_BIO_H BIO_METHOD *BIO_f_md(void); @@ -691,6 +737,8 @@ void EVP_PBE_cleanup(void); /* Function codes. */ #define EVP_F_D2I_PKEY 100 +#define EVP_F_EVP_CIPHERINIT 123 +#define EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH 122 #define EVP_F_EVP_DECRYPTFINAL 101 #define EVP_F_EVP_MD_CTX_COPY 110 #define EVP_F_EVP_OPENINIT 102 @@ -725,9 +773,11 @@ void EVP_PBE_cleanup(void); #define EVP_R_EXPECTING_A_DH_KEY 128 #define EVP_R_EXPECTING_A_DSA_KEY 129 #define EVP_R_INPUT_NOT_INITIALIZED 111 +#define EVP_R_INVALID_KEY_LENGTH 130 #define EVP_R_IV_TOO_LARGE 102 #define EVP_R_KEYGEN_FAILURE 120 #define EVP_R_MISSING_PARAMETERS 103 +#define EVP_R_NO_CIPHER_SET 131 #define EVP_R_NO_DSA_PARAMETERS 116 #define EVP_R_NO_SIGN_FUNCTION_CONFIGURED 104 #define EVP_R_NO_VERIFY_FUNCTION_CONFIGURED 105 diff --git a/crypto/evp/evp_enc.c b/crypto/evp/evp_enc.c index 5299a65b6a..4bf3a565a7 100644 --- a/crypto/evp/evp_enc.c +++ b/crypto/evp/evp_enc.c @@ -59,6 +59,8 @@ #include <stdio.h> #include "cryptlib.h" #include <openssl/evp.h> +#include <openssl/err.h> +#include "evp_locl.h" const char *EVP_version="EVP" OPENSSL_VERSION_PTEXT; @@ -68,55 +70,78 @@ void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *ctx) /* ctx->cipher=NULL; */ } -void EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *data, +int EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, unsigned char *key, unsigned char *iv, int enc) { - if (enc) - EVP_EncryptInit(ctx,data,key,iv); - else - EVP_DecryptInit(ctx,data,key,iv); + if(enc) enc = 1; + if (cipher) { + ctx->cipher=cipher; + ctx->key_len = cipher->key_len; + } else if(!ctx->cipher) { + EVPerr(EVP_F_EVP_CIPHERINIT, EVP_R_NO_CIPHER_SET); + return 0; + } + if(!(EVP_CIPHER_CTX_flags(ctx) & EVP_CIPH_CUSTOM_IV)) { + switch(EVP_CIPHER_CTX_mode(ctx)) { + + case EVP_CIPH_STREAM_CIPHER: + case EVP_CIPH_ECB_MODE: + break; + + case EVP_CIPH_CFB_MODE: + case EVP_CIPH_OFB_MODE: + + ctx->num = 0; + + case EVP_CIPH_CBC_MODE: + + if(iv) memcpy(ctx->oiv, iv, EVP_CIPHER_CTX_iv_length(ctx)); + memcpy(ctx->iv, ctx->oiv, EVP_CIPHER_CTX_iv_length(ctx)); + break; + + default: + return 0; + break; + } + } + + if(key || (ctx->cipher->flags & EVP_CIPH_ALWAYS_CALL_INIT)) { + if(!ctx->cipher->init(ctx,key,iv,enc)) return 0; + } + ctx->encrypt=enc; + ctx->buf_len=0; + return 1; } -void EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, +int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, unsigned char *in, int inl) { if (ctx->encrypt) - EVP_EncryptUpdate(ctx,out,outl,in,inl); - else EVP_DecryptUpdate(ctx,out,outl,in,inl); + return EVP_EncryptUpdate(ctx,out,outl,in,inl); + else return EVP_DecryptUpdate(ctx,out,outl,in,inl); } int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) { if (ctx->encrypt) - { - EVP_EncryptFinal(ctx,out,outl); - return(1); - } + return EVP_EncryptFinal(ctx,out,outl); else return(EVP_DecryptFinal(ctx,out,outl)); } -void EVP_EncryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, +int EVP_EncryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, unsigned char *key, unsigned char *iv) { - if (cipher != NULL) - ctx->cipher=cipher; - ctx->cipher->init(ctx,key,iv,1); - ctx->encrypt=1; - ctx->buf_len=0; + return EVP_CipherInit(ctx, cipher, key, iv, 1); } -void EVP_DecryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, +int EVP_DecryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, unsigned char *key, unsigned char *iv) { - if (cipher != NULL) - ctx->cipher=cipher; - ctx->cipher->init(ctx,key,iv,0); - ctx->encrypt=0; - ctx->buf_len=0; + return EVP_CipherInit(ctx, cipher, key, iv, 0); } -void EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, +int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, unsigned char *in, int inl) { int i,j,bl; @@ -124,20 +149,20 @@ void EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, i=ctx->buf_len; bl=ctx->cipher->block_size; *outl=0; - if ((inl == 0) && (i != bl)) return; + if ((inl == 0) && (i != bl)) return 1; if (i != 0) { if (i+inl < bl) { memcpy(&(ctx->buf[i]),in,inl); ctx->buf_len+=inl; - return; + return 1; } else { j=bl-i; if (j != 0) memcpy(&(ctx->buf[i]),in,j); - ctx->cipher->do_cipher(ctx,out,ctx->buf,bl); + if(!ctx->cipher->do_cipher(ctx,out,ctx->buf,bl)) return 0; inl-=j; in+=j; out+=bl; @@ -148,16 +173,17 @@ void EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, inl-=i; if (inl > 0) { - ctx->cipher->do_cipher(ctx,out,in,inl); + if(!ctx->cipher->do_cipher(ctx,out,in,inl)) return 0; *outl+=inl; } if (i != 0) memcpy(ctx->buf,&(in[inl]),i); ctx->buf_len=i; + return 1; } -void EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) +int EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) { int i,n,b,bl; @@ -165,24 +191,25 @@ void EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) if (b == 1) { *outl=0; - return; + return 1; } bl=ctx->buf_len; n=b-bl; for (i=bl; i<b; i++) ctx->buf[i]=n; - ctx->cipher->do_cipher(ctx,out,ctx->buf,b); + if(!ctx->cipher->do_cipher(ctx,out,ctx->buf,b)) return 0; *outl=b; + return 1; } -void EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, +int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, unsigned char *in, int inl) { int b,bl,n; int keep_last=0; *outl=0; - if (inl == 0) return; + if (inl == 0) return 1; b=ctx->cipher->block_size; if (b > 1) @@ -197,13 +224,13 @@ void EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, memcpy(&(ctx->buf[bl]),in,inl); ctx->buf_len=b; *outl=0; - return; + return 1; } keep_last=1; inl-=b; /* don't do the last block */ } } - EVP_EncryptUpdate(ctx,out,outl,in,inl); + if(!EVP_EncryptUpdate(ctx,out,outl,in,inl)) return 0; /* if we have 'decrypted' a multiple of block size, make sure * we have a copy of this last block */ @@ -218,6 +245,7 @@ void EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, #endif ctx->buf_len=b; } + return 1; } int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) @@ -234,7 +262,7 @@ int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) EVPerr(EVP_F_EVP_DECRYPTFINAL,EVP_R_WRONG_FINAL_BLOCK_LENGTH); return(0); } - EVP_EncryptUpdate(ctx,ctx->buf,&n,ctx->buf,0); + if(!EVP_EncryptUpdate(ctx,ctx->buf,&n,ctx->buf,0)) return 0; if (n != b) return(0); n=ctx->buf[b-1]; @@ -261,10 +289,24 @@ int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) return(1); } -void EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *c) +int EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *c) { if ((c->cipher != NULL) && (c->cipher->cleanup != NULL)) - c->cipher->cleanup(c); + { + if(!c->cipher->cleanup(c)) return 0; + } memset(c,0,sizeof(EVP_CIPHER_CTX)); + return 1; } +int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *c, int keylen) + { + if(c->key_len == keylen) return 1; + if((keylen > 0) && (c->cipher->flags & EVP_CIPH_VARIABLE_LENGTH)) + { + c->key_len = keylen; + return 1; + } + EVPerr(EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH,EVP_R_INVALID_KEY_LENGTH); + return 0; + } diff --git a/crypto/evp/evp_err.c b/crypto/evp/evp_err.c index fc149cbb1a..d48d9442b2 100644 --- a/crypto/evp/evp_err.c +++ b/crypto/evp/evp_err.c @@ -67,6 +67,8 @@ static ERR_STRING_DATA EVP_str_functs[]= { {ERR_PACK(0,EVP_F_D2I_PKEY,0), "D2I_PKEY"}, +{ERR_PACK(0,EVP_F_EVP_CIPHERINIT,0), "EVP_CipherInit"}, +{ERR_PACK(0,EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH,0), "EVP_CIPHER_CTX_set_key_length"}, {ERR_PACK(0,EVP_F_EVP_DECRYPTFINAL,0), "EVP_DecryptFinal"}, {ERR_PACK(0,EVP_F_EVP_MD_CTX_COPY,0), "EVP_MD_CTX_copy"}, {ERR_PACK(0,EVP_F_EVP_OPENINIT,0), "EVP_OpenInit"}, @@ -104,9 +106,11 @@ static ERR_STRING_DATA EVP_str_reasons[]= {EVP_R_EXPECTING_A_DH_KEY ,"expecting a dh key"}, {EVP_R_EXPECTING_A_DSA_KEY ,"expecting a dsa key"}, {EVP_R_INPUT_NOT_INITIALIZED ,"input not initialized"}, +{EVP_R_INVALID_KEY_LENGTH ,"invalid key length"}, {EVP_R_IV_TOO_LARGE ,"iv too large"}, {EVP_R_KEYGEN_FAILURE ,"keygen failure"}, {EVP_R_MISSING_PARAMETERS ,"missing parameters"}, +{EVP_R_NO_CIPHER_SET ,"no cipher set"}, {EVP_R_NO_DSA_PARAMETERS ,"no dsa parameters"}, {EVP_R_NO_SIGN_FUNCTION_CONFIGURED ,"no sign function configured"}, {EVP_R_NO_VERIFY_FUNCTION_CONFIGURED ,"no verify function configured"}, diff --git a/crypto/pkcs7/pk7_doit.c b/crypto/pkcs7/pk7_doit.c index 4ab24a86f5..d93b27e737 100644 --- a/crypto/pkcs7/pk7_doit.c +++ b/crypto/pkcs7/pk7_doit.c @@ -265,13 +265,6 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert) STACK_OF(PKCS7_RECIP_INFO) *rsk=NULL; X509_ALGOR *xalg=NULL; PKCS7_RECIP_INFO *ri=NULL; -#ifndef NO_RC2 - char is_rc2 = 0; -#endif -/* EVP_PKEY *pkey; */ -#if 0 - X509_STORE_CTX s_ctx; -#endif i=OBJ_obj2nid(p7->type); p7->state=PKCS7_S_HEADER; @@ -312,16 +305,6 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert) goto err; } - if(EVP_CIPHER_nid(evp_cipher) == NID_rc2_cbc) - { -#ifndef NO_RC2 - is_rc2 = 1; -#else - PKCS7err(PKCS7_F_PKCS7_DATADECODE,PKCS7_R_UNSUPPORTED_CIPHER_TYPE); - goto err; -#endif - } - /* We will be checking the signature */ if (md_sk != NULL) { @@ -413,24 +396,18 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert) return(NULL); if (jj != EVP_CIPHER_CTX_key_length(evp_ctx)) { - /* HACK: some S/MIME clients don't use the same key + /* Some S/MIME clients don't use the same key * and effective key length. The key length is * determined by the size of the decrypted RSA key. - * So we hack things to manually set the RC2 key - * because we currently can't do this with the EVP - * interface. */ -#ifndef NO_RC2 - if(is_rc2) RC2_set_key(&(evp_ctx->c.rc2_ks),jj, tmp, - EVP_CIPHER_CTX_key_length(evp_ctx)*8); - else -#endif + if(!EVP_CIPHER_CTX_set_key_length(evp_ctx, jj)) { PKCS7err(PKCS7_F_PKCS7_DATADECODE, PKCS7_R_DECRYPTED_KEY_IS_WRONG_LENGTH); goto err; } - } else EVP_CipherInit(evp_ctx,NULL,tmp,NULL,0); + } + EVP_CipherInit(evp_ctx,NULL,tmp,NULL,0); memset(tmp,0,jj); diff --git a/doc/apps/speed.pod b/doc/apps/speed.pod index fecd9a994d..77560f1c3d 100644 --- a/doc/apps/speed.pod +++ b/doc/apps/speed.pod @@ -39,7 +39,7 @@ This command is used to test the performance of cryptographic algorithms. =head1 OPTIONS -If an option is given, B<speed> test that algorithm, otherwise all of +If any options are given, B<speed> tests those algorithms, otherwise all of the above are tested. =cut diff --git a/doc/crypto/DH_set_method.pod b/doc/crypto/DH_set_method.pod index a8f75bdd9d..b9a61d542b 100644 --- a/doc/crypto/DH_set_method.pod +++ b/doc/crypto/DH_set_method.pod @@ -36,9 +36,6 @@ method. DH_set_method() selects B<meth> for all operations using the structure B<dh>. -DH_get_method() returns a pointer to the method currently selected -for B<dh>. - DH_new_method() allocates and initializes a B<DH> structure so that B<method> will be used for the DH operations. If B<method> is B<NULL>, the default method is used. @@ -75,8 +72,8 @@ the default method is used. =head1 RETURN VALUES -DH_OpenSSL(), DH_get_default_method() and DH_get_method() return -pointers to the respective B<DH_METHOD>s. +DH_OpenSSL() and DH_get_default_method() return pointers to the respective +B<DH_METHOD>s. DH_set_default_method() returns no value. diff --git a/doc/crypto/DSA_set_method.pod b/doc/crypto/DSA_set_method.pod index edec46413d..cabc3c004a 100644 --- a/doc/crypto/DSA_set_method.pod +++ b/doc/crypto/DSA_set_method.pod @@ -3,11 +3,11 @@ =head1 NAME DSA_set_default_method, DSA_get_default_method, DSA_set_method, -DSA_new_method, DSA_OpenSSL - select RSA method +DSA_new_method, DSA_OpenSSL - select DSA method =head1 SYNOPSIS - #include <openssl/DSA.h> + #include <openssl/dsa.h> void DSA_set_default_method(DSA_METHOD *meth); @@ -34,10 +34,7 @@ structures created later. DSA_get_default_method() returns a pointer to the current default method. -DSA_set_method() selects B<meth> for all operations using the structure B<DSA>. - -DSA_get_method() returns a pointer to the method currently selected -for B<DSA>. +DSA_set_method() selects B<meth> for all operations using the structure B<dsa>. DSA_new_method() allocates and initializes a B<DSA> structure so that B<method> will be used for the DSA operations. If B<method> is B<NULL>, @@ -87,8 +84,8 @@ struct =head1 RETURN VALUES -DSA_OpenSSL(), DSA_get_default_method() and DSA_get_method() return -pointers to the respective B<DSA_METHOD>s. +DSA_OpenSSL() and DSA_get_default_method() return pointers to the +respective B<DSA_METHOD>s. DSA_set_default_method() returns no value. diff --git a/ssl/s2_clnt.c b/ssl/s2_clnt.c index 6ff6a51362..47dd09c286 100644 --- a/ssl/s2_clnt.c +++ b/ssl/s2_clnt.c @@ -920,6 +920,7 @@ int ssl2_set_certificate(SSL *s, int type, int len, unsigned char *data) SSLerr(SSL_F_SSL2_SET_CERTIFICATE,SSL_R_CERTIFICATE_VERIFY_FAILED); goto err; } + ERR_clear_error(); /* but we keep s->verify_result */ /* server's cert for this session */ sc=ssl_sess_cert_new(); diff --git a/ssl/s3_clnt.c b/ssl/s3_clnt.c index 0c8f551f73..6a09d6aa8a 100644 --- a/ssl/s3_clnt.c +++ b/ssl/s3_clnt.c @@ -764,6 +764,7 @@ static int ssl3_get_server_certificate(SSL *s) SSLerr(SSL_F_SSL3_GET_SERVER_CERTIFICATE,SSL_R_CERTIFICATE_VERIFY_FAILED); goto f_err; } + ERR_clear_error(); /* but we keep s->verify_result */ sc=ssl_sess_cert_new(); if (sc == NULL) goto err; diff --git a/util/libeay.num b/util/libeay.num index f1001c78db..3f02e626d1 100755 --- a/util/libeay.num +++ b/util/libeay.num @@ -2242,7 +2242,6 @@ DSO_METHOD_win32 2273 ERR_load_DSO_strings 2274 DSO_METHOD_dl 2275 NCONF_load 2276 -CONF_dump 2277 NCONF_load_fp 2278 NCONF_new 2279 NCONF_get_string 2280 |