Skip to contentSkip to conversation

crypto/cryptod: use crypto_skcipher_type() for getting skcipher type

PATCH Applied Alexander Kuleshov 2 participants 2 messages Nov 25, 2015 – Nov 27, 2015 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto/cryptod: use crypto_skcipher_type() for getting skcipher type

The <linux/crypto.h> provides inline function - crypto_skcipher_type(). Let's use it in the cryptd_alloc_ablkcipher() instead of direct calculation.

---
 crypto/cryptd.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
crypto/cryptd.c +1 -2
index c81861b..c4af8aa 100644
@@ -887,8 +887,7 @@ struct cryptd_ablkcipher *cryptd_alloc_ablkcipher(const char *alg_name,
 	if (snprintf(cryptd_alg_name, CRYPTO_MAX_ALG_NAME,
 		     "cryptd(%s)", alg_name) >= CRYPTO_MAX_ALG_NAME)
 		return ERR_PTR(-EINVAL);
-	type &= ~(CRYPTO_ALG_TYPE_MASK | CRYPTO_ALG_GENIV);
-	type |= CRYPTO_ALG_TYPE_BLKCIPHER;
+	type = crypto_skcipher_type(type);
 	mask &= ~CRYPTO_ALG_TYPE_MASK;
 	mask |= (CRYPTO_ALG_GENIV | CRYPTO_ALG_TYPE_BLKCIPHER_MASK);
 	tfm = crypto_alloc_base(cryptd_alg_name, type, mask);
Signature · 1 line
2.5.0
maintainer Applied
#1 lore raw
Quoted 4 lines · Alexander Kuleshov

The <linux/crypto.h> provides inline function - crypto_skcipher_type(). Let's use it in the cryptd_alloc_ablkcipher() instead of direct calculation.

Applied.

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