Renamed ecp_format to ansi_format, as point formats in TLS use different identifiers
authorMartin Willi <martin@revosec.ch>
Mon, 6 Sep 2010 16:36:27 +0000 (18:36 +0200)
committerMartin Willi <martin@revosec.ch>
Mon, 6 Sep 2010 16:37:24 +0000 (18:37 +0200)
src/libtls/tls_crypto.c
src/libtls/tls_crypto.h
src/libtls/tls_peer.c
src/libtls/tls_server.c

index 586222e..982798b 100644 (file)
@@ -306,7 +306,7 @@ ENUM(tls_named_curve_names, TLS_SECT163K1, TLS_SECP521R1,
        "SECP521R1",
 );
 
-ENUM(tls_ecp_format_names, TLS_ECP_COMPRESSED, TLS_ECP_HYBRID_Y,
+ENUM(tls_ansi_point_format_names, TLS_ANSI_COMPRESSED, TLS_ANSI_HYBRID_Y,
        "compressed",
        "compressed y",
        "uncompressed",
index b41ae5f..175a7ac 100644 (file)
@@ -361,18 +361,18 @@ extern enum_name_t *tls_named_curve_names;
 /**
  * EC Point format, ANSI X9.62.
  */
-enum tls_ecp_format_t {
-       TLS_ECP_COMPRESSED =    2,
-       TLS_ECP_COMPRESSED_Y =  3,
-       TLS_ECP_UNCOMPRESSED =  4,
-       TLS_ECP_HYBRID =                6,
-       TLS_ECP_HYBRID_Y =              7,
+enum tls_ansi_point_format_t {
+       TLS_ANSI_COMPRESSED =   2,
+       TLS_ANSI_COMPRESSED_Y = 3,
+       TLS_ANSI_UNCOMPRESSED = 4,
+       TLS_ANSI_HYBRID =               6,
+       TLS_ANSI_HYBRID_Y =             7,
 };
 
 /**
- * Enum names for tls_ecp_format_t.
+ * Enum names for tls_ansi_point_format_t.
  */
-extern enum_name_t *tls_ecp_format_names;
+extern enum_name_t *tls_ansi_point_format_names;
 
 /**
  * TLS crypto helper functions.
index ac22bd1..bcc4eba 100644 (file)
@@ -449,10 +449,10 @@ static status_t process_ec_key_exchange(private_tls_peer_t *this,
                return NEED_MORE;
        }
 
-       if (pub.ptr[0] != TLS_ECP_UNCOMPRESSED)
+       if (pub.ptr[0] != TLS_ANSI_UNCOMPRESSED)
        {
                DBG1(DBG_TLS, "DH point format '%N' not supported",
-                        tls_ecp_format_names, pub.ptr[0]);
+                        tls_ansi_point_format_names, pub.ptr[0]);
                this->alert->add(this->alert, TLS_FATAL, TLS_INTERNAL_ERROR);
                return NEED_MORE;
        }
@@ -918,7 +918,7 @@ static status_t send_key_exchange_dhe(private_tls_peer_t *this,
        else
        {       /* ECP uses 8bit length header only, but a point format */
                writer->write_uint8(writer, pub.len + 1);
-               writer->write_uint8(writer, TLS_ECP_UNCOMPRESSED);
+               writer->write_uint8(writer, TLS_ANSI_UNCOMPRESSED);
                writer->write_data(writer, pub);
        }
        free(pub.ptr);
index e48e6c5..d1accbc 100644 (file)
@@ -419,10 +419,10 @@ static status_t process_key_exchange_dhe(private_tls_server_t *this,
                return NEED_MORE;
        }
 
-       if (pub.ptr[0] != TLS_ECP_UNCOMPRESSED)
+       if (pub.ptr[0] != TLS_ANSI_UNCOMPRESSED)
        {
                DBG1(DBG_TLS, "DH point format '%N' not supported",
-                        tls_ecp_format_names, pub.ptr[0]);
+                        tls_ansi_point_format_names, pub.ptr[0]);
                this->alert->add(this->alert, TLS_FATAL, TLS_INTERNAL_ERROR);
                return NEED_MORE;
        }
@@ -857,7 +857,7 @@ static status_t send_server_key_exchange(private_tls_server_t *this,
        else
        {       /* ECP uses 8bit length header only, but a point format */
                writer->write_uint8(writer, chunk.len + 1);
-               writer->write_uint8(writer, TLS_ECP_UNCOMPRESSED);
+               writer->write_uint8(writer, TLS_ANSI_UNCOMPRESSED);
                writer->write_data(writer, chunk);
        }
        free(chunk.ptr);