1# Copyright (C) 2021-2023 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/deps_adapter/deviceauth_hals.gni") 15import("//base/security/device_auth/services/deviceauth.gni") 16import("//base/security/device_auth/services/key_agree_sdk/key_agree_sdk.gni") 17import("//build/test.gni") 18 19module_output_path = "device_auth/deviceauth_test" 20 21ohos_unittest("deviceauth_llt") { 22 module_out_path = module_output_path 23 24 include_dirs = inc_path 25 include_dirs += hals_inc_path 26 27 include_dirs += [ 28 "./include", 29 "./unit_test/include", 30 "${dev_frameworks_path}/inc/permission_adapter", 31 "${dev_frameworks_path}/inc/hiview_adapter", 32 ] 33 34 include_dirs += [] 35 36 sources = hal_common_files 37 sources -= [ "${common_lib_path}/impl/src/json_utils.c" ] 38 sources += [ 39 "${key_management_adapter_path}/impl/src/common/mbedtls_ec_adapter.c", 40 "${key_management_adapter_path}/impl/src/huks_adapter.c", 41 "${key_management_adapter_path}/impl/src/huks_adapter_utils.c", 42 "${key_management_adapter_path}/impl/src/standard/crypto_hash_to_point.c", 43 "${key_management_adapter_path}/impl/src/standard/huks_adapter_diff_impl.c", 44 "${os_adapter_path}/impl/src/hc_log.c", 45 "${os_adapter_path}/impl/src/linux/hc_condition.c", 46 "${os_adapter_path}/impl/src/linux/hc_file.c", 47 "${os_adapter_path}/impl/src/linux/hc_init_protection.c", 48 "${os_adapter_path}/impl/src/linux/hc_thread.c", 49 "${os_adapter_path}/impl/src/linux/hc_types.c", 50 "source/hc_dev_info_mock.c", 51 "source/json_utils_mock.c", 52 ] 53 54 sources += dev_frameworks_files 55 sources += identity_service_mock_files 56 sources += deviceauth_common_files 57 sources += group_database_manager_files 58 sources += ext_plugin_manager_files 59 sources += session_manager_files 60 sources += session_v1_files 61 sources += session_v2_mock_files 62 sources += creds_manager_files 63 sources += broadcast_manager_files 64 sources += soft_bus_channel_mock_files 65 66 sources += group_auth_files 67 sources += group_auth_account_unrelated_files 68 69 sources += group_manager_files 70 sources += group_manager_peer_to_peer_files 71 72 sources += authenticators_p2p_files 73 sources += authenticators_p2p_iso_files 74 sources += authenticators_p2p_pake_files 75 sources += authenticators_standard_exchange_task_files 76 77 sources += account_related_files 78 79 sources += privacy_enhancement_files 80 sources += mk_agree_files 81 82 sources += security_label_adapter_files 83 84 include_dirs += identity_manager_inc 85 sources += identity_manager_files 86 87 sources -= [ 88 "${authenticators_path}/src/account_unrelated/iso_task/iso_task_main.c", 89 "${authenticators_path}/src/account_unrelated/pake_task/pake_v1_task/pake_v1_task_main.c", 90 "${deviceauth_account_group_auth_path}/src/group_auth_manager/account_related_group_auth/account_related_group_auth.c", 91 "${identity_manager_path}/src/identity_cred.c", 92 ] 93 94 sources += [ 95 "${dev_frameworks_path}/src/account_task_manager_mock/account_task_manager_mock.c", 96 "${dev_frameworks_path}/src/plugin_adapter_mock/account_auth_plugin_proxy_mock.c", 97 "source/creds_manager_test.cpp", 98 "source/device_auth_ext_mock.c", 99 "source/deviceauth_standard_auth_test.cpp", 100 "source/deviceauth_standard_member_test.cpp", 101 "source/deviceauth_standard_test.cpp", 102 "source/group_operation_common_test.cpp", 103 "source/identity_manager_test.cpp", 104 "source/iso_auth_task_test.cpp", 105 "source/mk_agree_test.cpp", 106 "source/os_account_adapter_mock.c", 107 "source/privacy_enhancement_test.cpp", 108 "source/protocol_task_main_mock.c", 109 "source/standard_exchange_task_test.cpp", 110 "unit_test/source/account_related_group_auth_dir_test.cpp", 111 "unit_test/source/pake_v2_auth_task_test.cpp", 112 ] 113 defines = [ 114 "P2P_PAKE_DL_PRIME_LEN_384", 115 "P2P_PAKE_EC_TYPE", 116 "ENABLE_ACCOUNT_AUTH_ISO", 117 "ENABLE_ACCOUNT_AUTH_EC_SPEKE", 118 "ENABLE_P2P_BIND_ISO", 119 "ENABLE_P2P_BIND_EC_SPEKE", 120 "ENABLE_P2P_AUTH_ISO", 121 "ENABLE_P2P_AUTH_EC_SPEKE", 122 "DEV_AUTH_FUNC_TEST", 123 "ENABLE_PSEUDONYM", 124 "DEFAULT_V2_NOT_SUPPORT", 125 ] 126 127 cflags = [ "-DHILOG_ENABLE" ] 128 cflags += [ 129 "-DDEV_AUTH_WORK_THREAD_STACK_SIZE=${device_auth_hichain_thread_stack_size}", 130 "-DMAX_AUTH_SESSION_COUNT=${max_auth_session_count}", 131 ] 132 133 deps = [] 134 135 external_deps = [ 136 "cJSON:cjson", 137 "c_utils:utils", 138 "googletest:gmock_main", 139 "googletest:gtest_main", 140 "hilog:libhilog", 141 "huks:libhukssdk", 142 "mbedtls:mbedtls_shared", 143 "openssl:libcrypto_static", 144 ] 145} 146 147ohos_unittest("device_auth_func_test") { 148 module_out_path = module_output_path 149 150 include_dirs = inc_path 151 include_dirs += hals_inc_path 152 153 include_dirs += [ 154 "./include", 155 "./unit_test/include", 156 "${dev_frameworks_path}/inc/permission_adapter", 157 "${dev_frameworks_path}/inc/hiview_adapter", 158 ] 159 160 sources = hal_common_files 161 sources -= [ "${common_lib_path}/impl/src/json_utils.c" ] 162 sources += [ 163 "${key_management_adapter_path}/impl/src/common/mbedtls_ec_adapter.c", 164 "${key_management_adapter_path}/impl/src/huks_adapter.c", 165 "${key_management_adapter_path}/impl/src/huks_adapter_utils.c", 166 "${key_management_adapter_path}/impl/src/standard/crypto_hash_to_point.c", 167 "${key_management_adapter_path}/impl/src/standard/huks_adapter_diff_impl.c", 168 "${os_adapter_path}/impl/src/hc_log.c", 169 "${os_adapter_path}/impl/src/linux/hc_condition.c", 170 "${os_adapter_path}/impl/src/linux/hc_file.c", 171 "${os_adapter_path}/impl/src/linux/hc_init_protection.c", 172 "${os_adapter_path}/impl/src/linux/hc_thread.c", 173 "${os_adapter_path}/impl/src/linux/hc_types.c", 174 "source/hc_dev_info_mock.c", 175 "source/json_utils_mock.c", 176 ] 177 178 sources += dev_frameworks_files 179 sources += identity_service_mock_files 180 sources += deviceauth_common_files 181 sources += group_database_manager_files 182 sources += ext_plugin_manager_files 183 sources += session_manager_files 184 sources += session_v1_files 185 sources += session_v2_files 186 sources += iso_protocol_files 187 sources += ec_speke_protocol_files 188 sources += auth_code_import_files 189 sources += pub_key_exchange_files 190 sources += save_trusted_info_files 191 sources += creds_manager_files 192 sources += broadcast_manager_files 193 sources += soft_bus_channel_mock_files 194 195 sources += group_auth_files 196 sources += group_auth_account_unrelated_files 197 198 sources += group_manager_files 199 sources += group_manager_peer_to_peer_files 200 201 sources += authenticators_p2p_files 202 sources += authenticators_p2p_iso_files 203 sources += authenticators_p2p_pake_files 204 sources += authenticators_standard_exchange_task_files 205 206 sources += account_related_files 207 208 sources += privacy_enhancement_files 209 sources += mk_agree_files 210 211 sources += security_label_adapter_files 212 213 sources += hiview_adapter_files 214 215 sources -= [ 216 "${authenticators_path}/src/account_unrelated/iso_task/iso_task_main.c", 217 "${authenticators_path}/src/account_unrelated/pake_task/pake_v1_task/pake_v1_task_main.c", 218 ] 219 220 sources += [ 221 "${dev_frameworks_path}/src/account_task_manager_mock/account_task_manager_mock.c", 222 "${dev_frameworks_path}/src/plugin_adapter_mock/account_auth_plugin_proxy_mock.c", 223 "source/creds_manager_test.cpp", 224 "source/device_auth_ext_mock.c", 225 "source/deviceauth_standard_auth_test.cpp", 226 "source/deviceauth_standard_member_test.cpp", 227 "source/deviceauth_standard_test.cpp", 228 "source/group_operation_common_test.cpp", 229 "source/iso_auth_task_test.cpp", 230 "source/os_account_adapter_mock.c", 231 "source/protocol_task_main_mock.c", 232 "source/standard_exchange_task_test.cpp", 233 ] 234 defines = [ 235 "P2P_PAKE_DL_PRIME_LEN_384", 236 "P2P_PAKE_EC_TYPE", 237 "ENABLE_EC_SPEKE", 238 "ENABLE_ISO", 239 "ENABLE_AUTH_CODE_IMPORT", 240 "ENABLE_PUB_KEY_EXCHANGE", 241 "ENABLE_SAVE_TRUSTED_INFO", 242 "ENABLE_ACCOUNT_AUTH_ISO", 243 "ENABLE_ACCOUNT_AUTH_EC_SPEKE", 244 "ENABLE_P2P_BIND_ISO", 245 "ENABLE_P2P_BIND_EC_SPEKE", 246 "ENABLE_P2P_AUTH_ISO", 247 "ENABLE_P2P_AUTH_EC_SPEKE", 248 "DEV_AUTH_FUNC_TEST", 249 "ENABLE_PSEUDONYM", 250 "DEV_AUTH_HIVIEW_ENABLE", 251 ] 252 253 sources += identity_manager_files 254 include_dirs += identity_manager_inc 255 sources += [ "source/deviceauth_func_test.cpp" ] 256 257 cflags = [ "-DHILOG_ENABLE" ] 258 cflags += [ 259 "-DDEV_AUTH_WORK_THREAD_STACK_SIZE=${device_auth_hichain_thread_stack_size}", 260 "-DMAX_AUTH_SESSION_COUNT=${max_auth_session_count}", 261 ] 262 263 deps = [] 264 265 external_deps = [ 266 "cJSON:cjson", 267 "c_utils:utils", 268 "googletest:gmock_main", 269 "googletest:gtest_main", 270 "hilog:libhilog", 271 "hisysevent:libhisysevent", 272 "hitrace:hitrace_meter", 273 "huks:libhukssdk", 274 "mbedtls:mbedtls_shared", 275 "openssl:libcrypto_static", 276 ] 277} 278 279ohos_unittest("device_auth_identity_service_test") { 280 module_out_path = module_output_path 281 282 include_dirs = inc_path 283 include_dirs += hals_inc_path 284 285 include_dirs += [ 286 "./include", 287 "./unit_test/include", 288 "${dev_frameworks_path}/inc/permission_adapter", 289 "${dev_frameworks_path}/inc/hiview_adapter", 290 ] 291 292 sources = hal_common_files 293 sources -= [ "${common_lib_path}/impl/src/json_utils.c" ] 294 sources += [ 295 "${key_management_adapter_path}/impl/src/common/mbedtls_ec_adapter.c", 296 "${key_management_adapter_path}/impl/src/huks_adapter.c", 297 "${key_management_adapter_path}/impl/src/huks_adapter_utils.c", 298 "${key_management_adapter_path}/impl/src/standard/crypto_hash_to_point.c", 299 "${key_management_adapter_path}/impl/src/standard/huks_adapter_diff_impl.c", 300 "${os_adapter_path}/impl/src/hc_log.c", 301 "${os_adapter_path}/impl/src/linux/hc_condition.c", 302 "${os_adapter_path}/impl/src/linux/hc_file.c", 303 "${os_adapter_path}/impl/src/linux/hc_init_protection.c", 304 "${os_adapter_path}/impl/src/linux/hc_thread.c", 305 "${os_adapter_path}/impl/src/linux/hc_types.c", 306 "source/hc_dev_info_mock.c", 307 "source/json_utils_mock.c", 308 ] 309 310 sources += dev_frameworks_files 311 sources += deviceauth_common_files 312 sources += group_database_manager_files 313 sources += ext_plugin_manager_files 314 sources += session_manager_files 315 sources += identity_service_files 316 sources += session_v1_files 317 sources += session_v2_files 318 sources += iso_protocol_files 319 sources += ec_speke_protocol_files 320 sources += auth_code_import_files 321 sources += pub_key_exchange_files 322 sources += save_trusted_info_files 323 sources += creds_manager_files 324 sources += broadcast_manager_files 325 sources += soft_bus_channel_mock_files 326 sources += permission_adapter_files 327 328 sources += group_auth_files 329 sources += group_auth_account_unrelated_files 330 331 sources += group_manager_files 332 sources += group_manager_peer_to_peer_files 333 334 sources += authenticators_p2p_files 335 sources += authenticators_p2p_iso_files 336 sources += authenticators_p2p_pake_files 337 sources += authenticators_standard_exchange_task_files 338 339 sources += account_related_files 340 341 sources += privacy_enhancement_files 342 sources += mk_agree_files 343 344 sources += security_label_adapter_files 345 346 sources += hiview_adapter_files 347 348 sources -= [ 349 "${authenticators_path}/src/account_unrelated/iso_task/iso_task_main.c", 350 "${authenticators_path}/src/account_unrelated/pake_task/pake_v1_task/pake_v1_task_main.c", 351 "${identity_service_path}/session/src/cred_session_util.c", 352 "${identity_service_path}/src/identity_operation.c", 353 ] 354 355 sources += [ 356 "${dev_frameworks_path}/src/account_task_manager_mock/account_task_manager_mock.c", 357 "${dev_frameworks_path}/src/plugin_adapter_mock/account_auth_plugin_proxy_mock.c", 358 "source/device_auth_ext_mock.c", 359 "source/deviceauth_identity_service_test.cpp", 360 "source/os_account_adapter_mock.c", 361 "source/protocol_task_main_mock.c", 362 ] 363 364 defines = [ 365 "P2P_PAKE_DL_PRIME_LEN_384", 366 "P2P_PAKE_EC_TYPE", 367 "ENABLE_EC_SPEKE", 368 "ENABLE_ISO", 369 "ENABLE_AUTH_CODE_IMPORT", 370 "ENABLE_PUB_KEY_EXCHANGE", 371 "ENABLE_SAVE_TRUSTED_INFO", 372 "ENABLE_ACCOUNT_AUTH_ISO", 373 "ENABLE_ACCOUNT_AUTH_EC_SPEKE", 374 "ENABLE_P2P_BIND_ISO", 375 "ENABLE_P2P_BIND_EC_SPEKE", 376 "ENABLE_P2P_AUTH_ISO", 377 "ENABLE_P2P_AUTH_EC_SPEKE", 378 "DEV_AUTH_FUNC_TEST", 379 "ENABLE_PSEUDONYM", 380 "DEV_AUTH_HIVIEW_ENABLE", 381 "DEV_AUTH_IS_ENABLE", 382 "DEV_AUTH_PERMISSION_ENABLE", 383 ] 384 385 sources += identity_manager_files 386 include_dirs += identity_manager_inc 387 388 cflags = [ "-DHILOG_ENABLE" ] 389 cflags += [ 390 "-DDEV_AUTH_WORK_THREAD_STACK_SIZE=${device_auth_hichain_thread_stack_size}", 391 "-DMAX_AUTH_SESSION_COUNT=${max_auth_session_count}", 392 ] 393 394 deps = [] 395 396 external_deps = [ 397 "access_token:libaccesstoken_sdk", 398 "cJSON:cjson", 399 "c_utils:utils", 400 "googletest:gmock_main", 401 "googletest:gtest_main", 402 "hilog:libhilog", 403 "hisysevent:libhisysevent", 404 "hitrace:hitrace_meter", 405 "huks:libhukssdk", 406 "ipc:ipc_single", 407 "mbedtls:mbedtls_shared", 408 "openssl:libcrypto_static", 409 ] 410} 411 412ohos_unittest("device_auth_interface_test") { 413 module_out_path = module_output_path 414 415 include_dirs = inc_path 416 include_dirs += hals_inc_path 417 418 include_dirs += [ 419 "./include", 420 "./unit_test/include", 421 "${dev_frameworks_path}/inc/hiview_adapter", 422 "${frameworks_path}/inc/standard", 423 "${dev_frameworks_path}/inc/permission_adapter", 424 ] 425 426 sources = hal_common_files 427 sources -= [ "${common_lib_path}/impl/src/json_utils.c" ] 428 sources += [ 429 "${key_management_adapter_path}/impl/src/common/mbedtls_ec_adapter.c", 430 "${key_management_adapter_path}/impl/src/huks_adapter.c", 431 "${key_management_adapter_path}/impl/src/huks_adapter_utils.c", 432 "${key_management_adapter_path}/impl/src/standard/crypto_hash_to_point.c", 433 "${key_management_adapter_path}/impl/src/standard/huks_adapter_diff_impl.c", 434 "${os_adapter_path}/impl/src/hc_log.c", 435 "${os_adapter_path}/impl/src/linux/hc_condition.c", 436 "${os_adapter_path}/impl/src/linux/hc_file.c", 437 "${os_adapter_path}/impl/src/linux/hc_init_protection.c", 438 "${os_adapter_path}/impl/src/linux/hc_thread.c", 439 "${os_adapter_path}/impl/src/linux/hc_types.c", 440 "source/hc_dev_info_mock.c", 441 "source/json_utils_mock.c", 442 ] 443 444 sources += dev_frameworks_files 445 sources += identity_service_mock_files 446 sources += deviceauth_common_files 447 sources += group_database_manager_files 448 sources += ext_plugin_manager_files 449 sources += session_manager_files 450 sources += session_v1_files 451 sources += session_v2_files 452 sources += iso_protocol_files 453 sources += ec_speke_protocol_files 454 sources += auth_code_import_files 455 sources += pub_key_exchange_files 456 sources += save_trusted_info_files 457 sources += creds_manager_files 458 sources += broadcast_manager_files 459 sources += soft_bus_channel_files 460 sources += deviceauth_ipc_files 461 sources += permission_adapter_files 462 463 sources += group_auth_files 464 sources += group_auth_account_unrelated_files 465 466 sources += group_manager_files 467 sources += group_manager_peer_to_peer_files 468 469 sources += authenticators_p2p_files 470 sources += authenticators_p2p_iso_files 471 sources += authenticators_p2p_pake_files 472 sources += authenticators_standard_exchange_task_files 473 474 sources += account_related_files 475 476 sources += privacy_enhancement_files 477 sources += mk_agree_files 478 479 sources += security_label_adapter_files 480 481 sources += hiview_adapter_files 482 483 sources += [ 484 "${dev_frameworks_path}/src/account_task_manager/account_task_manager.c", 485 "${dev_frameworks_path}/src/plugin_adapter/ext_part/account_auth_plugin/account_auth_plugin_proxy.c", 486 "source/device_auth_ext_mock.c", 487 "source/os_account_adapter_mock.c", 488 ] 489 sources -= [ 490 "${authenticators_path}/src/account_unrelated/pake_task/pake_v1_task/pake_v1_protocol_task/pake_v1_protocol_task_common.c", 491 "${deviceauth_account_group_manager_path}/src/group_operation/identical_account_group/identical_account_group.c", 492 "${session_manager_path}/src/session/v2/dev_session_util.c", 493 ] 494 defines = [ 495 "P2P_PAKE_DL_PRIME_LEN_384", 496 "P2P_PAKE_EC_TYPE", 497 "ENABLE_EC_SPEKE", 498 "ENABLE_ISO", 499 "ENABLE_AUTH_CODE_IMPORT", 500 "ENABLE_PUB_KEY_EXCHANGE", 501 "ENABLE_SAVE_TRUSTED_INFO", 502 "ENABLE_ACCOUNT_AUTH_ISO", 503 "ENABLE_ACCOUNT_AUTH_EC_SPEKE", 504 "ENABLE_P2P_BIND_ISO", 505 "ENABLE_P2P_BIND_EC_SPEKE", 506 "ENABLE_P2P_AUTH_ISO", 507 "ENABLE_P2P_AUTH_EC_SPEKE", 508 "ENABLE_PSEUDONYM", 509 "DEV_AUTH_HIVIEW_ENABLE", 510 "DEV_AUTH_PERMISSION_ENABLE", 511 ] 512 513 sources += identity_manager_files 514 include_dirs += identity_manager_inc 515 sources += [ "source/deviceauth_interface_test.cpp" ] 516 517 cflags = [ "-DHILOG_ENABLE" ] 518 cflags += [ 519 "-DDEV_AUTH_WORK_THREAD_STACK_SIZE=${device_auth_hichain_thread_stack_size}", 520 "-DMAX_AUTH_SESSION_COUNT=${max_auth_session_count}", 521 ] 522 523 deps = [] 524 525 external_deps = [ 526 "access_token:libaccesstoken_sdk", 527 "bounds_checking_function:libsec_shared", 528 "cJSON:cjson", 529 "c_utils:utils", 530 "dsoftbus:softbus_client", 531 "googletest:gmock_main", 532 "googletest:gtest_main", 533 "hilog:libhilog", 534 "hisysevent:libhisysevent", 535 "hitrace:hitrace_meter", 536 "huks:libhukssdk", 537 "init:libbegetutil", 538 "ipc:ipc_single", 539 "mbedtls:mbedtls_shared", 540 "openssl:libcrypto_static", 541 "samgr:samgr_proxy", 542 ] 543} 544 545ohos_unittest("deviceauth_unit_test") { 546 module_out_path = module_output_path 547 548 include_dirs = inc_path 549 include_dirs += hals_inc_path 550 551 include_dirs += [ 552 "./include", 553 "./unit_test/include", 554 "${dev_frameworks_path}/inc/permission_adapter", 555 "${dev_frameworks_path}/inc/hiview_adapter", 556 ] 557 558 sources = hal_common_files 559 sources -= [ "${common_lib_path}/impl/src/hc_parcel.c" ] 560 sources += [ 561 "${key_management_adapter_path}/impl/src/common/mbedtls_ec_adapter.c", 562 "${key_management_adapter_path}/impl/src/huks_adapter.c", 563 "${key_management_adapter_path}/impl/src/huks_adapter_utils.c", 564 "${key_management_adapter_path}/impl/src/standard/crypto_hash_to_point.c", 565 "${key_management_adapter_path}/impl/src/standard/huks_adapter_diff_impl.c", 566 "${os_adapter_path}/impl/src/hc_log.c", 567 "${os_adapter_path}/impl/src/linux/hc_condition.c", 568 "${os_adapter_path}/impl/src/linux/hc_file.c", 569 "${os_adapter_path}/impl/src/linux/hc_init_protection.c", 570 "${os_adapter_path}/impl/src/linux/hc_thread.c", 571 "${os_adapter_path}/impl/src/linux/hc_types.c", 572 "source/hc_dev_info_mock.c", 573 ] 574 575 include_dirs += identity_manager_inc 576 sources += identity_manager_files 577 sources += identity_service_mock_files 578 sources += dev_frameworks_files 579 sources += deviceauth_common_files 580 sources += group_database_manager_files 581 sources += ext_plugin_manager_files 582 sources += session_manager_files 583 sources += session_v1_files 584 sources += session_v2_files 585 sources += iso_protocol_files 586 sources += ec_speke_protocol_files 587 sources += auth_code_import_files 588 sources += pub_key_exchange_files 589 sources += save_trusted_info_files 590 sources += creds_manager_files 591 sources += broadcast_manager_files 592 sources += soft_bus_channel_mock_files 593 594 sources += group_auth_files 595 sources += group_auth_account_unrelated_files 596 597 sources += group_manager_files 598 sources += group_manager_peer_to_peer_files 599 600 sources += authenticators_p2p_files 601 sources += authenticators_p2p_iso_files 602 sources += authenticators_p2p_pake_files 603 sources += authenticators_standard_exchange_task_files 604 605 sources += account_related_files 606 607 sources += privacy_enhancement_files 608 sources += mk_agree_files 609 610 sources += security_label_adapter_files 611 612 sources -= [ 613 "${authenticators_path}/src/account_unrelated/iso_task/iso_task_main.c", 614 "${authenticators_path}/src/account_unrelated/pake_task/pake_v1_task/pake_v1_task_main.c", 615 ] 616 617 sources += [ 618 "${dev_frameworks_path}/src/account_task_manager_mock/account_task_manager_mock.c", 619 "${dev_frameworks_path}/src/plugin_adapter_mock/account_auth_plugin_proxy_mock.c", 620 "source/os_account_adapter_mock.c", 621 "source/protocol_task_main_mock.c", 622 "unit_test/source/account_related_creds_manager_dir_test.cpp", 623 "unit_test/source/common_lib_test.cpp", 624 "unit_test/source/key_management_test.cpp", 625 ] 626 627 defines = [ 628 "P2P_PAKE_DL_PRIME_LEN_384", 629 "P2P_PAKE_EC_TYPE", 630 "ENABLE_EC_SPEKE", 631 "ENABLE_ISO", 632 "ENABLE_AUTH_CODE_IMPORT", 633 "ENABLE_PUB_KEY_EXCHANGE", 634 "ENABLE_SAVE_TRUSTED_INFO", 635 "ENABLE_PSEUDONYM", 636 "DEV_AUTH_FUNC_TEST", 637 ] 638 639 cflags = [ "-DHILOG_ENABLE" ] 640 cflags += [ 641 "-DDEV_AUTH_WORK_THREAD_STACK_SIZE=${device_auth_hichain_thread_stack_size}", 642 "-DMAX_AUTH_SESSION_COUNT=${max_auth_session_count}", 643 ] 644 645 deps = [] 646 647 external_deps = [ 648 "access_token:libaccesstoken_sdk", 649 "cJSON:cjson", 650 "c_utils:utils", 651 "googletest:gmock_main", 652 "googletest:gtest_main", 653 "hilog:libhilog", 654 "huks:libhukssdk", 655 "mbedtls:mbedtls_shared", 656 "openssl:libcrypto_static", 657 ] 658} 659 660ohos_unittest("device_auth_ipc_test") { 661 module_out_path = module_output_path 662 663 include_dirs = hals_inc_path 664 include_dirs += [] 665 666 sources = [ 667 "source/device_auth_ipc_test.cpp", 668 "source/p2p_bind_ipc_test.cpp", 669 ] 670 671 deps = [ "${deps_adapter_path}:${hal_module_test_name}" ] 672 673 cflags = [ "-DHILOG_ENABLE" ] 674 675 external_deps = [ 676 "access_token:libnativetoken", 677 "access_token:libtoken_setproc", 678 "cJSON:cjson", 679 "c_utils:utils", 680 "device_auth:deviceauth_sdk", 681 "googletest:gmock_main", 682 "googletest:gtest_main", 683 "hilog:libhilog", 684 ] 685} 686 687ohos_unittest("identity_service_ipc_test") { 688 module_out_path = module_output_path 689 690 include_dirs = hals_inc_path 691 include_dirs += [] 692 693 sources = [ "source/identity_service_ipc_test.cpp" ] 694 695 deps = [ "${deps_adapter_path}:${hal_module_test_name}" ] 696 697 defines = [ "DEV_AUTH_IS_ENABLE" ] 698 699 cflags = [ "-DHILOG_ENABLE" ] 700 external_deps = [ 701 "access_token:libnativetoken", 702 "access_token:libtoken_setproc", 703 "cJSON:cjson", 704 "c_utils:utils", 705 "device_auth:deviceauth_sdk", 706 "googletest:gmock_main", 707 "googletest:gtest_main", 708 "hilog:libhilog", 709 ] 710} 711