summaryrefslogtreecommitdiff
path: root/crypto/cmac.c
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2016-10-10 10:15:14 -0700
committerHerbert Xu <herbert@gondor.apana.org.au>2016-10-21 11:03:42 +0800
commit8fd95025508cb816a0df00fab83b46b6f070a482 (patch)
tree53b136f1bebf0206c9d43752d9306c858cffd5fb /crypto/cmac.c
parent68b0f50b3534bdb9be58a943b51957d1570ba9dc (diff)
downloadlinux-crypto-8fd95025508cb816a0df00fab83b46b6f070a482.tar.gz
linux-crypto-8fd95025508cb816a0df00fab83b46b6f070a482.zip
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 <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/cmac.c')
-rw-r--r--crypto/cmac.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/crypto/cmac.c b/crypto/cmac.c
index 7a8bfbd5..b6c40597 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;
}