From: Simon Ruderich Date: Wed, 16 Mar 2011 21:26:37 +0000 (+0100) Subject: src/tlsproxy.h: Prepend global_ to tls_priority_cache and tls_dh_params. X-Git-Tag: 0.2~8 X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=b6debcde1dd7c16eb1102a9fe79d583c40c14b59;hp=1e4972b997cbdd2b287f60d197c33f38d8ec324d;p=tlsproxy%2Ftlsproxy.git src/tlsproxy.h: Prepend global_ to tls_priority_cache and tls_dh_params. --- diff --git a/src/connection.c b/src/connection.c index af14477..880087b 100644 --- a/src/connection.c +++ b/src/connection.c @@ -421,7 +421,7 @@ can't read server certificate ('%s') or key file ('%s'): %s", return -2; } - gnutls_certificate_set_dh_params(*x509_cred, tls_dh_params); + gnutls_certificate_set_dh_params(*x509_cred, global_tls_dh_params); result = gnutls_init(session, GNUTLS_SERVER); if (GNUTLS_E_SUCCESS != result) { @@ -431,7 +431,7 @@ can't read server certificate ('%s') or key file ('%s'): %s", gnutls_certificate_free_credentials(*x509_cred); return -1; } - result = gnutls_priority_set(*session, tls_priority_cache); + result = gnutls_priority_set(*session, global_tls_priority_cache); if (GNUTLS_E_SUCCESS != result) { LOG(LOG_ERROR, "initialize_tls_session_client(): gnutls_priority_set(): %s", @@ -477,7 +477,7 @@ gnutls_certificate_allocate_credentials(): %s", gnutls_certificate_free_credentials(*x509_cred); return -1; } - gnutls_priority_set(*session, tls_priority_cache); + gnutls_priority_set(*session, global_tls_priority_cache); if (GNUTLS_E_SUCCESS != result) { LOG(LOG_ERROR, "initialize_tls_session_server(): gnutls_priority_set(): %s", diff --git a/src/tlsproxy.c b/src/tlsproxy.c index 25f3704..d2b4506 100644 --- a/src/tlsproxy.c +++ b/src/tlsproxy.c @@ -376,18 +376,18 @@ static void initialize_gnutls(void) { GNUTLS_ERROR_EXIT(result, "gnutls_global_init()"); /* Setup GnuTLS cipher suites. */ - result = gnutls_priority_init(&tls_priority_cache, "NORMAL", NULL); + result = gnutls_priority_init(&global_tls_priority_cache, "NORMAL", NULL); GNUTLS_ERROR_EXIT(result, "gnutls_priority_init()"); /* Generate Diffie-Hellman parameters. */ - result = gnutls_dh_params_init(&tls_dh_params); + result = gnutls_dh_params_init(&global_tls_dh_params); GNUTLS_ERROR_EXIT(result, "gnutls_dh_params_init()"); - result = gnutls_dh_params_generate2(tls_dh_params, DH_SIZE); + result = gnutls_dh_params_generate2(global_tls_dh_params, DH_SIZE); GNUTLS_ERROR_EXIT(result, "gnutls_dh_params_generate2()"); } static void deinitialize_gnutls(void) { - gnutls_dh_params_deinit(tls_dh_params); - gnutls_priority_deinit(tls_priority_cache); + gnutls_dh_params_deinit(global_tls_dh_params); + gnutls_priority_deinit(global_tls_priority_cache); gnutls_global_deinit(); } diff --git a/src/tlsproxy.h b/src/tlsproxy.h index ae6a818..5f13a71 100644 --- a/src/tlsproxy.h +++ b/src/tlsproxy.h @@ -60,7 +60,7 @@ int global_log_level; int global_passthrough_unknown; /* "Global" GnuTLS data used by all threads, read only. */ -gnutls_priority_t tls_priority_cache; -gnutls_dh_params_t tls_dh_params; +gnutls_priority_t global_tls_priority_cache; +gnutls_dh_params_t global_tls_dh_params; #endif