blob: ddf278cf1b524e43dabe75ba1003e673574d2a9f [file] [log] [blame]
Jayashankar Padatha0135602019-04-22 16:22:58 +05301#include "openssl_alloc.hpp"
2
3#if OPENSSL_VERSION_NUMBER < 0x10100000L
4
5#include <string.h>
6
7static void* OPENSSL_zalloc(size_t num)
8{
9 void* ret = OPENSSL_malloc(num);
10
11 if (ret != NULL)
12 {
13 memset(ret, 0, num);
14 }
15 return ret;
16}
17
18EVP_MD_CTX* EVP_MD_CTX_new(void)
19{
20 return (EVP_MD_CTX*)OPENSSL_zalloc(sizeof(EVP_MD_CTX));
21}
22
23void EVP_MD_CTX_free(EVP_MD_CTX* ctx)
24{
25 EVP_MD_CTX_cleanup(ctx);
26 OPENSSL_free(ctx);
27}
28
29#endif