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
8
* Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
9
* Copyright (C) 2010 Fox Crypto B.V. <openvpn@fox-it.com>
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.
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.
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
27
* @file Data Channel Cryptography OpenSSL-specific backend interface
30
#ifndef CRYPTO_OPENSSL_H_
31
#define CRYPTO_OPENSSL_H_
33
#include <openssl/evp.h>
34
#include <openssl/hmac.h>
35
#include <openssl/md5.h>
37
/** Generic cipher key type %context. */
38
typedef EVP_CIPHER cipher_kt_t;
40
/** Generic message digest key type %context. */
41
typedef EVP_MD md_kt_t;
43
/** Generic cipher %context. */
44
typedef EVP_CIPHER_CTX cipher_ctx_t;
46
/** Generic message digest %context. */
47
typedef EVP_MD_CTX md_ctx_t;
49
/** Generic HMAC %context. */
50
typedef HMAC_CTX hmac_ctx_t;
52
/** Maximum length of an IV */
53
#define OPENVPN_MAX_IV_LENGTH EVP_MAX_IV_LENGTH
55
/** Cipher is in CBC mode */
56
#define OPENVPN_MODE_CBC EVP_CIPH_CBC_MODE
58
/** Cipher is in OFB mode */
59
#define OPENVPN_MODE_OFB EVP_CIPH_OFB_MODE
61
/** Cipher is in CFB mode */
62
#define OPENVPN_MODE_CFB EVP_CIPH_CFB_MODE
64
/** Cipher should encrypt */
65
#define OPENVPN_OP_ENCRYPT 1
67
/** Cipher should decrypt */
68
#define OPENVPN_OP_DECRYPT 0
70
#define DES_KEY_LENGTH 8
71
#define MD4_DIGEST_LENGTH 16
73
#endif /* CRYPTO_OPENSSL_H_ */