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

Fix ecp_tls_read_group's signature

This commit is contained in:
Manuel Pégourié-Gonnard
2013-02-10 13:20:52 +01:00
parent 8c16f96259
commit 7c145c6418
4 changed files with 15 additions and 8 deletions

View File

@ -589,7 +589,7 @@ int ecp_use_known_dp( ecp_group *grp, ecp_group_id id )
/*
* Set a group from an ECParameters record (RFC 4492)
*/
int ecp_tls_read_group( ecp_group *grp, const unsigned char *buf, size_t len )
int ecp_tls_read_group( ecp_group *grp, const unsigned char **buf, size_t len )
{
ecp_group_id id;
@ -602,13 +602,15 @@ int ecp_tls_read_group( ecp_group *grp, const unsigned char *buf, size_t len )
/*
* First byte is curve_type; only named_curve is handled
*/
if( *buf++ != POLARSSL_ECP_TLS_NAMED_CURVE )
if( *(*buf)++ != POLARSSL_ECP_TLS_NAMED_CURVE )
return( POLARSSL_ERR_ECP_BAD_INPUT_DATA );
/*
* Next two bytes are the namedcurve value
*/
id = 256 * buf[0] + buf[1];
id = *(*buf)++;
id <<= 8;
id |= *(*buf)++;
return ecp_use_known_dp( grp, id );
}