summaryrefslogtreecommitdiff
path: root/src/lib/libssl/tls_internal.h
diff options
context:
space:
mode:
authorcvs2svn <admin@example.com>2022-05-04 18:02:08 +0000
committercvs2svn <admin@example.com>2022-05-04 18:02:08 +0000
commit3c94dc45dfb15483d76c47a128ec352cc0b655ac (patch)
treea7cfb4512c784e9518f1b1c2f4009295b8766ef4 /src/lib/libssl/tls_internal.h
parentf32cca700e59c0fd1ddd8f1fd4b35a5401be28fe (diff)
downloadopenbsd-tb_20220504.tar.gz
openbsd-tb_20220504.tar.bz2
openbsd-tb_20220504.zip
This commit was manufactured by cvs2git to create tag 'tb_20220504'.tb_20220504
Diffstat (limited to 'src/lib/libssl/tls_internal.h')
-rw-r--r--src/lib/libssl/tls_internal.h83
1 files changed, 0 insertions, 83 deletions
diff --git a/src/lib/libssl/tls_internal.h b/src/lib/libssl/tls_internal.h
deleted file mode 100644
index a009635a05..0000000000
--- a/src/lib/libssl/tls_internal.h
+++ /dev/null
@@ -1,83 +0,0 @@
1/* $OpenBSD: tls_internal.h,v 1.5 2022/01/11 18:28:41 jsing Exp $ */
2/*
3 * Copyright (c) 2018, 2019, 2021 Joel Sing <jsing@openbsd.org>
4 *
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 */
17
18#ifndef HEADER_TLS_INTERNAL_H
19#define HEADER_TLS_INTERNAL_H
20
21#include <openssl/dh.h>
22#include <openssl/evp.h>
23
24#include "bytestring.h"
25
26__BEGIN_HIDDEN_DECLS
27
28#define TLS_IO_SUCCESS 1
29#define TLS_IO_EOF 0
30#define TLS_IO_FAILURE -1
31#define TLS_IO_ALERT -2
32#define TLS_IO_WANT_POLLIN -3
33#define TLS_IO_WANT_POLLOUT -4
34#define TLS_IO_WANT_RETRY -5 /* Retry the previous call immediately. */
35
36/*
37 * Callbacks.
38 */
39typedef ssize_t (*tls_read_cb)(void *_buf, size_t _buflen, void *_cb_arg);
40typedef ssize_t (*tls_write_cb)(const void *_buf, size_t _buflen,
41 void *_cb_arg);
42typedef ssize_t (*tls_flush_cb)(void *_cb_arg);
43
44/*
45 * Buffers.
46 */
47struct tls_buffer;
48
49struct tls_buffer *tls_buffer_new(size_t init_size);
50int tls_buffer_set_data(struct tls_buffer *buf, CBS *data);
51void tls_buffer_free(struct tls_buffer *buf);
52ssize_t tls_buffer_extend(struct tls_buffer *buf, size_t len,
53 tls_read_cb read_cb, void *cb_arg);
54void tls_buffer_cbs(struct tls_buffer *buf, CBS *cbs);
55int tls_buffer_finish(struct tls_buffer *buf, uint8_t **out, size_t *out_len);
56
57/*
58 * Key shares.
59 */
60struct tls_key_share;
61
62struct tls_key_share *tls_key_share_new(uint16_t group_id);
63struct tls_key_share *tls_key_share_new_nid(int nid);
64void tls_key_share_free(struct tls_key_share *ks);
65
66uint16_t tls_key_share_group(struct tls_key_share *ks);
67int tls_key_share_nid(struct tls_key_share *ks);
68void tls_key_share_set_key_bits(struct tls_key_share *ks, size_t key_bits);
69int tls_key_share_set_dh_params(struct tls_key_share *ks, DH *dh_params);
70int tls_key_share_peer_pkey(struct tls_key_share *ks, EVP_PKEY *pkey);
71int tls_key_share_generate(struct tls_key_share *ks);
72int tls_key_share_params(struct tls_key_share *ks, CBB *cbb);
73int tls_key_share_public(struct tls_key_share *ks, CBB *cbb);
74int tls_key_share_peer_params(struct tls_key_share *ks, CBS *cbs,
75 int *decode_error, int *invalid_params);
76int tls_key_share_peer_public(struct tls_key_share *ks, CBS *cbs,
77 int *decode_error, int *invalid_key);
78int tls_key_share_derive(struct tls_key_share *ks, uint8_t **shared_key,
79 size_t *shared_key_len);
80
81__END_HIDDEN_DECLS
82
83#endif