ECDH: Fix error code in mbedtls_ecdsa_sign

This commit is contained in:
Christoph M. Wintersteiger 2018-12-06 17:18:24 +00:00 committed by Janos Follath
parent 78c9c461cf
commit fba94e9726

2
library/ecdsa.c Normal file → Executable file
View File

@ -266,7 +266,7 @@ static int ecdsa_sign_restartable( mbedtls_ecp_group *grp,
if( grp->id == MBEDTLS_ECP_DP_CURVE25519 ||
grp->id == MBEDTLS_ECP_DP_CURVE448 ||
grp->N.p == NULL )
return( MBEDTLS_ERR_MD_FEATURE_UNAVAILABLE );
return( MBEDTLS_ERR_ECP_BAD_INPUT_DATA );
/* Make sure d is in range 1..n-1 */
if( mbedtls_mpi_cmp_int( d, 1 ) < 0 || mbedtls_mpi_cmp_mpi( d, &grp->N ) >= 0 )