diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2022-01-11 18:22:17 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2022-01-11 18:22:17 +0000 |
commit | 0082029c94f389e60159881e94e1ebe019aabe87 (patch) | |
tree | 5b68daf82dc1d8c8ce7aac15e34b32ca079adea0 /lib/libssl/ssl_tlsext.c | |
parent | 81ee12a638e5d816c883ee4dcfb3f6375179c28f (diff) |
Simplify tlsext_keyshare_server_parse()
SSL_AD_DECODE_ERROR is the default alert for a TLS extension parsing
failure - remove the various gotos and simply return 0 instead.
ok tb@
Diffstat (limited to 'lib/libssl/ssl_tlsext.c')
-rw-r--r-- | lib/libssl/ssl_tlsext.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/libssl/ssl_tlsext.c b/lib/libssl/ssl_tlsext.c index 71955d92952..857527d9434 100644 --- a/lib/libssl/ssl_tlsext.c +++ b/lib/libssl/ssl_tlsext.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_tlsext.c,v 1.105 2022/01/06 18:23:56 jsing Exp $ */ +/* $OpenBSD: ssl_tlsext.c,v 1.106 2022/01/11 18:22:16 jsing Exp $ */ /* * Copyright (c) 2016, 2017, 2019 Joel Sing <jsing@openbsd.org> * Copyright (c) 2017 Doug Hogan <doug@openbsd.org> @@ -1481,13 +1481,13 @@ tlsext_keyshare_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert) uint16_t group; if (!CBS_get_u16_length_prefixed(cbs, &client_shares)) - goto err; + return 0; while (CBS_len(&client_shares) > 0) { /* Unpack client share. */ if (!CBS_get_u16(&client_shares, &group)) - goto err; + return 0; if (!CBS_get_u16_length_prefixed(&client_shares, &key_exchange)) return 0; @@ -1511,17 +1511,13 @@ tlsext_keyshare_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert) /* Decode and store the selected key share. */ if ((S3I(s)->hs.key_share = tls_key_share_new(group)) == NULL) - goto err; + return 0; if (!tls_key_share_peer_public(S3I(s)->hs.key_share, &key_exchange, NULL)) - goto err; + return 0; } return 1; - - err: - *alert = SSL_AD_DECODE_ERROR; - return 0; } int |