• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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("@rules_cc//cc:cc_library.bzl", "cc_library")
16load("@rules_python//sphinxdocs:sphinx_docs_library.bzl", "sphinx_docs_library")
17load("//pw_build:compatibility.bzl", "incompatible_with_mcu")
18load("//pw_build:pw_facade.bzl", "pw_facade")
19load("//pw_unit_test:pw_cc_test.bzl", "pw_cc_test")
20
21package(default_visibility = ["//visibility:public"])
22
23licenses(["notice"])
24
25pw_facade(
26    name = "pw_tls_client",
27    hdrs = [
28        "public/pw_tls_client/options.h",
29        "public/pw_tls_client/session.h",
30        "public/pw_tls_client/status.h",
31    ],
32    backend = ":pw_tls_client_backend",
33    strip_include_prefix = "public",
34    tags = ["noclangtidy"],
35    deps = [
36        "//pw_assert:assert",
37        "//pw_assert:check",
38        "//pw_bytes",
39        "//pw_result",
40        "//pw_status",
41        "//pw_stream",
42        "//pw_string",
43    ],
44)
45
46label_flag(
47    name = "pw_tls_client_backend",
48    # TODO(zyecheng): Add a "backend_multiplexer" target once BoringSSL/MbedTLS
49    # is ready.
50    build_setting_default = "//pw_build:empty_cc_library",
51)
52
53pw_facade(
54    name = "entropy",
55    hdrs = [
56        "public/pw_tls_client/entropy.h",
57    ],
58    backend = ":entropy_backend",
59    strip_include_prefix = "public",
60    deps = [
61        "//pw_bytes",
62        "//pw_status",
63    ],
64)
65
66label_flag(
67    name = "entropy_backend",
68    # TODO(zyecheng): Add a "backend_multiplexer" target once BoringSSL/MbedTLS
69    # is ready.
70    build_setting_default = "//pw_build:empty_cc_library",
71)
72
73cc_library(
74    name = "fake_entropy",
75    srcs = ["fake_entropy.cc"],
76    hdrs = [
77        "public/pw_tls_client/entropy.h",
78    ],
79    strip_include_prefix = "public",
80    deps = [
81        "//pw_bytes",
82        "//pw_log",
83        "//pw_status",
84    ],
85)
86
87cc_library(
88    name = "crlset",
89    hdrs = ["public/pw_tls_client/crlset.h"],
90    strip_include_prefix = "public",
91    deps = [
92        "//pw_bytes",
93    ],
94)
95
96cc_library(
97    name = "test_server",
98    srcs = ["test_server.cc"],
99    hdrs = ["public/pw_tls_client/test/test_server.h"],
100    strip_include_prefix = "public",
101    # TODO: b/257527057 - Get this to build.
102    tags = ["manual"],
103    deps = [
104        "//pw_bytes",
105        "//pw_log",
106        "//pw_preprocessor",
107        "//pw_result",
108        "//pw_stream",
109    ],
110)
111
112pw_cc_test(
113    name = "test_server_test",
114    srcs = ["test_server_test.cc"],
115    # TODO: b/257527057 - Get this to build.
116    tags = ["manual"],
117    deps = [":test_server"],
118)
119
120sphinx_docs_library(
121    name = "docs",
122    srcs = [
123        "backends.rst",
124        "docs.rst",
125    ],
126    prefix = "pw_tls_client/",
127    target_compatible_with = incompatible_with_mcu(),
128)
129