ALSA: ice1724 - Fix ESI Maya44 capture source control
[safe/jmp/linux-2.6] / crypto / ablkcipher.c
index 03fb5fa..fe980da 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Asynchronous block chaining cipher operations.
- * 
+ *
  * This is the asynchronous version of blkcipher.c indicating completion
  * via a callback.
  *
@@ -8,7 +8,7 @@
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option) 
+ * Software Foundation; either version 2 of the License, or (at your option)
  * any later version.
  *
  */
@@ -183,6 +183,12 @@ EXPORT_SYMBOL_GPL(crypto_givcipher_type);
 
 const char *crypto_default_geniv(const struct crypto_alg *alg)
 {
+       if (((alg->cra_flags & CRYPTO_ALG_TYPE_MASK) ==
+            CRYPTO_ALG_TYPE_BLKCIPHER ? alg->cra_blkcipher.ivsize :
+                                        alg->cra_ablkcipher.ivsize) !=
+           alg->cra_blocksize)
+               return "chainiv";
+
        return alg->cra_flags & CRYPTO_ALG_ASYNC ?
               "eseqiv" : skcipher_default_geniv;
 }