summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2017-05-30 13:02:06 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2017-07-17 17:08:01 +0200
commit916e65e5117ed2ef67e0fb51ded4d7ca030bcbe6 (patch)
tree951bc63ed695cde4573b5a3556bf06d2c66f23ea
parentf9d196b026780a27ed295f3cbeb90b980ee518c5 (diff)
downloadgnutls-916e65e5117ed2ef67e0fb51ded4d7ca030bcbe6.tar.gz
Renamed GNUTLS_PK_ECDHX to GNUTLS_PK_ECDH_X25519
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
-rw-r--r--lib/algorithms.h2
-rw-r--r--lib/algorithms/ecc.c2
-rw-r--r--lib/algorithms/publickey.c2
-rw-r--r--lib/auth/ecdhe.c8
-rw-r--r--lib/includes/gnutls/gnutls.h.in5
-rw-r--r--lib/nettle/pk.c6
-rw-r--r--lib/x509/mpi.c2
-rw-r--r--tests/privkey-keygen.c2
8 files changed, 15 insertions, 14 deletions
diff --git a/lib/algorithms.h b/lib/algorithms.h
index f449f8bf0b..b5de6a8a5b 100644
--- a/lib/algorithms.h
+++ b/lib/algorithms.h
@@ -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)
diff --git a/lib/algorithms/ecc.c b/lib/algorithms/ecc.c
index c59099747e..5a8d0d1ec0 100644
--- a/lib/algorithms/ecc.c
+++ b/lib/algorithms/ecc.c
@@ -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,
},
{
diff --git a/lib/algorithms/publickey.c b/lib/algorithms/publickey.c
index 51a2daab3f..a5259622b0 100644
--- a/lib/algorithms/publickey.c
+++ b/lib/algorithms/publickey.c
@@ -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 },
diff --git a/lib/auth/ecdhe.c b/lib/auth/ecdhe.c
index d9b8b42eae..9a7f4f4ed6 100644
--- a/lib/auth/ecdhe.c
+++ b/lib/auth/ecdhe.c
@@ -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,
diff --git a/lib/includes/gnutls/gnutls.h.in b/lib/includes/gnutls/gnutls.h.in
index fa805f2f5e..7d2263664d 100644
--- a/lib/includes/gnutls/gnutls.h.in
+++ b/lib/includes/gnutls/gnutls.h.in
@@ -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
diff --git a/lib/nettle/pk.c b/lib/nettle/pk.c
index 890a92b3d3..da209d8bf4 100644
--- a/lib/nettle/pk.c
+++ b/lib/nettle/pk.c
@@ -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);
diff --git a/lib/x509/mpi.c b/lib/x509/mpi.c
index 384e6e9fda..1f562229e3 100644
--- a/lib/x509/mpi.c
+++ b/lib/x509/mpi.c
@@ -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) {
diff --git a/tests/privkey-keygen.c b/tests/privkey-keygen.c
index 9696392aef..ec79463430 100644
--- a/tests/privkey-keygen.c
+++ b/tests/privkey-keygen.c
@@ -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);