!13 修复-Werror=discarded-qualifiers告警错误

From: @liheavy 
Reviewed-by: @beilingxie 
Signed-off-by: @beilingxie
This commit is contained in:
openeuler-ci-bot 2023-02-09 03:40:23 +00:00 committed by Gitee
commit 40c9ec4865
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 59 additions and 1 deletions

View File

@ -14,7 +14,7 @@
Name: dsoftbus
Version: 1.0.0
Release: 6
Release: 7
Summary: openEuler embedded softbus capability support
License: Apache License 2.0
Url: https://openeuler.gitee.io/yocto-meta-openeuler/features/distributed_softbus.html
@ -37,6 +37,7 @@ Patch0201: security-device-auth-0002-deviceauth-ipc-service.patch
Patch0202: security-device-auth-0003-simplify-dependency-on-third-party-packages.patch
Patch0300: security-huks-0001-support-huks-for-openeuler.patch
Patch0301: security-huks-0002-simplify-dependency-on-third-party-packages.patch
Patch0302: security-huks-0003-fix-discarded-qualifiers-error.patch
Patch0400: commonlibrary-c-utils-0001-Adaptation-for-dsoftbus.patch
Patch0401: libboundscheck-0001-Adaptation-for-dsoftbus.patch
Patch0402: third-party-cjson-0001-adapter-cjson-in-openEuler-for-softbus.patch
@ -119,6 +120,7 @@ mv %{_builddir}/%{source_commonlibrary_c_utils}-%{openHarmony_source_release} ${
%patch202 -p1 -d ${dsoftbus_hichain}/deviceauth
%patch300 -p1 -d ${dsoftbus_hichain}/huks
%patch301 -p1 -d ${dsoftbus_hichain}/huks
%patch302 -p1 -d ${dsoftbus_hichain}/huks
%patch400 -p1 -d ${dsoftbus_utils}/native
%patch401 -p1 -d ${dsoftbus_thirdparty}/bounds_checking_function
%patch402 -p1 -d ${dsoftbus_thirdparty}/cJSON
@ -199,6 +201,9 @@ ${dsoftbus_build_dir}/third_party/bounds_checking_function/include/*.h \
/data/data
%changelog
* Wed Feb 8 2023 liheavy <lihaiwei8@huawei.com> - 1.0.0-7
- fix security huks discarded qualifiers error
* Fri Dec 30 2022 liheavy <lihaiwei8@huawei.com> - 1.0.0-6
- update version of dsoftbus_standard and embedded-ipc

View File

@ -0,0 +1,53 @@
From 05495d8cad3752f5bf357dfd878a1090fd2b191b Mon Sep 17 00:00:00 2001
From: liheavy <lihaiwei8@huawei.com>
Date: Wed, 8 Feb 2023 17:42:40 +0800
Subject: [PATCH] fix discarded-qualifiers-error
diff -Nur a/utils/crypto_adapter/hks_client_service_adapter.c b/utils/crypto_adapter/hks_client_service_adapter.c
--- a/utils/crypto_adapter/hks_client_service_adapter.c 2022-07-28 15:16:34.000000000 +0800
+++ b/utils/crypto_adapter/hks_client_service_adapter.c 2023-02-09 10:28:07.858448659 +0800
@@ -447,7 +447,7 @@
#ifdef HKS_SUPPORT_RSA_C
static int32_t X509PublicKeyToRsa(EVP_PKEY *pkey, struct HksBlob *rsaPublicKey)
{
- RSA *rsa = EVP_PKEY_get0_RSA(pkey);
+ const RSA *rsa = EVP_PKEY_get0_RSA(pkey);
if (rsa == NULL) {
HKS_LOG_E("EVP_PKEY_get1_RSA error %s", ERR_reason_error_string(ERR_get_error()));
return HKS_ERROR_NULL_POINTER;
@@ -488,7 +488,7 @@
#endif
#ifdef HKS_SUPPORT_ECC_C
-static int32_t EcKeyToPublicKey(EC_KEY *ecKey, struct HksBlob *eccPublicKey)
+static int32_t EcKeyToPublicKey(const EC_KEY *ecKey, struct HksBlob *eccPublicKey)
{
BIGNUM *x = BN_new();
BIGNUM *y = BN_new();
@@ -546,7 +546,7 @@
static int32_t X509PublicKeyToEcc(EVP_PKEY *pkey, struct HksBlob *eccPublicKey)
{
- EC_KEY *ecKey = EVP_PKEY_get0_EC_KEY(pkey);
+ const EC_KEY *ecKey = EVP_PKEY_get0_EC_KEY(pkey);
if (ecKey == NULL) {
HKS_LOG_E("EVP_PKEY_get1_EC_KEY error %s", ERR_reason_error_string(ERR_get_error()));
return HKS_ERROR_NULL_POINTER;
@@ -559,7 +559,7 @@
#ifdef HKS_SUPPORT_DSA_C
static int32_t X509PublicKeyToDsa(EVP_PKEY *pkey, struct HksBlob *dsaPublicKey)
{
- DSA *dsa = EVP_PKEY_get0_DSA(pkey);
+ const DSA *dsa = EVP_PKEY_get0_DSA(pkey);
if (dsa == NULL) {
HKS_LOG_E("EVP_PKEY_get1_DSA error %s", ERR_reason_error_string(ERR_get_error()));
return HKS_ERROR_NULL_POINTER;
@@ -615,7 +615,7 @@
#ifdef HKS_SUPPORT_DH_C
static int32_t X509PublicKeyToDh(EVP_PKEY *pkey, struct HksBlob *dhPublicKey)
{
- DH *dh = EVP_PKEY_get0_DH(pkey);
+ const DH *dh = EVP_PKEY_get0_DH(pkey);
if (dh == NULL) {
HKS_LOG_E("EVP_PKEY_get0_DH error %s", ERR_reason_error_string(ERR_get_error()));
return HKS_ERROR_NULL_POINTER;