projects/linux·commit bc45eb89

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

bc45eb89 · Linus Torvalds <[email protected]> · 2008-09-14 22:50:43 -07:00

* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: talitos - Avoid consecutive packets going out with same IV
Commit
bc45eb8950b8c14487385cfd2bda1613ca8d9703
Parents
21238705 · ba95487d

Merge commit. Changes below are compared with the first parent: 21238705.

Changes

1 files changed · +4 −2

FileStatusAddDelContent
drivers/crypto/talitos.cmodified+4−2View file

drivers/crypto/talitos.c

View file
diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c
index ee827a7..b6ad3ac 100644
--- a/drivers/crypto/talitos.c
+++ b/drivers/crypto/talitos.c
@@ -1157,6 +1157,8 @@ static int aead_authenc_givencrypt(
edesc->desc.hdr = ctx->desc_hdr_template | DESC_HDR_MODE0_ENCRYPT;
memcpy(req->giv, ctx->iv, crypto_aead_ivsize(authenc));
+ /* avoid consecutive packets going out with same IV */
+ *(__be64 *)req->giv ^= cpu_to_be64(req->seq);
return ipsec_esp(edesc, areq, req->giv, req->seq,
ipsec_esp_encrypt_done);
@@ -1449,6 +1451,8 @@ static int talitos_probe(struct of_device *ofdev,
priv->ofdev = ofdev;
+ INIT_LIST_HEAD(&priv->alg_list);
+
tasklet_init(&priv->done_task, talitos_done, (unsigned long)dev);
tasklet_init(&priv->error_task, talitos_error, (unsigned long)dev);
@@ -1575,8 +1579,6 @@ static int talitos_probe(struct of_device *ofdev,
}
/* register crypto algorithms the device supports */
- INIT_LIST_HEAD(&priv->alg_list);
-
for (i = 0; i < ARRAY_SIZE(driver_algs); i++) {
if (hw_supports(dev, driver_algs[i].desc_hdr_template)) {
struct talitos_crypto_alg *t_alg;