From de44a4aecf96796a59721942ffcf551eb14bd228 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Tue, 9 Jul 2013 16:05:52 +0200 Subject: [PATCH] Rename ecp_check_prvkey with a 'i' for consistency --- include/polarssl/ecp.h | 2 +- library/ecp.c | 2 +- library/x509parse.c | 4 ++-- tests/suites/test_suite_x509parse.function | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/polarssl/ecp.h b/include/polarssl/ecp.h index 707d04028..c1f08c9f7 100644 --- a/include/polarssl/ecp.h +++ b/include/polarssl/ecp.h @@ -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 diff --git a/library/ecp.c b/library/ecp.c index 29cfce5a3..9e7a96785 100644 --- a/library/ecp.c +++ b/library/ecp.c @@ -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 ) diff --git a/library/x509parse.c b/library/x509parse.c index 179ff959d..c5f9049df 100644 --- a/library/x509parse.c +++ b/library/x509parse.c @@ -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 ); diff --git a/tests/suites/test_suite_x509parse.function b/tests/suites/test_suite_x509parse.function index 2baf76416..b6383d734 100644 --- a/tests/suites/test_suite_x509parse.function +++ b/tests/suites/test_suite_x509parse.function @@ -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 );