Move tls13_phh_done_cb() after tl13_phh_received_cb().
authorjsing <jsing@openbsd.org>
Sun, 24 Jul 2022 14:19:45 +0000 (14:19 +0000)
committerjsing <jsing@openbsd.org>
Sun, 24 Jul 2022 14:19:45 +0000 (14:19 +0000)
This is the order that they're called/run in.

lib/libssl/tls13_lib.c

index 9d62479..d63951a 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: tls13_lib.c,v 1.68 2022/07/24 14:16:29 jsing Exp $ */
+/*     $OpenBSD: tls13_lib.c,v 1.69 2022/07/24 14:19:45 jsing Exp $ */
 /*
  * Copyright (c) 2018, 2019 Joel Sing <jsing@openbsd.org>
  * Copyright (c) 2019 Bob Beck <beck@openbsd.org>
@@ -328,17 +328,6 @@ tls13_key_update_recv(struct tls13_ctx *ctx, CBS *cbs)
        return tls13_send_alert(ctx->rl, alert);
 }
 
-static void
-tls13_phh_done_cb(void *cb_arg)
-{
-       struct tls13_ctx *ctx = cb_arg;
-
-       if (ctx->key_update_request) {
-               tls13_phh_update_write_traffic_secret(ctx);
-               ctx->key_update_request = 0;
-       }
-}
-
 static ssize_t
 tls13_phh_received_cb(void *cb_arg)
 {
@@ -380,6 +369,17 @@ tls13_phh_received_cb(void *cb_arg)
        return ret;
 }
 
+static void
+tls13_phh_done_cb(void *cb_arg)
+{
+       struct tls13_ctx *ctx = cb_arg;
+
+       if (ctx->key_update_request) {
+               tls13_phh_update_write_traffic_secret(ctx);
+               ctx->key_update_request = 0;
+       }
+}
+
 static const struct tls13_record_layer_callbacks rl_callbacks = {
        .wire_read = tls13_legacy_wire_read_cb,
        .wire_write = tls13_legacy_wire_write_cb,