From: Wenkai Lin linwenkai6@hisilicon.com
When a combined algorithm is used, the authsize should not be 0, so add check for it.
Signed-off-by: Wenkai Lin linwenkai6@hisilicon.com --- wd_aead.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/wd_aead.c b/wd_aead.c index 11fee5a6..c6c40374 100644 --- a/wd_aead.c +++ b/wd_aead.c @@ -263,7 +263,7 @@ int wd_aead_set_authsize(handle_t h_sess, __u16 authsize) return -WD_EINVAL; } } else { - if (sess->dalg >= WD_DIGEST_TYPE_MAX || + if (sess->dalg >= WD_DIGEST_TYPE_MAX || !authsize || authsize & (WD_AEAD_CCM_GCM_MAX - 1) || authsize > g_aead_mac_len[sess->dalg]) { WD_ERR("failed to check aead mac authsize, size = %u\n",