diff options
author | Alex Shi <alex.shi@linaro.org> | 2018-01-18 15:26:28 +0800 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2018-01-18 15:26:28 +0800 |
commit | 2ba51c6d36ee1b43c1f898c6c48ddf3d33e9ab30 (patch) | |
tree | ff3302dc45a91d7bfcaabd37bfa8fa391a954180 /crypto/hmac.c | |
parent | 28610abf4a574c33ca70e3d7b0e523fdede488d1 (diff) | |
parent | 90816cc1d4a1d23efe37b74866c6174dd5eab6b5 (diff) |
Merge remote-tracking branch 'rt-stable/v4.9-rt' into linux-linaro-lsk-v4.9-rtlsk-v4.9-18.02-rt
Conflicts:
arch/arm64/mm/init.c
Diffstat (limited to 'crypto/hmac.c')
-rw-r--r-- | crypto/hmac.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/crypto/hmac.c b/crypto/hmac.c index 72e38c098bb3..ba07fb6221ae 100644 --- a/crypto/hmac.c +++ b/crypto/hmac.c @@ -194,11 +194,15 @@ static int hmac_create(struct crypto_template *tmpl, struct rtattr **tb) salg = shash_attr_alg(tb[1], 0, 0); if (IS_ERR(salg)) return PTR_ERR(salg); + alg = &salg->base; + /* The underlying hash algorithm must be unkeyed */ err = -EINVAL; + if (crypto_shash_alg_has_setkey(salg)) + goto out_put_alg; + ds = salg->digestsize; ss = salg->statesize; - alg = &salg->base; if (ds > alg->cra_blocksize || ss < alg->cra_blocksize) goto out_put_alg; |