• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2022 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//base/security/device_auth/deviceauth_env.gni")
15
16protocol_path = "${services_path}/protocol"
17key_agree_sdk_path = "${services_path}/key_agree_sdk"
18dev_frameworks_path = "${services_path}/frameworks"
19
20key_agree_inc_path = [
21  "${inner_api_path}",
22  "${common_lib_path}/interfaces",
23  "${dev_frameworks_path}/inc/",
24  "${key_agree_sdk_path}/inc",
25  "${protocol_path}/inc",
26  "${protocol_path}/inc/pake_protocol",
27  "${protocol_path}/inc/pake_protocol/pake_v2_protocol",
28  "${protocol_path}/inc/pake_protocol/pake_protocol_dl_common",
29  "${protocol_path}/inc/pake_protocol/pake_protocol_ec_common",
30]
31
32key_agree_deviceauth_common_files = [
33  "${protocol_path}/src/protocol_common.c",
34  "${protocol_path}/src/pake_protocol/pake_common.c",
35  "${protocol_path}/src/pake_protocol/pake_v2_protocol/pake_v2_protocol_common.c",
36  "${protocol_path}/src/pake_protocol/pake_protocol_dl_common/pake_protocol_dl_common.c",
37  "${protocol_path}/src/pake_protocol/pake_protocol_ec_common/pake_protocol_ec_common.c",
38]
39
40key_agree_sdk_file = [
41  "${key_agree_sdk_path}/src/key_agree_sdk.c",
42  "${key_agree_sdk_path}/src/key_agree_session_manager.c",
43  "${key_agree_sdk_path}/src/key_agree_session.c",
44]
45
46key_agree_hal_common_files = [
47  "${common_lib_path}/impl/src/hc_parcel.c",
48  "${common_lib_path}/impl/src/hc_string.c",
49  "${common_lib_path}/impl/src/hc_string_vector.c",
50  "${common_lib_path}/impl/src/hc_tlv_parser.c",
51  "${common_lib_path}/impl/src/json_utils.c",
52  "${common_lib_path}/impl/src/string_util.c",
53  "${key_management_adapter_path}/impl/src/alg_loader.c",
54
55  "${os_adapter_path}/impl/src/hc_log.c",
56  "${os_adapter_path}/impl/src/hc_mutex.c",
57  "${os_adapter_path}/impl/src/hc_task_thread.c",
58  "${os_adapter_path}/impl/src/hc_time.c",
59]
60
61key_agree_defines = []
62if (enable_key_agree_dl_prime_len_384 == true) {
63  key_agree_defines += [ "P2P_PAKE_DL_PRIME_LEN_384" ]
64}
65if (enable_key_agree_dl_prime_len_256 == true) {
66  key_agree_defines += [ "P2P_PAKE_DL_PRIME_LEN_256" ]
67}
68if (enable_key_agree_pake_ec_prime_p256 == true) {
69  key_agree_defines += [ "P2P_PAKE_EC_PRIME_P256" ]
70}
71if (enable_key_agree_pake_ec_prime_x25519 == true) {
72  key_agree_defines += [ "P2P_PAKE_EC_PRIME_X25519" ]
73}
74
75build_flags = [ "-Werror" ]
76
77if (target_os == "linux") {
78  build_flags += [ "-D__LINUX__" ]
79}
80