Commit cd208bcc7cb0acd851e25c951ec2a9c14b084eab

Authored by Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: padlock - Revert aes-all alias to aes
  crypto: api - Fix algorithm module auto-loading
  crypto: eseqiv - Fix IV generation for sync algorithms
  crypto: ixp4xx - check firmware for crypto support

Showing 4 changed files Side-by-side Diff

... ... @@ -221,7 +221,8 @@
221 221  
222 222 request_module(name);
223 223  
224   - if (!((type ^ CRYPTO_ALG_NEED_FALLBACK) & mask) &&
  224 + if (!((type ^ CRYPTO_ALG_NEED_FALLBACK) & mask &
  225 + CRYPTO_ALG_NEED_FALLBACK) &&
225 226 snprintf(tmp, sizeof(tmp), "%s-all", name) < sizeof(tmp))
226 227 request_module(tmp);
227 228  
... ... @@ -153,7 +153,8 @@
153 153 if (err)
154 154 goto out;
155 155  
156   - eseqiv_complete2(req);
  156 + if (giv != req->giv)
  157 + eseqiv_complete2(req);
157 158  
158 159 out:
159 160 return err;
drivers/crypto/ixp4xx_crypto.c
... ... @@ -415,6 +415,7 @@
415 415 static int init_ixp_crypto(void)
416 416 {
417 417 int ret = -ENODEV;
  418 + u32 msg[2] = { 0, 0 };
418 419  
419 420 if (! ( ~(*IXP4XX_EXP_CFG2) & (IXP4XX_FEATURE_HASH |
420 421 IXP4XX_FEATURE_AES | IXP4XX_FEATURE_DES))) {
421 422  
... ... @@ -426,9 +427,35 @@
426 427 return ret;
427 428  
428 429 if (!npe_running(npe_c)) {
429   - npe_load_firmware(npe_c, npe_name(npe_c), dev);
  430 + ret = npe_load_firmware(npe_c, npe_name(npe_c), dev);
  431 + if (ret) {
  432 + return ret;
  433 + }
  434 + if (npe_recv_message(npe_c, msg, "STATUS_MSG"))
  435 + goto npe_error;
  436 + } else {
  437 + if (npe_send_message(npe_c, msg, "STATUS_MSG"))
  438 + goto npe_error;
  439 +
  440 + if (npe_recv_message(npe_c, msg, "STATUS_MSG"))
  441 + goto npe_error;
430 442 }
431 443  
  444 + switch ((msg[1]>>16) & 0xff) {
  445 + case 3:
  446 + printk(KERN_WARNING "Firmware of %s lacks AES support\n",
  447 + npe_name(npe_c));
  448 + support_aes = 0;
  449 + break;
  450 + case 4:
  451 + case 5:
  452 + support_aes = 1;
  453 + break;
  454 + default:
  455 + printk(KERN_ERR "Firmware of %s lacks crypto support\n",
  456 + npe_name(npe_c));
  457 + return -ENODEV;
  458 + }
432 459 /* buffer_pool will also be used to sometimes store the hmac,
433 460 * so assure it is large enough
434 461 */
... ... @@ -459,6 +486,10 @@
459 486  
460 487 qmgr_enable_irq(RECV_QID);
461 488 return 0;
  489 +
  490 +npe_error:
  491 + printk(KERN_ERR "%s not responding\n", npe_name(npe_c));
  492 + ret = -EIO;
462 493 err:
463 494 if (ctx_pool)
464 495 dma_pool_destroy(ctx_pool);
drivers/crypto/padlock-aes.c
... ... @@ -489,5 +489,5 @@
489 489 MODULE_LICENSE("GPL");
490 490 MODULE_AUTHOR("Michal Ludvig");
491 491  
492   -MODULE_ALIAS("aes-all");
  492 +MODULE_ALIAS("aes");