OpenVPN
ssl_openssl.h
Go to the documentation of this file.
1 /*
2  * OpenVPN -- An application to securely tunnel IP networks
3  * over a single TCP/UDP port, with support for SSL/TLS-based
4  * session authentication and key exchange,
5  * packet encryption, packet authentication, and
6  * packet compression.
7  *
8  * Copyright (C) 2002-2023 OpenVPN Inc <sales@openvpn.net>
9  * Copyright (C) 2010-2021 Fox Crypto B.V. <openvpn@foxcrypto.com>
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License version 2
13  * as published by the Free Software Foundation.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License along
21  * with this program; if not, write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23  */
24 
29 #ifndef SSL_OPENSSL_H_
30 #define SSL_OPENSSL_H_
31 
32 #include <openssl/ssl.h>
33 #include <openssl/err.h>
34 
39 struct tls_root_ctx {
40  SSL_CTX *ctx;
41  time_t crl_last_mtime;
42  off_t crl_last_size;
43 };
44 
45 struct key_state_ssl {
46  SSL *ssl; /* SSL object -- new obj created for each new key */
47  BIO *ssl_bio; /* read/write plaintext from here */
48  BIO *ct_in; /* write ciphertext to here */
49  BIO *ct_out; /* read ciphertext from here */
50 };
51 
56 extern int mydata_index; /* GLOBAL */
57 
58 static inline void
60 {
61  ERR_clear_error();
62 }
63 
64 #endif /* SSL_OPENSSL_H_ */
key_state_ssl
Definition: ssl_mbedtls.h:125
key_state_ssl::ct_in
BIO * ct_in
Definition: ssl_openssl.h:48
key_state_ssl::ssl_bio
BIO * ssl_bio
Definition: ssl_openssl.h:47
key_state_ssl::ct_out
BIO * ct_out
Definition: ssl_openssl.h:49
tls_clear_error
static void tls_clear_error(void)
Definition: ssl_openssl.h:59
key_state_ssl::ssl
SSL * ssl
Definition: ssl_openssl.h:46
tls_root_ctx::crl_last_mtime
time_t crl_last_mtime
CRL last modification time.
Definition: ssl_mbedtls.h:114
tls_root_ctx::crl_last_size
off_t crl_last_size
size of last loaded CRL
Definition: ssl_mbedtls.h:115
mydata_index
int mydata_index
Allocate space in SSL objects in which to store a struct tls_session pointer back to parent.
Definition: ssl_openssl.c:82
tls_root_ctx
Structure that wraps the TLS context.
Definition: ssl_mbedtls.h:104
tls_root_ctx::ctx
SSL_CTX * ctx
Definition: ssl_openssl.h:40