From 0f138cf2d59891bed94dcedcc4fb271e663a2520 Mon Sep 17 00:00:00 2001 From: Nicolas Williams Date: Wed, 30 Mar 2016 14:26:57 -0500 Subject: [PATCH] Add missing hcrypto rename macros --- lib/hcrypto/bn.h | 5 +++++ lib/hcrypto/ec.h | 4 ++++ lib/hcrypto/engine.h | 2 ++ lib/hcrypto/evp.h | 38 +++++++++++++++++++++++++++++++------- lib/hcrypto/rsa.h | 3 +++ 5 files changed, 45 insertions(+), 7 deletions(-) diff --git a/lib/hcrypto/bn.h b/lib/hcrypto/bn.h index 2fa25ac1a..3b78c220d 100644 --- a/lib/hcrypto/bn.h +++ b/lib/hcrypto/bn.h @@ -68,6 +68,11 @@ #define BN_CTX_start hc_BN_CTX_start #define BN_CTX_end hc_BN_CTX_end +#define BIGNUM hc_BIGNUM +#define BN_GENCB hc_BN_GENCB +#define BN_CTX hc_BN_CTX +#define BN_BLINDING hc_BN_BLINDING + /* * */ diff --git a/lib/hcrypto/ec.h b/lib/hcrypto/ec.h index d92a46efc..ac6e87788 100644 --- a/lib/hcrypto/ec.h +++ b/lib/hcrypto/ec.h @@ -34,6 +34,10 @@ #ifndef HEIM_EC_H #define HEIM_EC_H 1 +#define EC_KEY hc_EC_KEY +#define EC_GROUP hc_EC_GROUP +#define EC_GROUP_ID hc_EC_GROUP_ID +#define EC_GROUP_ID_s hc_EC_GROUP_ID_s #define EC_GROUP_get_degree hc_EC_GROUP_get_degree #define EC_KEY_get0_group hc_EC_KEY_get0_group #define EC_GROUP_get_order hc_EC_GROUP_get_order diff --git a/lib/hcrypto/engine.h b/lib/hcrypto/engine.h index 7fd8f3e1e..2ee745e4e 100644 --- a/lib/hcrypto/engine.h +++ b/lib/hcrypto/engine.h @@ -62,6 +62,8 @@ #define ENGINE_set_default_DH hc_ENGINE_set_default_DH #define ENGINE_set_default_RSA hc_ENGINE_set_default_RSA +#define ENGINE hc_ENGINE + /* * */ diff --git a/lib/hcrypto/evp.h b/lib/hcrypto/evp.h index 626c46329..8c5be7916 100644 --- a/lib/hcrypto/evp.h +++ b/lib/hcrypto/evp.h @@ -108,6 +108,27 @@ #define EVP_CIPHER_CTX_rand_key hc_EVP_CIPHER_CTX_rand_key #define hcrypto_validate hc_hcrypto_validate +/* Type name renaming */ +#define EVP_MD_CTX hc_EVP_MD_CTX +#define EVP_PKEY hc_EVP_PKEY +#define EVP_MD hc_EVP_MD +#define EVP_CIPHER hc_EVP_CIPHER +#define EVP_CIPHER_CTX hc_EVP_CIPHER_CTX + +/* Constant renaming */ +#define EVP_CIPH_STREAM_CIPHER hc_EVP_CIPH_STREAM_CIPHER +#define EVP_CIPH_CBC_MODE hc_EVP_CIPH_CBC_MODE +#define EVP_CIPH_CFB8_MODE hc_EVP_CIPH_CFB8_MODE +#define EVP_CIPH_MODE hc_EVP_CIPH_MODE +#define EVP_CIPH_CTRL_INIT hc_EVP_CIPH_CTRL_INIT + +#define EVP_CIPH_VARIABLE_LENGTH hc_EVP_CIPH_VARIABLE_LENGTH +#define EVP_CIPH_ALWAYS_CALL_INIT hc_EVP_CIPH_ALWAYS_CALL_INIT +#define EVP_CIPH_RAND_KEY hc_EVP_CIPH_RAND_KEY + +#define EVP_CTRL_INIT hc_EVP_CTRL_INIT + + /* * */ @@ -133,14 +154,17 @@ struct hc_CIPHER { * cipher is used in (use EVP_CIPHER.._mode() to extract the * mode). The rest of the flag field is a bitfield. */ -#define EVP_CIPH_STREAM_CIPHER 0 -#define EVP_CIPH_CBC_MODE 2 -#define EVP_CIPH_CFB8_MODE 4 -#define EVP_CIPH_MODE 0x7 +#define hc_EVP_CIPH_STREAM_CIPHER 1 +#define hc_EVP_CIPH_CBC_MODE 2 +#define hc_EVP_CIPH_CFB8_MODE 4 +#define hc_EVP_CIPH_MODE 0x7 +#define hc_EVP_CIPH_CTRL_INIT 0x40 -#define EVP_CIPH_VARIABLE_LENGTH 0x008 /* variable key length */ -#define EVP_CIPH_ALWAYS_CALL_INIT 0x020 -#define EVP_CIPH_RAND_KEY 0x200 +#define hc_EVP_CTRL_INIT 0x0 + +#define hc_EVP_CIPH_VARIABLE_LENGTH 0x008 /* variable key length */ +#define hc_EVP_CIPH_ALWAYS_CALL_INIT 0x020 +#define hc_EVP_CIPH_RAND_KEY 0x200 int (*init)(EVP_CIPHER_CTX*,const unsigned char*,const unsigned char*,int); int (*do_cipher)(EVP_CIPHER_CTX *, unsigned char *, diff --git a/lib/hcrypto/rsa.h b/lib/hcrypto/rsa.h index 798852d3f..a5bf51395 100644 --- a/lib/hcrypto/rsa.h +++ b/lib/hcrypto/rsa.h @@ -67,6 +67,9 @@ #define i2d_RSAPublicKey hc_i2d_RSAPublicKey #define d2i_RSAPublicKey hc_d2i_RSAPublicKey +#define RSA hc_RSA +#define RSA_METHOD hc_RSA_METHOD + /* * */