1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-30 22:43:08 +03:00

Add tests for (and fix bug in) ecp_tls_write_group

This commit is contained in:
Manuel Pégourié-Gonnard
2013-02-10 12:51:17 +01:00
parent 420f1eb675
commit 46106a9d75
3 changed files with 48 additions and 12 deletions

View File

@ -69,6 +69,8 @@ void ecp_group_init( ecp_group *grp )
if( grp == NULL )
return;
grp->id = 0;
mpi_init( &grp->P );
mpi_init( &grp->B );
ecp_point_init( &grp->G );
@ -632,7 +634,7 @@ int ecp_tls_write_group( const ecp_group *grp, size_t *olen,
* Next two bytes are the namedcurve value
*/
buf[0] = grp->id >> 8;
buf[1] = grp->id && 0xFF;
buf[1] = grp->id & 0xFF;
return 0;
}