From 6612d759045c7571f6be2ff1366a704ba82eb216 Mon Sep 17 00:00:00 2001 From: jsing <> Date: Fri, 22 Jul 2022 19:33:53 +0000 Subject: Add read and write support to tls_buffer. tls_buffer was original created for a specific use case, namely reading in length prefixed messages. This adds read and write support, along with a capacity limit, allowing it to be used in additional use cases. ok beck@ tb@ --- src/lib/libssl/tls13_record.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/lib/libssl/tls13_record.c') diff --git a/src/lib/libssl/tls13_record.c b/src/lib/libssl/tls13_record.c index 2c744668e5..dbc835c546 100644 --- a/src/lib/libssl/tls13_record.c +++ b/src/lib/libssl/tls13_record.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tls13_record.c,v 1.9 2021/10/23 13:12:14 jsing Exp $ */ +/* $OpenBSD: tls13_record.c,v 1.10 2022/07/22 19:33:53 jsing Exp $ */ /* * Copyright (c) 2018, 2019 Joel Sing * @@ -134,7 +134,8 @@ tls13_record_recv(struct tls13_record *rec, tls_read_cb wire_read, TLS13_RECORD_HEADER_LEN, wire_read, wire_arg)) <= 0) return ret; - tls_buffer_cbs(rec->buf, &cbs); + if (!tls_buffer_data(rec->buf, &cbs)) + return TLS13_IO_FAILURE; if (!CBS_get_u8(&cbs, &content_type)) return TLS13_IO_FAILURE; -- cgit v1.2.3-55-g6feb