Add function parsing a TLS ECParameters record

This commit is contained in:
Manuel Pégourié-Gonnard 2013-02-09 17:03:58 +01:00
parent cf4a70c8ed
commit 1a96728964
4 changed files with 96 additions and 9 deletions

View file

@ -322,6 +322,28 @@ ecp_gen_keypair:id
}
END_CASE
BEGIN_CASE
ecp_read_params:record:ret:bits
{
ecp_group grp;
unsigned char buf[10];
int len, ret;
ecp_group_init( &grp );
memset( buf, 0x00, sizeof( buf ) );
len = unhexify( buf, {record} );
ret = ecp_tls_read_group( &grp, buf, len );
TEST_ASSERT( ret == {ret} );
if( ret == 0)
TEST_ASSERT( mpi_msb( &grp.P ) == {bits} );
ecp_group_free( &grp );
}
END_CASE
BEGIN_CASE
ecp_selftest:
{