!969 add customized huks adapter control

Merge pull request !969 from 何寅燊/master
This commit is contained in:
openharmony_ci
2025-03-02 09:39:12 +00:00
committed by Gitee
4 changed files with 27 additions and 10 deletions
+20 -8
View File
@@ -1,4 +1,4 @@
# Copyright (C) 2021-2023 Huawei Device Co., Ltd.
# Copyright (C) 2021-2025 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
@@ -29,15 +29,14 @@ if (defined(ohos_lite)) {
"//base/hiviewdfx/hilog_lite/interfaces/native/kits/hilog_lite",
"//commonlibrary/utils_lite/memory/include",
"//base/startup/init/interfaces/innerkits/include/syspara",
"//third_party/mbedtls/include",
]
if (device_auth_use_customized_key_adapter == false) {
include_dirs += [ "//third_party/mbedtls/include" ]
}
sources = hal_common_files
sources += [
"${key_management_adapter_path}/impl/src/common/mbedtls_ec_adapter.c",
"${key_management_adapter_path}/impl/src/huks_adapter.c",
"${key_management_adapter_path}/impl/src/huks_adapter_utils.c",
"${key_management_adapter_path}/impl/src/mini/huks_adapter_diff_impl.c",
"${os_adapter_path}/impl/src/liteos/hc_condition.c",
"${os_adapter_path}/impl/src/liteos/hc_dev_info.c",
"${os_adapter_path}/impl/src/liteos/hc_thread.c",
@@ -45,6 +44,15 @@ if (defined(ohos_lite)) {
"${os_adapter_path}/impl/src/liteos/mini/hc_init_protection.c",
]
if (device_auth_use_customized_key_adapter == false) {
sources += [
"${key_management_adapter_path}/impl/src/common/mbedtls_ec_adapter.c",
"${key_management_adapter_path}/impl/src/huks_adapter.c",
"${key_management_adapter_path}/impl/src/huks_adapter_utils.c",
"${key_management_adapter_path}/impl/src/mini/huks_adapter_diff_impl.c",
]
}
if (device_auth_enable_posix_interface) {
sources += [ "${os_adapter_path}/impl/src/liteos/mini/hc_file_posix.c" ]
} else {
@@ -64,12 +72,16 @@ if (defined(ohos_lite)) {
cflags += build_flags
}
deps = [
"//base/security/huks/interfaces/inner_api/huks_lite:huks_3.0_sdk",
"//base/startup/init/interfaces/innerkits:libbegetutil",
"//build/lite/config/component/cJSON:cjson_shared",
"//commonlibrary/utils_lite:utils",
"//third_party/mbedtls:mbedtls_shared",
]
if (device_auth_use_customized_key_adapter == false) {
deps += [
"//base/security/huks/interfaces/inner_api/huks_lite:huks_3.0_sdk",
"//third_party/mbedtls:mbedtls_shared",
]
}
}
} else {
static_library("deviceauth_hal_linux") {
+5 -1
View File
@@ -1,4 +1,4 @@
# Copyright (C) 2021 Huawei Device Co., Ltd.
# Copyright (C) 2021-2025 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
@@ -26,6 +26,10 @@ if (target_os == "liteos" ||
"${os_adapter_path}/interfaces",
"${os_adapter_path}/interfaces/liteos",
]
if (defined(ohos_lite) && ohos_kernel_type == "liteos_m" &&
device_auth_use_customized_key_adapter == true) {
hals_inc_path -= [ "${key_management_adapter_path}/impl/inc" ]
}
hal_module_name = "deviceauth_hal_liteos"
} else {
hals_inc_path = [
+2 -1
View File
@@ -1,4 +1,4 @@
# Copyright (C) 2021-2022 Huawei Device Co., Ltd.
# Copyright (C) 2021-2025 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
@@ -25,6 +25,7 @@ services_path = "${deviceauth_path}/services"
declare_args() {
deviceauth_feature_config = "//base/security/device_auth/default_config"
device_auth_enable_soft_bus_channel = true
device_auth_use_customized_key_adapter = false
}
build_flags = [