]> git.ipfire.org Git - thirdparty/linux.git/commit
crypto: hisilicon/sec2 - fix for aead invalid authsize
authorWenkai Lin <linwenkai6@hisilicon.com>
Fri, 13 Dec 2024 09:13:35 +0000 (17:13 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sat, 21 Dec 2024 14:46:24 +0000 (22:46 +0800)
commita5a9d959936499a3106a1bf3b9070875d0d3dec4
tree9febf6759f9e9d6de3f8d2da49a51aa5d20eb5e9
parentfd337f852b2677b53d0859a47b58e6e6bd189f30
crypto: hisilicon/sec2 - fix for aead invalid authsize

When the digest alg is HMAC-SHAx or another, the authsize may be less
than 4 bytes and mac_len of the BD is set to zero, the hardware considers
it a BD configuration error and reports a ras error, so the sec driver
needs to switch to software calculation in this case, this patch add a
check for it and remove unnecessary check that has been done by crypto.

Fixes: 2f072d75d1ab ("crypto: hisilicon - Add aead support on SEC2")
Signed-off-by: Wenkai Lin <linwenkai6@hisilicon.com>
Signed-off-by: Chenghai Huang <huangchenghai2@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/hisilicon/sec2/sec.h
drivers/crypto/hisilicon/sec2/sec_crypto.c