mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-29 11:41:15 +03:00
ecjpake_zkp_read() now returns ...BAD_INPUT_DATA when r len == 0 and test follows that
Signed-off-by: TRodziewicz <tomasz.rodziewicz@mobica.com>
This commit is contained in:
@ -273,7 +273,7 @@ static int ecjpake_zkp_read( const mbedtls_md_info_t *md_info,
|
||||
|
||||
r_len = *(*p)++;
|
||||
|
||||
if( end < *p || (size_t)( end - *p ) < r_len )
|
||||
if( end < *p || (size_t)( end - *p ) < r_len || r_len == 0 )
|
||||
{
|
||||
ret = MBEDTLS_ERR_ECP_BAD_INPUT_DATA;
|
||||
goto cleanup;
|
||||
@ -286,13 +286,6 @@ static int ecjpake_zkp_read( const mbedtls_md_info_t *md_info,
|
||||
* Verification
|
||||
*/
|
||||
MBEDTLS_MPI_CHK( ecjpake_hash( md_info, grp, pf, G, &V, X, id, &h ) );
|
||||
|
||||
if( mbedtls_mpi_cmp_int( &r,0 ) == 0 )
|
||||
{
|
||||
ret = MBEDTLS_ERR_ECP_INVALID_KEY;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
MBEDTLS_MPI_CHK( mbedtls_ecp_muladd( (mbedtls_ecp_group *) grp,
|
||||
&VV, &h, X, &r, G ) );
|
||||
|
||||
|
Reference in New Issue
Block a user