Jiri Bourek:
> Well they seem to know what they are talking about. The description
> of the threat in linked screenshot says "attacker needs to have
> ability to submit any plain text"

I wrote the attached patch to add SSL_OP_NO_COMPRESSION to dovecot.
Looks not perfect but definitly works.

Andreas
Index: dovecot-2.2.13/src/lib-ssl-iostream/iostream-openssl-context.c
===================================================================
--- dovecot-2.2.13.orig/src/lib-ssl-iostream/iostream-openssl-context.c	2014-05-18 11:54:18.000000000 +0200
+++ dovecot-2.2.13/src/lib-ssl-iostream/iostream-openssl-context.c	2014-05-18 12:03:20.000000000 +0200
@@ -16,6 +16,11 @@
 #  define HAVE_ECDH
 #endif
 
+/* Hm, I expect this in the included <openssl/ssl.h> but compile failed */
+#if !defined SSL_OP_NO_COMPRESSION
+#  define SSL_OP_NO_COMPRESSION 0x00020000L
+#endif
+
 struct ssl_iostream_password_context {
 	const char *password;
 	const char *error;
@@ -503,7 +508,7 @@
 
 	/* enable all SSL workarounds, except empty fragments as it
 	   makes SSL more vulnerable against attacks */
-	SSL_CTX_set_options(ctx->ssl_ctx, SSL_OP_NO_SSLv2 |
+	SSL_CTX_set_options(ctx->ssl_ctx, SSL_OP_NO_SSLv2 | SSL_OP_NO_COMPRESSION |
 			    (SSL_OP_ALL & ~SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS));
 	if (ssl_proxy_ctx_set_crypto_params(ctx->ssl_ctx, set, error_r) < 0)
 		return -1;
Index: dovecot-2.2.13/src/login-common/ssl-proxy-openssl.c
===================================================================
--- dovecot-2.2.13.orig/src/login-common/ssl-proxy-openssl.c	2014-05-18 11:54:18.000000000 +0200
+++ dovecot-2.2.13/src/login-common/ssl-proxy-openssl.c	2014-05-18 12:04:10.000000000 +0200
@@ -33,6 +33,11 @@
 #  define HAVE_ECDH
 #endif
 
+/* Hm, I expect this in the included <openssl/ssl.h> but compile failed */
+#if !defined SSL_OP_NO_COMPRESSION
+#  define SSL_OP_NO_COMPRESSION 0x00020000L
+#endif
+
 /* Check every 30 minutes if parameters file has been updated */
 #define SSL_PARAMFILE_CHECK_INTERVAL (60*30)
 
@@ -1003,7 +1008,7 @@
 
 	/* enable all SSL workarounds, except empty fragments as it
 	   makes SSL more vulnerable against attacks */
-	SSL_CTX_set_options(ssl_ctx, SSL_OP_ALL &
+	SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_COMPRESSION | SSL_OP_ALL &
 			    ~SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS);
 
 #ifdef SSL_MODE_RELEASE_BUFFERS

Reply via email to