提交 0785274c 编写于 作者: M Matt Caswell

Fix extension for various no- options

Previously we were omitting the extension information from ext_defs if
the association no- option was defined. This doesn't work because the
indexes into the table are no longer valid.
Reviewed-by: NRichard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2153)
上级 397f4f78
...@@ -92,6 +92,7 @@ typedef struct extensions_definition_st { ...@@ -92,6 +92,7 @@ typedef struct extensions_definition_st {
* *
* TODO(TLS1.3): Make sure we have a test to check the consistency of these * TODO(TLS1.3): Make sure we have a test to check the consistency of these
*/ */
#define INVALID_EXTENSION { 0x10000, 0, NULL, NULL, NULL, NULL, NULL, NULL }
static const EXTENSION_DEFINITION ext_defs[] = { static const EXTENSION_DEFINITION ext_defs[] = {
{ {
TLSEXT_TYPE_renegotiate, TLSEXT_TYPE_renegotiate,
...@@ -116,6 +117,8 @@ static const EXTENSION_DEFINITION ext_defs[] = { ...@@ -116,6 +117,8 @@ static const EXTENSION_DEFINITION ext_defs[] = {
EXT_CLIENT_HELLO | EXT_TLS1_2_AND_BELOW_ONLY, EXT_CLIENT_HELLO | EXT_TLS1_2_AND_BELOW_ONLY,
init_srp, tls_parse_ctos_srp, NULL, NULL, tls_construct_ctos_srp, NULL init_srp, tls_parse_ctos_srp, NULL, NULL, tls_construct_ctos_srp, NULL
}, },
#else
INVALID_EXTENSION,
#endif #endif
#ifndef OPENSSL_NO_EC #ifndef OPENSSL_NO_EC
{ {
...@@ -132,6 +135,9 @@ static const EXTENSION_DEFINITION ext_defs[] = { ...@@ -132,6 +135,9 @@ static const EXTENSION_DEFINITION ext_defs[] = {
NULL /* TODO(TLS1.3): Need to add this */, NULL /* TODO(TLS1.3): Need to add this */,
tls_construct_ctos_supported_groups, NULL tls_construct_ctos_supported_groups, NULL
}, },
#else
INVALID_EXTENSION,
INVALID_EXTENSION,
#endif #endif
{ {
TLSEXT_TYPE_session_ticket, TLSEXT_TYPE_session_ticket,
...@@ -155,6 +161,8 @@ static const EXTENSION_DEFINITION ext_defs[] = { ...@@ -155,6 +161,8 @@ static const EXTENSION_DEFINITION ext_defs[] = {
tls_parse_stoc_status_request, tls_construct_stoc_status_request, tls_parse_stoc_status_request, tls_construct_stoc_status_request,
tls_construct_ctos_status_request, final_status_request tls_construct_ctos_status_request, final_status_request
}, },
#else
INVALID_EXTENSION,
#endif #endif
#ifndef OPENSSL_NO_NEXTPROTONEG #ifndef OPENSSL_NO_NEXTPROTONEG
{ {
...@@ -163,6 +171,8 @@ static const EXTENSION_DEFINITION ext_defs[] = { ...@@ -163,6 +171,8 @@ static const EXTENSION_DEFINITION ext_defs[] = {
init_npn, tls_parse_ctos_npn, tls_parse_stoc_npn, init_npn, tls_parse_ctos_npn, tls_parse_stoc_npn,
tls_construct_stoc_next_proto_neg, tls_construct_ctos_npn, NULL tls_construct_stoc_next_proto_neg, tls_construct_ctos_npn, NULL
}, },
#else
INVALID_EXTENSION,
#endif #endif
{ {
/* /*
...@@ -183,6 +193,8 @@ static const EXTENSION_DEFINITION ext_defs[] = { ...@@ -183,6 +193,8 @@ static const EXTENSION_DEFINITION ext_defs[] = {
init_srtp, tls_parse_ctos_use_srtp, tls_parse_stoc_use_srtp, init_srtp, tls_parse_ctos_use_srtp, tls_parse_stoc_use_srtp,
tls_construct_stoc_use_srtp, tls_construct_ctos_use_srtp, NULL tls_construct_stoc_use_srtp, tls_construct_ctos_use_srtp, NULL
}, },
#else
INVALID_EXTENSION,
#endif #endif
{ {
TLSEXT_TYPE_encrypt_then_mac, TLSEXT_TYPE_encrypt_then_mac,
...@@ -203,6 +215,8 @@ static const EXTENSION_DEFINITION ext_defs[] = { ...@@ -203,6 +215,8 @@ static const EXTENSION_DEFINITION ext_defs[] = {
*/ */
NULL, tls_parse_stoc_sct, NULL, tls_construct_ctos_sct, NULL NULL, tls_parse_stoc_sct, NULL, tls_construct_ctos_sct, NULL
}, },
#else
INVALID_EXTENSION,
#endif #endif
{ {
TLSEXT_TYPE_extended_master_secret, TLSEXT_TYPE_extended_master_secret,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册