X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fevp%2Fp_lib.c;h=934f8ff8be3ef23ada717531b36264b3f130ca74;hp=2760d7b1ed86f901d74e25d8e4c3f7c3a5edc58d;hb=60a938c6bca4c0890ed2d320e29fb43c970094d5;hpb=a8b728445c6d2d3f1d3ef568b8bff2b651aa0b52 diff --git a/crypto/evp/p_lib.c b/crypto/evp/p_lib.c index 2760d7b1ed..934f8ff8be 100644 --- a/crypto/evp/p_lib.c +++ b/crypto/evp/p_lib.c @@ -64,6 +64,9 @@ #include #include #include +#include +#include +#include static void EVP_PKEY_free_it(EVP_PKEY *x); @@ -233,6 +236,15 @@ int EVP_PKEY_cmp_parameters(const EVP_PKEY *a, const EVP_PKEY *b) else return(1); } +#endif +#ifndef OPENSSL_NO_EC + if (a->type == EVP_PKEY_EC && b->type == EVP_PKEY_EC) + { + if (EC_GROUP_cmp(a->pkey.eckey->group, b->pkey.eckey->group, NULL)) + return 0; + else + return 1; + } #endif return(-1); } @@ -242,14 +254,8 @@ int EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b) if (a->type != b->type) return -1; - /* XXXXX - We should really check for != 0, but cmp_paramters doesn't compare EC - groups, and I'm currently unsure how to handle that case... Except for - adding such functionality to cmp_parameters, but that would require - things like EC_GROUP_cmp(), which I'm not currently ready to write. - -- Richard Levitte */ - if (EVP_PKEY_cmp_parameters(a, b) == 1) - return 1; + if (EVP_PKEY_cmp_parameters(a, b) == 0) + return 0; switch (a->type) {