From 628139bccaff2499d35cb530f54519f0aa744923 Mon Sep 17 00:00:00 2001 From: Longfang Liu Date: Fri, 29 Mar 2024 16:54:41 +0800 Subject: [PATCH 46/52] uadk/v1: improve the judgment conditions of tag Before calling this function, it is guaranteed that the tag is not empty. In addition, some alarm issues in hpre have been modified. Signed-off-by: Longfang Liu Signed-off-by: Qi Tao --- v1/drv/hisi_hpre_udrv.c | 4 ++-- v1/drv/hisi_sec_udrv.c | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/v1/drv/hisi_hpre_udrv.c b/v1/drv/hisi_hpre_udrv.c index de614f2..eaee4b1 100644 --- a/v1/drv/hisi_hpre_udrv.c +++ b/v1/drv/hisi_hpre_udrv.c @@ -212,13 +212,13 @@ static int qm_fill_rsa_pubkey(struct wcrypto_rsa_pubkey *pubkey, void **data) wd_e->bsize, wd_e->dsize, "rsa pubkey e"); if (unlikely(ret)) return ret; - wd_e->dsize = wd_e->dsize; + wd_e->dsize = wd_e->bsize; ret = qm_crypto_bin_to_hpre_bin(wd_n->data, (const char *)wd_n->data, wd_n->bsize, wd_n->dsize, "rsa pubkey n"); if (unlikely(ret)) return ret; - wd_n->dsize = wd_n->dsize; + wd_n->dsize = wd_n->bsize; *data = wd_e->data; return (int)(wd_n->bsize + wd_e->bsize); diff --git a/v1/drv/hisi_sec_udrv.c b/v1/drv/hisi_sec_udrv.c index d046327..c0bd73d 100644 --- a/v1/drv/hisi_sec_udrv.c +++ b/v1/drv/hisi_sec_udrv.c @@ -759,8 +759,7 @@ static int fill_cipher_bd2(struct wd_queue *q, struct hisi_sec_sqe *sqe, return ret; } - if (tag) - sqe->type2.tag = tag->wcrypto_tag.ctx_id; + sqe->type2.tag = tag->wcrypto_tag.ctx_id; return ret; } -- 2.25.1