From 4136279164d74c64d8baf721e3949275073a88f4 Mon Sep 17 00:00:00 2001 From: tb <> Date: Sat, 25 Jan 2020 13:11:20 +0000 Subject: Support legacy message callbacks. First step for SSL_set_msg_callback(3) support. Makes openssl s_client -msg work for handshake messages. ok beck jsing --- src/lib/libssl/tls13_handshake.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/lib/libssl/tls13_handshake.c') diff --git a/src/lib/libssl/tls13_handshake.c b/src/lib/libssl/tls13_handshake.c index ed70ec1f4b..1528bd5e2a 100644 --- a/src/lib/libssl/tls13_handshake.c +++ b/src/lib/libssl/tls13_handshake.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tls13_handshake.c,v 1.45 2020/01/25 06:37:30 beck Exp $ */ +/* $OpenBSD: tls13_handshake.c,v 1.46 2020/01/25 13:11:20 tb Exp $ */ /* * Copyright (c) 2018-2019 Theo Buehler * Copyright (c) 2019 Joel Sing @@ -363,6 +363,9 @@ tls13_handshake_send_action(struct tls13_ctx *ctx, return TLS13_IO_FAILURE; } + if (ctx->handshake_message_sent_cb != NULL) + ctx->handshake_message_sent_cb(ctx, &cbs); + tls13_handshake_msg_free(ctx->hs_msg); ctx->hs_msg = NULL; @@ -399,6 +402,9 @@ tls13_handshake_recv_action(struct tls13_ctx *ctx, if (!tls1_transcript_record(ctx->ssl, CBS_data(&cbs), CBS_len(&cbs))) return TLS13_IO_FAILURE; + if (ctx->handshake_message_recv_cb != NULL) + ctx->handshake_message_recv_cb(ctx, &cbs); + /* * In TLSv1.3 there is no way to know if you're going to receive a * certificate request message or not, hence we have to special case it -- cgit v1.2.3-55-g6feb