uadk_engine/0025-ecc-cleanup-sm2-unreachable-code.patch
Wenkai Lin 2bf32ce015 engine: update uadk engine source
Backport uadk engine patch(24-32) from linaro.

Signed-off-by: Wenkai Lin <linwenkai6@hisilicon.com>
(cherry picked from commit 9a48324e3f545ee8f8485847f3fecf252682eb6a)
2022-03-08 20:00:26 +08:00

29 lines
783 B
Diff

From dcceb7e8f77306dda7dea31798ea8ab952fbe8ea Mon Sep 17 00:00:00 2001
From: Zhiqi Song <songzhiqi1@huawei.com>
Date: Thu, 3 Mar 2022 02:00:46 +0000
Subject: [PATCH 25/31] ecc: cleanup sm2 unreachable code
The variable "b_s" should be judged, rather than "b_r".
Signed-off-by: Zhiqi Song <songzhiqi1@huawei.com>
---
src/uadk_sm2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/uadk_sm2.c b/src/uadk_sm2.c
index b39c418..8c75611 100644
--- a/src/uadk_sm2.c
+++ b/src/uadk_sm2.c
@@ -422,7 +422,7 @@ static int sig_ber_to_bin(EC_KEY *ec, unsigned char *sig, size_t sig_len,
}
b_s = (void *)ECDSA_SIG_get0_s((const ECDSA_SIG *)e_sig);
- if (!b_r) {
+ if (!b_s) {
fprintf(stderr, "failed to get s\n");
ret = -EINVAL;
goto free_der;
--
2.24.4