1 Replace the deprecated gnutls_protocol_set_priority() with
2 gnutls_priority_set_direct()
4 Reported on http://bugs.debian.org/624058
6 --- a/mutt_ssl_gnutls.c
7 +++ b/mutt_ssl_gnutls.c
9 gnutls_x509_crt_deinit (clientcrt);
12 -static int protocol_priority[] = {GNUTLS_TLS1, GNUTLS_SSL3, 0};
14 /* tls_negotiate: After TLS state has been initialised, attempt to negotiate
15 * TLS over the wire, including certificate checks. */
16 static int tls_negotiate (CONNECTION * conn)
21 +#if GNUTLS_VERSION_MAJOR >= 2 && GNUTLS_VERSION_MINOR >= 12
22 + char *force_sslv3_str = "NORMAL:-VERS-TLS-ALL:+VERS-SSL3.0";
23 + char *force_tls_str = "NORMAL:-VERS-SSL3.0:+VERS-TLS-ALL";
25 + char *force_sslv3_str =
26 + "NORMAL:-VERS-TLS1.2:-VERS-TLS1.1:-VERS-TLS1.0:+VERS-SSL3.0";
27 + char *force_tls_str = "NORMAL:-VERS-SSL3.0:+VERS-TLS-1.2:+VERS-TLS1.1:+VERS-TLS1.0";
29 + char *priority_str = "NORMAL";
30 + const char *error_pos;
33 data = (tlssockdata *) safe_calloc (1, sizeof (tlssockdata));
34 conn->sockdata = data;
35 err = gnutls_certificate_allocate_credentials (&data->xcred);
38 else if (!option(OPTTLSV1))
40 - protocol_priority[0] = GNUTLS_SSL3;
41 - protocol_priority[1] = 0;
42 + priority_str = force_sslv3_str;
44 else if (!option(OPTSSLV3))
46 - protocol_priority[0] = GNUTLS_TLS1;
47 - protocol_priority[1] = 0;
48 + priority_str = force_tls_str;
54 /* We use default priorities (see gnutls documentation),
55 except for protocol version */
56 - gnutls_set_default_priority (data->state);
57 - gnutls_protocol_set_priority (data->state, protocol_priority);
59 + if ( (error_code = gnutls_priority_set_direct (data->state, priority_str,
64 + mutt_error("gnutls_priority_set_direct(%s) pos %s", priority_str, error_pos);
68 + mutt_error("gnutls_priority_set_direct(%s)", priority_str);
74 if (SslDHPrimeBits > 0)