From 5fdf06666c863cd62d53173d1d2011cdec71200c Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Sat, 27 Dec 2003 16:10:30 +0000 Subject: [PATCH] Avoid including cryptlib.h, it's not really needed. Check if IDEA is being built or not. This is part of a large change submitted by Markus Friedl --- ssl/s2_clnt.c | 1 - ssl/s2_enc.c | 1 - ssl/s2_lib.c | 3 ++- ssl/s2_pkt.c | 1 - ssl/s2_srvr.c | 1 - ssl/s3_clnt.c | 1 - ssl/s3_lib.c | 2 ++ ssl/s3_srvr.c | 3 ++- ssl/ssl_asn1.c | 1 - ssl/ssl_ciph.c | 6 ++++++ ssl/ssl_lib.c | 1 - ssl/ssl_sess.c | 1 - ssl/ssltest.c | 3 ++- 13 files changed, 14 insertions(+), 11 deletions(-) diff --git a/ssl/s2_clnt.c b/ssl/s2_clnt.c index 62e83afb35..da88460259 100644 --- a/ssl/s2_clnt.c +++ b/ssl/s2_clnt.c @@ -116,7 +116,6 @@ #include #include #include -#include "cryptlib.h" static SSL_METHOD *ssl2_get_client_method(int ver); static int get_server_finished(SSL *s); diff --git a/ssl/s2_enc.c b/ssl/s2_enc.c index 12e17bf668..18882bf704 100644 --- a/ssl/s2_enc.c +++ b/ssl/s2_enc.c @@ -59,7 +59,6 @@ #include "ssl_locl.h" #ifndef OPENSSL_NO_SSL2 #include -#include "cryptlib.h" int ssl2_enc_init(SSL *s, int client) { diff --git a/ssl/s2_lib.c b/ssl/s2_lib.c index a0edfb8960..4a86ac2dd6 100644 --- a/ssl/s2_lib.c +++ b/ssl/s2_lib.c @@ -63,7 +63,6 @@ #include #include #include -#include "cryptlib.h" static long ssl2_default_timeout(void ); const char *ssl2_version_str="SSLv2" OPENSSL_VERSION_PTEXT; @@ -139,6 +138,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl2_ciphers[]={ SSL_ALL_STRENGTHS, }, /* IDEA_128_CBC_WITH_MD5 */ +#ifndef OPENSSL_NO_IDEA { 1, SSL2_TXT_IDEA_128_CBC_WITH_MD5, @@ -151,6 +151,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl2_ciphers[]={ SSL_ALL_CIPHERS, SSL_ALL_STRENGTHS, }, +#endif /* DES_64_CBC_WITH_MD5 */ { 1, diff --git a/ssl/s2_pkt.c b/ssl/s2_pkt.c index d82f137613..a10929a757 100644 --- a/ssl/s2_pkt.c +++ b/ssl/s2_pkt.c @@ -113,7 +113,6 @@ #ifndef OPENSSL_NO_SSL2 #include #include -#include "cryptlib.h" #define USE_SOCKETS static int read_n(SSL *s,unsigned int n,unsigned int max,unsigned int extend); diff --git a/ssl/s2_srvr.c b/ssl/s2_srvr.c index 62859a2d95..5da2a54af3 100644 --- a/ssl/s2_srvr.c +++ b/ssl/s2_srvr.c @@ -116,7 +116,6 @@ #include #include #include -#include "cryptlib.h" static SSL_METHOD *ssl2_get_server_method(int ver); static int get_client_master_key(SSL *s); diff --git a/ssl/s3_clnt.c b/ssl/s3_clnt.c index 96631db230..cd70bb1fb9 100644 --- a/ssl/s3_clnt.c +++ b/ssl/s3_clnt.c @@ -130,7 +130,6 @@ #include #include #include -#include "cryptlib.h" static SSL_METHOD *ssl3_get_client_method(int ver); static int ssl3_client_hello(SSL *s); diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c index 6c208ccfc1..1ff9e3093b 100644 --- a/ssl/s3_lib.c +++ b/ssl/s3_lib.c @@ -284,6 +284,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[]={ SSL_ALL_STRENGTHS, }, /* Cipher 07 */ +#ifndef OPENSSL_NO_IDEA { 1, SSL3_TXT_RSA_IDEA_128_SHA, @@ -296,6 +297,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[]={ SSL_ALL_CIPHERS, SSL_ALL_STRENGTHS, }, +#endif /* Cipher 08 */ { 1, diff --git a/ssl/s3_srvr.c b/ssl/s3_srvr.c index abb03ca585..c426cd444b 100644 --- a/ssl/s3_srvr.c +++ b/ssl/s3_srvr.c @@ -133,9 +133,10 @@ #include #include #include +#ifndef OPENSSL_NO_KRB5 #include +#endif #include -#include "cryptlib.h" static SSL_METHOD *ssl3_get_server_method(int ver); static int ssl3_get_client_hello(SSL *s); diff --git a/ssl/ssl_asn1.c b/ssl/ssl_asn1.c index f5d3c135bb..9edc447b29 100644 --- a/ssl/ssl_asn1.c +++ b/ssl/ssl_asn1.c @@ -62,7 +62,6 @@ #include #include #include -#include "cryptlib.h" typedef struct ssl_session_asn1_st { diff --git a/ssl/ssl_ciph.c b/ssl/ssl_ciph.c index 4d0a646615..c31927706a 100644 --- a/ssl/ssl_ciph.c +++ b/ssl/ssl_ciph.c @@ -135,7 +135,9 @@ static const SSL_CIPHER cipher_aliases[]={ {0,SSL_TXT_3DES,0,SSL_3DES, 0,0,0,0,SSL_ENC_MASK,0}, {0,SSL_TXT_RC4, 0,SSL_RC4, 0,0,0,0,SSL_ENC_MASK,0}, {0,SSL_TXT_RC2, 0,SSL_RC2, 0,0,0,0,SSL_ENC_MASK,0}, +#ifndef OPENSSL_NO_IDEA {0,SSL_TXT_IDEA,0,SSL_IDEA, 0,0,0,0,SSL_ENC_MASK,0}, +#endif {0,SSL_TXT_eNULL,0,SSL_eNULL,0,0,0,0,SSL_ENC_MASK,0}, {0,SSL_TXT_eFZA,0,SSL_eFZA, 0,0,0,0,SSL_ENC_MASK,0}, {0,SSL_TXT_AES, 0,SSL_AES, 0,0,0,0,SSL_ENC_MASK,0}, @@ -176,8 +178,12 @@ static void load_ciphers(void) EVP_get_cipherbyname(SN_rc4); ssl_cipher_methods[SSL_ENC_RC2_IDX]= EVP_get_cipherbyname(SN_rc2_cbc); +#ifndef OPENSSL_NO_IDEA ssl_cipher_methods[SSL_ENC_IDEA_IDX]= EVP_get_cipherbyname(SN_idea_cbc); +#else + ssl_cipher_methods[SSL_ENC_IDEA_IDX]= NULL; +#endif ssl_cipher_methods[SSL_ENC_AES128_IDX]= EVP_get_cipherbyname(SN_aes_128_cbc); ssl_cipher_methods[SSL_ENC_AES256_IDX]= diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index bf7d7ba561..b7b2e4086a 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -125,7 +125,6 @@ #include #include #include -#include "cryptlib.h" const char *SSL_version_str=OPENSSL_VERSION_TEXT; diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c index 5cf79d274a..85581d43ca 100644 --- a/ssl/ssl_sess.c +++ b/ssl/ssl_sess.c @@ -60,7 +60,6 @@ #include #include #include "ssl_locl.h" -#include "cryptlib.h" static void SSL_SESSION_list_remove(SSL_CTX *ctx, SSL_SESSION *s); static void SSL_SESSION_list_add(SSL_CTX *ctx,SSL_SESSION *s); diff --git a/ssl/ssltest.c b/ssl/ssltest.c index 68eb654572..63641df6c3 100644 --- a/ssl/ssltest.c +++ b/ssl/ssltest.c @@ -124,6 +124,7 @@ #include #include #include +#include #define USE_SOCKETS #include "e_os.h" @@ -1593,7 +1594,7 @@ static int MS_CALLBACK app_verify_callback(X509_STORE_CTX *ctx, void *arg) fprintf(stderr, "In app_verify_callback, allowing cert. "); fprintf(stderr, "Arg is: %s\n", (char *)arg); fprintf(stderr, "Finished printing do we have a context? 0x%x a cert? 0x%x\n", - (unsigned int)ctx, (unsigned int)ctx->cert); + (uintptr_t)ctx, (uintptr_t)ctx->cert); if (ctx->cert) s=X509_NAME_oneline(X509_get_subject_name(ctx->cert),buf,256); if (s != NULL) -- 2.25.1