feat: split dslm_service

Signed-off-by: zhuofan0129 <861080528@qq.com>
This commit is contained in:
zhuofan0129 2023-12-04 21:11:35 +08:00
parent 1b19a72416
commit c6bae4da8a
13 changed files with 75 additions and 42 deletions

56
oem_property/BUILD.gn Normal file
View File

@ -0,0 +1,56 @@
# Copyright (c) 2023 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//build/ohos.gni")
config("device_security_level_ext_config") {
include_dirs = [ "include" ]
}
ohos_source_set("dslm_oem_ext") {
sanitize = {
integer_overflow = true
ubsan = true
boundary_sanitize = true
cfi = true
cfi_cross_dso = true
blocklist = "../cfi_blocklist.txt"
}
branch_protector_ret = "pac_ret"
sources = [ "ohos/standard/dslm_ohos_credential.c" ]
include_dirs = [
"../common/include",
"../interfaces/inner_api/include",
"ohos/standard",
"ohos/common",
"common",
"ohos/standard/impl",
"../baselib/utils/include",
]
deps = [ "ohos/standard:dslm_ohos_cred_obj" ]
configs = [ "../common:common_configs" ]
public_configs = [ ":device_security_level_ext_config" ]
external_deps = [
"c_utils:utils",
"hilog:libhilog",
]
part_name = "device_security_level"
subsystem_name = "security"
}

View File

@ -16,11 +16,15 @@ import("//build/ohos.gni")
# oem_common_obj object
ohos_source_set("oem_common_obj") {
sources = [ "dslm_credential_utils.c" ]
sources = [
"dslm_credential.c",
"dslm_credential_utils.c",
]
include_dirs = [
"../../common/include",
"../../interfaces/inner_api/include",
"../include",
]
deps = [ "../../baselib/utils:utils_static" ]

View File

@ -19,7 +19,7 @@
#include <stdbool.h>
#include <stdint.h>
#include "device_security_defines.h"
typedef struct DeviceIdentify DeviceIdentify;
#define CRED_INFO_VERSION_LEN 32
#define CRED_INFO_TYPE_LEN 32

View File

@ -17,7 +17,7 @@ group("dslm_service") {
if (defined(ohos_lite)) {
deps = [ "../../services/sa:dslm_server" ]
} else {
deps = [ "standard:dslm_service" ]
deps = [ "../../services/sa:dslm_service" ]
}
}

View File

@ -28,6 +28,7 @@ ohos_source_set("dslm_ohos_cred_obj") {
"impl",
"../common",
"../../common",
"../../include",
"../../../common/include",
"../../../interfaces/inner_api/include",
"../../../services/include",

View File

@ -14,42 +14,6 @@
import("//build/ohos.gni")
# sa lib
ohos_shared_library("dslm_service") {
sanitize = {
integer_overflow = true
ubsan = true
boundary_sanitize = true
cfi = true
cfi_cross_dso = true
blocklist = "../../../cfi_blocklist.txt"
}
branch_protector_ret = "pac_ret"
sources = [ "dslm_ohos_credential.c" ]
include_dirs = [
"../common",
"../../../common/include",
"../../../interfaces/inner_api/include",
]
deps = [
":dslm_ohos_cred_obj",
"../../../baselib/utils:utils_static",
"../../../services/sa:service_sa_static",
]
configs = [ "../../../common:common_configs" ]
external_deps = [
"c_utils:utils",
"hilog:libhilog",
]
part_name = "device_security_level"
subsystem_name = "security"
}
ohos_source_set("dslm_ohos_cred_obj") {
sanitize = {
integer_overflow = true
@ -73,6 +37,7 @@ ohos_source_set("dslm_ohos_cred_obj") {
"impl",
"../common",
"../../common",
"../../include",
"../../../common/include",
"../../../interfaces/inner_api/include",
"../../../services/include",

View File

@ -36,6 +36,8 @@ ohos_source_set("dslm_extension_dfx") {
"../../services/include",
"../../interfaces/inner_api/include",
"../../services/dslm",
"../../oem_property/common/",
"../../oem_property/include/",
]
deps = [ "../../baselib/utils:utils_static" ]

View File

@ -16,7 +16,6 @@ import("//build/ohos.gni")
service_dslm_sources = [
"dslm_core_process.c",
"dslm_credential.c",
"dslm_device_list.c",
"dslm_dfx_default.c",
"dslm_fsm_process.c",
@ -28,6 +27,8 @@ service_dslm_sources = [
service_dslm_include_dirs = [
"../include",
"../../common/include",
"../../oem_property/common",
"../../oem_property/include",
"../../interfaces/inner_api/include",
]

View File

@ -26,6 +26,7 @@ if (defined(ohos_lite)) {
"../include",
"../../common/include",
"../../interfaces/inner_api/include",
"../../oem_property/include",
]
deps = [
@ -82,6 +83,7 @@ if (defined(ohos_lite)) {
"../include",
"../../common/include",
"../../interfaces/inner_api/include",
"../../oem_property/include",
"../../oem_property/ohos/lite",
]
@ -135,7 +137,7 @@ if (defined(ohos_lite)) {
}
}
} else {
ohos_static_library("service_sa_static") {
ohos_shared_library("dslm_service") {
sanitize = {
integer_overflow = true
ubsan = true
@ -163,6 +165,7 @@ if (defined(ohos_lite)) {
deps = [
"../../baselib/utils:utils_static",
"../../oem_property:dslm_oem_ext",
"../common:service_common_obj",
"../dfx:dslm_extension_dfx",
"../dslm:service_dslm_obj",

View File

@ -34,7 +34,7 @@ if (os_level == "standard") {
sources = [ "dslm_fuzzer.cpp" ]
deps = [ "../../../oem_property/ohos:dslm_service" ]
deps = [ "../../../services/sa:dslm_service" ]
external_deps = [
"c_utils:utils",

View File

@ -64,6 +64,7 @@ if (os_level == "standard") {
"../../interfaces/inner_api/include",
"../../interfaces/inner_api/src/standard",
"../../oem_property/common",
"../../oem_property/include",
"../../oem_property/ohos/common",
"../../oem_property/ohos/standard/impl",
"../../services/include",