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:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user