diff options
author | jsing <> | 2021-10-23 13:12:14 +0000 |
---|---|---|
committer | jsing <> | 2021-10-23 13:12:14 +0000 |
commit | d2039e7348559d4183f5d055e691e70e1dadf349 (patch) | |
tree | bfbb08766325a11dd03fa658249cdacb09f2c3c0 /src/lib/libssl/tls13_handshake_msg.c | |
parent | c4a5b1f8676a44f32abf55d9aff5ae7d2c36a4be (diff) | |
download | openbsd-d2039e7348559d4183f5d055e691e70e1dadf349.tar.gz openbsd-d2039e7348559d4183f5d055e691e70e1dadf349.tar.bz2 openbsd-d2039e7348559d4183f5d055e691e70e1dadf349.zip |
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@
Diffstat (limited to 'src/lib/libssl/tls13_handshake_msg.c')
-rw-r--r-- | src/lib/libssl/tls13_handshake_msg.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/lib/libssl/tls13_handshake_msg.c b/src/lib/libssl/tls13_handshake_msg.c index ff6d6d7e19..67eab3152f 100644 --- a/src/lib/libssl/tls13_handshake_msg.c +++ b/src/lib/libssl/tls13_handshake_msg.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: tls13_handshake_msg.c,v 1.3 2021/05/16 14:19:04 jsing Exp $ */ | 1 | /* $OpenBSD: tls13_handshake_msg.c,v 1.4 2021/10/23 13:12:14 jsing 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 | * |
@@ -28,7 +28,7 @@ struct tls13_handshake_msg { | |||
28 | uint8_t *data; | 28 | uint8_t *data; |
29 | size_t data_len; | 29 | size_t data_len; |
30 | 30 | ||
31 | struct tls13_buffer *buf; | 31 | struct tls_buffer *buf; |
32 | CBS cbs; | 32 | CBS cbs; |
33 | CBB cbb; | 33 | CBB cbb; |
34 | }; | 34 | }; |
@@ -40,7 +40,7 @@ tls13_handshake_msg_new() | |||
40 | 40 | ||
41 | if ((msg = calloc(1, sizeof(struct tls13_handshake_msg))) == NULL) | 41 | if ((msg = calloc(1, sizeof(struct tls13_handshake_msg))) == NULL) |
42 | goto err; | 42 | goto err; |
43 | if ((msg->buf = tls13_buffer_new(0)) == NULL) | 43 | if ((msg->buf = tls_buffer_new(0)) == NULL) |
44 | goto err; | 44 | goto err; |
45 | 45 | ||
46 | return msg; | 46 | return msg; |
@@ -57,7 +57,7 @@ tls13_handshake_msg_free(struct tls13_handshake_msg *msg) | |||
57 | if (msg == NULL) | 57 | if (msg == NULL) |
58 | return; | 58 | return; |
59 | 59 | ||
60 | tls13_buffer_free(msg->buf); | 60 | tls_buffer_free(msg->buf); |
61 | 61 | ||
62 | CBB_cleanup(&msg->cbb); | 62 | CBB_cleanup(&msg->cbb); |
63 | 63 | ||
@@ -74,7 +74,7 @@ tls13_handshake_msg_data(struct tls13_handshake_msg *msg, CBS *cbs) | |||
74 | int | 74 | int |
75 | tls13_handshake_msg_set_buffer(struct tls13_handshake_msg *msg, CBS *cbs) | 75 | tls13_handshake_msg_set_buffer(struct tls13_handshake_msg *msg, CBS *cbs) |
76 | { | 76 | { |
77 | return tls13_buffer_set_data(msg->buf, cbs); | 77 | return tls_buffer_set_data(msg->buf, cbs); |
78 | } | 78 | } |
79 | 79 | ||
80 | uint8_t | 80 | uint8_t |
@@ -137,12 +137,12 @@ tls13_handshake_msg_recv(struct tls13_handshake_msg *msg, | |||
137 | return TLS13_IO_FAILURE; | 137 | return TLS13_IO_FAILURE; |
138 | 138 | ||
139 | if (msg->msg_type == 0) { | 139 | if (msg->msg_type == 0) { |
140 | if ((ret = tls13_buffer_extend(msg->buf, | 140 | if ((ret = tls_buffer_extend(msg->buf, |
141 | TLS13_HANDSHAKE_MSG_HEADER_LEN, | 141 | TLS13_HANDSHAKE_MSG_HEADER_LEN, |
142 | tls13_handshake_msg_read_cb, rl)) <= 0) | 142 | tls13_handshake_msg_read_cb, rl)) <= 0) |
143 | return ret; | 143 | return ret; |
144 | 144 | ||
145 | tls13_buffer_cbs(msg->buf, &cbs); | 145 | tls_buffer_cbs(msg->buf, &cbs); |
146 | 146 | ||
147 | if (!CBS_get_u8(&cbs, &msg_type)) | 147 | if (!CBS_get_u8(&cbs, &msg_type)) |
148 | return TLS13_IO_FAILURE; | 148 | return TLS13_IO_FAILURE; |
@@ -157,12 +157,12 @@ tls13_handshake_msg_recv(struct tls13_handshake_msg *msg, | |||
157 | msg->msg_len = msg_len; | 157 | msg->msg_len = msg_len; |
158 | } | 158 | } |
159 | 159 | ||
160 | if ((ret = tls13_buffer_extend(msg->buf, | 160 | if ((ret = tls_buffer_extend(msg->buf, |
161 | TLS13_HANDSHAKE_MSG_HEADER_LEN + msg->msg_len, | 161 | TLS13_HANDSHAKE_MSG_HEADER_LEN + msg->msg_len, |
162 | tls13_handshake_msg_read_cb, rl)) <= 0) | 162 | tls13_handshake_msg_read_cb, rl)) <= 0) |
163 | return ret; | 163 | return ret; |
164 | 164 | ||
165 | if (!tls13_buffer_finish(msg->buf, &msg->data, &msg->data_len)) | 165 | if (!tls_buffer_finish(msg->buf, &msg->data, &msg->data_len)) |
166 | return TLS13_IO_FAILURE; | 166 | return TLS13_IO_FAILURE; |
167 | 167 | ||
168 | return TLS13_IO_SUCCESS; | 168 | return TLS13_IO_SUCCESS; |