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-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
9 *  Copyright (C) 2010 Fox Crypto B.V. <openvpn@fox-it.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
21 *  along with this program (see the file COPYING included with this
22 *  distribution); if not, write to the Free Software Foundation, Inc.,
23 *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
24 */
25
26/**
27 * @file Control Channel OpenSSL Backend
28 */
29
30#ifndef SSL_OPENSSL_H_
31#define SSL_OPENSSL_H_
32
33#include <openssl/ssl.h>
34
35/**
36 * Structure that wraps the TLS context. Contents differ depending on the
37 * SSL library used.
38 */
39struct tls_root_ctx {
40    SSL_CTX *ctx;
41};
42
43struct key_state_ssl {
44    SSL *ssl;			/* SSL object -- new obj created for each new key */
45    BIO *ssl_bio;			/* read/write plaintext from here */
46    BIO *ct_in;			/* write ciphertext to here */
47    BIO *ct_out;			/* read ciphertext from here */
48};
49
50/**
51 * Allocate space in SSL objects in which to store a struct tls_session
52 * pointer back to parent.
53 */
54extern int mydata_index; /* GLOBAL */
55
56void openssl_set_mydata_index (void);
57
58#endif /* SSL_OPENSSL_H_ */
59