diff --git a/linuxkm/lkcapi_ecdsa_glue.c b/linuxkm/lkcapi_ecdsa_glue.c index 15113e6b1b..46469131e5 100644 --- a/linuxkm/lkcapi_ecdsa_glue.c +++ b/linuxkm/lkcapi_ecdsa_glue.c @@ -401,7 +401,9 @@ static int km_ecdsa_verify(struct akcipher_request *req) sig_len = req->src_len; hash_len = req->dst_len; - if (hash_len <= 0) { + if ((hash_len > WC_MAX_DIGEST_SIZE) || + (hash_len < WC_MIN_DIGEST_SIZE)) + { err = -EINVAL; goto ecdsa_verify_end; }