|
Line 0
Link Here
|
|
|
1 |
--- init.h.orig 2010-09-15 08:39:31.000000000 -0700 |
| 2 |
+++ init.h 2012-03-28 10:58:42.870572835 -0700 |
| 3 |
@@ -2972,6 +2972,18 @@ struct option_t MuttVars[] = { |
| 4 |
** SSL authentication process. |
| 5 |
*/ |
| 6 |
#ifdef USE_SSL_OPENSSL |
| 7 |
+ { "ssl_use_tlsv1_1", DT_BOOL, R_NONE, OPTTLSV1_1, 1 }, |
| 8 |
+ /* |
| 9 |
+ ** .pp |
| 10 |
+ ** This variable specifies whether to attempt to use TLSv1.1 in the |
| 11 |
+ ** SSL authentication process. |
| 12 |
+ */ |
| 13 |
+ { "ssl_use_tlsv1_2", DT_BOOL, R_NONE, OPTTLSV1_2, 1 }, |
| 14 |
+ /* |
| 15 |
+ ** .pp |
| 16 |
+ ** This variable specifies whether to attempt to use TLSv1.2 in the |
| 17 |
+ ** SSL authentication process. |
| 18 |
+ */ |
| 19 |
{ "ssl_usesystemcerts", DT_BOOL, R_NONE, OPTSSLSYSTEMCERTS, 1 }, |
| 20 |
/* |
| 21 |
** .pp |
| 22 |
--- mutt.h 2010-09-13 10:19:55.000000000 -0700 |
| 23 |
+++ mutt.h 2012-03-28 10:59:24.437237530 -0700 |
| 24 |
@@ -376,6 +376,8 @@ enum |
| 25 |
# endif /* USE_SSL_GNUTLS */ |
| 26 |
OPTSSLV3, |
| 27 |
OPTTLSV1, |
| 28 |
+ OPTTLSV1_1, |
| 29 |
+ OPTTLSV1_2, |
| 30 |
OPTSSLFORCETLS, |
| 31 |
OPTSSLVERIFYDATES, |
| 32 |
OPTSSLVERIFYHOST, |
| 33 |
--- mutt_ssl.c.orig 2010-08-25 18:31:40.000000000 +0200 |
| 34 |
+++ mutt_ssl.c 2013-08-20 13:51:14.000000000 +0200 |
| 35 |
@@ -100,12 +100,33 @@ |
| 36 |
goto bail; |
| 37 |
|
| 38 |
ssldata = (sslsockdata*) safe_calloc (1, sizeof (sslsockdata)); |
| 39 |
- /* the ssl_use_xxx protocol options don't apply. We must use TLS in TLS. */ |
| 40 |
- if (! (ssldata->ctx = SSL_CTX_new (TLSv1_client_method ()))) |
| 41 |
+ /* the ssl_use_xxx protocol options don't apply. We must use TLS in TLS. |
| 42 |
+ * TLSv1.2 support was added in OpenSSL 1.0.1. RHEL6 shipped with 1.0.0 so |
| 43 |
+ * our configure script checks for TLSv1.2 availability. |
| 44 |
+ */ |
| 45 |
+ if (! (ssldata->ctx = SSL_CTX_new ( |
| 46 |
+#ifdef HAVE_TLSV1_2_CLIENT_METHOD |
| 47 |
+ TLSv1_2_client_method () |
| 48 |
+#else |
| 49 |
+ TLSv1_client_method () |
| 50 |
+#endif |
| 51 |
+ ))) |
| 52 |
{ |
| 53 |
dprint (1, (debugfile, "mutt_ssl_starttls: Error allocating SSL_CTX\n")); |
| 54 |
goto bail_ssldata; |
| 55 |
} |
| 56 |
+#ifdef SSL_OP_NO_TLSv1_1 |
| 57 |
+ if (!option(OPTTLSV1_1)) |
| 58 |
+ { |
| 59 |
+ SSL_CTX_set_options(ssldata->ctx, SSL_OP_NO_TLSv1_1); |
| 60 |
+ } |
| 61 |
+#endif |
| 62 |
+#ifdef SSL_OP_NO_TLSv1_2 |
| 63 |
+ if (!option(OPTTLSV1_2)) |
| 64 |
+ { |
| 65 |
+ SSL_CTX_set_options(ssldata->ctx, SSL_OP_NO_TLSv1_2); |
| 66 |
+ } |
| 67 |
+#endif |
| 68 |
|
| 69 |
ssl_get_client_cert(ssldata, conn); |
| 70 |
|
| 71 |
@@ -303,6 +324,21 @@ |
| 72 |
{ |
| 73 |
SSL_CTX_set_options(data->ctx, SSL_OP_NO_TLSv1); |
| 74 |
} |
| 75 |
+ /* TLSv1.1/1.2 support was added in OpenSSL 1.0.1, but some OS distros such |
| 76 |
+ * as Fedora 17 are on OpenSSL 1.0.0. |
| 77 |
+ */ |
| 78 |
+#ifdef SSL_OP_NO_TLSv1_1 |
| 79 |
+ if (!option(OPTTLSV1_1)) |
| 80 |
+ { |
| 81 |
+ SSL_CTX_set_options(data->ctx, SSL_OP_NO_TLSv1_1); |
| 82 |
+ } |
| 83 |
+#endif |
| 84 |
+#ifdef SSL_OP_NO_TLSv1_2 |
| 85 |
+ if (!option(OPTTLSV1_2)) |
| 86 |
+ { |
| 87 |
+ SSL_CTX_set_options(data->ctx, SSL_OP_NO_TLSv1_2); |
| 88 |
+ } |
| 89 |
+#endif |
| 90 |
if (!option(OPTSSLV2)) |
| 91 |
{ |
| 92 |
SSL_CTX_set_options(data->ctx, SSL_OP_NO_SSLv2); |
| 93 |
@@ -375,8 +411,8 @@ |
| 94 |
if (!ssl_check_certificate (conn, ssldata)) |
| 95 |
return -1; |
| 96 |
|
| 97 |
- mutt_message (_("SSL connection using %s (%s)"), |
| 98 |
- SSL_get_cipher_version (ssldata->ssl), SSL_get_cipher_name (ssldata->ssl)); |
| 99 |
+ mutt_message (_("%s connection using %s (%s)"), |
| 100 |
+ SSL_get_version(ssldata->ssl), SSL_get_cipher_version (ssldata->ssl), SSL_get_cipher_name (ssldata->ssl)); |
| 101 |
mutt_sleep (0); |
| 102 |
|
| 103 |
return 0; |
| 104 |
@@ -911,7 +947,7 @@ |
| 105 |
|
| 106 |
static int interactive_check_cert (X509 *cert, int idx, int len) |
| 107 |
{ |
| 108 |
- char *part[] = |
| 109 |
+ static const char * const part[] = |
| 110 |
{"/CN=", "/Email=", "/O=", "/OU=", "/L=", "/ST=", "/C="}; |
| 111 |
char helpstr[LONG_STRING]; |
| 112 |
char buf[STRING]; |