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: talitos - Avoid consecutive packets going out with same IV
  • Loading branch information
torvalds committed Sep 15, 2008
2 parents 2123870 + ba95487 commit bc45eb8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/crypto/talitos.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit bc45eb8

Please sign in to comment.