diff options
| author | tb <> | 2021-06-08 19:34:44 +0000 |
|---|---|---|
| committer | tb <> | 2021-06-08 19:34:44 +0000 |
| commit | abf71fee0026581e46075f835ce66e3c83c72777 (patch) | |
| tree | 3687c6fbb9de9c9c5916b960ed5ca3f06f09820f /src | |
| parent | c91a47ed747c414a982d63de1c1ea78816edf4e3 (diff) | |
| download | openbsd-abf71fee0026581e46075f835ce66e3c83c72777.tar.gz openbsd-abf71fee0026581e46075f835ce66e3c83c72777.tar.bz2 openbsd-abf71fee0026581e46075f835ce66e3c83c72777.zip | |
Simplify tlsext_ecpf_parse()
The default alert in the tlsext parsing code is a decode_error, so
there's no need for an error path that only sets that alert.
suggested by/ok jsing
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libssl/ssl_tlsext.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/lib/libssl/ssl_tlsext.c b/src/lib/libssl/ssl_tlsext.c index bd70733362..8cc86d4649 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.93 2021/06/08 17:22:00 tb Exp $ */ | 1 | /* $OpenBSD: ssl_tlsext.c,v 1.94 2021/06/08 19:34:44 tb 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> |
| @@ -353,11 +353,11 @@ tlsext_ecpf_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert) | |||
| 353 | CBS ecpf; | 353 | CBS ecpf; |
| 354 | 354 | ||
| 355 | if (!CBS_get_u8_length_prefixed(cbs, &ecpf)) | 355 | if (!CBS_get_u8_length_prefixed(cbs, &ecpf)) |
| 356 | goto err; | 356 | return 0; |
| 357 | if (CBS_len(&ecpf) == 0) | 357 | if (CBS_len(&ecpf) == 0) |
| 358 | goto err; | 358 | return 0; |
| 359 | if (CBS_len(cbs) != 0) | 359 | if (CBS_len(cbs) != 0) |
| 360 | goto err; | 360 | return 0; |
| 361 | 361 | ||
| 362 | /* Must contain uncompressed (0) - RFC 8422, section 5.1.2. */ | 362 | /* Must contain uncompressed (0) - RFC 8422, section 5.1.2. */ |
| 363 | if (!CBS_contains_zero_byte(&ecpf)) { | 363 | if (!CBS_contains_zero_byte(&ecpf)) { |
| @@ -375,10 +375,6 @@ tlsext_ecpf_parse(SSL *s, uint16_t msg_type, CBS *cbs, int *alert) | |||
| 375 | } | 375 | } |
| 376 | 376 | ||
| 377 | return 1; | 377 | return 1; |
| 378 | |||
| 379 | err: | ||
| 380 | *alert = SSL_AD_DECODE_ERROR; | ||
| 381 | return 0; | ||
| 382 | } | 378 | } |
| 383 | 379 | ||
| 384 | int | 380 | int |
