未验证 提交 92adf595 编写于 作者: O openeuler-ci-bot 提交者: Gitee

!1052 [sync] PR-1027: scripts: Fix issue of module signing with openssl 3.x

Merge Pull Request from: @openeuler-sync-bot 
 

Origin pull request: 
https://gitee.com/openeuler/kernel/pulls/1027 
 
The SM2 signature for module signing is only supported
with openEuler openssl 1.1.1. Fix the compile option to
avoid compilation failure with openssl 3.x. 
 
Link:https://gitee.com/openeuler/kernel/pulls/1052 

Reviewed-by: Zhu Jianwei <zhujianwei7@huawei.com> 
Signed-off-by: Zhu Jianwei <zhujianwei7@huawei.com> 
......@@ -206,7 +206,7 @@ static X509 *read_x509(const char *x509_name)
return x509;
}
#if defined(EVP_PKEY_SM2)
#if defined(EVP_PKEY_SM2) && OPENSSL_VERSION_NUMBER < 0x10200000L
static int pkey_is_sm2(EVP_PKEY *pkey)
{
EC_KEY *eckey = NULL;
......@@ -242,7 +242,7 @@ int main(int argc, char **argv)
unsigned int use_signed_attrs;
const EVP_MD *digest_algo;
EVP_PKEY *private_key;
#if defined(EVP_PKEY_SM2)
#if defined(EVP_PKEY_SM2) && OPENSSL_VERSION_NUMBER < 0x10200000L
EVP_PKEY *public_key;
#endif
......@@ -329,7 +329,7 @@ int main(int argc, char **argv)
digest_algo = EVP_get_digestbyname(hash_algo);
ERR(!digest_algo, "EVP_get_digestbyname");
#if defined(EVP_PKEY_SM2)
#if defined(EVP_PKEY_SM2) && OPENSSL_VERSION_NUMBER < 0x10200000L
if (pkey_is_sm2(private_key))
EVP_PKEY_set_alias_type(private_key, EVP_PKEY_SM2);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册