From 167103faa44f8407455f11f6599e9919e2b22653 Mon Sep 17 00:00:00 2001 From: jsing <> Date: Fri, 11 Nov 2022 17:15:27 +0000 Subject: Convert the legacy TLS stack to tls_content. This converts the legacy TLS stack to tls_content - records are now opened into a tls_content structure, rather than being written back into the same buffer that the sealed record was read into. This will allow for further clean up of the legacy record layer. ok tb@ --- src/lib/libssl/d1_lib.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'src/lib/libssl/d1_lib.c') diff --git a/src/lib/libssl/d1_lib.c b/src/lib/libssl/d1_lib.c index cf4c5100d5..fe51769530 100644 --- a/src/lib/libssl/d1_lib.c +++ b/src/lib/libssl/d1_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: d1_lib.c,v 1.62 2022/10/02 16:36:41 jsing Exp $ */ +/* $OpenBSD: d1_lib.c,v 1.63 2022/11/11 17:15:26 jsing Exp $ */ /* * DTLS implementation written by Nagendra Modadugu * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. @@ -104,6 +104,23 @@ dtls1_new(SSL *s) return (0); } +static void +dtls1_drain_rcontents(pqueue queue) +{ + DTLS1_RCONTENT_DATA_INTERNAL *rdata; + pitem *item; + + if (queue == NULL) + return; + + while ((item = pqueue_pop(queue)) != NULL) { + rdata = (DTLS1_RCONTENT_DATA_INTERNAL *)item->data; + tls_content_free(rdata->rcontent); + free(item->data); + pitem_free(item); + } +} + static void dtls1_drain_records(pqueue queue) { @@ -141,7 +158,7 @@ dtls1_clear_queues(SSL *s) dtls1_drain_records(s->d1->unprocessed_rcds.q); dtls1_drain_fragments(s->d1->buffered_messages); dtls1_drain_fragments(s->d1->sent_messages); - dtls1_drain_records(s->d1->buffered_app_data.q); + dtls1_drain_rcontents(s->d1->buffered_app_data.q); } void -- cgit v1.2.3-55-g6feb