summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/libssl/ssl_tlsext.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/lib/libssl/ssl_tlsext.c b/src/lib/libssl/ssl_tlsext.c
index 71955d9295..857527d943 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.105 2022/01/06 18:23:56 jsing Exp $ */ 1/* $OpenBSD: ssl_tlsext.c,v 1.106 2022/01/11 18:22:16 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>
@@ -1481,13 +1481,13 @@ tlsext_keyshare_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
1481 uint16_t group; 1481 uint16_t group;
1482 1482
1483 if (!CBS_get_u16_length_prefixed(cbs, &client_shares)) 1483 if (!CBS_get_u16_length_prefixed(cbs, &client_shares))
1484 goto err; 1484 return 0;
1485 1485
1486 while (CBS_len(&client_shares) > 0) { 1486 while (CBS_len(&client_shares) > 0) {
1487 1487
1488 /* Unpack client share. */ 1488 /* Unpack client share. */
1489 if (!CBS_get_u16(&client_shares, &group)) 1489 if (!CBS_get_u16(&client_shares, &group))
1490 goto err; 1490 return 0;
1491 if (!CBS_get_u16_length_prefixed(&client_shares, &key_exchange)) 1491 if (!CBS_get_u16_length_prefixed(&client_shares, &key_exchange))
1492 return 0; 1492 return 0;
1493 1493
@@ -1511,17 +1511,13 @@ tlsext_keyshare_server_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert)
1511 1511
1512 /* Decode and store the selected key share. */ 1512 /* Decode and store the selected key share. */
1513 if ((S3I(s)->hs.key_share = tls_key_share_new(group)) == NULL) 1513 if ((S3I(s)->hs.key_share = tls_key_share_new(group)) == NULL)
1514 goto err; 1514 return 0;
1515 if (!tls_key_share_peer_public(S3I(s)->hs.key_share, 1515 if (!tls_key_share_peer_public(S3I(s)->hs.key_share,
1516 &key_exchange, NULL)) 1516 &key_exchange, NULL))
1517 goto err; 1517 return 0;
1518 } 1518 }
1519 1519
1520 return 1; 1520 return 1;
1521
1522 err:
1523 *alert = SSL_AD_DECODE_ERROR;
1524 return 0;
1525} 1521}
1526 1522
1527int 1523int