Fix when no SHA3 family is found.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos 2022-05-17 11:45:59 +02:00
parent 85eeda0122
commit 116411e1a9
No known key found for this signature in database
GPG Key ID: C0095B7870A4CCD3

View File

@ -203,7 +203,7 @@ int mbedtls_sha3_starts( mbedtls_sha3_context *ctx, mbedtls_sha3_id id )
break;
}
if( p == NULL )
if( p == NULL || p->id == MBEDTLS_SHA3_NONE )
return( MBEDTLS_ERR_SHA3_BAD_INPUT_DATA );
ctx->id = id;