提交 78568d28 编写于 作者: H Huaxin Lu

scripts: Fix issue of module signing with openssl 3.x

openEuler inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7BZZ1
CVE: NA

--------------------------------------------------------

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.

Fixes: c1ad2f07 ("sign-file: Support SM signature")
Signed-off-by: NHuaxin Lu <luhuaxin1@huawei.com>
上级 38ded397
......@@ -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.
先完成此消息的编辑!
想要评论请 注册