1 Replace the deprecated gnutls_protocol_set_priority() with
2 gnutls_priority_set_direct()
4 Reported on http://bugs.debian.org/624058
5 Report upstream on http://bugs.mutt.org/3515
7 --- a/mutt_ssl_gnutls.c
8 +++ b/mutt_ssl_gnutls.c
10 gnutls_x509_crt_deinit (clientcrt);
13 -static int protocol_priority[] = {GNUTLS_TLS1, GNUTLS_SSL3, 0};
15 /* tls_negotiate: After TLS state has been initialised, attempt to negotiate
16 * TLS over the wire, including certificate checks. */
17 static int tls_negotiate (CONNECTION * conn)
22 +#if GNUTLS_VERSION_MAJOR >= 2 && GNUTLS_VERSION_MINOR >= 12
23 + char *force_sslv3_str = "NORMAL:-VERS-TLS-ALL:+VERS-SSL3.0";
24 + char *force_tls_str = "NORMAL:-VERS-SSL3.0:+VERS-TLS-ALL";
26 + char *force_sslv3_str =
27 + "NORMAL:-VERS-TLS1.2:-VERS-TLS1.1:-VERS-TLS1.0:+VERS-SSL3.0";
28 + char *force_tls_str = "NORMAL:-VERS-SSL3.0:+VERS-TLS-1.2:+VERS-TLS1.1:+VERS-TLS1.0";
30 + char *priority_str = "NORMAL";
31 + const char *error_pos;
34 data = (tlssockdata *) safe_calloc (1, sizeof (tlssockdata));
35 conn->sockdata = data;
36 err = gnutls_certificate_allocate_credentials (&data->xcred);
39 else if (!option(OPTTLSV1))
41 - protocol_priority[0] = GNUTLS_SSL3;
42 - protocol_priority[1] = 0;
43 + priority_str = force_sslv3_str;
45 else if (!option(OPTSSLV3))
47 - protocol_priority[0] = GNUTLS_TLS1;
48 - protocol_priority[1] = 0;
49 + priority_str = force_tls_str;
55 /* We use default priorities (see gnutls documentation),
56 except for protocol version */
57 - gnutls_set_default_priority (data->state);
58 - gnutls_protocol_set_priority (data->state, protocol_priority);
60 + if ( (error_code = gnutls_priority_set_direct (data->state, priority_str,
65 + mutt_error("gnutls_priority_set_direct(%s) pos %s", priority_str, error_pos);
69 + mutt_error("gnutls_priority_set_direct(%s)", priority_str);
75 if (SslDHPrimeBits > 0)