aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/hmac.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/hmac.c')
-rw-r--r--crypto/hmac.c10
1 files changed, 6 insertions, 4 deletions
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 @@
16 * 16 *
17 */ 17 */
18 18
19#include <crypto/algapi.h> 19#include <crypto/internal/hash.h>
20#include <crypto/scatterwalk.h> 20#include <crypto/scatterwalk.h>
21#include <linux/err.h> 21#include <linux/err.h>
22#include <linux/init.h> 22#include <linux/init.h>
@@ -238,9 +238,11 @@ static struct crypto_instance *hmac_alloc(struct rtattr **tb)
238 return ERR_CAST(alg); 238 return ERR_CAST(alg);
239 239
240 inst = ERR_PTR(-EINVAL); 240 inst = ERR_PTR(-EINVAL);
241 ds = (alg->cra_flags & CRYPTO_ALG_TYPE_MASK) == 241 ds = alg->cra_type == &crypto_hash_type ?
242 CRYPTO_ALG_TYPE_HASH ? alg->cra_hash.digestsize : 242 alg->cra_hash.digestsize :
243 alg->cra_digest.dia_digestsize; 243 alg->cra_type ?
244 __crypto_shash_alg(alg)->digestsize :
245 alg->cra_digest.dia_digestsize;
244 if (ds > alg->cra_blocksize) 246 if (ds > alg->cra_blocksize)
245 goto out_put_alg; 247 goto out_put_alg;
246 248