Fix DTLS1.2 compression
authorHiroyuki YAMAMORI <h-yamamo@db3.so-net.ne.jp>
Wed, 26 Aug 2015 14:06:22 +0000 (15:06 +0100)
committerMatt Caswell <matt@openssl.org>
Tue, 1 Sep 2015 23:37:58 +0000 (00:37 +0100)
Backport of equivalent fix from master. The only compression
method is stateful and hence incompatible with DTLS. The DTLS
test was not working for DTLS1.2

Reviewed-by: Emilia Käsper <emilia@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
ssl/ssl_lib.c

index c0931e787728ed17d4c10fc4b02763807e858293..d72756a957db2d07ffc75d4e24030a220a5b7744 100644 (file)
@@ -1980,7 +1980,7 @@ SSL_CTX *SSL_CTX_new(const SSL_METHOD *meth)
 
     ret->extra_certs = NULL;
     /* No compression for DTLS */
-    if (meth->version != DTLS1_VERSION)
+    if (!(meth->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS))
         ret->comp_methods = SSL_COMP_get_compression_methods();
 
     ret->max_send_fragment = SSL3_RT_MAX_PLAIN_LENGTH;