Make return value from EVP_PKEY_cmp() and EVP_PKEY_cmp_parameters() consistent.
This commit is contained in:
parent
9c62bca11a
commit
86207c1960
@ -161,11 +161,20 @@ int EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b)
|
|||||||
if (a->type != b->type)
|
if (a->type != b->type)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (EVP_PKEY_cmp_parameters(a, b) == 0)
|
if (a->meth)
|
||||||
return 0;
|
{
|
||||||
|
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 && a->ameth->pub_cmp)
|
if (a->ameth->pub_cmp)
|
||||||
return a->ameth->pub_cmp(a, b);
|
return a->ameth->pub_cmp(a, b);
|
||||||
|
}
|
||||||
|
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user