]> ruderich.org/simon Gitweb - tlsproxy/tlsproxy.git/commitdiff
src/tlsproxy.h: Prepend global_ to tls_priority_cache and tls_dh_params.
authorSimon Ruderich <simon@ruderich.org>
Wed, 16 Mar 2011 21:26:37 +0000 (22:26 +0100)
committerSimon Ruderich <simon@ruderich.org>
Wed, 16 Mar 2011 21:26:37 +0000 (22:26 +0100)
src/connection.c
src/tlsproxy.c
src/tlsproxy.h

index af14477cb71592c9dd1dcc90d75ef71d37e75db2..880087b9fb6a92193ec280bf71e68151fc372ed8 100644 (file)
@@ -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",
index 25f37043394518b1c02184fb775925ef1564d4f2..d2b4506c00d26ad2c282aa51751324ec421f03d4 100644 (file)
@@ -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();
 }
index ae6a818f435729a2af734cda3e74eaa16206d931..5f13a7180e2ceab414bd7dbb7b76655421b43850 100644 (file)
@@ -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