summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libssl/tls13_handshake.c6
-rw-r--r--lib/libssl/tls13_internal.h4
-rw-r--r--lib/libssl/tls13_lib.c28
3 files changed, 22 insertions, 16 deletions
diff --git a/lib/libssl/tls13_handshake.c b/lib/libssl/tls13_handshake.c
index 31bd796b93a..c850e716e76 100644
--- a/lib/libssl/tls13_handshake.c
+++ b/lib/libssl/tls13_handshake.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tls13_handshake.c,v 1.49 2020/01/29 13:44:42 tb Exp $ */
+/* $OpenBSD: tls13_handshake.c,v 1.50 2020/02/05 06:12:43 tb Exp $ */
/*
* Copyright (c) 2018-2019 Theo Buehler <tb@openbsd.org>
* Copyright (c) 2019 Joel Sing <jsing@openbsd.org>
@@ -355,7 +355,7 @@ tls13_handshake_send_action(struct tls13_ctx *ctx,
}
if (ctx->handshake_message_sent_cb != NULL)
- ctx->handshake_message_sent_cb(ctx, &cbs);
+ ctx->handshake_message_sent_cb(ctx);
tls13_handshake_msg_free(ctx->hs_msg);
ctx->hs_msg = NULL;
@@ -394,7 +394,7 @@ tls13_handshake_recv_action(struct tls13_ctx *ctx,
return TLS13_IO_FAILURE;
if (ctx->handshake_message_recv_cb != NULL)
- ctx->handshake_message_recv_cb(ctx, &cbs);
+ ctx->handshake_message_recv_cb(ctx);
/*
* In TLSv1.3 there is no way to know if you're going to receive a
diff --git a/lib/libssl/tls13_internal.h b/lib/libssl/tls13_internal.h
index 00035ea36ea..2c325fe9149 100644
--- a/lib/libssl/tls13_internal.h
+++ b/lib/libssl/tls13_internal.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tls13_internal.h,v 1.58 2020/01/30 17:09:23 jsing Exp $ */
+/* $OpenBSD: tls13_internal.h,v 1.59 2020/02/05 06:12:43 tb Exp $ */
/*
* Copyright (c) 2018 Bob Beck <beck@openbsd.org>
* Copyright (c) 2018 Theo Buehler <tb@openbsd.org>
@@ -50,7 +50,7 @@ typedef void (*tls13_phh_sent_cb)(void *_cb_arg);
typedef ssize_t (*tls13_read_cb)(void *_buf, size_t _buflen, void *_cb_arg);
typedef ssize_t (*tls13_write_cb)(const void *_buf, size_t _buflen,
void *_cb_arg);
-typedef void (*tls13_handshake_message_cb)(void *_cb_arg, CBS *_cbs);
+typedef void (*tls13_handshake_message_cb)(void *_cb_arg);
/*
* Buffers.
diff --git a/lib/libssl/tls13_lib.c b/lib/libssl/tls13_lib.c
index 3a90c0d6df9..92743ef4b36 100644
--- a/lib/libssl/tls13_lib.c
+++ b/lib/libssl/tls13_lib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tls13_lib.c,v 1.32 2020/01/29 17:03:58 jsing Exp $ */
+/* $OpenBSD: tls13_lib.c,v 1.33 2020/02/05 06:12:43 tb Exp $ */
/*
* Copyright (c) 2018, 2019 Joel Sing <jsing@openbsd.org>
* Copyright (c) 2019 Bob Beck <beck@openbsd.org>
@@ -106,27 +106,33 @@ tls13_alert_received_cb(uint8_t alert_desc, void *arg)
}
static void
-tls13_legacy_handshake_message_recv_cb(void *arg, CBS *cbs)
+tls13_legacy_handshake_message_recv_cb(void *arg)
{
struct tls13_ctx *ctx = arg;
SSL *s = ctx->ssl;
+ CBS cbs;
- if (s->internal->msg_callback != NULL)
- s->internal->msg_callback(0, TLS1_3_VERSION, SSL3_RT_HANDSHAKE,
- CBS_data(cbs), CBS_len(cbs), s,
- s->internal->msg_callback_arg);
+ if (s->internal->msg_callback == NULL)
+ return;
+
+ tls13_handshake_msg_data(ctx->hs_msg, &cbs);
+ s->internal->msg_callback(0, TLS1_3_VERSION, SSL3_RT_HANDSHAKE,
+ CBS_data(&cbs), CBS_len(&cbs), s, s->internal->msg_callback_arg);
}
static void
-tls13_legacy_handshake_message_sent_cb(void *arg, CBS *cbs)
+tls13_legacy_handshake_message_sent_cb(void *arg)
{
struct tls13_ctx *ctx = arg;
SSL *s = ctx->ssl;
+ CBS cbs;
+
+ if (s->internal->msg_callback == NULL)
+ return;
- if (s->internal->msg_callback != NULL)
- s->internal->msg_callback(1, TLS1_3_VERSION, SSL3_RT_HANDSHAKE,
- CBS_data(cbs), CBS_len(cbs), s,
- s->internal->msg_callback_arg);
+ tls13_handshake_msg_data(ctx->hs_msg, &cbs);
+ s->internal->msg_callback(1, TLS1_3_VERSION, SSL3_RT_HANDSHAKE,
+ CBS_data(&cbs), CBS_len(&cbs), s, s->internal->msg_callback_arg);
}
static int