Complete tests for reading round one

Also change the code to forbid public keys being 0
This commit is contained in:
Manuel Pégourié-Gonnard 2015-08-17 10:37:40 +02:00
parent bbe4e52c3b
commit 3059095e86
2 changed files with 103 additions and 1 deletions

View file

@ -355,6 +355,12 @@ static int ecjpake_kkp_read( const mbedtls_md_info_t *md_info,
* } ECJPAKEKeyKP;
*/
MBEDTLS_MPI_CHK( mbedtls_ecp_tls_read_point( grp, X, p, end - *p ) );
if( mbedtls_ecp_is_zero( X ) )
{
ret = MBEDTLS_ERR_ECP_INVALID_KEY;
goto cleanup;
}
MBEDTLS_MPI_CHK( ecjpake_zkp_read( md_info, grp, G, X, id, p, end ) );
cleanup: