Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

crypto: ahash - check for shash type instead of not ahash type

Since the previous patch made crypto_shash_type visible to ahash.c,
change checks for '->cra_type != &crypto_ahash_type' to '->cra_type ==
&crypto_shash_type'. This makes more sense and avoids having to
forward-declare crypto_ahash_type. The result is still the same, since
the type is either shash or ahash here.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Eric Biggers and committed by
Herbert Xu
85b84327 ecf889b7

+3 -5
+3 -5
crypto/ahash.c
··· 27 27 28 28 #define CRYPTO_ALG_TYPE_AHASH_MASK 0x0000000e 29 29 30 - static const struct crypto_type crypto_ahash_type; 31 - 32 30 static int shash_async_setkey(struct crypto_ahash *tfm, const u8 *key, 33 31 unsigned int keylen) 34 32 { ··· 509 511 510 512 crypto_ahash_set_statesize(hash, alg->halg.statesize); 511 513 512 - if (tfm->__crt_alg->cra_type != &crypto_ahash_type) 514 + if (tfm->__crt_alg->cra_type == &crypto_shash_type) 513 515 return crypto_init_shash_ops_async(tfm); 514 516 515 517 hash->init = alg->init; ··· 533 535 534 536 static unsigned int crypto_ahash_extsize(struct crypto_alg *alg) 535 537 { 536 - if (alg->cra_type != &crypto_ahash_type) 538 + if (alg->cra_type == &crypto_shash_type) 537 539 return sizeof(struct crypto_shash *); 538 540 539 541 return crypto_alg_extsize(alg); ··· 758 760 { 759 761 struct crypto_alg *alg = &halg->base; 760 762 761 - if (alg->cra_type != &crypto_ahash_type) 763 + if (alg->cra_type == &crypto_shash_type) 762 764 return crypto_shash_alg_has_setkey(__crypto_shash_alg(alg)); 763 765 764 766 return __crypto_ahash_alg(alg)->setkey != NULL;