X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=crypto%2Fhmac.c;h=0ad39c3749639e227bef876664ce3ff7ed147c2c;hb=74a6d0f064cd9106599ce3f1d924309669e83582;hp=7ff2d6a8c7d0b5c58b753140cd579e332e385819;hpb=ff5d48a6d18d09bb750d1f89f6464f5fdb6fc85b;p=firefly-linux-kernel-4.4.55.git diff --git a/crypto/hmac.c b/crypto/hmac.c index 7ff2d6a8c7d0..0ad39c374963 100644 --- a/crypto/hmac.c +++ b/crypto/hmac.c @@ -16,7 +16,7 @@ * */ -#include +#include #include #include #include @@ -238,9 +238,11 @@ static struct crypto_instance *hmac_alloc(struct rtattr **tb) return ERR_CAST(alg); inst = ERR_PTR(-EINVAL); - ds = (alg->cra_flags & CRYPTO_ALG_TYPE_MASK) == - CRYPTO_ALG_TYPE_HASH ? alg->cra_hash.digestsize : - alg->cra_digest.dia_digestsize; + ds = alg->cra_type == &crypto_hash_type ? + alg->cra_hash.digestsize : + alg->cra_type ? + __crypto_shash_alg(alg)->digestsize : + alg->cra_digest.dia_digestsize; if (ds > alg->cra_blocksize) goto out_put_alg;