uadk_engine: delete digest duplicate code
digest task not need to alloc session twice. Signed-off-by: Wenkai Lin <linwenkai6@hisilicon.com> (cherry picked from commit b8671c2b8e0cb45265d72feaec8e67572c5a11c0)
This commit is contained in:
parent
7a7bd9df96
commit
7284652795
55
0001-digest-delete-some-duplicate-code.patch
Normal file
55
0001-digest-delete-some-duplicate-code.patch
Normal file
@ -0,0 +1,55 @@
|
||||
From eba09f6a2eb20bf431822718fa752a68b6d682c5 Mon Sep 17 00:00:00 2001
|
||||
From: Kai Ye <yekai13@huawei.com>
|
||||
Date: Thu, 9 Dec 2021 11:17:40 +0800
|
||||
Subject: [PATCH] digest: delete some duplicate code
|
||||
|
||||
digest task not need to allocate session twice for one stream.
|
||||
init->update->final as one stream.
|
||||
|
||||
Signed-off-by: Kai Ye <yekai13@huawei.com>
|
||||
---
|
||||
src/uadk_digest.c | 14 +++++---------
|
||||
1 file changed, 5 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/src/uadk_digest.c b/src/uadk_digest.c
|
||||
index 9fdec91..db33d16 100644
|
||||
--- a/src/uadk_digest.c
|
||||
+++ b/src/uadk_digest.c
|
||||
@@ -607,10 +607,6 @@ static int uadk_e_digest_final(EVP_MD_CTX *ctx, unsigned char *digest)
|
||||
int ret = 1;
|
||||
struct async_op op;
|
||||
|
||||
- priv->sess = wd_digest_alloc_sess(&priv->setup);
|
||||
- if (unlikely(!priv->sess))
|
||||
- return 0;
|
||||
-
|
||||
priv->req.in = priv->data;
|
||||
priv->req.out = digest;
|
||||
priv->req.in_bytes = priv->tail;
|
||||
@@ -639,11 +635,6 @@ static int uadk_e_digest_final(EVP_MD_CTX *ctx, unsigned char *digest)
|
||||
goto clear;
|
||||
}
|
||||
|
||||
- if (priv->sess) {
|
||||
- wd_digest_free_sess(priv->sess);
|
||||
- priv->sess = 0;
|
||||
- }
|
||||
-
|
||||
return 1;
|
||||
|
||||
sync_err:
|
||||
@@ -665,6 +656,11 @@ static int uadk_e_digest_cleanup(EVP_MD_CTX *ctx)
|
||||
if (!priv || priv->copy)
|
||||
return 1;
|
||||
|
||||
+ if (priv->sess) {
|
||||
+ wd_digest_free_sess(priv->sess);
|
||||
+ priv->sess = 0;
|
||||
+ }
|
||||
+
|
||||
if (priv && priv->data)
|
||||
OPENSSL_free(priv->data);
|
||||
|
||||
--
|
||||
2.24.4
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
Name: uadk_engine
|
||||
Summary: UADK Accelerator Engine
|
||||
Version: 1.0.0
|
||||
Release: 1
|
||||
Release: 2
|
||||
License: Apache-2.0
|
||||
Source: %{name}-%{version}.tar.gz
|
||||
ExclusiveOS: linux
|
||||
@ -16,6 +16,8 @@ BuildRequires: openssl-devel sed autoconf automake libtool
|
||||
Requires: openssl
|
||||
ExclusiveArch: aarch64
|
||||
|
||||
Patch0001: 0001-digest-delete-some-duplicate-code.patch
|
||||
|
||||
%description
|
||||
This package contains the UADK Accelerator Engine
|
||||
|
||||
@ -64,5 +66,8 @@ fi
|
||||
/sbin/ldconfig
|
||||
|
||||
%changelog
|
||||
* Fri Dec 10 2021 linwenkai <linwenkai6@hisilicon.com> 1.0.0-2
|
||||
- Delete digest duplicate code
|
||||
|
||||
* Fri Dec 10 2021 linwenkai <linwenkai6@hisilicon.com> 1.0.0-1
|
||||
- First Spec Version Include uadk_engine Code
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user