Skip to content

Commit

Permalink
[CRYPTO] api: Fixed incorrect passing of context instead of tfm
Browse files Browse the repository at this point in the history
Fix a few omissions in passing TFM instead of CTX to algorithms.

Signed-off-by: Michal Ludvig <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
Michal Ludvig authored and herbertx committed Jun 26, 2006
1 parent 82062c7 commit 110bf1c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions crypto/compress.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ int crypto_init_compress_ops(struct crypto_tfm *tfm)
int ret = 0;
struct compress_tfm *ops = &tfm->crt_compress;

ret = tfm->__crt_alg->cra_compress.coa_init(crypto_tfm_ctx(tfm));
ret = tfm->__crt_alg->cra_compress.coa_init(tfm);
if (ret)
goto out;

Expand All @@ -57,5 +57,5 @@ int crypto_init_compress_ops(struct crypto_tfm *tfm)

void crypto_exit_compress_ops(struct crypto_tfm *tfm)
{
tfm->__crt_alg->cra_compress.coa_exit(crypto_tfm_ctx(tfm));
tfm->__crt_alg->cra_compress.coa_exit(tfm);
}
4 changes: 2 additions & 2 deletions crypto/digest.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ static void final(struct crypto_tfm *tfm, u8 *out)
unsigned int size = crypto_tfm_alg_digestsize(tfm);
u8 buffer[size + alignmask];
u8 *dst = (u8 *)ALIGN((unsigned long)buffer, alignmask + 1);
tfm->__crt_alg->cra_digest.dia_final(crypto_tfm_ctx(tfm), dst);
tfm->__crt_alg->cra_digest.dia_final(tfm, dst);
memcpy(out, dst, size);
} else
tfm->__crt_alg->cra_digest.dia_final(crypto_tfm_ctx(tfm), out);
tfm->__crt_alg->cra_digest.dia_final(tfm, out);
}

static int setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen)
Expand Down

0 comments on commit 110bf1c

Please sign in to comment.