EVP_MD_CTX_reset and EVP_aes fixes

pull/2775/head
Eric Blankenhorn 2020-01-09 13:21:14 -06:00
parent ba25161f6c
commit 0abc814792
3 changed files with 196 additions and 68 deletions

138
src/ssl.c
View File

@ -3807,6 +3807,54 @@ static const struct cipher{
#ifdef WOLFSSL_AES_256
{AES_256_CBC_TYPE, "AES-256-CBC", NID_aes_256_cbc},
#endif
#ifdef WOLFSSL_AES_128
{AES_128_CFB1_TYPE, "AES-128-CFB1", NID_aes_128_cfb1},
#endif
#ifdef WOLFSSL_AES_192
{AES_192_CFB1_TYPE, "AES-192-CFB1", NID_aes_192_cfb1},
#endif
#ifdef WOLFSSL_AES_256
{AES_256_CFB1_TYPE, "AES-256-CFB1", NID_aes_256_cfb1},
#endif
#ifdef WOLFSSL_AES_128
{AES_128_CFB8_TYPE, "AES-128-CFB8", NID_aes_128_cfb8},
#endif
#ifdef WOLFSSL_AES_192
{AES_192_CFB8_TYPE, "AES-192-CFB8", NID_aes_192_cfb8},
#endif
#ifdef WOLFSSL_AES_256
{AES_256_CFB8_TYPE, "AES-256-CFB8", NID_aes_256_cfb8},
#endif
#ifdef WOLFSSL_AES_128
{AES_128_CFB128_TYPE, "AES-128-CFB128", NID_aes_128_cfb128},
#endif
#ifdef WOLFSSL_AES_192
{AES_192_CFB128_TYPE, "AES-192-CFB128", NID_aes_192_cfb128},
#endif
#ifdef WOLFSSL_AES_256
{AES_256_CFB128_TYPE, "AES-256-CFB128", NID_aes_256_cfb128},
#endif
#ifdef WOLFSSL_AES_128
{AES_128_OFB_TYPE, "AES-128-OFB", NID_aes_128_ofb},
#endif
#ifdef WOLFSSL_AES_192
{AES_192_OFB_TYPE, "AES-192-OFB", NID_aes_192_ofb},
#endif
#ifdef WOLFSSL_AES_256
{AES_256_OFB_TYPE, "AES-256-OFB", NID_aes_256_ofb},
#endif
#ifdef WOLFSSL_AES_128
{AES_128_XTS_TYPE, "AES-128-XTS", NID_aes_128_xts},
#endif
#ifdef WOLFSSL_AES_256
{AES_256_XTS_TYPE, "AES-256-XTS", NID_aes_256_xts},
#endif
#if defined(OPENSSL_EXTRA)
#ifdef WOLFSSL_AES_128
{AES_128_GCM_TYPE, "AES-128-GCM", NID_aes_128_gcm},
@ -4074,7 +4122,7 @@ const WOLFSSL_EVP_CIPHER *wolfSSL_EVP_get_cipherbynid(int id)
#endif
#endif /* HAVE_AES_CBC */
#ifdef HAVE_AES_OFB
#ifdef WOLFSSL_AES_OFB
#ifdef WOLFSSL_AES_128
static char *EVP_AES_128_OFB;
#endif
@ -4084,18 +4132,18 @@ const WOLFSSL_EVP_CIPHER *wolfSSL_EVP_get_cipherbynid(int id)
#ifdef WOLFSSL_AES_256
static char *EVP_AES_256_OFB;
#endif
#endif /* HAVE_AES_OFB */
#endif /* WOLFSSL_AES_OFB */
#ifdef HAVE_AES_XTS
#ifdef WOLFSSL_AES_XTS
#ifdef WOLFSSL_AES_128
static char *EVP_AES_128_XTS;
#endif
#ifdef WOLFSSL_AES_256
static char *EVP_AES_256_XTS;
#endif
#endif /* HAVE_AES_XTS */
#endif /* WOLFSSL_AES_XTS */
#ifdef HAVE_AES_CFB1
#ifdef WOLFSSL_AES_CFB
#ifdef WOLFSSL_AES_128
static char *EVP_AES_128_CFB1;
#endif
@ -4105,9 +4153,7 @@ const WOLFSSL_EVP_CIPHER *wolfSSL_EVP_get_cipherbynid(int id)
#ifdef WOLFSSL_AES_256
static char *EVP_AES_256_CFB1;
#endif
#endif /* HAVE_AES_CFB1 */
#ifdef HAVE_AES_CFB8
#ifdef WOLFSSL_AES_128
static char *EVP_AES_128_CFB8;
#endif
@ -4117,9 +4163,7 @@ const WOLFSSL_EVP_CIPHER *wolfSSL_EVP_get_cipherbynid(int id)
#ifdef WOLFSSL_AES_256
static char *EVP_AES_256_CFB8;
#endif
#endif /* HAVE_AES_CFB8 */
#ifdef HAVE_AES_CFB128
#ifdef WOLFSSL_AES_128
static char *EVP_AES_128_CFB128;
#endif
@ -4129,7 +4173,7 @@ const WOLFSSL_EVP_CIPHER *wolfSSL_EVP_get_cipherbynid(int id)
#ifdef WOLFSSL_AES_256
static char *EVP_AES_256_CFB128;
#endif
#endif /* HAVE_AES_CFB128 */
#endif /* WOLFSSL_AES_CFB */
#if defined(OPENSSL_EXTRA)
#ifdef HAVE_AESGCM
@ -4202,7 +4246,7 @@ void wolfSSL_EVP_init(void)
#endif
#endif /* HAVE_AES_CBC */
#ifdef HAVE_AES_CFB1
#ifdef WOLFSSL_AES_CFB
#ifdef WOLFSSL_AES_128
EVP_AES_128_CFB1 = (char *)EVP_get_cipherbyname("AES-128-CFB1");
#endif
@ -4214,9 +4258,7 @@ void wolfSSL_EVP_init(void)
#ifdef WOLFSSL_AES_256
EVP_AES_256_CFB1 = (char *)EVP_get_cipherbyname("AES-256-CFB1");
#endif
#endif /* HAVE_AES_CFB1 */
#ifdef HAVE_AES_CFB8
#ifdef WOLFSSL_AES_128
EVP_AES_128_CFB8 = (char *)EVP_get_cipherbyname("AES-128-CFB8");
#endif
@ -4228,9 +4270,7 @@ void wolfSSL_EVP_init(void)
#ifdef WOLFSSL_AES_256
EVP_AES_256_CFB8 = (char *)EVP_get_cipherbyname("AES-256-CFB8");
#endif
#endif /* HAVE_AES_CFB8 */
#ifdef HAVE_AES_CFB12828
#ifdef WOLFSSL_AES_128
EVP_AES_128_CFB128 = (char *)EVP_get_cipherbyname("AES-128-CFB128");
#endif
@ -4242,9 +4282,9 @@ void wolfSSL_EVP_init(void)
#ifdef WOLFSSL_AES_256
EVP_AES_256_CFB128 = (char *)EVP_get_cipherbyname("AES-256-CFB128");
#endif
#endif /* HAVE_AES_CFB128 */
#endif /* WOLFSSL_AES_CFB */
#ifdef HAVE_AES_OFB
#ifdef WOLFSSL_AES_OFB
#ifdef WOLFSSL_AES_128
EVP_AES_128_OFB = (char *)EVP_get_cipherbyname("AES-128-OFB");
#endif
@ -4256,9 +4296,9 @@ void wolfSSL_EVP_init(void)
#ifdef WOLFSSL_AES_256
EVP_AES_256_OFB = (char *)EVP_get_cipherbyname("AES-256-OFB");
#endif
#endif /* HAVE_AES_OFB */
#endif /* WOLFSSL_AES_OFB */
#ifdef HAVE_AES_XTS
#ifdef WOLFSSL_AES_XTS
#ifdef WOLFSSL_AES_128
EVP_AES_128_XTS = (char *)EVP_get_cipherbyname("AES-128-XTS");
#endif
@ -4266,7 +4306,7 @@ void wolfSSL_EVP_init(void)
#ifdef WOLFSSL_AES_256
EVP_AES_256_XTS = (char *)EVP_get_cipherbyname("AES-256-XTS");
#endif
#endif /* HAVE_AES_XTS */
#endif /* WOLFSSL_AES_XTS */
#if defined(OPENSSL_EXTRA)
#ifdef HAVE_AESGCM
@ -16487,7 +16527,7 @@ int wolfSSL_EVP_MD_type(const WOLFSSL_EVP_MD *md)
#endif /* WOLFSSL_AES_256 */
#endif /* HAVE_AES_CBC */
#ifdef HAVE_AES_CFB1
#ifdef WOLFSSL_AES_CFB
#ifdef WOLFSSL_AES_128
const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_128_cfb1(void)
{
@ -16517,9 +16557,7 @@ int wolfSSL_EVP_MD_type(const WOLFSSL_EVP_MD *md)
return EVP_AES_256_CFB1;
}
#endif /* WOLFSSL_AES_256 */
#endif /* HAVE_AES_CFB1 */
#ifdef HAVE_AES_CFB8
#ifdef WOLFSSL_AES_128
const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_128_cfb8(void)
{
@ -16549,9 +16587,7 @@ int wolfSSL_EVP_MD_type(const WOLFSSL_EVP_MD *md)
return EVP_AES_256_CFB8;
}
#endif /* WOLFSSL_AES_256 */
#endif /* HAVE_AES_CFB8 */
#ifdef HAVE_AES_CFB12828
#ifdef WOLFSSL_AES_128
const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_128_cfb128(void)
{
@ -16581,9 +16617,9 @@ int wolfSSL_EVP_MD_type(const WOLFSSL_EVP_MD *md)
return EVP_AES_256_CFB128;
}
#endif /* WOLFSSL_AES_256 */
#endif /* HAVE_AES_CFB128 */
#endif /* WOLFSSL_AES_CFB */
#ifdef HAVE_AES_OFB
#ifdef WOLFSSL_AES_OFB
#ifdef WOLFSSL_AES_128
const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_128_ofb(void)
{
@ -16613,9 +16649,9 @@ int wolfSSL_EVP_MD_type(const WOLFSSL_EVP_MD *md)
return EVP_AES_256_OFB;
}
#endif /* WOLFSSL_AES_256 */
#endif /* HAVE_AES_OFB */
#endif /* WOLFSSL_AES_OFB */
#ifdef HAVE_AES_XTS
#ifdef WOLFSSL_AES_XTS
#ifdef WOLFSSL_AES_128
const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_128_xts(void)
{
@ -16635,7 +16671,7 @@ int wolfSSL_EVP_MD_type(const WOLFSSL_EVP_MD *md)
return EVP_AES_256_XTS;
}
#endif /* WOLFSSL_AES_256 */
#endif /* HAVE_AES_XTS */
#endif /* WOLFSSL_AES_XTS */
#ifdef HAVE_AESGCM
#ifdef WOLFSSL_AES_128
@ -17606,6 +17642,48 @@ int wolfSSL_EVP_MD_type(const WOLFSSL_EVP_MD *md)
ret = wc_AesCbcDecrypt(&ctx->cipher.aes, dst, src, len);
break;
#endif /* HAVE_AES_CBC */
#ifdef WOLFSSL_AES_CFB
case AES_128_CFB1_TYPE:
case AES_192_CFB1_TYPE:
case AES_256_CFB1_TYPE:
case AES_128_CFB8_TYPE:
case AES_192_CFB8_TYPE:
case AES_256_CFB8_TYPE:
case AES_128_CFB128_TYPE:
case AES_192_CFB128_TYPE:
case AES_256_CFB128_TYPE:
WOLFSSL_MSG("AES CFB");
if (ctx->enc)
ret = wc_AesCfbEncrypt(&ctx->cipher.aes, dst, src, len);
else
ret = wc_AesCfbDecrypt(&ctx->cipher.aes, dst, src, len);
break;
#endif /* WOLFSSL_AES_CFB */
#if defined(WOLFSSL_AES_OFB)
case AES_128_OFB_TYPE:
case AES_192_OFB_TYPE:
case AES_256_OFB_TYPE:
WOLFSSL_MSG("AES OFB");
if (ctx->enc)
ret = wc_AesOfbEncrypt(&ctx->cipher.aes, dst, src, len);
else
ret = wc_AesOfbDecrypt(&ctx->cipher.aes, dst, src, len);
break;
#endif /* WOLFSSL_AES_OFB */
#if defined(WOLFSSL_AES_XTS)
case AES_128_XTS_TYPE:
case AES_256_XTS_TYPE:
WOLFSSL_MSG("AES XTS");
if (ctx->enc)
ret = wc_AesXtsEncrypt(&ctx->cipher.xts, dst, src, len,
ctx->cipher.tweak, ctx->cipher.tweakSz);
else
ret = wc_AesXtsDecrypt(&ctx->cipher.xts, dst, src, len,
ctx->cipher.tweak, ctx->cipher.tweakSz);
break;
#endif /* WOLFSSL_AES_XTS */
#ifdef HAVE_AESGCM
case AES_128_GCM_TYPE :
case AES_192_GCM_TYPE :

View File

@ -54,6 +54,26 @@ int wolfSSL_EVP_Cipher_key_length(const WOLFSSL_EVP_CIPHER* c)
case AES_192_CBC_TYPE: return 24;
case AES_256_CBC_TYPE: return 32;
#endif
#if defined(WOLFSSL_AES_CFB)
case AES_128_CFB1_TYPE: return 16;
case AES_192_CFB1_TYPE: return 24;
case AES_256_CFB1_TYPE: return 32;
case AES_128_CFB8_TYPE: return 16;
case AES_192_CFB8_TYPE: return 24;
case AES_256_CFB8_TYPE: return 32;
case AES_128_CFB128_TYPE: return 16;
case AES_192_CFB128_TYPE: return 24;
case AES_256_CFB128_TYPE: return 32;
#endif
#if defined(WOLFSSL_AES_OFB)
case AES_128_OFB_TYPE: return 16;
case AES_192_OFB_TYPE: return 24;
case AES_256_OFB_TYPE: return 32;
#endif
#if defined(WOLFSSL_AES_XTS)
case AES_128_XTS_TYPE: return 16;
case AES_256_XTS_TYPE: return 32;
#endif
#if defined(HAVE_AESGCM)
case AES_128_GCM_TYPE: return 16;
case AES_192_GCM_TYPE: return 24;

View File

@ -95,27 +95,23 @@ WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_192_cbc(void);
WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_256_cbc(void);
#endif
#ifndef NO_AES
#ifdef HAVE_AES_CFB1
#ifdef WOLFSSL_AES_CFB
WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_128_cfb1(void);
WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_192_cfb1(void);
WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_256_cfb1(void);
#endif
#ifdef HAVE_AES_CFB8
WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_128_cfb8(void);
WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_192_cfb8(void);
WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_256_cfb8(void);
#endif
#ifdef HAVE_AES_CFB128
WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_128_cfb128(void);
WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_192_cfb128(void);
WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_256_cfb128(void);
#endif
#ifdef HAVE_AES_OFB
#ifdef WOLFSSL_AES_OFB
WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_128_ofb(void);
WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_192_ofb(void);
WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_256_ofb(void);
#endif
#ifdef HAVE_AES_XTS
#ifdef WOLFSSL_AES_XTS
WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_128_xts(void);
WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_256_xts(void);
#endif
@ -179,6 +175,11 @@ typedef struct WOLFSSL_EVP_MD_CTX {
typedef union {
#ifndef NO_AES
Aes aes;
#ifdef WOLFSSL_AES_XTS
XtsAes xts;
byte* tweak;
word32 tweakSz;
#endif
#endif
#ifndef NO_DES3
Des des;
@ -226,7 +227,21 @@ enum {
NID_hmac = 855,
NID_dhKeyAgreement= 28,
EVP_PKEY_DH = NID_dhKeyAgreement,
EVP_PKEY_HMAC = NID_hmac
EVP_PKEY_HMAC = NID_hmac,
AES_128_CFB1_TYPE = 24,
AES_192_CFB1_TYPE = 25,
AES_256_CFB1_TYPE = 26,
AES_128_CFB8_TYPE = 27,
AES_192_CFB8_TYPE = 28,
AES_256_CFB8_TYPE = 29,
AES_128_CFB128_TYPE = 30,
AES_192_CFB128_TYPE = 31,
AES_256_CFB128_TYPE = 32,
AES_128_OFB_TYPE = 33,
AES_192_OFB_TYPE = 34,
AES_256_OFB_TYPE = 35,
AES_128_XTS_TYPE = 36,
AES_256_XTS_TYPE = 37
};
enum {
@ -267,6 +282,20 @@ enum {
NID_des_ede3_cbc= 44,
NID_des_ede3_ecb= 33,
NID_idea_cbc = 34,
NID_aes_128_cfb1= 650,
NID_aes_192_cfb1= 651,
NID_aes_256_cfb1= 652,
NID_aes_128_cfb8= 653,
NID_aes_192_cfb8= 654,
NID_aes_256_cfb8= 655,
NID_aes_128_cfb128 = 421,
NID_aes_192_cfb128 = 425,
NID_aes_256_cfb128 = 429,
NID_aes_128_ofb = 420,
NID_aes_192_ofb = 424,
NID_aes_256_ofb = 428,
NID_aes_128_xts = 913,
NID_aes_256_xts = 914
};
#define WOLFSSL_EVP_BUF_SIZE 16
@ -594,39 +623,39 @@ typedef WOLFSSL_EVP_CIPHER_CTX EVP_CIPHER_CTX;
#define EVP_sha512 wolfSSL_EVP_sha512
#define EVP_ripemd160 wolfSSL_EVP_ripemd160
#define EVP_aes_128_cbc wolfSSL_EVP_aes_128_cbc
#define EVP_aes_192_cbc wolfSSL_EVP_aes_192_cbc
#define EVP_aes_256_cbc wolfSSL_EVP_aes_256_cbc
#define EVP_aes_128_cfb1 wolfSSL_EVP_aes_128_cfb1
#define EVP_aes_192_cfb1 wolfSSL_EVP_aes_192_cfb1
#define EVP_aes_256_cfb1 wolfSSL_EVP_aes_256_cfb1
#define EVP_aes_128_cfb8 wolfSSL_EVP_aes_128_cfb8
#define EVP_aes_192_cfb8 wolfSSL_EVP_aes_192_cfb8
#define EVP_aes_256_cfb8 wolfSSL_EVP_aes_256_cfb8
#define EVP_aes_128_cbc wolfSSL_EVP_aes_128_cbc
#define EVP_aes_192_cbc wolfSSL_EVP_aes_192_cbc
#define EVP_aes_256_cbc wolfSSL_EVP_aes_256_cbc
#define EVP_aes_128_cfb1 wolfSSL_EVP_aes_128_cfb1
#define EVP_aes_192_cfb1 wolfSSL_EVP_aes_192_cfb1
#define EVP_aes_256_cfb1 wolfSSL_EVP_aes_256_cfb1
#define EVP_aes_128_cfb8 wolfSSL_EVP_aes_128_cfb8
#define EVP_aes_192_cfb8 wolfSSL_EVP_aes_192_cfb8
#define EVP_aes_256_cfb8 wolfSSL_EVP_aes_256_cfb8
#define EVP_aes_128_cfb128 wolfSSL_EVP_aes_128_cfb128
#define EVP_aes_192_cfb128 wolfSSL_EVP_aes_192_cfb128
#define EVP_aes_256_cfb128 wolfSSL_EVP_aes_256_cfb128
#define EVP_aes_128_ofb wolfSSL_EVP_aes_128_ofb
#define EVP_aes_192_ofb wolfSSL_EVP_aes_192_ofb
#define EVP_aes_256_ofb wolfSSL_EVP_aes_256_ofb
#define EVP_aes_128_xts wolfSSL_EVP_aes_128_xts
#define EVP_aes_256_xts wolfSSL_EVP_aes_256_xts
#define EVP_aes_128_gcm wolfSSL_EVP_aes_128_gcm
#define EVP_aes_192_gcm wolfSSL_EVP_aes_192_gcm
#define EVP_aes_256_gcm wolfSSL_EVP_aes_256_gcm
#define EVP_aes_128_ecb wolfSSL_EVP_aes_128_ecb
#define EVP_aes_192_ecb wolfSSL_EVP_aes_192_ecb
#define EVP_aes_256_ecb wolfSSL_EVP_aes_256_ecb
#define EVP_aes_128_ctr wolfSSL_EVP_aes_128_ctr
#define EVP_aes_192_ctr wolfSSL_EVP_aes_192_ctr
#define EVP_aes_256_ctr wolfSSL_EVP_aes_256_ctr
#define EVP_des_cbc wolfSSL_EVP_des_cbc
#define EVP_des_ecb wolfSSL_EVP_des_ecb
#define EVP_des_ede3_cbc wolfSSL_EVP_des_ede3_cbc
#define EVP_des_ede3_ecb wolfSSL_EVP_des_ede3_ecb
#define EVP_rc4 wolfSSL_EVP_rc4
#define EVP_idea_cbc wolfSSL_EVP_idea_cbc
#define EVP_enc_null wolfSSL_EVP_enc_null
#define EVP_aes_128_ofb wolfSSL_EVP_aes_128_ofb
#define EVP_aes_192_ofb wolfSSL_EVP_aes_192_ofb
#define EVP_aes_256_ofb wolfSSL_EVP_aes_256_ofb
#define EVP_aes_128_xts wolfSSL_EVP_aes_128_xts
#define EVP_aes_256_xts wolfSSL_EVP_aes_256_xts
#define EVP_aes_128_gcm wolfSSL_EVP_aes_128_gcm
#define EVP_aes_192_gcm wolfSSL_EVP_aes_192_gcm
#define EVP_aes_256_gcm wolfSSL_EVP_aes_256_gcm
#define EVP_aes_128_ecb wolfSSL_EVP_aes_128_ecb
#define EVP_aes_192_ecb wolfSSL_EVP_aes_192_ecb
#define EVP_aes_256_ecb wolfSSL_EVP_aes_256_ecb
#define EVP_aes_128_ctr wolfSSL_EVP_aes_128_ctr
#define EVP_aes_192_ctr wolfSSL_EVP_aes_192_ctr
#define EVP_aes_256_ctr wolfSSL_EVP_aes_256_ctr
#define EVP_des_cbc wolfSSL_EVP_des_cbc
#define EVP_des_ecb wolfSSL_EVP_des_ecb
#define EVP_des_ede3_cbc wolfSSL_EVP_des_ede3_cbc
#define EVP_des_ede3_ecb wolfSSL_EVP_des_ede3_ecb
#define EVP_rc4 wolfSSL_EVP_rc4
#define EVP_idea_cbc wolfSSL_EVP_idea_cbc
#define EVP_enc_null wolfSSL_EVP_enc_null
#define EVP_MD_size wolfSSL_EVP_MD_size
#define EVP_MD_CTX_new wolfSSL_EVP_MD_CTX_new
@ -635,6 +664,7 @@ typedef WOLFSSL_EVP_CIPHER_CTX EVP_CIPHER_CTX;
#define EVP_MD_CTX_destroy wolfSSL_EVP_MD_CTX_free
#define EVP_MD_CTX_init wolfSSL_EVP_MD_CTX_init
#define EVP_MD_CTX_cleanup wolfSSL_EVP_MD_CTX_cleanup
#define EVP_MD_CTX_reset wolfSSL_EVP_MD_CTX_cleanup
#define EVP_MD_CTX_md wolfSSL_EVP_MD_CTX_md
#define EVP_MD_CTX_type wolfSSL_EVP_MD_CTX_type
#define EVP_MD_CTX_size wolfSSL_EVP_MD_CTX_size