blob: 42bf702841772edee0361d3cc39c83f51e40eadb [file]
# Copyright 2024 The Pigweed Authors
#
# 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
#
# https://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.
load("@pigweed//pw_unit_test:pw_cc_test.bzl", "pw_cc_test")
package(default_visibility = ["//visibility:public"])
exports_files(glob(["**/*"]))
cc_library(
name = "definitions",
srcs = [
"error.cc",
"packet.cc",
"types.cc",
],
deps = [
"//pw_bluetooth_sapphire:public",
"//pw_bluetooth_sapphire/host/common",
"//pw_bluetooth_sapphire/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",
"//pw_bluetooth_sapphire:public",
"//pw_bluetooth_sapphire/host/gap:definitions",
"//pw_bluetooth_sapphire/host/hci",
"//pw_bluetooth_sapphire/host/l2cap",
"@boringssl//:crypto",
"@pigweed//pw_string",
"@pigweed//third_party/fuchsia:fit",
],
)
cc_library(
name = "testing",
srcs = [
"test_security_manager.cc",
],
deps = [
":sm",
"//pw_bluetooth_sapphire:public",
],
)
pw_cc_test(
name = "sm_test",
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",
],
test_main = "//pw_bluetooth_sapphire/host/testing:gtest_main",
deps = [
":sm",
":testing",
"//pw_bluetooth_sapphire/host/hci:testing",
"//pw_bluetooth_sapphire/host/l2cap:testing",
"//pw_bluetooth_sapphire/host/testing",
],
)