[CRYPTO] aead: Fix mask in crypto_alloc_aead

There is a silly typo in crypto_alloc_aead and crypto_grab_aead where
we set the GENIV bit in the mask when we were supposed to clear it
instead.  This broke the construction of AEAD geniv wrappers.

Signed-off-by: Herbert Xu <[EMAIL PROTECTED]>
---

 crypto/aead.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/crypto/aead.c b/crypto/aead.c
index 4a62ea7..77694ad 100644
--- a/crypto/aead.c
+++ b/crypto/aead.c
@@ -429,7 +429,8 @@ int crypto_grab_aead(struct crypto_aead_spawn *spawn, const 
char *name,
 
        type &= ~(CRYPTO_ALG_TYPE_MASK | CRYPTO_ALG_GENIV);
        type |= CRYPTO_ALG_TYPE_AEAD;
-       mask |= CRYPTO_ALG_TYPE_MASK | CRYPTO_ALG_GENIV;
+       mask &= ~(CRYPTO_ALG_TYPE_MASK | CRYPTO_ALG_GENIV);
+       mask |= CRYPTO_ALG_TYPE_MASK;
 
        alg = crypto_lookup_aead(name, type, mask);
        if (IS_ERR(alg))
@@ -448,7 +449,8 @@ struct crypto_aead *crypto_alloc_aead(const char *alg_name, 
u32 type, u32 mask)
 
        type &= ~(CRYPTO_ALG_TYPE_MASK | CRYPTO_ALG_GENIV);
        type |= CRYPTO_ALG_TYPE_AEAD;
-       mask |= CRYPTO_ALG_TYPE_MASK | CRYPTO_ALG_GENIV;
+       mask &= ~(CRYPTO_ALG_TYPE_MASK | CRYPTO_ALG_GENIV);
+       mask |= CRYPTO_ALG_TYPE_MASK;
 
        for (;;) {
                struct crypto_alg *alg;
-
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to