Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Linus Torvalds committed May 17, 2009
2 parents 8646010 + acd246b commit cd208bc
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 4 deletions.
3 changes: 2 additions & 1 deletion crypto/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@ struct crypto_alg *crypto_larval_lookup(const char *name, u32 type, u32 mask)

request_module(name);

if (!((type ^ CRYPTO_ALG_NEED_FALLBACK) & mask) &&
if (!((type ^ CRYPTO_ALG_NEED_FALLBACK) & mask &
CRYPTO_ALG_NEED_FALLBACK) &&
snprintf(tmp, sizeof(tmp), "%s-all", name) < sizeof(tmp))
request_module(tmp);

Expand Down
3 changes: 2 additions & 1 deletion crypto/eseqiv.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ static int eseqiv_givencrypt(struct skcipher_givcrypt_request *req)
if (err)
goto out;

eseqiv_complete2(req);
if (giv != req->giv)
eseqiv_complete2(req);

out:
return err;
Expand Down
33 changes: 32 additions & 1 deletion drivers/crypto/ixp4xx_crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ static void crypto_done_action(unsigned long arg)
static int init_ixp_crypto(void)
{
int ret = -ENODEV;
u32 msg[2] = { 0, 0 };

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

if (!npe_running(npe_c)) {
npe_load_firmware(npe_c, npe_name(npe_c), dev);
ret = npe_load_firmware(npe_c, npe_name(npe_c), dev);
if (ret) {
return ret;
}
if (npe_recv_message(npe_c, msg, "STATUS_MSG"))
goto npe_error;
} else {
if (npe_send_message(npe_c, msg, "STATUS_MSG"))
goto npe_error;

if (npe_recv_message(npe_c, msg, "STATUS_MSG"))
goto npe_error;
}

switch ((msg[1]>>16) & 0xff) {
case 3:
printk(KERN_WARNING "Firmware of %s lacks AES support\n",
npe_name(npe_c));
support_aes = 0;
break;
case 4:
case 5:
support_aes = 1;
break;
default:
printk(KERN_ERR "Firmware of %s lacks crypto support\n",
npe_name(npe_c));
return -ENODEV;
}
/* buffer_pool will also be used to sometimes store the hmac,
* so assure it is large enough
*/
Expand Down Expand Up @@ -459,6 +486,10 @@ static int init_ixp_crypto(void)

qmgr_enable_irq(RECV_QID);
return 0;

npe_error:
printk(KERN_ERR "%s not responding\n", npe_name(npe_c));
ret = -EIO;
err:
if (ctx_pool)
dma_pool_destroy(ctx_pool);
Expand Down
2 changes: 1 addition & 1 deletion drivers/crypto/padlock-aes.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,4 +489,4 @@ MODULE_DESCRIPTION("VIA PadLock AES algorithm support");
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Michal Ludvig");

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

0 comments on commit cd208bc

Please sign in to comment.