From a1f6faed257046775cf08036b1d1e5822fc6aa5e Mon Sep 17 00:00:00 2001 From: Love Hornquist Astrand Date: Mon, 17 Aug 2009 10:23:01 +0200 Subject: [PATCH] switch to use EVP interface instead of old MDX_ style interface --- lib/hx509/ca.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/hx509/ca.c b/lib/hx509/ca.c index 624d74289..efeeed675 100644 --- a/lib/hx509/ca.c +++ b/lib/hx509/ca.c @@ -1193,12 +1193,14 @@ ca_sign(hx509_context context, unsigned char hash[SHA_DIGEST_LENGTH]; { - SHA_CTX m; - - SHA1_Init(&m); - SHA1_Update(&m, tbs->spki.subjectPublicKey.data, - tbs->spki.subjectPublicKey.length / 8); - SHA1_Final (hash, &m); + EVP_MD_CTX ctx; + + EVP_MD_CTX_init(&ctx); + EVP_DigestInit_ex(&ctx, EVP_sha1(), NULL); + EVP_DigestUpdate(&ctx, tbs->spki.subjectPublicKey.data, + tbs->spki.subjectPublicKey.length / 8); + EVP_DigestFinal_ex(&ctx, hash, NULL); + EVP_MD_CTX_cleanup(&ctx); } si.data = hash; -- 2.11.4.GIT