提交 47b2e238 编写于 作者: D Dr. Stephen Henson

Use EVP_DigestVerify() in dgst.c if verifying.

上级 ad35cdac
......@@ -412,13 +412,18 @@ int MAIN(int argc, char **argv)
{
EVP_MD_CTX *mctx = NULL;
EVP_PKEY_CTX *pctx = NULL;
int r;
if (!BIO_get_md_ctx(bmd, &mctx))
{
BIO_printf(bio_err, "Error getting context\n");
ERR_print_errors(bio_err);
goto end;
}
if (!EVP_DigestSignInit(mctx, &pctx, md, e, sigkey))
if (do_verify)
r = EVP_DigestVerifyInit(mctx, &pctx, md, e, sigkey);
else
r = EVP_DigestSignInit(mctx, &pctx, md, e, sigkey);
if (!r)
{
BIO_printf(bio_err, "Error setting context\n");
ERR_print_errors(bio_err);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册