diff options
author | Adriaan de Jong <dejong@fox-it.com> | 2011-06-23 17:54:49 +0200 |
---|---|---|
committer | David Sommerseth <davids@redhat.com> | 2011-10-19 22:17:22 +0200 |
commit | 1b1a98069b290512f673db5630eb4134f4899f16 (patch) | |
tree | 9992c511482ce2843e4e1fb525d7793e38b0cf64 /crypto.h | |
parent | 76dafacecdcdf30a8278ab3abcec64831e95054f (diff) | |
download | openvpn-1b1a98069b290512f673db5630eb4134f4899f16.tar.gz openvpn-1b1a98069b290512f673db5630eb4134f4899f16.tar.xz openvpn-1b1a98069b290512f673db5630eb4134f4899f16.zip |
Removed stale OpenSSL defines from crypto.h
Signed-off-by: Adriaan de Jong <dejong@fox-it.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
Diffstat (limited to 'crypto.h')
-rw-r--r-- | crypto.h | 119 |
1 files changed, 0 insertions, 119 deletions
@@ -34,22 +34,6 @@ #define ALLOW_NON_CBC_CIPHERS -#include <openssl/objects.h> -#include <openssl/rand.h> -#include <openssl/evp.h> -#include <openssl/hmac.h> -#include <openssl/des.h> -#include <openssl/md5.h> -#if NTLM -#include <openssl/md4.h> -#endif -#include <openssl/sha.h> -#include <openssl/err.h> - -#if SSLEAY_VERSION_NUMBER >= 0x00907000L -#include <openssl/des_old.h> -#endif - #include "crypto_backend.h" #include "basic.h" #include "buffer.h" @@ -57,109 +41,6 @@ #include "mtu.h" /* - * Workarounds for incompatibilites between OpenSSL libraries. - * Right now we accept OpenSSL libraries from 0.9.5 to 0.9.7. - */ - -#if SSLEAY_VERSION_NUMBER < 0x00907000L - -/* Workaround: EVP_CIPHER_mode is defined wrong in OpenSSL 0.9.6 but is fixed in 0.9.7 */ -#undef EVP_CIPHER_mode -#define EVP_CIPHER_mode(e) (((e)->flags) & EVP_CIPH_MODE) - -#define DES_cblock des_cblock -#define DES_is_weak_key des_is_weak_key -#define DES_check_key_parity des_check_key_parity -#define DES_set_odd_parity des_set_odd_parity - -#define HMAC_CTX_init(ctx) CLEAR (*ctx) -#define HMAC_Init_ex(ctx,sec,len,md,impl) HMAC_Init(ctx, sec, len, md) -#define HMAC_CTX_cleanup(ctx) HMAC_cleanup(ctx) -#define EVP_MD_CTX_cleanup(md) CLEAR (*md) - -#define INFO_CALLBACK_SSL_CONST - -#endif - -#ifndef INFO_CALLBACK_SSL_CONST -#define INFO_CALLBACK_SSL_CONST const -#endif - -#if SSLEAY_VERSION_NUMBER < 0x00906000 - -#undef EVP_CIPHER_mode -#define EVP_CIPHER_mode(x) 1 -#define EVP_CIPHER_CTX_mode(x) 1 -#define EVP_CIPHER_flags(x) 0 - -#define EVP_CIPH_CBC_MODE 1 -#define EVP_CIPH_CFB_MODE 0 -#define EVP_CIPH_OFB_MODE 0 -#define EVP_CIPH_VARIABLE_LENGTH 0 - -#define OPENSSL_malloc(x) malloc(x) -#define OPENSSL_free(x) free(x) - -static inline int -EVP_CipherInit_ov (EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, uint8_t *key, uint8_t *iv, int enc) -{ - EVP_CipherInit (ctx, type, key, iv, enc); - return 1; -} - -static inline int -EVP_CipherUpdate_ov (EVP_CIPHER_CTX *ctx, uint8_t *out, int *outl, uint8_t *in, int inl) -{ - EVP_CipherUpdate (ctx, out, outl, in, inl); - return 1; -} - -static inline bool -cipher_ok (const char* name) -{ - const int i = strlen (name) - 4; - if (i >= 0) - return !strcmp (name + i, "-CBC"); - else - return false; -} - -#else - -static inline int -EVP_CipherInit_ov (EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, uint8_t *key, uint8_t *iv, int enc) -{ - return EVP_CipherInit (ctx, type, key, iv, enc); -} - -static inline int -EVP_CipherUpdate_ov (EVP_CIPHER_CTX *ctx, uint8_t *out, int *outl, uint8_t *in, int inl) -{ - return EVP_CipherUpdate (ctx, out, outl, in, inl); -} - -static inline bool -cipher_ok (const char* name) -{ - return true; -} - -#endif - -#if SSLEAY_VERSION_NUMBER < 0x0090581f -#undef DES_check_key_parity -#define DES_check_key_parity(x) 1 -#endif - -#ifndef EVP_CIPHER_name -#define EVP_CIPHER_name(e) OBJ_nid2sn(EVP_CIPHER_nid(e)) -#endif - -#ifndef EVP_MD_name -#define EVP_MD_name(e) OBJ_nid2sn(EVP_MD_type(e)) -#endif - -/* * Defines a key type and key length for both cipher and HMAC. */ struct key_type |