Skip to content
This repository was archived by the owner on Mar 12, 2019. It is now read-only.

Commit a3575f1

Browse files
committed
Fix building against OpenSSL 1.1.0
2 parents 742682a + d9c5bfe commit a3575f1

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

cache.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ static unsigned int sha_hash(const char *data, size_t size, unsigned char *out)
4545
const EVP_MD *md = EVP_get_digestbyname("SHA1");
4646

4747
if (md != NULL) {
48-
EVP_MD_CTX mdctx;
49-
EVP_MD_CTX_init(&mdctx);
50-
EVP_DigestInit_ex(&mdctx, md, NULL);
51-
EVP_DigestUpdate(&mdctx, data, size);
52-
EVP_DigestFinal_ex(&mdctx, out, &md_len);
53-
EVP_MD_CTX_cleanup(&mdctx);
48+
EVP_MD_CTX *mdctx = EVP_MD_CTX_new();
49+
EVP_MD_CTX_init(mdctx);
50+
EVP_DigestInit_ex(mdctx, md, NULL);
51+
EVP_DigestUpdate(mdctx, data, size);
52+
EVP_DigestFinal_ex(mdctx, out, &md_len);
53+
EVP_MD_CTX_free(mdctx);
5454
}
5555
return md_len;
5656
}

0 commit comments

Comments
 (0)