Commit de44a4ae authored by Manuel Pégourié-Gonnard's avatar Manuel Pégourié-Gonnard
Browse files

Rename ecp_check_prvkey with a 'i' for consistency

parent 81c313cc
......@@ -454,7 +454,7 @@ int ecp_check_pubkey( const ecp_group *grp, const ecp_point *pt );
* in order to ease use with other structures such as
* ecdh_context of ecdsa_context.
*/
int ecp_check_prvkey( const ecp_group *grp, const mpi *d );
int ecp_check_privkey( const ecp_group *grp, const mpi *d );
/**
* \brief Generate a keypair
......
......@@ -1308,7 +1308,7 @@ cleanup:
/*
* Check that an mpi is valid as a private key (SEC1 3.2)
*/
int ecp_check_prvkey( const ecp_group *grp, const mpi *d )
int ecp_check_privkey( const ecp_group *grp, const mpi *d )
{
/* We want 1 <= d <= N-1 */
if ( mpi_cmp_int( d, 1 ) < 0 || mpi_cmp_mpi( d, &grp->N ) >= 0 )
......
......@@ -2731,7 +2731,7 @@ static int x509parse_key_sec1_der( ecp_keypair *eck,
return( POLARSSL_ERR_X509_KEY_INVALID_FORMAT + ret );
}
if( ( ret = ecp_check_prvkey( &eck->grp, &eck->d ) ) != 0 )
if( ( ret = ecp_check_privkey( &eck->grp, &eck->d ) ) != 0 )
{
ecp_keypair_free( eck );
return( ret );
......@@ -2823,7 +2823,7 @@ static int x509parse_key_pkcs8_unencrypted_der_ec(
return( ret );
}
if( ( ret = ecp_check_prvkey( &eck->grp, &eck->d ) ) != 0 )
if( ( ret = ecp_check_privkey( &eck->grp, &eck->d ) ) != 0 )
{
ecp_keypair_free( eck );
return( ret );
......
......@@ -220,7 +220,7 @@ x509parse_keyfile_ec:key_file:password:result
ecp_keypair *eckey;
TEST_ASSERT( ctx.type == POLARSSL_PK_ECKEY );
eckey = (ecp_keypair *) ctx.data;
TEST_ASSERT( ecp_check_prvkey( &eckey->grp, &eckey->d ) == 0 );
TEST_ASSERT( ecp_check_privkey( &eckey->grp, &eckey->d ) == 0 );
}
pk_free( &ctx );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment