From: Eric Biggers Date: Mon, 10 Oct 2016 17:15:14 +0000 (-0700) Subject: crypto: cmac - return -EINVAL if block size is unsupported X-Git-Tag: v4.10-rc1~117^2~132 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=48ee41bf5ba052364f78781e9082a510fbcd104a;p=linux.git crypto: cmac - return -EINVAL if block size is unsupported cmac_create() previously returned 0 if a cipher with a block size other than 8 or 16 bytes was specified. It should return -EINVAL instead. Granted, this doesn't actually change any behavior because cryptomgr currently ignores any return value other than -EAGAIN from template ->create() functions. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu --- diff --git a/crypto/cmac.c b/crypto/cmac.c index 7a8bfbd548f6..b6c4059764aa 100644 --- a/crypto/cmac.c +++ b/crypto/cmac.c @@ -243,6 +243,7 @@ static int cmac_create(struct crypto_template *tmpl, struct rtattr **tb) case 8: break; default: + err = -EINVAL; goto out_put_alg; }