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
This commit is contained in:
Nils Larsch 2005-05-08 22:09:12 +00:00
parent b6223d2f70
commit 7dc17a6cf0
9 changed files with 14 additions and 14 deletions

View File

@ -303,7 +303,7 @@ int ECPKParameters_print(BIO *bp, const EC_GROUP *x, int off)
if (!BIO_indent(bp, off, 128)) if (!BIO_indent(bp, off, 128))
goto err; goto err;
nid = EC_GROUP_get_nid(x); nid = EC_GROUP_get_curve_name(x);
if (nid == 0) if (nid == 0)
goto err; goto err;

View File

@ -171,7 +171,7 @@ int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey)
} }
if (EC_GROUP_get_asn1_flag(eckey->group) 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 */ /* just set the OID */
a->parameter->type = V_ASN1_OBJECT; a->parameter->type = V_ASN1_OBJECT;

View File

@ -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_order(const EC_GROUP *, BIGNUM *order, BN_CTX *);
int EC_GROUP_get_cofactor(const EC_GROUP *, BIGNUM *cofactor, BN_CTX *); int EC_GROUP_get_cofactor(const EC_GROUP *, BIGNUM *cofactor, BN_CTX *);
void EC_GROUP_set_nid(EC_GROUP *, int); /* curve name */ void EC_GROUP_set_curve_name(EC_GROUP *, int nid); /* curve name */
int EC_GROUP_get_nid(const EC_GROUP *); int EC_GROUP_get_curve_name(const EC_GROUP *);
void EC_GROUP_set_asn1_flag(EC_GROUP *, int flag); void EC_GROUP_set_asn1_flag(EC_GROUP *, int flag);
int EC_GROUP_get_asn1_flag(const EC_GROUP *); int EC_GROUP_get_asn1_flag(const EC_GROUP *);

View File

@ -707,7 +707,7 @@ ECPKPARAMETERS *ec_asn1_group2pkparameters(const EC_GROUP *group,
/* use the asn1 OID to describe the /* use the asn1 OID to describe the
* the elliptic curve parameters * the elliptic curve parameters
*/ */
tmp = EC_GROUP_get_nid(group); tmp = EC_GROUP_get_curve_name(group);
if (tmp) if (tmp)
{ {
ret->type = 0; ret->type = 0;

View File

@ -1245,7 +1245,7 @@ EC_GROUP *EC_GROUP_new_by_nid(int nid)
return NULL; return NULL;
} }
EC_GROUP_set_nid(ret, nid); EC_GROUP_set_curve_name(ret, nid);
return ret; return ret;
} }

View File

@ -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; 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; 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))) EC_METHOD_get_field_type(EC_GROUP_method_of(b)))
return 1; return 1;
/* compare the curve name (if present) */ /* compare the curve name (if present) */
if (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_nid(a) == EC_GROUP_get_nid(b)) EC_GROUP_get_curve_name(a) == EC_GROUP_get_curve_name(b))
return 0; return 0;
if (!ctx) if (!ctx)

View File

@ -616,7 +616,7 @@ static int eckey_pkey2pkcs8(PKCS8_PRIV_KEY_INFO *p8, EVP_PKEY *pkey)
} }
if (EC_GROUP_get_asn1_flag(eckey->group) 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 */ /* we have a 'named curve' => just set the OID */
p8->pkeyalg->parameter->type = V_ASN1_OBJECT; p8->pkeyalg->parameter->type = V_ASN1_OBJECT;

View File

@ -1327,7 +1327,7 @@ int ssl3_send_server_key_exchange(SSL *s)
* supported named curves, curve_id is non-zero. * supported named curves, curve_id is non-zero.
*/ */
if ((curve_id = if ((curve_id =
nid2curve_id(EC_GROUP_get_nid(ecdh->group))) nid2curve_id(EC_GROUP_get_curve_name(ecdh->group)))
== 0) == 0)
{ {
SSLerr(SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE,SSL_R_UNSUPPORTED_ELLIPTIC_CURVE); SSLerr(SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE,SSL_R_UNSUPPORTED_ELLIPTIC_CURVE);

View File

@ -2937,7 +2937,7 @@ X509_VERIFY_PARAM_set1_policies 3367 EXIST::FUNCTION:
EVP_sha512 3368 EXIST::FUNCTION:SHA,SHA512 EVP_sha512 3368 EXIST::FUNCTION:SHA,SHA512
X509_VERIFY_PARAM_set1_name 3369 EXIST::FUNCTION: X509_VERIFY_PARAM_set1_name 3369 EXIST::FUNCTION:
X509_VERIFY_PARAM_set_purpose 3370 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: STORE_get_number 3372 EXIST::FUNCTION:
ECDSA_sign_setup 3373 EXIST::FUNCTION:ECDSA ECDSA_sign_setup 3373 EXIST::FUNCTION:ECDSA
BN_GF2m_mod_solve_quad_arr 3374 EXIST::FUNCTION: 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 PEM_write_bio_ECPKParameters 3410 EXIST::FUNCTION:EC
STORE_method_set_ctrl_function 3411 EXIST::FUNCTION: STORE_method_set_ctrl_function 3411 EXIST::FUNCTION:
STORE_list_public_key_end 3412 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_get_arbitrary 3414 EXIST::FUNCTION:
STORE_store_crl 3415 EXIST::FUNCTION: STORE_store_crl 3415 EXIST::FUNCTION:
X509_policy_node_get0_policy 3416 EXIST::FUNCTION: X509_policy_node_get0_policy 3416 EXIST::FUNCTION: