Use MBEDTLS_GET_UINT16_BE in mbedtls_ecp_tls_read_group_id
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
This commit is contained in:
parent
a4c01dd6e9
commit
6a9fb932fb
1 changed files with 2 additions and 3 deletions
|
@ -958,9 +958,8 @@ int mbedtls_ecp_tls_read_group_id(mbedtls_ecp_group_id *grp,
|
||||||
/*
|
/*
|
||||||
* Next two bytes are the namedcurve value
|
* Next two bytes are the namedcurve value
|
||||||
*/
|
*/
|
||||||
tls_id = *(*buf)++;
|
tls_id = MBEDTLS_GET_UINT16_BE(*buf, 0);
|
||||||
tls_id <<= 8;
|
*buf += 2;
|
||||||
tls_id |= *(*buf)++;
|
|
||||||
|
|
||||||
if ((curve_info = mbedtls_ecp_curve_info_from_tls_id(tls_id)) == NULL) {
|
if ((curve_info = mbedtls_ecp_curve_info_from_tls_id(tls_id)) == NULL) {
|
||||||
return MBEDTLS_ERR_ECP_FEATURE_UNAVAILABLE;
|
return MBEDTLS_ERR_ECP_FEATURE_UNAVAILABLE;
|
||||||
|
|
Loading…
Reference in a new issue