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];
|
unsigned char hash[SHA_DIGEST_LENGTH];
|
||||||
|
|
||||||
{
|
{
|
||||||
SHA_CTX m;
|
EVP_MD_CTX ctx;
|
||||||
|
|
||||||
SHA1_Init(&m);
|
EVP_MD_CTX_init(&ctx);
|
||||||
SHA1_Update(&m, tbs->spki.subjectPublicKey.data,
|
EVP_DigestInit_ex(&ctx, EVP_sha1(), NULL);
|
||||||
|
EVP_DigestUpdate(&ctx, tbs->spki.subjectPublicKey.data,
|
||||||
tbs->spki.subjectPublicKey.length / 8);
|
tbs->spki.subjectPublicKey.length / 8);
|
||||||
SHA1_Final (hash, &m);
|
EVP_DigestFinal_ex(&ctx, hash, NULL);
|
||||||
|
EVP_MD_CTX_cleanup(&ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
si.data = hash;
|
si.data = hash;
|
||||||
|
Reference in New Issue
Block a user