mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
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: 2f072d75d1 ("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>
This commit is contained in:
@@ -37,6 +37,7 @@ struct sec_aead_req {
|
||||
u8 *a_ivin;
|
||||
dma_addr_t a_ivin_dma;
|
||||
struct aead_request *aead_req;
|
||||
bool fallback;
|
||||
};
|
||||
|
||||
/* SEC request of Crypto */
|
||||
@@ -91,7 +92,6 @@ struct sec_auth_ctx {
|
||||
u8 *a_key;
|
||||
u8 a_key_len;
|
||||
u8 a_alg;
|
||||
bool fallback;
|
||||
struct crypto_shash *hash_tfm;
|
||||
struct crypto_aead *fallback_aead_tfm;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user