get rid of EVP_PKEY_ECDSA (now we have EVP_PKEY_EC instead)
[openssl.git] / crypto / x509 / x509type.c
index 05d6919..8eaf102 100644 (file)
@@ -1,5 +1,5 @@
 /* crypto/x509/x509type.c */
-/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
  * All rights reserved.
  *
  * This package is an SSL implementation written
 
 #include <stdio.h>
 #include "cryptlib.h"
-#include "evp.h"
-#include "objects.h"
-#include "x509.h"
+#include <openssl/evp.h>
+#include <openssl/objects.h>
+#include <openssl/x509.h>
 
-int X509_certificate_type(x,pkey)
-X509 *x;
-EVP_PKEY *pkey;
+int X509_certificate_type(X509 *x, EVP_PKEY *pkey)
        {
        EVP_PKEY *pk;
        int ret=0,i;
@@ -88,6 +86,9 @@ EVP_PKEY *pkey;
        case EVP_PKEY_DSA:
                ret=EVP_PK_DSA|EVP_PKT_SIGN;
                break;
+       case EVP_PKEY_EC:
+               ret=EVP_PK_EC|EVP_PKT_SIGN|EVP_PKT_EXCH;
+               break;
        case EVP_PKEY_DH:
                ret=EVP_PK_DH|EVP_PKT_EXCH;
                break;
@@ -104,12 +105,16 @@ EVP_PKEY *pkey;
        case EVP_PKS_DSA:
                ret|=EVP_PKS_DSA;
                break;
+       case EVP_PKS_EC:
+               ret|=EVP_PKS_EC;
+               break;
        default:
                break;
                }
 
-       if (EVP_PKEY_size(pkey) <= 512)
+       if (EVP_PKEY_size(pk) <= 512)
                ret|=EVP_PKT_EXP;
+       if(pkey==NULL) EVP_PKEY_free(pk);
        return(ret);
        }