summaryrefslogtreecommitdiff
path: root/src/lib/libressl/ressl.h
diff options
context:
space:
mode:
authorjsing <>2014-07-12 01:20:25 +0000
committerjsing <>2014-07-12 01:20:25 +0000
commit2b0153d4f076d501b21de2e54937a5bb1b139635 (patch)
treecb217fd8fb935cea61fc26de366b7e407229df65 /src/lib/libressl/ressl.h
parentc95157e4b6c5e281cb496ef41f9969df25abef91 (diff)
downloadopenbsd-2b0153d4f076d501b21de2e54937a5bb1b139635.tar.gz
openbsd-2b0153d4f076d501b21de2e54937a5bb1b139635.tar.bz2
openbsd-2b0153d4f076d501b21de2e54937a5bb1b139635.zip
Initial version of libressl - a library that provides a clean, simple,
consistent and secure-by-default API for SSL clients (and soon servers). This is a long way from complete and the interface will likely change substantially - committing now so that further work can happen in the tree. Initiated by tedu@ and inspired by discussions with tedu@, beck@ and other developers.
Diffstat (limited to 'src/lib/libressl/ressl.h')
-rw-r--r--src/lib/libressl/ressl.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/lib/libressl/ressl.h b/src/lib/libressl/ressl.h
new file mode 100644
index 0000000000..5217a69c15
--- /dev/null
+++ b/src/lib/libressl/ressl.h
@@ -0,0 +1,39 @@
1/*
2 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
3 *
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16
17#ifndef HEADER_RESSL_H
18#define HEADER_RESSL_H
19
20#include <ressl/ressl_config.h>
21
22struct ressl;
23
24int ressl_init(void);
25
26const char *ressl_error(struct ressl *ctx);
27
28struct ressl *ressl_new(struct ressl_config *config);
29void ressl_reset(struct ressl *ctx);
30void ressl_free(struct ressl *ctx);
31
32int ressl_connect(struct ressl *ctx, const char *host, const char *port);
33int ressl_connect_socket(struct ressl *ctx, int s, const char *hostname);
34int ressl_read(struct ressl *ctx, char *buf, size_t buflen, size_t *outlen);
35int ressl_write(struct ressl *ctx, const char *buf, size_t buflen,
36 size_t *outlen);
37int ressl_close(struct ressl *ctx);
38
39#endif /* HEADER_RESSL_H */