mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-24 00:06:32 +01:00
Add tests for (and fix bug in) ecp_tls_write_group
This commit is contained in:
parent
420f1eb675
commit
46106a9d75
3 changed files with 48 additions and 12 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue