Skip to contentSkip to conversation

crypto: cmac - return -EINVAL if block size is unsupported

PATCH In review Eric Biggers 2 participants 2 messages Oct 10, 2016 – Oct 21, 2016 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 crypto/cmac.c | 1 +
 1 file changed, 1 insertion(+)
crypto/cmac.c +1 -0
index 7a8bfbd..b6c4059 100644
@@ -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;
 	}
 
Signature · 1 line
2.8.0.rc3.226.g39d4020
maintainer
#1 lore raw
Quoted 7 lines · 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.

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt