uadk_engine/0074-ecc-add-check-of-siglen.patch
2023-11-29 16:35:32 +08:00

33 lines
740 B
Diff

From 7c1a870b448ad5bd269ed6cb496ee098a223b0ae Mon Sep 17 00:00:00 2001
From: Zhiqi Song <songzhiqi1@huawei.com>
Date: Sat, 25 Nov 2023 16:13:25 +0800
Subject: [PATCH 74/82] ecc: add check of siglen
Add null pointer check of 'siglen' parameter.
Signed-off-by: Zhiqi Song <songzhiqi1@huawei.com>
---
src/uadk_ec.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/uadk_ec.c b/src/uadk_ec.c
index 400040e..b1dbdfe 100644
--- a/src/uadk_ec.c
+++ b/src/uadk_ec.c
@@ -548,8 +548,11 @@ static int ecdsa_sign(int type, const unsigned char *dgst, int dlen,
goto err;
}
- *siglen = i2d_ECDSA_SIG(s, &sig);
+ if (siglen)
+ *siglen = i2d_ECDSA_SIG(s, &sig);
+
ECDSA_SIG_free(s);
+
return 1;
err:
--
2.25.1