Commit 45ecec0d 45ecec0da61992ea2add464da3be67078b8dbe0e by Sergey Poznyakoff

tls: do not generate DH params.

* libmu_auth/tls.c: Don't generate DH params at all.
1 parent 424589b9
...@@ -67,9 +67,6 @@ mu_tls_module_init (enum mu_gocs_op op, void *data) ...@@ -67,9 +67,6 @@ mu_tls_module_init (enum mu_gocs_op op, void *data)
67 #include <gnutls/gnutls.h> 67 #include <gnutls/gnutls.h>
68 #include <mailutils/sys/tls-stream.h> 68 #include <mailutils/sys/tls-stream.h>
69 69
70 #define DH_BITS 768
71
72 static gnutls_dh_params dh_params;
73 static gnutls_certificate_server_credentials x509_cred; 70 static gnutls_certificate_server_credentials x509_cred;
74 71
75 /* Return: zero means NOT READY, one means READY */ 72 /* Return: zero means NOT READY, one means READY */
...@@ -145,7 +142,6 @@ mu_init_tls_libs (int x509_setup) ...@@ -145,7 +142,6 @@ mu_init_tls_libs (int x509_setup)
145 142
146 if (x509_setup && !x509_cred) 143 if (x509_setup && !x509_cred)
147 { 144 {
148 mu_diag_output (MU_DIAG_INFO, _("initializing X509..."));
149 gnutls_certificate_allocate_credentials (&x509_cred); 145 gnutls_certificate_allocate_credentials (&x509_cred);
150 if (mu_tls_module_config.ssl_cafile) 146 if (mu_tls_module_config.ssl_cafile)
151 gnutls_certificate_set_x509_trust_file (x509_cred, 147 gnutls_certificate_set_x509_trust_file (x509_cred,
...@@ -156,11 +152,6 @@ mu_init_tls_libs (int x509_setup) ...@@ -156,11 +152,6 @@ mu_init_tls_libs (int x509_setup)
156 mu_tls_module_config.ssl_cert, 152 mu_tls_module_config.ssl_cert,
157 mu_tls_module_config.ssl_key, 153 mu_tls_module_config.ssl_key,
158 GNUTLS_X509_FMT_PEM); 154 GNUTLS_X509_FMT_PEM);
159
160 gnutls_dh_params_init (&dh_params);
161 gnutls_dh_params_generate2 (dh_params, DH_BITS);
162 gnutls_certificate_set_dh_params (x509_cred, dh_params);
163 mu_diag_output (MU_DIAG_INFO, _("finished initializing X509"));
164 } 155 }
165 156
166 #ifdef DEBUG_TLS 157 #ifdef DEBUG_TLS
...@@ -191,7 +182,6 @@ initialize_tls_session (void) ...@@ -191,7 +182,6 @@ initialize_tls_session (void)
191 gnutls_set_default_priority (session); 182 gnutls_set_default_priority (session);
192 gnutls_credentials_set (session, GNUTLS_CRD_CERTIFICATE, x509_cred); 183 gnutls_credentials_set (session, GNUTLS_CRD_CERTIFICATE, x509_cred);
193 gnutls_certificate_server_set_request (session, GNUTLS_CERT_REQUEST); 184 gnutls_certificate_server_set_request (session, GNUTLS_CERT_REQUEST);
194 gnutls_dh_set_prime_bits (session, DH_BITS);
195 185
196 return session; 186 return session;
197 } 187 }
......