Add explicit mbedtls_ecp_tls_read_group_id call
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
This commit is contained in:
parent
7403d93f8a
commit
ccae25b4bf
1 changed files with 7 additions and 1 deletions
|
@ -798,6 +798,7 @@ void mbedtls_ecp_group_metadata( int id, int bit_size, int crv_type,
|
||||||
{
|
{
|
||||||
mbedtls_ecp_group grp, grp_read, grp_cpy;
|
mbedtls_ecp_group grp, grp_read, grp_cpy;
|
||||||
const mbedtls_ecp_group_id *g_id;
|
const mbedtls_ecp_group_id *g_id;
|
||||||
|
mbedtls_ecp_group_id read_g_id;
|
||||||
const mbedtls_ecp_curve_info *crv, *crv_tls_id, *crv_name;
|
const mbedtls_ecp_curve_info *crv, *crv_tls_id, *crv_name;
|
||||||
|
|
||||||
mbedtls_mpi exp_P, exp_A, exp_B, exp_G_x, exp_G_y, exp_N;
|
mbedtls_mpi exp_P, exp_A, exp_B, exp_G_x, exp_G_y, exp_N;
|
||||||
|
@ -860,13 +861,18 @@ void mbedtls_ecp_group_metadata( int id, int bit_size, int crv_type,
|
||||||
TEST_EQUAL( crv_tls_id->grp_id, id );
|
TEST_EQUAL( crv_tls_id->grp_id, id );
|
||||||
TEST_EQUAL( crv_name->grp_id, id );
|
TEST_EQUAL( crv_name->grp_id, id );
|
||||||
|
|
||||||
// Validate write_group against test data, read result
|
// Validate write_group against test data
|
||||||
TEST_EQUAL( mbedtls_ecp_tls_write_group( &grp, &olen,
|
TEST_EQUAL( mbedtls_ecp_tls_write_group( &grp, &olen,
|
||||||
buf, sizeof( buf ) ),
|
buf, sizeof( buf ) ),
|
||||||
0 );
|
0 );
|
||||||
TEST_EQUAL( mbedtls_test_hexcmp( buf, ecparameters, olen,
|
TEST_EQUAL( mbedtls_test_hexcmp( buf, ecparameters, olen,
|
||||||
sizeof( ecparameters ) ),
|
sizeof( ecparameters ) ),
|
||||||
0 );
|
0 );
|
||||||
|
|
||||||
|
// Read group from buffer and compare with expected ID
|
||||||
|
TEST_EQUAL( mbedtls_ecp_tls_read_group_id( &read_g_id, &vbuf, olen ),
|
||||||
|
0 );
|
||||||
|
TEST_EQUAL( read_g_id, id );
|
||||||
TEST_EQUAL( mbedtls_ecp_tls_read_group( &grp_read, &vbuf, olen ),
|
TEST_EQUAL( mbedtls_ecp_tls_read_group( &grp_read, &vbuf, olen ),
|
||||||
0 );
|
0 );
|
||||||
TEST_EQUAL( grp_read.id, id );
|
TEST_EQUAL( grp_read.id, id );
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue