Use named curve parameter encoding by default.
authorDr. Stephen Henson <steve@openssl.org>
Thu, 19 Feb 2015 14:32:44 +0000 (14:32 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Thu, 19 Feb 2015 14:44:46 +0000 (14:44 +0000)
Many applications require named curve parameter encoding instead of explicit
parameter encoding (including the TLS library in OpenSSL itself). Set this
encoding by default instead of requiring an explicit call to set it.

Add OPENSSL_EC_EXPLICT_CURVE define.
Reviewed-by: Matt Caswell <matt@openssl.org>
crypto/ec/ec.h
crypto/ec/ec_lib.c

index b89add60e0edb62e854e6caa64406dddf07ad1c9..2d36dd5ea74e82ea470f622acdeee286bb9181e1 100644 (file)
@@ -715,7 +715,8 @@ int EC_GROUP_get_pentanomial_basis(const EC_GROUP *, unsigned int *k1,
                                    unsigned int *k2, unsigned int *k3);
 # endif
 
-# define OPENSSL_EC_NAMED_CURVE  0x001
+# define OPENSSL_EC_EXPLICIT_CURVE  0x000
+# define OPENSSL_EC_NAMED_CURVE     0x001
 
 typedef struct ecpk_parameters_st ECPKPARAMETERS;
 
index cc3dd350773d3e9cc0c4849552cbe3e976acd486..2dcdb40168301fa46ab8d30416c2fa092d6c11f1 100644 (file)
@@ -106,7 +106,7 @@ EC_GROUP *EC_GROUP_new(const EC_METHOD *meth)
         goto err;
 
     ret->curve_name = 0;
-    ret->asn1_flag = 0;
+    ret->asn1_flag = OPENSSL_EC_NAMED_CURVE;
     ret->asn1_form = POINT_CONVERSION_UNCOMPRESSED;
 
     ret->seed = NULL;