Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 132695
b: refs/heads/master
c: b170a13
h: refs/heads/master
i:
  132693: 26e5f99
  132691: 3131dea
  132687: d882321
v: v3
  • Loading branch information
Herbert Xu committed Feb 18, 2009
1 parent 4a3dbb2 commit 4e0e424
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3f683d6175748ef9daf4698d9ef5a488dd037063
refs/heads/master: b170a137f467ea951c3f256da1b911545acf3ffd
19 changes: 19 additions & 0 deletions trunk/crypto/ablkcipher.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,25 @@ static struct crypto_alg *crypto_lookup_skcipher(const char *name, u32 type,
alg->cra_ablkcipher.ivsize))
return alg;

crypto_mod_put(alg);
alg = crypto_alg_mod_lookup(name, type | CRYPTO_ALG_TESTED,
mask & ~CRYPTO_ALG_TESTED);
if (IS_ERR(alg))
return alg;

if ((alg->cra_flags & CRYPTO_ALG_TYPE_MASK) ==
CRYPTO_ALG_TYPE_GIVCIPHER) {
if ((alg->cra_flags ^ type ^ ~mask) & CRYPTO_ALG_TESTED) {
crypto_mod_put(alg);
alg = ERR_PTR(-ENOENT);
}
return alg;
}

BUG_ON(!((alg->cra_flags & CRYPTO_ALG_TYPE_MASK) ==
CRYPTO_ALG_TYPE_BLKCIPHER ? alg->cra_blkcipher.ivsize :
alg->cra_ablkcipher.ivsize));

return ERR_PTR(crypto_givcipher_default(alg, type, mask));
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/crypto/blkcipher.c
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ static int crypto_grab_nivcipher(struct crypto_skcipher_spawn *spawn,
int err;

type = crypto_skcipher_type(type);
mask = crypto_skcipher_mask(mask) | CRYPTO_ALG_GENIV;
mask = crypto_skcipher_mask(mask)| CRYPTO_ALG_GENIV;

alg = crypto_alg_mod_lookup(name, type, mask);
if (IS_ERR(alg))
Expand Down

0 comments on commit 4e0e424

Please sign in to comment.