1# Copyright 2024 The Pigweed Authors 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); you may not 4# use this file except in compliance with the License. You may obtain a copy of 5# the License at 6# 7# https://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12# License for the specific language governing permissions and limitations under 13# the License. 14 15load("@pigweed//pw_unit_test:pw_cc_test.bzl", "pw_cc_test") 16 17package(default_visibility = ["//visibility:public"]) 18 19exports_files(glob(["**/*"])) 20 21cc_library( 22 name = "definitions", 23 srcs = [ 24 "error.cc", 25 "packet.cc", 26 "types.cc", 27 ], 28 deps = [ 29 "//pw_bluetooth_sapphire:public", 30 "//pw_bluetooth_sapphire/host/common", 31 "//pw_bluetooth_sapphire/host/hci-spec", 32 ], 33) 34 35cc_library( 36 name = "sm", 37 srcs = [ 38 "ecdh_key.cc", 39 "pairing_channel.cc", 40 "pairing_phase.cc", 41 "phase_1.cc", 42 "phase_2_legacy.cc", 43 "phase_2_secure_connections.cc", 44 "phase_3.cc", 45 "sc_stage_1_just_works_numeric_comparison.cc", 46 "sc_stage_1_passkey.cc", 47 "security_manager.cc", 48 "security_request_phase.cc", 49 "util.cc", 50 ], 51 deps = [ 52 ":definitions", 53 "//pw_bluetooth_sapphire:public", 54 "//pw_bluetooth_sapphire/host/gap:definitions", 55 "//pw_bluetooth_sapphire/host/hci", 56 "//pw_bluetooth_sapphire/host/l2cap", 57 "@boringssl//:crypto", 58 "@pigweed//pw_string", 59 "@pigweed//third_party/fuchsia:fit", 60 ], 61) 62 63cc_library( 64 name = "testing", 65 srcs = [ 66 "test_security_manager.cc", 67 ], 68 deps = [ 69 ":sm", 70 "//pw_bluetooth_sapphire:public", 71 ], 72) 73 74pw_cc_test( 75 name = "sm_test", 76 srcs = [ 77 "ecdh_key_test.cc", 78 "error_test.cc", 79 "packet_test.cc", 80 "pairing_channel_test.cc", 81 "pairing_phase_test.cc", 82 "phase_1_test.cc", 83 "phase_2_legacy_test.cc", 84 "phase_2_secure_connections_test.cc", 85 "phase_3_test.cc", 86 "sc_stage_1_just_works_numeric_comparison_test.cc", 87 "sc_stage_1_passkey_test.cc", 88 "security_manager_test.cc", 89 "security_request_phase_test.cc", 90 "types_test.cc", 91 "util_test.cc", 92 ], 93 test_main = "//pw_bluetooth_sapphire/host/testing:gtest_main", 94 deps = [ 95 ":sm", 96 ":testing", 97 "//pw_bluetooth_sapphire/host/hci:testing", 98 "//pw_bluetooth_sapphire/host/l2cap:testing", 99 "//pw_bluetooth_sapphire/host/testing", 100 ], 101) 102