]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - crypto/hmac.c
s390/cio: Allow zero-length CCWs in vfio-ccw
[linux.git] / crypto / hmac.c
index a68c1266121f5ff20fb078559d41ad147520bf08..241b1868c1d01c5730d919ee598c804e2038de75 100644 (file)
@@ -157,6 +157,8 @@ static int hmac_init_tfm(struct crypto_tfm *tfm)
 
        parent->descsize = sizeof(struct shash_desc) +
                           crypto_shash_descsize(hash);
+       if (WARN_ON(parent->descsize > HASH_MAX_DESCSIZE))
+               return -EINVAL;
 
        ctx->hash = hash;
        return 0;