Skip to content

Commit cd208bc

Browse files
committed
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
2 parents 8646010 + acd246b commit cd208bc

File tree

4 files changed

+37
-4
lines changed

4 files changed

+37
-4
lines changed

crypto/api.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,8 @@ struct crypto_alg *crypto_larval_lookup(const char *name, u32 type, u32 mask)
221221

222222
request_module(name);
223223

224-
if (!((type ^ CRYPTO_ALG_NEED_FALLBACK) & mask) &&
224+
if (!((type ^ CRYPTO_ALG_NEED_FALLBACK) & mask &
225+
CRYPTO_ALG_NEED_FALLBACK) &&
225226
snprintf(tmp, sizeof(tmp), "%s-all", name) < sizeof(tmp))
226227
request_module(tmp);
227228

crypto/eseqiv.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@ static int eseqiv_givencrypt(struct skcipher_givcrypt_request *req)
153153
if (err)
154154
goto out;
155155

156-
eseqiv_complete2(req);
156+
if (giv != req->giv)
157+
eseqiv_complete2(req);
157158

158159
out:
159160
return err;

drivers/crypto/ixp4xx_crypto.c

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,7 @@ static void crypto_done_action(unsigned long arg)
415415
static int init_ixp_crypto(void)
416416
{
417417
int ret = -ENODEV;
418+
u32 msg[2] = { 0, 0 };
418419

419420
if (! ( ~(*IXP4XX_EXP_CFG2) & (IXP4XX_FEATURE_HASH |
420421
IXP4XX_FEATURE_AES | IXP4XX_FEATURE_DES))) {
@@ -426,9 +427,35 @@ static int init_ixp_crypto(void)
426427
return ret;
427428

428429
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;
430442
}
431443

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+
}
432459
/* buffer_pool will also be used to sometimes store the hmac,
433460
* so assure it is large enough
434461
*/
@@ -459,6 +486,10 @@ static int init_ixp_crypto(void)
459486

460487
qmgr_enable_irq(RECV_QID);
461488
return 0;
489+
490+
npe_error:
491+
printk(KERN_ERR "%s not responding\n", npe_name(npe_c));
492+
ret = -EIO;
462493
err:
463494
if (ctx_pool)
464495
dma_pool_destroy(ctx_pool);

drivers/crypto/padlock-aes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,4 +489,4 @@ MODULE_DESCRIPTION("VIA PadLock AES algorithm support");
489489
MODULE_LICENSE("GPL");
490490
MODULE_AUTHOR("Michal Ludvig");
491491

492-
MODULE_ALIAS("aes-all");
492+
MODULE_ALIAS("aes");

0 commit comments

Comments
 (0)