| # Copyright 2024 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| load( |
| "@fuchsia_sdk//fuchsia:defs.bzl", |
| "fuchsia_cc_test", |
| "fuchsia_unittest_package", |
| ) |
| |
| package(default_visibility = ["//visibility:public"]) |
| |
| cc_library( |
| name = "definitions", |
| srcs = [ |
| "error.cc", |
| "packet.cc", |
| "types.cc", |
| ], |
| deps = [ |
| "//src/connectivity/bluetooth/core/bt-host:public", |
| "//src/connectivity/bluetooth/core/bt-host/common", |
| "//src/connectivity/bluetooth/core/bt-host/hci-spec", |
| ], |
| ) |
| |
| cc_library( |
| name = "sm", |
| srcs = [ |
| "ecdh_key.cc", |
| "pairing_channel.cc", |
| "pairing_phase.cc", |
| "phase_1.cc", |
| "phase_2_legacy.cc", |
| "phase_2_secure_connections.cc", |
| "phase_3.cc", |
| "sc_stage_1_just_works_numeric_comparison.cc", |
| "sc_stage_1_passkey.cc", |
| "security_manager.cc", |
| "security_request_phase.cc", |
| "util.cc", |
| ], |
| deps = [ |
| ":definitions", |
| "//src/connectivity/bluetooth/core/bt-host:public", |
| "//src/connectivity/bluetooth/core/bt-host/gap:definitions", |
| "//src/connectivity/bluetooth/core/bt-host/hci", |
| "//src/connectivity/bluetooth/core/bt-host/l2cap", |
| "@boringssl", |
| "@pigweed//pw_string", |
| "@pigweed//third_party/fuchsia:fit", |
| ], |
| ) |
| |
| cc_library( |
| name = "testing", |
| srcs = [ |
| "test_security_manager.cc", |
| ], |
| deps = [ |
| ":sm", |
| "//src/connectivity/bluetooth/core/bt-host:public", |
| ], |
| ) |
| |
| fuchsia_cc_test( |
| name = "sm_test", |
| testonly = True, |
| srcs = [ |
| "ecdh_key_test.cc", |
| "error_test.cc", |
| "packet_test.cc", |
| "pairing_channel_test.cc", |
| "pairing_phase_test.cc", |
| "phase_1_test.cc", |
| "phase_2_legacy_test.cc", |
| "phase_2_secure_connections_test.cc", |
| "phase_3_test.cc", |
| "sc_stage_1_just_works_numeric_comparison_test.cc", |
| "sc_stage_1_passkey_test.cc", |
| "security_manager_test.cc", |
| "security_request_phase_test.cc", |
| "types_test.cc", |
| "util_test.cc", |
| ], |
| death_unittest = True, |
| visibility = ["//visibility:public"], |
| deps = [ |
| ":sm", |
| ":testing", |
| "//src/connectivity/bluetooth/core/bt-host/hci:testing", |
| "//src/connectivity/bluetooth/core/bt-host/l2cap:testing", |
| "//src/connectivity/bluetooth/core/bt-host/testing", |
| "//src/connectivity/bluetooth/core/bt-host/testing:gtest_main", |
| ], |
| ) |
| |
| fuchsia_unittest_package( |
| name = "test_pkg", |
| package_name = "sm_tests", |
| testonly = True, |
| fuchsia_api_level = "HEAD", |
| unit_tests = [ |
| ":sm_test", |
| ], |
| visibility = ["//visibility:public"], |
| ) |