]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Renamed GNUTLS_PK_ECDHX to GNUTLS_PK_ECDH_X25519
authorNikos Mavrogiannopoulos <nmav@redhat.com>
Tue, 30 May 2017 11:02:06 +0000 (13:02 +0200)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Mon, 17 Jul 2017 15:08:01 +0000 (17:08 +0200)
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
lib/algorithms.h
lib/algorithms/ecc.c
lib/algorithms/publickey.c
lib/auth/ecdhe.c
lib/includes/gnutls/gnutls.h.in
lib/nettle/pk.c
lib/x509/mpi.c
tests/privkey-keygen.c

index f449f8bf0bcf477ddbc977e22afc7b1b9f22aa79..b5de6a8a5b80ec6453833e7eb2b065cf2deadaed 100644 (file)
@@ -32,7 +32,7 @@
 #define GNUTLS_FALLBACK_SCSV_MAJOR 0x56
 #define GNUTLS_FALLBACK_SCSV_MINOR 0x00
 
-#define IS_EC(x) (((x)==GNUTLS_PK_ECDSA)||((x)==GNUTLS_PK_ECDHX)||((x)==GNUTLS_PK_EDDSA_ED25519))
+#define IS_EC(x) (((x)==GNUTLS_PK_ECDSA)||((x)==GNUTLS_PK_ECDH_X25519)||((x)==GNUTLS_PK_EDDSA_ED25519))
 
 #define TLS_SIGN_AID_UNKNOWN {{255, 255}}
 #define HAVE_UNKNOWN_SIGAID(aid) ((aid)->id[0] == 255 && (aid)->id[1] == 255)
index c59099747e59adfcb4c83fb227481620bc52aca2..5a8d0d1ec0a5adc61689920649da56195908c01b 100644 (file)
@@ -74,7 +74,7 @@ static const gnutls_ecc_curve_entry_st ecc_curves[] = {
         .name = "X25519",
         .id = GNUTLS_ECC_CURVE_X25519,
         .tls_id = 29,
-        .pk = GNUTLS_PK_ECDHX,
+        .pk = GNUTLS_PK_ECDH_X25519,
         .size = 32,
        },
        {
index 51a2daab3fe17f9a9d07feacba95f13552578a15..a5259622b04460f2d75a3d0e1990992ab208acee 100644 (file)
@@ -136,7 +136,7 @@ static const gnutls_pk_entry pk_algorithms[] = {
          .curve = GNUTLS_ECC_CURVE_ED25519, .no_prehashed = 1 },
        { .name = "DH", .oid = NULL, .id = GNUTLS_PK_DH,
           .curve = GNUTLS_ECC_CURVE_INVALID },
-       { .name = "ECDH (X25519)", .oid = "1.3.101.110", .id = GNUTLS_PK_ECDHX,
+       { .name = "ECDH (X25519)", .oid = "1.3.101.110", .id = GNUTLS_PK_ECDH_X25519,
          .curve = GNUTLS_ECC_CURVE_X25519 },
        { .name = "UNKNOWN", .oid = NULL, .id = GNUTLS_PK_UNKNOWN, 
          .curve = GNUTLS_ECC_CURVE_INVALID },
index d9b8b42eae0e3764df675634e9a5913d521a792e..9a7f4f4ed6df820aaea8b04956d3b92b0b9df615 100644 (file)
@@ -162,7 +162,7 @@ int _gnutls_proc_ecdh_common_client_kx(gnutls_session_t session,
                        gnutls_assert();
                        goto cleanup;
                }
-       } else if (ecurve->pk == GNUTLS_PK_ECDHX) {
+       } else if (ecurve->pk == GNUTLS_PK_ECDH_X25519) {
                if (ecurve->size != point_size)
                        return gnutls_assert_val(GNUTLS_E_RECEIVED_ILLEGAL_PARAMETER);
 
@@ -267,7 +267,7 @@ _gnutls_gen_ecdh_common_client_kx_int(gnutls_session_t session,
                        gnutls_assert();
                        goto cleanup;
                }
-       } else if (pk == GNUTLS_PK_ECDHX) {
+       } else if (pk == GNUTLS_PK_ECDH_X25519) {
                ret =
                    _gnutls_buffer_append_data_prefix(data, 8,
                                        session->key.ecdh_params.raw_pub.data,
@@ -367,7 +367,7 @@ _gnutls_proc_ecdh_common_server_kx(gnutls_session_t session,
                if (ret < 0)
                        return gnutls_assert_val(ret);
 
-       } else if (ecurve->pk == GNUTLS_PK_ECDHX) {
+       } else if (ecurve->pk == GNUTLS_PK_ECDH_X25519) {
                if (ecurve->size != point_size)
                        return gnutls_assert_val(GNUTLS_E_RECEIVED_ILLEGAL_PARAMETER);
 
@@ -448,7 +448,7 @@ int _gnutls_ecdh_common_print_server_kx(gnutls_session_t session,
                if (ret < 0)
                        return gnutls_assert_val(ret);
 
-       } else if (pk == GNUTLS_PK_ECDHX) {
+       } else if (pk == GNUTLS_PK_ECDH_X25519) {
                ret =
                        _gnutls_buffer_append_data_prefix(data, 8,
                                        session->key.ecdh_params.raw_pub.data,
index fa805f2f5e31af46c6a09f903e2f847862f1a4b0..7d2263664d68015fe3b3f5b65a6216ec4c19b15d 100644 (file)
@@ -697,6 +697,7 @@ typedef enum gnutls_certificate_print_formats {
 #define GNUTLS_PK_ECC GNUTLS_PK_ECDSA
 #define GNUTLS_PK_EC GNUTLS_PK_ECDSA
 
+#define GNUTLS_PK_ECDHX GNUTLS_PK_ECDH_X25519
 /**
  * gnutls_pk_algorithm_t:
  * @GNUTLS_PK_UNKNOWN: Unknown public-key algorithm.
@@ -705,7 +706,7 @@ typedef enum gnutls_certificate_print_formats {
  * @GNUTLS_PK_DSA: DSA public-key algorithm.
  * @GNUTLS_PK_DH: Diffie-Hellman algorithm. Used to generate parameters.
  * @GNUTLS_PK_ECDSA: Elliptic curve algorithm. These parameters are compatible with the ECDSA and ECDH algorithm.
- * @GNUTLS_PK_ECDHX: Elliptic curve algorithm, restricted to ECDH as per rfc7748.
+ * @GNUTLS_PK_ECDH_X25519: Elliptic curve algorithm, restricted to ECDH as per rfc7748.
  * @GNUTLS_PK_EDDSA_ED25519: Edwards curve Digital signature algorithm.
  *
  * Enumeration of different public-key algorithms.
@@ -716,7 +717,7 @@ typedef enum {
        GNUTLS_PK_DSA = 2,
        GNUTLS_PK_DH = 3,
        GNUTLS_PK_ECDSA = 4,
-       GNUTLS_PK_ECDHX = 5,
+       GNUTLS_PK_ECDH_X25519 = 5,
        GNUTLS_PK_RSA_PSS = 6,
        GNUTLS_PK_EDDSA_ED25519 = 7,
        GNUTLS_PK_MAX = GNUTLS_PK_EDDSA_ED25519
index 890a92b3d3408b7b613d778ec9d0a82b56166ffa..da209d8bf4312d96cef991a795228aef4fb31a65 100644 (file)
@@ -309,7 +309,7 @@ dh_cleanup:
                                goto cleanup;
                        break;
                }
-       case GNUTLS_PK_ECDHX:
+       case GNUTLS_PK_ECDH_X25519:
                {
                        unsigned size = gnutls_ecc_curve_get_size(priv->flags);
 
@@ -1548,7 +1548,7 @@ char* gen_data = NULL;
                }
                break;
        case GNUTLS_PK_DH:
-       case GNUTLS_PK_ECDHX:
+       case GNUTLS_PK_ECDH_X25519:
                ret = 0;
                goto cleanup;
        default:
@@ -1880,7 +1880,7 @@ wrap_nettle_pk_generate_keys(gnutls_pk_algorithm_t algo,
 
                        break;
                }
-       case GNUTLS_PK_ECDHX:
+       case GNUTLS_PK_ECDH_X25519:
                {
                        unsigned size = gnutls_ecc_curve_get_size(level);
 
index 384e6e9fda9a0f561f05b20502c20ef8ab34adc7..1f562229e31edefb35cd0e798f82a547854470b7 100644 (file)
@@ -136,7 +136,7 @@ _gnutls_get_asn_mpis(ASN1_TYPE asn, const char *root,
         * then the issuer's parameters should be used. This is not
         * needed in practice though.
         */
-       if (pk_algorithm != GNUTLS_PK_RSA && pk_algorithm != GNUTLS_PK_EDDSA_ED25519 && pk_algorithm != GNUTLS_PK_ECDHX) {
+       if (pk_algorithm != GNUTLS_PK_RSA && pk_algorithm != GNUTLS_PK_EDDSA_ED25519 && pk_algorithm != GNUTLS_PK_ECDH_X25519) {
                /* RSA and EdDSA do not use parameters */
                result = _gnutls_x509_read_value(asn, name, &tmp);
                if (result < 0) {
index 9696392aef28dc9bc212c4755abdb014e530e8d4..ec794634309df55ce41816ce68ceb91a3daaae11 100644 (file)
@@ -106,7 +106,7 @@ void doit(void)
                for (algorithm = GNUTLS_PK_RSA; algorithm <= GNUTLS_PK_RSA_PSS;
                     algorithm++) {
                        if (algorithm == GNUTLS_PK_DH ||
-                           algorithm == GNUTLS_PK_ECDHX)
+                           algorithm == GNUTLS_PK_ECDH_X25519)
                                continue;
 
                        ret = gnutls_x509_privkey_init(&pkey);