提交 86207c19 编写于 作者: D Dr. Stephen Henson

Make return value from EVP_PKEY_cmp() and EVP_PKEY_cmp_parameters() consistent.

上级 9c62bca1
......@@ -161,11 +161,20 @@ int EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b)
if (a->type != b->type)
return -1;
if (EVP_PKEY_cmp_parameters(a, b) == 0)
return 0;
if (a->ameth && a->ameth->pub_cmp)
return a->ameth->pub_cmp(a, b);
if (a->meth)
{
int ret;
/* Compare parameters if the algorithm has them */
if (a->meth->param_cmp)
{
ret = a->meth->param_cmp(a, b);
if (ret <= 0)
return ret;
}
if (a->ameth->pub_cmp)
return a->ameth->pub_cmp(a, b);
}
return -2;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册