# Copyright (C) 2022 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("//base/security/device_auth/deviceauth_env.gni") protocol_path = "${services_path}/protocol" key_agree_sdk_path = "${services_path}/key_agree_sdk" dev_frameworks_path = "${services_path}/frameworks" key_agree_inc_path = [ "${inner_api_path}", "${common_lib_path}/interfaces", "${dev_frameworks_path}/inc/", "${key_agree_sdk_path}/inc", "${protocol_path}/inc", "${protocol_path}/inc/pake_protocol", "${protocol_path}/inc/pake_protocol/pake_v2_protocol", "${protocol_path}/inc/pake_protocol/pake_protocol_dl_common", "${protocol_path}/inc/pake_protocol/pake_protocol_ec_common", ] key_agree_deviceauth_common_files = [ "${protocol_path}/src/protocol_common.c", "${protocol_path}/src/pake_protocol/pake_common.c", "${protocol_path}/src/pake_protocol/pake_v2_protocol/pake_v2_protocol_common.c", "${protocol_path}/src/pake_protocol/pake_protocol_dl_common/pake_protocol_dl_common.c", "${protocol_path}/src/pake_protocol/pake_protocol_ec_common/pake_protocol_ec_common.c", ] key_agree_sdk_file = [ "${key_agree_sdk_path}/src/key_agree_sdk.c", "${key_agree_sdk_path}/src/key_agree_session_manager.c", "${key_agree_sdk_path}/src/key_agree_session.c", ] key_agree_hal_common_files = [ "${common_lib_path}/impl/src/hc_parcel.c", "${common_lib_path}/impl/src/hc_string.c", "${common_lib_path}/impl/src/hc_string_vector.c", "${common_lib_path}/impl/src/hc_tlv_parser.c", "${common_lib_path}/impl/src/json_utils.c", "${common_lib_path}/impl/src/string_util.c", "${key_management_adapter_path}/impl/src/alg_loader.c", "${os_adapter_path}/impl/src/hc_log.c", "${os_adapter_path}/impl/src/hc_mutex.c", "${os_adapter_path}/impl/src/hc_task_thread.c", "${os_adapter_path}/impl/src/hc_time.c", ] key_agree_defines = [] if (enable_key_agree_dl_prime_len_384 == true) { key_agree_defines += [ "P2P_PAKE_DL_PRIME_LEN_384" ] } if (enable_key_agree_dl_prime_len_256 == true) { key_agree_defines += [ "P2P_PAKE_DL_PRIME_LEN_256" ] } if (enable_key_agree_pake_ec_prime_p256 == true) { key_agree_defines += [ "P2P_PAKE_EC_PRIME_P256" ] } if (enable_key_agree_pake_ec_prime_x25519 == true) { key_agree_defines += [ "P2P_PAKE_EC_PRIME_X25519" ] } build_flags = [ "-Werror" ] if (target_os == "linux") { build_flags += [ "-D__LINUX__" ] }