From d2039e7348559d4183f5d055e691e70e1dadf349 Mon Sep 17 00:00:00 2001 From: jsing <> Date: Sat, 23 Oct 2021 13:12:14 +0000 Subject: Rename tls13_buffer to tls_buffer. This code will soon be used in the DTLSv1.2 and TLSv1.2 stack. Also introduce tls_internal.h and move/rename the read/write/flush callbacks. ok beck@ tb@ --- src/lib/libssl/tls13_record.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 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 3bdaead5a7..2c744668e5 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.8 2021/05/16 14:19:04 jsing Exp $ */ +/* $OpenBSD: tls13_record.c,v 1.9 2021/10/23 13:12:14 jsing Exp $ */ /* * Copyright (c) 2018, 2019 Joel Sing * @@ -26,7 +26,7 @@ struct tls13_record { size_t data_len; CBS cbs; - struct tls13_buffer *buf; + struct tls_buffer *buf; }; struct tls13_record * @@ -36,7 +36,7 @@ tls13_record_new(void) if ((rec = calloc(1, sizeof(struct tls13_record))) == NULL) goto err; - if ((rec->buf = tls13_buffer_new(TLS13_RECORD_MAX_LEN)) == NULL) + if ((rec->buf = tls_buffer_new(TLS13_RECORD_MAX_LEN)) == NULL) goto err; return rec; @@ -53,7 +53,7 @@ tls13_record_free(struct tls13_record *rec) if (rec == NULL) return; - tls13_buffer_free(rec->buf); + tls_buffer_free(rec->buf); freezero(rec->data, rec->data_len); freezero(rec, sizeof(struct tls13_record)); @@ -118,7 +118,7 @@ tls13_record_set_data(struct tls13_record *rec, uint8_t *data, size_t data_len) } ssize_t -tls13_record_recv(struct tls13_record *rec, tls13_read_cb wire_read, +tls13_record_recv(struct tls13_record *rec, tls_read_cb wire_read, void *wire_arg) { uint16_t rec_len, rec_version; @@ -130,11 +130,11 @@ tls13_record_recv(struct tls13_record *rec, tls13_read_cb wire_read, return TLS13_IO_FAILURE; if (rec->content_type == 0) { - if ((ret = tls13_buffer_extend(rec->buf, + if ((ret = tls_buffer_extend(rec->buf, TLS13_RECORD_HEADER_LEN, wire_read, wire_arg)) <= 0) return ret; - tls13_buffer_cbs(rec->buf, &cbs); + tls_buffer_cbs(rec->buf, &cbs); if (!CBS_get_u8(&cbs, &content_type)) return TLS13_IO_FAILURE; @@ -153,18 +153,18 @@ tls13_record_recv(struct tls13_record *rec, tls13_read_cb wire_read, rec->rec_len = rec_len; } - if ((ret = tls13_buffer_extend(rec->buf, + if ((ret = tls_buffer_extend(rec->buf, TLS13_RECORD_HEADER_LEN + rec->rec_len, wire_read, wire_arg)) <= 0) return ret; - if (!tls13_buffer_finish(rec->buf, &rec->data, &rec->data_len)) + if (!tls_buffer_finish(rec->buf, &rec->data, &rec->data_len)) return TLS13_IO_FAILURE; return rec->data_len; } ssize_t -tls13_record_send(struct tls13_record *rec, tls13_write_cb wire_write, +tls13_record_send(struct tls13_record *rec, tls_write_cb wire_write, void *wire_arg) { ssize_t ret; -- cgit v1.2.3-55-g6feb