Rename ecp_check_prvkey with a 'i' for consistency
This commit is contained in:
parent
81c313ccc6
commit
de44a4aecf
4 changed files with 5 additions and 5 deletions
|
@ -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
|
* in order to ease use with other structures such as
|
||||||
* ecdh_context of ecdsa_context.
|
* 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
|
* \brief Generate a keypair
|
||||||
|
|
|
@ -1308,7 +1308,7 @@ cleanup:
|
||||||
/*
|
/*
|
||||||
* Check that an mpi is valid as a private key (SEC1 3.2)
|
* 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 */
|
/* We want 1 <= d <= N-1 */
|
||||||
if ( mpi_cmp_int( d, 1 ) < 0 || mpi_cmp_mpi( d, &grp->N ) >= 0 )
|
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 );
|
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 );
|
ecp_keypair_free( eck );
|
||||||
return( ret );
|
return( ret );
|
||||||
|
@ -2823,7 +2823,7 @@ static int x509parse_key_pkcs8_unencrypted_der_ec(
|
||||||
return( ret );
|
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 );
|
ecp_keypair_free( eck );
|
||||||
return( ret );
|
return( ret );
|
||||||
|
|
|
@ -220,7 +220,7 @@ x509parse_keyfile_ec:key_file:password:result
|
||||||
ecp_keypair *eckey;
|
ecp_keypair *eckey;
|
||||||
TEST_ASSERT( ctx.type == POLARSSL_PK_ECKEY );
|
TEST_ASSERT( ctx.type == POLARSSL_PK_ECKEY );
|
||||||
eckey = (ecp_keypair *) ctx.data;
|
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 );
|
pk_free( &ctx );
|
||||||
|
|
Loading…
Reference in a new issue