From 7dc17a6cf015b175c78f3c459498b05a0d6b2955 Mon Sep 17 00:00:00 2001 From: Nils Larsch Date: Sun, 8 May 2005 22:09:12 +0000 Subject: [PATCH] give EC_GROUP_*_nid functions a more meaningful name EC_GROUP_get_nid -> EC_GROUP_get_curve_name EC_GROUP_set_nid -> EC_GROUP_set_curve_name --- crypto/asn1/t_pkey.c | 2 +- crypto/asn1/x_pubkey.c | 2 +- crypto/ec/ec.h | 4 ++-- crypto/ec/ec_asn1.c | 2 +- crypto/ec/ec_curve.c | 2 +- crypto/ec/ec_lib.c | 8 ++++---- crypto/evp/evp_pkey.c | 2 +- ssl/s3_srvr.c | 2 +- util/libeay.num | 4 ++-- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/crypto/asn1/t_pkey.c b/crypto/asn1/t_pkey.c index 94bd37c32e..687a2bd6f5 100644 --- a/crypto/asn1/t_pkey.c +++ b/crypto/asn1/t_pkey.c @@ -303,7 +303,7 @@ int ECPKParameters_print(BIO *bp, const EC_GROUP *x, int off) if (!BIO_indent(bp, off, 128)) goto err; - nid = EC_GROUP_get_nid(x); + nid = EC_GROUP_get_curve_name(x); if (nid == 0) goto err; diff --git a/crypto/asn1/x_pubkey.c b/crypto/asn1/x_pubkey.c index 2a7f2cab15..c3bfd8db37 100644 --- a/crypto/asn1/x_pubkey.c +++ b/crypto/asn1/x_pubkey.c @@ -171,7 +171,7 @@ int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey) } if (EC_GROUP_get_asn1_flag(eckey->group) - && (nid = EC_GROUP_get_nid(eckey->group))) + && (nid = EC_GROUP_get_curve_name(eckey->group))) { /* just set the OID */ a->parameter->type = V_ASN1_OBJECT; diff --git a/crypto/ec/ec.h b/crypto/ec/ec.h index 2813b374b1..6b90e7a8fd 100644 --- a/crypto/ec/ec.h +++ b/crypto/ec/ec.h @@ -143,8 +143,8 @@ EC_POINT *EC_GROUP_get0_generator(const EC_GROUP *); int EC_GROUP_get_order(const EC_GROUP *, BIGNUM *order, BN_CTX *); int EC_GROUP_get_cofactor(const EC_GROUP *, BIGNUM *cofactor, BN_CTX *); -void EC_GROUP_set_nid(EC_GROUP *, int); /* curve name */ -int EC_GROUP_get_nid(const EC_GROUP *); +void EC_GROUP_set_curve_name(EC_GROUP *, int nid); /* curve name */ +int EC_GROUP_get_curve_name(const EC_GROUP *); void EC_GROUP_set_asn1_flag(EC_GROUP *, int flag); int EC_GROUP_get_asn1_flag(const EC_GROUP *); diff --git a/crypto/ec/ec_asn1.c b/crypto/ec/ec_asn1.c index d43ca49ec7..6c7de81eb7 100644 --- a/crypto/ec/ec_asn1.c +++ b/crypto/ec/ec_asn1.c @@ -707,7 +707,7 @@ ECPKPARAMETERS *ec_asn1_group2pkparameters(const EC_GROUP *group, /* use the asn1 OID to describe the * the elliptic curve parameters */ - tmp = EC_GROUP_get_nid(group); + tmp = EC_GROUP_get_curve_name(group); if (tmp) { ret->type = 0; diff --git a/crypto/ec/ec_curve.c b/crypto/ec/ec_curve.c index a523b206c7..979f86530e 100644 --- a/crypto/ec/ec_curve.c +++ b/crypto/ec/ec_curve.c @@ -1245,7 +1245,7 @@ EC_GROUP *EC_GROUP_new_by_nid(int nid) return NULL; } - EC_GROUP_set_nid(ret, nid); + EC_GROUP_set_curve_name(ret, nid); return ret; } diff --git a/crypto/ec/ec_lib.c b/crypto/ec/ec_lib.c index 98c2edc611..ae9ee08660 100644 --- a/crypto/ec/ec_lib.c +++ b/crypto/ec/ec_lib.c @@ -334,13 +334,13 @@ int EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor, BN_CTX *ctx) } -void EC_GROUP_set_nid(EC_GROUP *group, int nid) +void EC_GROUP_set_curve_name(EC_GROUP *group, int nid) { group->curve_name = nid; } -int EC_GROUP_get_nid(const EC_GROUP *group) +int EC_GROUP_get_curve_name(const EC_GROUP *group) { return group->curve_name; } @@ -481,8 +481,8 @@ int EC_GROUP_cmp(const EC_GROUP *a, const EC_GROUP *b, BN_CTX *ctx) EC_METHOD_get_field_type(EC_GROUP_method_of(b))) return 1; /* compare the curve name (if present) */ - if (EC_GROUP_get_nid(a) && EC_GROUP_get_nid(b) && - EC_GROUP_get_nid(a) == EC_GROUP_get_nid(b)) + if (EC_GROUP_get_curve_name(a) && EC_GROUP_get_curve_name(b) && + EC_GROUP_get_curve_name(a) == EC_GROUP_get_curve_name(b)) return 0; if (!ctx) diff --git a/crypto/evp/evp_pkey.c b/crypto/evp/evp_pkey.c index 7260460744..41107686ec 100644 --- a/crypto/evp/evp_pkey.c +++ b/crypto/evp/evp_pkey.c @@ -616,7 +616,7 @@ static int eckey_pkey2pkcs8(PKCS8_PRIV_KEY_INFO *p8, EVP_PKEY *pkey) } if (EC_GROUP_get_asn1_flag(eckey->group) - && (nid = EC_GROUP_get_nid(eckey->group))) + && (nid = EC_GROUP_get_curve_name(eckey->group))) { /* we have a 'named curve' => just set the OID */ p8->pkeyalg->parameter->type = V_ASN1_OBJECT; diff --git a/ssl/s3_srvr.c b/ssl/s3_srvr.c index 6daf703f5e..a34fc729be 100644 --- a/ssl/s3_srvr.c +++ b/ssl/s3_srvr.c @@ -1327,7 +1327,7 @@ int ssl3_send_server_key_exchange(SSL *s) * supported named curves, curve_id is non-zero. */ if ((curve_id = - nid2curve_id(EC_GROUP_get_nid(ecdh->group))) + nid2curve_id(EC_GROUP_get_curve_name(ecdh->group))) == 0) { SSLerr(SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE,SSL_R_UNSUPPORTED_ELLIPTIC_CURVE); diff --git a/util/libeay.num b/util/libeay.num index 559ca3085c..921b7c42cf 100755 --- a/util/libeay.num +++ b/util/libeay.num @@ -2937,7 +2937,7 @@ X509_VERIFY_PARAM_set1_policies 3367 EXIST::FUNCTION: EVP_sha512 3368 EXIST::FUNCTION:SHA,SHA512 X509_VERIFY_PARAM_set1_name 3369 EXIST::FUNCTION: X509_VERIFY_PARAM_set_purpose 3370 EXIST::FUNCTION: -EC_GROUP_get_nid 3371 EXIST::FUNCTION:EC +EC_GROUP_get_curve_name 3371 EXIST::FUNCTION:EC STORE_get_number 3372 EXIST::FUNCTION: ECDSA_sign_setup 3373 EXIST::FUNCTION:ECDSA BN_GF2m_mod_solve_quad_arr 3374 EXIST::FUNCTION: @@ -2983,7 +2983,7 @@ ECDSA_SIG_free 3409 EXIST::FUNCTION:ECDSA PEM_write_bio_ECPKParameters 3410 EXIST::FUNCTION:EC STORE_method_set_ctrl_function 3411 EXIST::FUNCTION: STORE_list_public_key_end 3412 EXIST::FUNCTION: -EC_GROUP_set_nid 3413 EXIST::FUNCTION:EC +EC_GROUP_set_curve_name 3413 EXIST::FUNCTION:EC STORE_get_arbitrary 3414 EXIST::FUNCTION: STORE_store_crl 3415 EXIST::FUNCTION: X509_policy_node_get0_policy 3416 EXIST::FUNCTION: -- 2.34.1