]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix SSL_export_keying_material() for DTLS1_BAD_VER
authorDavid Woodhouse <David.Woodhouse@intel.com>
Fri, 8 Jul 2016 19:46:07 +0000 (20:46 +0100)
committerMatt Caswell <matt@openssl.org>
Fri, 26 Aug 2016 17:08:23 +0000 (18:08 +0100)
Commit d8e8590e ("Fix missing return value checks in SCTP") made the
DTLS handshake fail, even for non-SCTP connections, if
SSL_export_keying_material() fails. Which it does, for DTLS1_BAD_VER.

Apply the trivial fix to make it succeed, since there's no real reason
why it shouldn't even though we never need it.

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(cherry picked from commit c8a18468caef4d62778381be0acdadc8a88d6e51)

ssl/ssl_lib.c

index 896b5a35a24da90695e247f562c6e95b65529c41..83ef233b5072acf2e6a958535a24300b4557aa65 100644 (file)
@@ -1662,7 +1662,7 @@ int SSL_export_keying_material(SSL *s, unsigned char *out, size_t olen,
                                const unsigned char *p, size_t plen,
                                int use_context)
 {
-    if (s->version < TLS1_VERSION)
+    if (s->version < TLS1_VERSION && s->version != DTLS1_BAD_VER)
         return -1;
 
     return s->method->ssl3_enc->export_keying_material(s, out, olen, label,