OpenVPN
|
#include <openssl/evp.h>
#include <openssl/hmac.h>
#include <openssl/md5.h>
#include <openssl/sha.h>
Go to the source code of this file.
Macros | |
#define | OPENVPN_MAX_IV_LENGTH EVP_MAX_IV_LENGTH |
Maximum length of an IV. More... | |
#define | OPENVPN_MODE_CBC EVP_CIPH_CBC_MODE |
Cipher is in CBC mode. More... | |
#define | OPENVPN_MODE_OFB EVP_CIPH_OFB_MODE |
Cipher is in OFB mode. More... | |
#define | OPENVPN_MODE_CFB EVP_CIPH_CFB_MODE |
Cipher is in CFB mode. More... | |
#define | OPENVPN_MODE_GCM EVP_CIPH_GCM_MODE |
Cipher is in GCM mode. More... | |
#define | OPENVPN_OP_ENCRYPT 1 |
Cipher should encrypt. More... | |
#define | OPENVPN_OP_DECRYPT 0 |
Cipher should decrypt. More... | |
#define | DES_KEY_LENGTH 8 |
#define | MD4_DIGEST_LENGTH 16 |
#define | crypto_msg(flags, ...) |
Retrieve any OpenSSL errors, then print the supplied error message. More... | |
Typedefs | |
typedef EVP_CIPHER_CTX | cipher_ctx_t |
Generic cipher context. More... | |
typedef EVP_MD_CTX | md_ctx_t |
Generic message digest context. More... | |
typedef HMAC_CTX | hmac_ctx_t |
Generic HMAC context. More... | |
typedef void | provider_t |
typedef int | crypto_operation_t |
Functions | |
void | crypto_print_openssl_errors (const unsigned int flags) |
Retrieve any occurred OpenSSL errors and print those errors. More... | |
Variables | |
const typedef EVP_CIPHER | evp_cipher_type |
const typedef EVP_MD | evp_md_type |
#define crypto_msg | ( | flags, | |
... | |||
) |
Retrieve any OpenSSL errors, then print the supplied error message.
This is just a convenience wrapper for often occurring situations.
flags | Flags to indicate error type and priority. |
format | Format string to print. |
format | args (optional) arguments for the format string. |
Definition at line 117 of file crypto_openssl.h.
#define DES_KEY_LENGTH 8 |
Definition at line 96 of file crypto_openssl.h.
#define MD4_DIGEST_LENGTH 16 |
Definition at line 97 of file crypto_openssl.h.
#define OPENVPN_MAX_IV_LENGTH EVP_MAX_IV_LENGTH |
Maximum length of an IV.
Definition at line 74 of file crypto_openssl.h.
#define OPENVPN_MODE_CBC EVP_CIPH_CBC_MODE |
Cipher is in CBC mode.
Definition at line 77 of file crypto_openssl.h.
#define OPENVPN_MODE_CFB EVP_CIPH_CFB_MODE |
Cipher is in CFB mode.
Definition at line 83 of file crypto_openssl.h.
#define OPENVPN_MODE_GCM EVP_CIPH_GCM_MODE |
Cipher is in GCM mode.
Definition at line 86 of file crypto_openssl.h.
#define OPENVPN_MODE_OFB EVP_CIPH_OFB_MODE |
Cipher is in OFB mode.
Definition at line 80 of file crypto_openssl.h.
#define OPENVPN_OP_DECRYPT 0 |
Cipher should decrypt.
Definition at line 94 of file crypto_openssl.h.
#define OPENVPN_OP_ENCRYPT 1 |
Cipher should encrypt.
Definition at line 91 of file crypto_openssl.h.
typedef EVP_CIPHER_CTX cipher_ctx_t |
Generic cipher context.
Definition at line 41 of file crypto_openssl.h.
typedef int crypto_operation_t |
Definition at line 88 of file crypto_openssl.h.
typedef HMAC_CTX hmac_ctx_t |
Generic HMAC context.
Definition at line 48 of file crypto_openssl.h.
typedef EVP_MD_CTX md_ctx_t |
Generic message digest context.
Definition at line 44 of file crypto_openssl.h.
typedef void provider_t |
Definition at line 51 of file crypto_openssl.h.
void crypto_print_openssl_errors | ( | const unsigned int | flags | ) |
Retrieve any occurred OpenSSL errors and print those errors.
Note that this function uses the not thread-safe OpenSSL error API.
flags | Flags to indicate error type and priority. |
Definition at line 235 of file crypto_openssl.c.
References check_debug_level(), D_CRYPT_ERRORS, D_TLS_DEBUG_MED, ERR_get_error_all(), and msg.
Referenced by tls_ctx_load_cert_file(), and tls_ctx_load_pkcs12().
const typedef EVP_CIPHER evp_cipher_type |
Definition at line 66 of file crypto_openssl.h.
Referenced by cipher_ctx_init(), cipher_kt_block_size(), cipher_kt_insecure(), cipher_kt_iv_size(), cipher_kt_key_size(), cipher_kt_mode_aead(), cipher_kt_mode_cbc(), cipher_kt_mode_ofb_cfb(), cipher_kt_name(), and cipher_valid_reason().
const typedef EVP_MD evp_md_type |
Definition at line 67 of file crypto_openssl.h.
Referenced by hmac_ctx_init(), md_ctx_init(), md_full(), md_get(), md_kt_name(), md_kt_size(), and md_valid().