crypto: cmac - return -EINVAL if block size is unsupported
authorEric Biggers <ebiggers@google.com>
Mon, 10 Oct 2016 17:15:14 +0000 (10:15 -0700)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 21 Oct 2016 03:03:42 +0000 (11:03 +0800)
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>
crypto/cmac.c

index 7a8bfbd548f60835fbf417ab96e43b749a5d283f..b6c4059764aa7330ac44a2809759247375959154 100644 (file)
@@ -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;
        }