Rename tls_curve_info to TLS_GROUP_INFO, move to ssl_locl.h
authorDr. Stephen Henson <steve@openssl.org>
Fri, 22 Sep 2017 22:47:54 +0000 (23:47 +0100)
committerDr. Stephen Henson <steve@openssl.org>
Tue, 26 Sep 2017 12:00:26 +0000 (13:00 +0100)
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/=4412)

ssl/ssl_locl.h
ssl/t1_lib.c

index 69f547ee106dd03f46d0458ef23d7ad7150047b1..aa99153a012e258e3ff81f0f7898ef17dc7bb325 100644 (file)
@@ -1349,6 +1349,18 @@ typedef struct sigalg_lookup_st {
     int curve;
 } SIGALG_LOOKUP;
 
+typedef struct tls_group_info_st {
+    int nid;                    /* Curve NID */
+    int secbits;                /* Bits of security (from SP800-57) */
+    uint16_t flags;             /* Flags: currently just group type */
+} TLS_GROUP_INFO;
+
+/* flags values */
+# define TLS_CURVE_TYPE          0x3 /* Mask for group type */
+# define TLS_CURVE_PRIME         0x0
+# define TLS_CURVE_CHAR2         0x1
+# define TLS_CURVE_CUSTOM        0x2
+
 typedef struct cert_pkey_st CERT_PKEY;
 
 /*
@@ -2326,12 +2338,6 @@ __owur int ssl_check_srvr_ecc_cert_and_alg(X509 *x, SSL *s);
 SSL_COMP *ssl3_comp_find(STACK_OF(SSL_COMP) *sk, int n);
 
 #  ifndef OPENSSL_NO_EC
-/* Flags values from tls1_ec_curve_id2nid() */
-/* Mask for curve type */
-# define TLS_CURVE_TYPE          0x3
-# define TLS_CURVE_PRIME         0x0
-# define TLS_CURVE_CHAR2         0x1
-# define TLS_CURVE_CUSTOM        0x2
 
 __owur int tls1_ec_curve_id2nid(uint16_t curve_id, unsigned int *pflags);
 __owur uint16_t tls1_ec_nid2curve_id(int nid);
index 4345576ae6782a9a7bb9d519d98ec1b1b25c1d22..0f57b53f7733e6580ce943ce1f5ecf835f8bf277 100644 (file)
@@ -130,18 +130,12 @@ int tls1_clear(SSL *s)
 
 #ifndef OPENSSL_NO_EC
 
-typedef struct {
-    int nid;                    /* Curve NID */
-    int secbits;                /* Bits of security (from SP800-57) */
-    unsigned int flags;         /* Flags: currently just field type */
-} tls_curve_info;
-
 /*
  * Table of curve information.
  * Do not delete entries or reorder this array! It is used as a lookup
  * table: the index of each entry is one less than the TLS curve id.
  */
-static const tls_curve_info nid_list[] = {
+static const TLS_GROUP_INFO nid_list[] = {
     {NID_sect163k1, 80, TLS_CURVE_CHAR2}, /* sect163k1 (1) */
     {NID_sect163r1, 80, TLS_CURVE_CHAR2}, /* sect163r1 (2) */
     {NID_sect163r2, 80, TLS_CURVE_CHAR2}, /* sect163r2 (3) */
@@ -194,7 +188,7 @@ static const uint16_t suiteb_curves[] = {
 
 int tls1_ec_curve_id2nid(uint16_t curve_id, unsigned int *pflags)
 {
-    const tls_curve_info *cinfo;
+    const TLS_GROUP_INFO *cinfo;
     /* ECC curves from RFC 4492 and RFC 7027 */
     if (curve_id < 1 || curve_id > OSSL_NELEM(nid_list))
         return NID_undef;
@@ -265,7 +259,7 @@ int tls1_get_curvelist(SSL *s, int sess, const uint16_t **pcurves,
 /* See if curve is allowed by security callback */
 int tls_curve_allowed(SSL *s, uint16_t curve, int op)
 {
-    const tls_curve_info *cinfo;
+    const TLS_GROUP_INFO *cinfo;
     unsigned char ctmp[2];
     if (curve > 0xff)
         return 1;