diff options
author | jsing <> | 2019-05-29 17:28:37 +0000 |
---|---|---|
committer | jsing <> | 2019-05-29 17:28:37 +0000 |
commit | 611703507e5a4b9de58cf05b58dbc23925de8d2d (patch) | |
tree | 66cfbf2c2533e3e9b8d0dc387eae2b801aa4d60f /src | |
parent | 2214ddcdafdaaba29c0539cecf71267cc591193d (diff) | |
download | openbsd-611703507e5a4b9de58cf05b58dbc23925de8d2d.tar.gz openbsd-611703507e5a4b9de58cf05b58dbc23925de8d2d.tar.bz2 openbsd-611703507e5a4b9de58cf05b58dbc23925de8d2d.zip |
Relax parsing of TLS key share extensions on the server.
The RFC does not require X25519 and it also allows clients to send an empty
key share when the want the server to select a group. The current behaviour
results in handshake failures where the client supports TLS 1.3 and sends a
TLS key share extension that does not contain X25519.
Issue reported by Hubert Kario via github.
ok tb@
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libssl/ssl_tlsext.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/lib/libssl/ssl_tlsext.c b/src/lib/libssl/ssl_tlsext.c index 506cfbcfea..91b74b5d3f 100644 --- a/src/lib/libssl/ssl_tlsext.c +++ b/src/lib/libssl/ssl_tlsext.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssl_tlsext.c,v 1.48 2019/05/29 17:25:27 jsing Exp $ */ | 1 | /* $OpenBSD: ssl_tlsext.c,v 1.49 2019/05/29 17:28:37 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2016, 2017, 2019 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2016, 2017, 2019 Joel Sing <jsing@openbsd.org> |
4 | * Copyright (c) 2017 Doug Hogan <doug@openbsd.org> | 4 | * Copyright (c) 2017 Doug Hogan <doug@openbsd.org> |
@@ -1272,7 +1272,6 @@ tlsext_keyshare_server_parse(SSL *s, CBS *cbs, int *alert) | |||
1272 | CBS key_exchange; | 1272 | CBS key_exchange; |
1273 | uint16_t group; | 1273 | uint16_t group; |
1274 | size_t out_len; | 1274 | size_t out_len; |
1275 | int ret = 0; | ||
1276 | 1275 | ||
1277 | if (!CBS_get_u16_length_prefixed(cbs, &client_shares)) | 1276 | if (!CBS_get_u16_length_prefixed(cbs, &client_shares)) |
1278 | goto err; | 1277 | goto err; |
@@ -1304,11 +1303,9 @@ tlsext_keyshare_server_parse(SSL *s, CBS *cbs, int *alert) | |||
1304 | if (!CBS_stow(&key_exchange, &S3I(s)->hs_tls13.x25519_peer_public, | 1303 | if (!CBS_stow(&key_exchange, &S3I(s)->hs_tls13.x25519_peer_public, |
1305 | &out_len)) | 1304 | &out_len)) |
1306 | goto err; | 1305 | goto err; |
1307 | |||
1308 | ret = 1; | ||
1309 | } | 1306 | } |
1310 | 1307 | ||
1311 | return ret; | 1308 | return 1; |
1312 | 1309 | ||
1313 | err: | 1310 | err: |
1314 | *alert = SSL_AD_DECODE_ERROR; | 1311 | *alert = SSL_AD_DECODE_ERROR; |