diff options
author | tb <> | 2020-05-21 19:43:40 +0000 |
---|---|---|
committer | tb <> | 2020-05-21 19:43:40 +0000 |
commit | 919686e3aeba6fcad99207e3e25b401b339f721c (patch) | |
tree | ea55a3c7efb4d6568d6689bcc2df7ed2fb77a5eb /src | |
parent | f2982b9fc5373ef8f91b30a69958c2a24bcccc9f (diff) | |
download | openbsd-919686e3aeba6fcad99207e3e25b401b339f721c.tar.gz openbsd-919686e3aeba6fcad99207e3e25b401b339f721c.tar.bz2 openbsd-919686e3aeba6fcad99207e3e25b401b339f721c.zip |
Simplify: transform a dangling else into an early return and
unindent a bunch of code.
Suggested by jsing
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libssl/tls13_lib.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/lib/libssl/tls13_lib.c b/src/lib/libssl/tls13_lib.c index 9d5889ff1e..7232b6dea0 100644 --- a/src/lib/libssl/tls13_lib.c +++ b/src/lib/libssl/tls13_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: tls13_lib.c,v 1.48 2020/05/21 19:27:22 tb Exp $ */ | 1 | /* $OpenBSD: tls13_lib.c,v 1.49 2020/05/21 19:43:40 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2018, 2019 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2018, 2019 Joel Sing <jsing@openbsd.org> |
4 | * Copyright (c) 2019 Bob Beck <beck@openbsd.org> | 4 | * Copyright (c) 2019 Bob Beck <beck@openbsd.org> |
@@ -281,25 +281,25 @@ tls13_key_update_recv(struct tls13_ctx *ctx, CBS *cbs) | |||
281 | if (!tls13_phh_update_peer_traffic_secret(ctx)) | 281 | if (!tls13_phh_update_peer_traffic_secret(ctx)) |
282 | goto err; | 282 | goto err; |
283 | 283 | ||
284 | if (key_update_request == 1) { | 284 | if (key_update_request == 0) |
285 | if ((hs_msg = tls13_handshake_msg_new()) == NULL) | 285 | return TLS13_IO_SUCCESS; |
286 | goto err; | 286 | |
287 | if (!tls13_handshake_msg_start(hs_msg, &cbb_hs, | 287 | /* key_update_request == 1 */ |
288 | TLS13_MT_KEY_UPDATE)) | 288 | if ((hs_msg = tls13_handshake_msg_new()) == NULL) |
289 | goto err; | 289 | goto err; |
290 | if (!CBB_add_u8(&cbb_hs, 0)) | 290 | if (!tls13_handshake_msg_start(hs_msg, &cbb_hs, TLS13_MT_KEY_UPDATE)) |
291 | goto err; | 291 | goto err; |
292 | if (!tls13_handshake_msg_finish(hs_msg)) | 292 | if (!CBB_add_u8(&cbb_hs, 0)) |
293 | goto err; | 293 | goto err; |
294 | 294 | if (!tls13_handshake_msg_finish(hs_msg)) | |
295 | ctx->key_update_request = 1; | 295 | goto err; |
296 | tls13_handshake_msg_data(hs_msg, &cbs_hs); | 296 | |
297 | ret = tls13_record_layer_phh(ctx->rl, &cbs_hs); | 297 | ctx->key_update_request = 1; |
298 | 298 | tls13_handshake_msg_data(hs_msg, &cbs_hs); | |
299 | tls13_handshake_msg_free(hs_msg); | 299 | ret = tls13_record_layer_phh(ctx->rl, &cbs_hs); |
300 | hs_msg = NULL; | 300 | |
301 | } else | 301 | tls13_handshake_msg_free(hs_msg); |
302 | ret = TLS13_IO_SUCCESS; | 302 | hs_msg = NULL; |
303 | 303 | ||
304 | return ret; | 304 | return ret; |
305 | 305 | ||