blob: 95fc2e0366238256503321ec31e3b0ae40b7c784 [file] [log] [blame]
Adriana Kobylak70ca2422018-09-06 14:23:38 -05001#include "utils.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 // OPENSSL_VERSION_NUMBER < 0x10100000L