Initial support for generalized public key parameters.
[openssl.git] / crypto / ecdsa / ecs_lib.c
index 8a6d4ad45d2a05b4b1e5f39326ceb2138c0bbc60..1fb9bc9600c86434c43465578446cb27cc72fbd5 100644 (file)
@@ -65,6 +65,7 @@ const char *ECDSA_version="ECDSA" OPENSSL_VERSION_PTEXT;
 
 static const ECDSA_METHOD *default_ECDSA_method = NULL;
 
+static void *ecdsa_data_new(void);
 static void *ecdsa_data_dup(void *);
 static void  ecdsa_data_free(void *);
 
@@ -147,7 +148,7 @@ static ECDSA_DATA *ECDSA_DATA_new_method(ENGINE *engine)
        return(ret);
 }
 
-void *ecdsa_data_new(void)
+static void *ecdsa_data_new(void)
 {
        return (void *)ECDSA_DATA_new_method(NULL);
 }
@@ -205,10 +206,14 @@ int ECDSA_size(const EC_KEY *r)
        ASN1_INTEGER bs;
        BIGNUM  *order=NULL;
        unsigned char buf[4];
-       const EC_GROUP *group = EC_KEY_get0_group(r);
+       const EC_GROUP *group;
 
-       if (r == NULL || group == NULL)
+       if (r == NULL)
+               return 0;
+       group = EC_KEY_get0_group(r);
+       if (group == NULL)
                return 0;
+
        if ((order = BN_new()) == NULL) return 0;
        if (!EC_GROUP_get_order(group,order,NULL))
        {