[CRYPTO] api: Get rid of flags argument to setkey
[linux-block.git] / crypto / cipher.c
index b899eb97abd7ceac0bc752418954b66bfc0ea6e6..56406a4a88d4dd3d310bcd196245732a60d5e87d 100644 (file)
@@ -264,12 +264,12 @@ static int setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen)
 {
        struct cipher_alg *cia = &tfm->__crt_alg->cra_cipher;
        
+       tfm->crt_flags &= ~CRYPTO_TFM_RES_MASK;
        if (keylen < cia->cia_min_keysize || keylen > cia->cia_max_keysize) {
                tfm->crt_flags |= CRYPTO_TFM_RES_BAD_KEY_LEN;
                return -EINVAL;
        } else
-               return cia->cia_setkey(tfm, key, keylen,
-                                      &tfm->crt_flags);
+               return cia->cia_setkey(tfm, key, keylen);
 }
 
 static int ecb_encrypt(struct crypto_tfm *tfm,