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) {
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",
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",
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();
}
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