diff options
author | jsing <> | 2022-11-11 17:15:27 +0000 |
---|---|---|
committer | jsing <> | 2022-11-11 17:15:27 +0000 |
commit | 167103faa44f8407455f11f6599e9919e2b22653 (patch) | |
tree | a8f8e94c51cf1dc74d90e267faf0ad4720537e35 /src/lib/libssl/d1_lib.c | |
parent | f8749b129444d560b9e645a68ec7b045800243ed (diff) | |
download | openbsd-167103faa44f8407455f11f6599e9919e2b22653.tar.gz openbsd-167103faa44f8407455f11f6599e9919e2b22653.tar.bz2 openbsd-167103faa44f8407455f11f6599e9919e2b22653.zip |
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@
Diffstat (limited to 'src/lib/libssl/d1_lib.c')
-rw-r--r-- | src/lib/libssl/d1_lib.c | 21 |
1 files changed, 19 insertions, 2 deletions
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 @@ | |||
1 | /* $OpenBSD: d1_lib.c,v 1.62 2022/10/02 16:36:41 jsing Exp $ */ | 1 | /* $OpenBSD: d1_lib.c,v 1.63 2022/11/11 17:15:26 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * DTLS implementation written by Nagendra Modadugu | 3 | * DTLS implementation written by Nagendra Modadugu |
4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. | 4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. |
@@ -105,6 +105,23 @@ dtls1_new(SSL *s) | |||
105 | } | 105 | } |
106 | 106 | ||
107 | static void | 107 | static void |
108 | dtls1_drain_rcontents(pqueue queue) | ||
109 | { | ||
110 | DTLS1_RCONTENT_DATA_INTERNAL *rdata; | ||
111 | pitem *item; | ||
112 | |||
113 | if (queue == NULL) | ||
114 | return; | ||
115 | |||
116 | while ((item = pqueue_pop(queue)) != NULL) { | ||
117 | rdata = (DTLS1_RCONTENT_DATA_INTERNAL *)item->data; | ||
118 | tls_content_free(rdata->rcontent); | ||
119 | free(item->data); | ||
120 | pitem_free(item); | ||
121 | } | ||
122 | } | ||
123 | |||
124 | static void | ||
108 | dtls1_drain_records(pqueue queue) | 125 | dtls1_drain_records(pqueue queue) |
109 | { | 126 | { |
110 | pitem *item; | 127 | pitem *item; |
@@ -141,7 +158,7 @@ dtls1_clear_queues(SSL *s) | |||
141 | dtls1_drain_records(s->d1->unprocessed_rcds.q); | 158 | dtls1_drain_records(s->d1->unprocessed_rcds.q); |
142 | dtls1_drain_fragments(s->d1->buffered_messages); | 159 | dtls1_drain_fragments(s->d1->buffered_messages); |
143 | dtls1_drain_fragments(s->d1->sent_messages); | 160 | dtls1_drain_fragments(s->d1->sent_messages); |
144 | dtls1_drain_records(s->d1->buffered_app_data.q); | 161 | dtls1_drain_rcontents(s->d1->buffered_app_data.q); |
145 | } | 162 | } |
146 | 163 | ||
147 | void | 164 | void |