From 212aacd76080ec12b9b4f04d5c72dc835aad01dd Mon Sep 17 00:00:00 2001 From: jsing <> Date: Sat, 10 Sep 2022 15:29:33 +0000 Subject: Provide a version of ssl_msg_callback() that takes a CBS. Use this from the TLSv1.3 code. ok tb@ --- src/lib/libssl/ssl_lib.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/lib/libssl/ssl_lib.c') diff --git a/src/lib/libssl/ssl_lib.c b/src/lib/libssl/ssl_lib.c index c0ca19c7c1..f5f7bf66c1 100644 --- a/src/lib/libssl/ssl_lib.c +++ b/src/lib/libssl/ssl_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_lib.c,v 1.304 2022/08/21 19:42:15 jsing Exp $ */ +/* $OpenBSD: ssl_lib.c,v 1.305 2022/09/10 15:29:33 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -2939,9 +2939,17 @@ void ssl_msg_callback(SSL *s, int is_write, int content_type, const void *msg_buf, size_t msg_len) { - if (s->internal->msg_callback != NULL) - s->internal->msg_callback(is_write, s->version, content_type, - msg_buf, msg_len, s, s->internal->msg_callback_arg); + if (s->internal->msg_callback == NULL) + return; + + s->internal->msg_callback(is_write, s->version, content_type, + msg_buf, msg_len, s, s->internal->msg_callback_arg); +} + +void +ssl_msg_callback_cbs(SSL *s, int is_write, int content_type, CBS *cbs) +{ + ssl_msg_callback(s, is_write, content_type, CBS_data(cbs), CBS_len(cbs)); } /* Fix this function so that it takes an optional type parameter */ -- cgit v1.2.3-55-g6feb