diff options
Diffstat (limited to 'src/lib/libressl/ressl_internal.h')
-rw-r--r-- | src/lib/libressl/ressl_internal.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/lib/libressl/ressl_internal.h b/src/lib/libressl/ressl_internal.h new file mode 100644 index 0000000000..f4eec10e63 --- /dev/null +++ b/src/lib/libressl/ressl_internal.h | |||
@@ -0,0 +1,52 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2014 Jeremie Courreges-Anglas <jca@openbsd.org> | ||
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_INTERNAL_H | ||
19 | #define HEADER_RESSL_INTERNAL_H | ||
20 | |||
21 | #include <openssl/ssl.h> | ||
22 | |||
23 | #define HTTPS_PORT "443" | ||
24 | |||
25 | #define _PATH_SSL_CA_FILE "/etc/ssl/cert.pem" | ||
26 | |||
27 | struct ressl_config { | ||
28 | const char *ca_file; | ||
29 | const char *ca_path; | ||
30 | const char *ciphers; | ||
31 | const char *server_name; | ||
32 | int verify; | ||
33 | int verify_depth; | ||
34 | }; | ||
35 | |||
36 | struct ressl { | ||
37 | struct ressl_config *config; | ||
38 | |||
39 | int err; | ||
40 | char *errmsg; | ||
41 | |||
42 | int socket; | ||
43 | |||
44 | SSL *ssl_conn; | ||
45 | SSL_CTX *ssl_ctx; | ||
46 | }; | ||
47 | |||
48 | int ressl_check_hostname(X509 *cert, const char *host); | ||
49 | int ressl_host_port(const char *hostport, char **host, char **port); | ||
50 | int ressl_set_error(struct ressl *ctx, char *fmt, ...); | ||
51 | |||
52 | #endif /* HEADER_RESSL_INTERNAL_H */ | ||