aboutsummaryrefslogtreecommitdiff
path: root/programs/pkey
diff options
context:
space:
mode:
authorGilles Peskine <Gilles.Peskine@arm.com>2021-05-27 23:53:07 +0200
committerGilles Peskine <Gilles.Peskine@arm.com>2021-06-15 00:12:37 +0200
commitbf69ea5b8f882af439ac3b288b7063ce6757e730 (patch)
tree1d892a38940f20ea116420091afa2218c542236d /programs/pkey
parentcd07e22048e650562873b9ee76f3e690fb6d9516 (diff)
downloadmbedtls-bf69ea5b8f882af439ac3b288b7063ce6757e730.zip
mbedtls-bf69ea5b8f882af439ac3b288b7063ce6757e730.tar.gz
mbedtls-bf69ea5b8f882af439ac3b288b7063ce6757e730.tar.bz2
Make some fields of mbedtls_ecp_group public
The Mbed TLS code relies heavily on reading certain fields of mbedtls_ecp_group directly. Make these fields public. Require that MBEDTLS_ECP_ALT alternative implementations have them. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Diffstat (limited to 'programs/pkey')
-rw-r--r--programs/pkey/ecdsa.c2
-rw-r--r--programs/pkey/gen_key.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/programs/pkey/ecdsa.c b/programs/pkey/ecdsa.c
index 3dacd75..3dd85bf 100644
--- a/programs/pkey/ecdsa.c
+++ b/programs/pkey/ecdsa.c
@@ -156,7 +156,7 @@ int main( int argc, char *argv[] )
goto exit;
}
- mbedtls_printf( " ok (key size: %d bits)\n", (int) ctx_sign.MBEDTLS_PRIVATE(grp).MBEDTLS_PRIVATE(pbits) );
+ mbedtls_printf( " ok (key size: %d bits)\n", (int) ctx_sign.MBEDTLS_PRIVATE(grp).pbits );
dump_pubkey( " + Public key: ", &ctx_sign );
diff --git a/programs/pkey/gen_key.c b/programs/pkey/gen_key.c
index 9ad1190..9415530 100644
--- a/programs/pkey/gen_key.c
+++ b/programs/pkey/gen_key.c
@@ -395,7 +395,7 @@ int main( int argc, char *argv[] )
{
mbedtls_ecp_keypair *ecp = mbedtls_pk_ec( key );
mbedtls_printf( "curve: %s\n",
- mbedtls_ecp_curve_info_from_grp_id( ecp->MBEDTLS_PRIVATE(grp).MBEDTLS_PRIVATE(id) )->MBEDTLS_PRIVATE(name) );
+ mbedtls_ecp_curve_info_from_grp_id( ecp->MBEDTLS_PRIVATE(grp).id )->MBEDTLS_PRIVATE(name) );
mbedtls_mpi_write_file( "X_Q: ", &ecp->MBEDTLS_PRIVATE(Q).MBEDTLS_PRIVATE(X), 16, NULL );
mbedtls_mpi_write_file( "Y_Q: ", &ecp->MBEDTLS_PRIVATE(Q).MBEDTLS_PRIVATE(Y), 16, NULL );
mbedtls_mpi_write_file( "D: ", &ecp->MBEDTLS_PRIVATE(d) , 16, NULL );