linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] crypto: cmac - return -EINVAL if block size is unsupported
@ 2016-10-10 17:15 Eric Biggers
  2016-10-21  3:14 ` Herbert Xu
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Biggers @ 2016-10-10 17:15 UTC (permalink / raw)
  To: herbert, davem; +Cc: linux-crypto, linux-kernel, Eric Biggers

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>
---
 crypto/cmac.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/crypto/cmac.c b/crypto/cmac.c
index 7a8bfbd..b6c4059 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;
 	}
 
-- 
2.8.0.rc3.226.g39d4020

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] crypto: cmac - return -EINVAL if block size is unsupported
  2016-10-10 17:15 [PATCH] crypto: cmac - return -EINVAL if block size is unsupported Eric Biggers
@ 2016-10-21  3:14 ` Herbert Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2016-10-21  3:14 UTC (permalink / raw)
  To: Eric Biggers; +Cc: davem, linux-crypto, linux-kernel

On Mon, Oct 10, 2016 at 10:15:14AM -0700, Eric Biggers wrote:
> 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>

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-10-21  3:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-10 17:15 [PATCH] crypto: cmac - return -EINVAL if block size is unsupported Eric Biggers
2016-10-21  3:14 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).