Projects
Eulaceura:Mainline:GA
uadk_engine
_service:obs_scm:0007-sm2-add-ctx-allocation-ch...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:0007-sm2-add-ctx-allocation-check.patch of Package uadk_engine
From 75ee064d69f687aa43cff40ce2061db1afe75f85 Mon Sep 17 00:00:00 2001 From: Zhiqi Song <songzhiqi1@huawei.com> Date: Fri, 29 Mar 2024 10:13:25 +0800 Subject: [PATCH 7/7] sm2: add ctx allocation check Add result check of EVP_MD_CTX_new(). Signed-off-by: Zhiqi Song <songzhiqi1@huawei.com> Signed-off-by: JiangShui Yang <yangjiangshui@h-partners.com> --- src/uadk_sm2.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/uadk_sm2.c b/src/uadk_sm2.c index 8421931..c0a5303 100644 --- a/src/uadk_sm2.c +++ b/src/uadk_sm2.c @@ -152,9 +152,13 @@ static int compute_hash(const char *in, size_t in_len, char *out, size_t out_len, void *usr) { const EVP_MD *digest = (const EVP_MD *)usr; - EVP_MD_CTX *hash = EVP_MD_CTX_new(); + EVP_MD_CTX *hash; int ret = 0; + hash = EVP_MD_CTX_new(); + if (!hash) + return -1; + if (EVP_DigestInit(hash, digest) == 0 || EVP_DigestUpdate(hash, in, in_len) == 0 || EVP_DigestFinal(hash, (void *)out, NULL) == 0) { -- 2.25.1
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2