summaryrefslogtreecommitdiff
path: root/src/lib/libressl/ressl.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/libressl/ressl.h81
1 files changed, 0 insertions, 81 deletions
diff --git a/src/lib/libressl/ressl.h b/src/lib/libressl/ressl.h
deleted file mode 100644
index 4ca2507f5a..0000000000
--- a/src/lib/libressl/ressl.h
+++ /dev/null
@@ -1,81 +0,0 @@
1/* $OpenBSD: ressl.h,v 1.21 2014/10/15 21:02:39 tedu Exp $ */
2/*
3 * Copyright (c) 2014 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_RESSL_H
19#define HEADER_RESSL_H
20
21#define RESSL_API 20141008
22
23#define RESSL_PROTOCOL_TLSv1_0 (1 << 1)
24#define RESSL_PROTOCOL_TLSv1_1 (1 << 2)
25#define RESSL_PROTOCOL_TLSv1_2 (1 << 3)
26#define RESSL_PROTOCOL_TLSv1 \
27 (RESSL_PROTOCOL_TLSv1_0|RESSL_PROTOCOL_TLSv1_1|RESSL_PROTOCOL_TLSv1_2)
28#define RESSL_PROTOCOLS_DEFAULT RESSL_PROTOCOL_TLSv1
29
30#define RESSL_READ_AGAIN -2
31#define RESSL_WRITE_AGAIN -3
32
33struct ressl;
34struct ressl_config;
35
36int ressl_init(void);
37
38const char *ressl_error(struct ressl *ctx);
39
40struct ressl_config *ressl_config_new(void);
41void ressl_config_free(struct ressl_config *config);
42
43int ressl_config_set_ca_file(struct ressl_config *config, const char *ca_file);
44int ressl_config_set_ca_path(struct ressl_config *config, const char *ca_path);
45int ressl_config_set_cert_file(struct ressl_config *config,
46 const char *cert_file);
47int ressl_config_set_cert_mem(struct ressl_config *config, const uint8_t *cert,
48 size_t len);
49int ressl_config_set_ciphers(struct ressl_config *config, const char *ciphers);
50int ressl_config_set_ecdhcurve(struct ressl_config *config, const char *name);
51int ressl_config_set_key_file(struct ressl_config *config,
52 const char *key_file);
53int ressl_config_set_key_mem(struct ressl_config *config, const uint8_t *key,
54 size_t len);
55void ressl_config_set_protocols(struct ressl_config *config,
56 uint32_t protocols);
57void ressl_config_set_verify_depth(struct ressl_config *config,
58 int verify_depth);
59
60void ressl_config_clear_keys(struct ressl_config *config);
61void ressl_config_insecure_noverifyhost(struct ressl_config *config);
62void ressl_config_insecure_noverifycert(struct ressl_config *config);
63void ressl_config_verify(struct ressl_config *config);
64
65struct ressl *ressl_client(void);
66struct ressl *ressl_server(void);
67int ressl_configure(struct ressl *ctx, struct ressl_config *config);
68void ressl_reset(struct ressl *ctx);
69void ressl_free(struct ressl *ctx);
70
71int ressl_accept(struct ressl *ctx, struct ressl **cctx);
72int ressl_accept_socket(struct ressl *ctx, struct ressl **cctx, int socket);
73int ressl_connect(struct ressl *ctx, const char *host, const char *port);
74int ressl_connect_socket(struct ressl *ctx, int s, const char *hostname);
75int ressl_listen(struct ressl *ctx, const char *host, const char *port, int af);
76int ressl_read(struct ressl *ctx, void *buf, size_t buflen, size_t *outlen);
77int ressl_write(struct ressl *ctx, const void *buf, size_t buflen,
78 size_t *outlen);
79int ressl_close(struct ressl *ctx);
80
81#endif /* HEADER_RESSL_H */