diff --git a/ssl/dtls1.h b/ssl/dtls1.h index ff406d8ba6f73e41b92e0c622df7cfbdbb683fb1..542ae04627b59b8b7840fa776e9cfe2ad9059bbd 100644 --- a/ssl/dtls1.h +++ b/ssl/dtls1.h @@ -86,6 +86,7 @@ extern "C" { # define DTLS1_VERSION 0xFEFF # define DTLS1_2_VERSION 0xFEFD # define DTLS_MAX_VERSION DTLS1_2_VERSION +# define DTLS1_VERSION_MAJOR 0xFE # define DTLS1_BAD_VER 0x0100 diff --git a/ssl/ssl_asn1.c b/ssl/ssl_asn1.c index 63fe17f16e4bfb13696fb152cbcc176595b7bf44..dd02b4171a4c53f668cf946df3679e43710079ac 100644 --- a/ssl/ssl_asn1.c +++ b/ssl/ssl_asn1.c @@ -410,7 +410,9 @@ SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, const unsigned char **pp, os.data = NULL; os.length = 0; M_ASN1_D2I_get_x(ASN1_OCTET_STRING, osp, d2i_ASN1_OCTET_STRING); - if ((ssl_version >> 8) >= SSL3_VERSION_MAJOR) { + if ((ssl_version >> 8) == SSL3_VERSION_MAJOR + || (ssl_version >> 8) == DTLS1_VERSION_MAJOR + || ssl_version == DTLS1_BAD_VER) { if (os.length != 2) { c.error = SSL_R_CIPHER_CODE_WRONG_LENGTH; c.line = __LINE__;