From 9d1a01be8f84143618fc862e1222eb714949fdc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ulf=20M=C3=B6ller?= Date: Sun, 30 Jan 2000 22:20:28 +0000 Subject: Source code cleanups: Use void * rather than char * in lhash, eliminate some of the -Wcast-qual warnings (debug-ben-strict target) --- ssl/s23_lib.c | 2 +- ssl/s3_srvr.c | 2 +- ssl/ssl.h | 2 +- ssl/ssl_lib.c | 4 ++-- ssl/ssl_sess.c | 13 ++++++------- ssl/t1_lib.c | 2 +- 6 files changed, 12 insertions(+), 13 deletions(-) (limited to 'ssl') diff --git a/ssl/s23_lib.c b/ssl/s23_lib.c index e2c3bb47da..41843dfea2 100644 --- a/ssl/s23_lib.c +++ b/ssl/s23_lib.c @@ -67,7 +67,7 @@ static int ssl23_write(SSL *s, const void *buf, int len); static long ssl23_default_timeout(void ); static int ssl23_put_cipher_by_char(const SSL_CIPHER *c, unsigned char *p); static SSL_CIPHER *ssl23_get_cipher_by_char(const unsigned char *p); -char *SSL23_version_str="SSLv2/3 compatibility" OPENSSL_VERSION_PTEXT; +const char *SSL23_version_str="SSLv2/3 compatibility" OPENSSL_VERSION_PTEXT; static SSL_METHOD SSLv23_data= { TLS1_VERSION, diff --git a/ssl/s3_srvr.c b/ssl/s3_srvr.c index ce68732e60..b500b2315f 100644 --- a/ssl/s3_srvr.c +++ b/ssl/s3_srvr.c @@ -903,7 +903,7 @@ static int ssl3_send_server_key_exchange(SSL *s) unsigned int u; #endif #ifndef NO_DH - DH *dh,*dhp; + DH *dh=NULL,*dhp; #endif EVP_PKEY *pkey; unsigned char *p,*d; diff --git a/ssl/ssl.h b/ssl/ssl.h index 3ada66d9ab..79033329f0 100644 --- a/ssl/ssl.h +++ b/ssl/ssl.h @@ -1042,7 +1042,7 @@ long SSL_ctrl(SSL *ssl,int cmd, long larg, char *parg); long SSL_CTX_ctrl(SSL_CTX *ctx,int cmd, long larg, char *parg); int SSL_get_error(SSL *s,int ret_code); -char * SSL_get_version(SSL *s); +const char *SSL_get_version(SSL *s); /* This sets the 'default' SSL version that SSL_new() will create */ int SSL_CTX_set_ssl_version(SSL_CTX *ctx,SSL_METHOD *meth); diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index 1c58dec45f..4eabc612ef 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -64,7 +64,7 @@ #include #include "ssl_locl.h" -char *SSL_version_str=OPENSSL_VERSION_TEXT; +const char *SSL_version_str=OPENSSL_VERSION_TEXT; static STACK_OF(CRYPTO_EX_DATA_FUNCS) *ssl_meth=NULL; static STACK_OF(CRYPTO_EX_DATA_FUNCS) *ssl_ctx_meth=NULL; @@ -1615,7 +1615,7 @@ SSL_METHOD *ssl_bad_method(int ver) return(NULL); } -char *SSL_get_version(SSL *s) +const char *SSL_get_version(SSL *s) { if (s->version == TLS1_VERSION) return("TLSv1"); diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c index cab50d107f..9e01f72753 100644 --- a/ssl/ssl_sess.c +++ b/ssl/ssl_sess.c @@ -180,8 +180,7 @@ int ssl_get_new_session(SSL *s, int session) RAND_pseudo_bytes(ss->session_id,ss->session_id_length); CRYPTO_r_lock(CRYPTO_LOCK_SSL_CTX); - r=(SSL_SESSION *)lh_retrieve(s->ctx->sessions, - (char *)ss); + r=(SSL_SESSION *)lh_retrieve(s->ctx->sessions, ss); CRYPTO_r_unlock(CRYPTO_LOCK_SSL_CTX); if (r == NULL) break; /* else - woops a session_id match */ @@ -225,7 +224,7 @@ int ssl_get_prev_session(SSL *s, unsigned char *session_id, int len) if (!(s->ctx->session_cache_mode & SSL_SESS_CACHE_NO_INTERNAL_LOOKUP)) { CRYPTO_r_lock(CRYPTO_LOCK_SSL_CTX); - ret=(SSL_SESSION *)lh_retrieve(s->ctx->sessions,(char *)&data); + ret=(SSL_SESSION *)lh_retrieve(s->ctx->sessions,&data); if (ret != NULL) /* don't allow other threads to steal it: */ CRYPTO_add(&ret->references,1,CRYPTO_LOCK_SSL_SESSION); @@ -358,7 +357,7 @@ int SSL_CTX_add_session(SSL_CTX *ctx, SSL_SESSION *c) /* if session c is in already in cache, we take back the increment later */ CRYPTO_w_lock(CRYPTO_LOCK_SSL_CTX); - s=(SSL_SESSION *)lh_insert(ctx->sessions,(char *)c); + s=(SSL_SESSION *)lh_insert(ctx->sessions,c); /* s != NULL iff we already had a session with the given PID. * In this case, s == c should hold (then we did not really modify @@ -424,7 +423,7 @@ static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck) if ((c != NULL) && (c->session_id_length != 0)) { if(lck) CRYPTO_w_lock(CRYPTO_LOCK_SSL_CTX); - r=(SSL_SESSION *)lh_delete(ctx->sessions,(char *)c); + r=(SSL_SESSION *)lh_delete(ctx->sessions,c); if (r != NULL) { ret=1; @@ -585,7 +584,7 @@ static void timeout(SSL_SESSION *s, TIMEOUT_PARAM *p) { /* The reason we don't call SSL_CTX_remove_session() is to * save on locking overhead */ - lh_delete(p->cache,(char *)s); + lh_delete(p->cache,s); SSL_SESSION_list_remove(p->ctx,s); s->not_resumable=1; if (p->ctx->remove_session_cb != NULL) @@ -606,7 +605,7 @@ void SSL_CTX_flush_sessions(SSL_CTX *s, long t) CRYPTO_w_lock(CRYPTO_LOCK_SSL_CTX); i=tp.cache->down_load; tp.cache->down_load=0; - lh_doall_arg(tp.cache,(void (*)())timeout,(char *)&tp); + lh_doall_arg(tp.cache,(void (*)())timeout,&tp); tp.cache->down_load=i; CRYPTO_w_unlock(CRYPTO_LOCK_SSL_CTX); } diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c index b734528da0..531969b421 100644 --- a/ssl/t1_lib.c +++ b/ssl/t1_lib.c @@ -60,7 +60,7 @@ #include #include "ssl_locl.h" -char *tls1_version_str="TLSv1" OPENSSL_VERSION_PTEXT; +const char *tls1_version_str="TLSv1" OPENSSL_VERSION_PTEXT; static long tls1_default_timeout(void); -- cgit v1.2.1