size_t-fication of message digest APIs. We should size_t-fy more APIs...
[openssl.git] / crypto / evp / p_lib.c
index 74a007e29d5657223cbd68158067f0a7f33fbd81..934f8ff8be3ef23ada717531b36264b3f130ca74 100644 (file)
@@ -64,6 +64,9 @@
 #include <openssl/evp.h>
 #include <openssl/asn1_mac.h>
 #include <openssl/x509.h>
+#include <openssl/rsa.h>
+#include <openssl/dsa.h>
+#include <openssl/dh.h>
 
 static void EVP_PKEY_free_it(EVP_PKEY *x);
 
@@ -150,7 +153,7 @@ int EVP_PKEY_save_parameters(EVP_PKEY *pkey, int mode)
        return(0);
        }
 
-int EVP_PKEY_copy_parameters(EVP_PKEY *to, cpnst EVP_PKEY *from)
+int EVP_PKEY_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from)
        {
        if (to->type != from->type)
                {
@@ -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,6 +254,9 @@ 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;
+
        switch (a->type)
                {
 #ifndef OPENSSL_NO_RSA