summaryrefslogtreecommitdiff
path: root/src/lib/libssl/tls_buffer.c
diff options
context:
space:
mode:
authorjsing <>2022-07-20 06:32:24 +0000
committerjsing <>2022-07-20 06:32:24 +0000
commitccb4f685d743447d79e76e1380f93ba28b5b8e1e (patch)
tree71c8f3c98cc3af4e296c929982738339c5534368 /src/lib/libssl/tls_buffer.c
parent65be960bd3c39cb5e24e7479f7f1dfd10d8c6f69 (diff)
downloadopenbsd-ccb4f685d743447d79e76e1380f93ba28b5b8e1e.tar.gz
openbsd-ccb4f685d743447d79e76e1380f93ba28b5b8e1e.tar.bz2
openbsd-ccb4f685d743447d79e76e1380f93ba28b5b8e1e.zip
Remove tls_buffer_set_data() and remove/revise callers.
There is no way that tls_buffer_set_data() can currently work in conjunction with tls_buffer_expand(). This fact is currently hidden by the way that PHH works, which reads the same data from the record layer (which it needs to do anyway, since we may not have all of the handshake message in a single record). Since this is broken, mop it up and change the PHH callback to not provide the record data. ok beck@ tb@
Diffstat (limited to 'src/lib/libssl/tls_buffer.c')
-rw-r--r--src/lib/libssl/tls_buffer.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/lib/libssl/tls_buffer.c b/src/lib/libssl/tls_buffer.c
index 5c0ca7e40e..9bb6b62e51 100644
--- a/src/lib/libssl/tls_buffer.c
+++ b/src/lib/libssl/tls_buffer.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tls_buffer.c,v 1.1 2021/10/23 13:12:14 jsing Exp $ */ 1/* $OpenBSD: tls_buffer.c,v 1.2 2022/07/20 06:32:24 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 *
@@ -76,15 +76,6 @@ tls_buffer_resize(struct tls_buffer *buf, size_t capacity)
76 return 1; 76 return 1;
77} 77}
78 78
79int
80tls_buffer_set_data(struct tls_buffer *buf, CBS *data)
81{
82 if (!tls_buffer_resize(buf, CBS_len(data)))
83 return 0;
84 memcpy(buf->data, CBS_data(data), CBS_len(data));
85 return 1;
86}
87
88ssize_t 79ssize_t
89tls_buffer_extend(struct tls_buffer *buf, size_t len, 80tls_buffer_extend(struct tls_buffer *buf, size_t len,
90 tls_read_cb read_cb, void *cb_arg) 81 tls_read_cb read_cb, void *cb_arg)