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>
36#include <openssl/sha.h>
37#if OPENSSL_VERSION_NUMBER >= 0x30000000L
38#include <openssl/provider.h>
48#if OPENSSL_VERSION_NUMBER < 0x30000000L
56 uint8_t
key[EVP_MAX_KEY_LENGTH];
66#if OPENSSL_VERSION_NUMBER < 0x30000000L
75#define OPENVPN_MAX_IV_LENGTH EVP_MAX_IV_LENGTH
78#define OPENVPN_MODE_CBC EVP_CIPH_CBC_MODE
81#define OPENVPN_MODE_OFB EVP_CIPH_OFB_MODE
84#define OPENVPN_MODE_CFB EVP_CIPH_CFB_MODE
87#define OPENVPN_MODE_GCM EVP_CIPH_GCM_MODE
92#define OPENVPN_OP_ENCRYPT 1
95#define OPENVPN_OP_DECRYPT 0
97#define MD4_DIGEST_LENGTH 16
116#define crypto_msg(flags, ...) \
118 crypto_print_openssl_errors(nonfatal(flags)); \
119 msg((flags), __VA_ARGS__); \
void crypto_print_openssl_errors(const unsigned int flags)
Retrieve any occurred OpenSSL errors and print those errors.
EVP_MD_CTX md_ctx_t
Generic message digest context.
HMAC_CTX hmac_ctx_t
Generic HMAC context.
const EVP_CIPHER evp_cipher_type
EVP_CIPHER_CTX cipher_ctx_t
Generic cipher context.
Container for unidirectional cipher and HMAC key material.