summaryrefslogtreecommitdiff
path: root/src/lib/libssl
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libssl')
-rw-r--r--src/lib/libssl/tls13_record.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/lib/libssl/tls13_record.c b/src/lib/libssl/tls13_record.c
index dbc835c546..0723fa3b0a 100644
--- a/src/lib/libssl/tls13_record.c
+++ b/src/lib/libssl/tls13_record.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tls13_record.c,v 1.10 2022/07/22 19:33:53 jsing Exp $ */ 1/* $OpenBSD: tls13_record.c,v 1.11 2026/08/21 02:23:33 kenjiro Exp $ */
2/* 2/*
3 * Copyright (c) 2018, 2019 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2018, 2019 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -32,19 +32,7 @@ struct tls13_record {
32struct tls13_record * 32struct tls13_record *
33tls13_record_new(void) 33tls13_record_new(void)
34{ 34{
35 struct tls13_record *rec = NULL; 35 return calloc(1, sizeof(struct tls13_record));
36
37 if ((rec = calloc(1, sizeof(struct tls13_record))) == NULL)
38 goto err;
39 if ((rec->buf = tls_buffer_new(TLS13_RECORD_MAX_LEN)) == NULL)
40 goto err;
41
42 return rec;
43
44 err:
45 tls13_record_free(rec);
46
47 return NULL;
48} 36}
49 37
50void 38void
@@ -129,6 +117,11 @@ tls13_record_recv(struct tls13_record *rec, tls_read_cb wire_read,
129 if (rec->data != NULL) 117 if (rec->data != NULL)
130 return TLS13_IO_FAILURE; 118 return TLS13_IO_FAILURE;
131 119
120 if (rec->buf == NULL)
121 rec->buf = tls_buffer_new(TLS13_RECORD_HEADER_LEN);
122 if (rec->buf == NULL)
123 return TLS13_IO_FAILURE;
124
132 if (rec->content_type == 0) { 125 if (rec->content_type == 0) {
133 if ((ret = tls_buffer_extend(rec->buf, 126 if ((ret = tls_buffer_extend(rec->buf,
134 TLS13_RECORD_HEADER_LEN, wire_read, wire_arg)) <= 0) 127 TLS13_RECORD_HEADER_LEN, wire_read, wire_arg)) <= 0)