switch to use EVP interface instead of old MDX_ style interface
This commit is contained in:
@@ -1193,12 +1193,14 @@ ca_sign(hx509_context context,
|
||||
unsigned char hash[SHA_DIGEST_LENGTH];
|
||||
|
||||
{
|
||||
SHA_CTX m;
|
||||
EVP_MD_CTX ctx;
|
||||
|
||||
SHA1_Init(&m);
|
||||
SHA1_Update(&m, tbs->spki.subjectPublicKey.data,
|
||||
tbs->spki.subjectPublicKey.length / 8);
|
||||
SHA1_Final (hash, &m);
|
||||
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;
|
||||
|
Reference in New Issue
Block a user