xref: /aosp_15_r20/external/pigweed/pw_tls_client/BUILD.bazel (revision 61c4878ac05f98d0ceed94b57d316916de578985)
1# Copyright 2021 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("//pw_build:pw_facade.bzl", "pw_facade")
16load("//pw_unit_test:pw_cc_test.bzl", "pw_cc_test")
17
18package(default_visibility = ["//visibility:public"])
19
20licenses(["notice"])
21
22pw_facade(
23    name = "pw_tls_client",
24    hdrs = [
25        "public/pw_tls_client/options.h",
26        "public/pw_tls_client/session.h",
27        "public/pw_tls_client/status.h",
28    ],
29    backend = ":pw_tls_client_backend",
30    strip_include_prefix = "public",
31    deps = [
32        "//pw_assert",
33        "//pw_bytes",
34        "//pw_result",
35        "//pw_status",
36        "//pw_stream",
37        "//pw_string",
38    ],
39)
40
41label_flag(
42    name = "pw_tls_client_backend",
43    # TODO(zyecheng): Add a "backend_multiplexer" target once BoringSSL/MbedTLS
44    # is ready.
45    build_setting_default = "//pw_build:empty_cc_library",
46)
47
48pw_facade(
49    name = "entropy",
50    hdrs = [
51        "public/pw_tls_client/entropy.h",
52    ],
53    backend = ":entropy_backend",
54    strip_include_prefix = "public",
55    deps = [
56        "//pw_bytes",
57        "//pw_status",
58    ],
59)
60
61label_flag(
62    name = "entropy_backend",
63    # TODO(zyecheng): Add a "backend_multiplexer" target once BoringSSL/MbedTLS
64    # is ready.
65    build_setting_default = "//pw_build:empty_cc_library",
66)
67
68cc_library(
69    name = "fake_entropy",
70    srcs = ["fake_entropy.cc"],
71    hdrs = [
72        "public/pw_tls_client/entropy.h",
73    ],
74    strip_include_prefix = "public",
75    deps = [
76        "//pw_bytes",
77        "//pw_log",
78        "//pw_status",
79    ],
80)
81
82cc_library(
83    name = "crlset",
84    hdrs = ["public/pw_tls_client/crlset.h"],
85    strip_include_prefix = "public",
86    deps = [
87        "//pw_bytes",
88    ],
89)
90
91cc_library(
92    name = "test_server",
93    srcs = ["test_server.cc"],
94    hdrs = ["public/pw_tls_client/test/test_server.h"],
95    strip_include_prefix = "public",
96    # TODO: b/257527057 - Get this to build.
97    tags = ["manual"],
98    deps = [
99        "//pw_bytes",
100        "//pw_log",
101        "//pw_preprocessor",
102        "//pw_result",
103        "//pw_stream",
104    ],
105)
106
107pw_cc_test(
108    name = "test_server_test",
109    srcs = ["test_server_test.cc"],
110    # TODO: b/257527057 - Get this to build.
111    tags = ["manual"],
112    deps = [":test_server"],
113)
114