From b8ea760e4a2c49fa9f1a74c59beb2374001481bd Mon Sep 17 00:00:00 2001 From: zhenghui Date: Tue, 23 Jan 2024 16:06:36 +0800 Subject: [PATCH] cfi configure in local_code_signature Signed-off-by: zhenghui --- interfaces/innerkits/local_code_sign/BUILD.gn | 8 +++++++- services/local_code_sign/BUILD.gn | 6 ++++++ test/unittest/BUILD.gn | 6 ++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/interfaces/innerkits/local_code_sign/BUILD.gn b/interfaces/innerkits/local_code_sign/BUILD.gn index 99827d1..5c5a55a 100644 --- a/interfaces/innerkits/local_code_sign/BUILD.gn +++ b/interfaces/innerkits/local_code_sign/BUILD.gn @@ -19,6 +19,12 @@ config("public_local_code_sign_configs") { } ohos_shared_library("liblocal_code_sign_sdk") { + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + } + branch_protector_ret = "pac_ret" sources = [ "src/local_code_sign_client.cpp", "src/local_code_sign_kit.cpp", @@ -34,8 +40,8 @@ ohos_shared_library("liblocal_code_sign_sdk") { external_deps = [ "c_utils:utils", - "hisysevent:libhisysevent", "hilog:libhilog", + "hisysevent:libhisysevent", "ipc:ipc_core", "safwk:system_ability_fwk", "samgr:samgr_proxy", diff --git a/services/local_code_sign/BUILD.gn b/services/local_code_sign/BUILD.gn index 8b3f3b0..5c38c04 100644 --- a/services/local_code_sign/BUILD.gn +++ b/services/local_code_sign/BUILD.gn @@ -16,6 +16,12 @@ import("//build/ohos/sa_profile/sa_profile.gni") import("../../code_signature.gni") ohos_shared_library("liblocal_code_sign") { + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + } + branch_protector_ret = "pac_ret" sources = [ "${code_signature_root_dir}/utils/src/cert_utils.cpp", "src/local_code_sign_service.cpp", diff --git a/test/unittest/BUILD.gn b/test/unittest/BUILD.gn index 82a2287..9acd9b5 100644 --- a/test/unittest/BUILD.gn +++ b/test/unittest/BUILD.gn @@ -64,6 +64,12 @@ ohos_unittest("code_sign_utils_unittest") { } ohos_unittest("local_code_sign_unittest") { + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + } + branch_protector_ret = "pac_ret" module_out_path = "security/code_signature" resource_config_file = "resources/ohos_test.xml" sources = [ "local_code_sign_test.cpp" ]