Skip to content

Commit d555eb6

Browse files
committed
Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto fixes from Herbert Xu: "Fix two regressions in the inside-secure driver with respect to hmac(sha1)" * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: inside-secure - fix the sha state length in hmac_sha1_setkey crypto: inside-secure - fix invalidation check in hmac_sha1_setkey
2 parents 4530cca + 60c4081 commit d555eb6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/crypto/inside-secure/safexcel_hash.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -883,17 +883,17 @@ static int safexcel_hmac_sha1_setkey(struct crypto_ahash *tfm, const u8 *key,
883883
if (ret)
884884
return ret;
885885

886-
memcpy(ctx->ipad, &istate.state, SHA1_DIGEST_SIZE);
887-
memcpy(ctx->opad, &ostate.state, SHA1_DIGEST_SIZE);
888-
889-
for (i = 0; i < ARRAY_SIZE(istate.state); i++) {
886+
for (i = 0; i < SHA1_DIGEST_SIZE / sizeof(u32); i++) {
890887
if (ctx->ipad[i] != le32_to_cpu(istate.state[i]) ||
891888
ctx->opad[i] != le32_to_cpu(ostate.state[i])) {
892889
ctx->base.needs_inv = true;
893890
break;
894891
}
895892
}
896893

894+
memcpy(ctx->ipad, &istate.state, SHA1_DIGEST_SIZE);
895+
memcpy(ctx->opad, &ostate.state, SHA1_DIGEST_SIZE);
896+
897897
return 0;
898898
}
899899

0 commit comments

Comments
 (0)