Skip to content

Commit 4428b96

Browse files
jwendellclaude
andcommitted
Add bssl-compat: BoringSSL compatibility layer for OpenSSL
This commit adds the complete bssl-compat library, which provides an implementation of the BoringSSL API on top of OpenSSL 3.0.x. This allows Envoy to be built against OpenSSL instead of BoringSSL. Key components: - prefixer tool: Generates OpenSSL header wrappers with ossl_ prefix - Mapping functions: Implement BoringSSL API using OpenSSL calls - Patch scripts: Control how BoringSSL headers are adapted - Test suite: Unit tests for compatibility layer functions - Build files: CMake and Bazel configuration The compatibility layer handles differences between BoringSSL and OpenSSL: - Opaque data structures requiring EVP functions - Different function signatures and return values - Macro and constant value differences - Structure layout compatibility 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Jonh Wendell <jwendell@redhat.com>
1 parent 0c30f2c commit 4428b96

8,402 files changed

Lines changed: 2414266 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

bssl-compat/BUILD

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
load("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake")
2+
load(":filter_out_shared_libs.bzl", "filter_out_shared_libs")
3+
4+
filegroup(
5+
name = "srcs",
6+
srcs = glob(["**"]),
7+
)
8+
9+
licenses(["notice"]) # Apache 2
10+
11+
cmake(
12+
name = "bssl-compat-build",
13+
lib_source = ":srcs",
14+
out_shared_libs = [],
15+
out_static_libs = ["libbssl-compat.a"],
16+
visibility = ["//visibility:private"],
17+
generate_crosstool_file = False,
18+
out_binaries = ["utests-bssl-compat"],
19+
build_args = [ "-j" ],
20+
deps = ["@openssl//:openssl"],
21+
cache_entries = {"OPENSSL_ROOT_DIR": "$$EXT_BUILD_DEPS/openssl"},
22+
# Add the OpenSSL shared libraries as a *data* dependency, so they get
23+
# propagated to dependant targets, and made available in their runfiles
24+
# directory when they run, so libbssl-compat.a can dlopen() them.
25+
data = ["@openssl//:libs"],
26+
)
27+
28+
filegroup(
29+
name = "utests-bssl-compat",
30+
srcs = [":bssl-compat-build"],
31+
output_group = "utests-bssl-compat",
32+
visibility = ["//visibility:public"],
33+
)
34+
35+
# This target is identical to :bssl-compat-build but with the OpenSSL shared
36+
# libraries dependency filtered out, to stop dependants linking against them.
37+
filter_out_shared_libs(
38+
name = "bssl-compat",
39+
dep = ":bssl-compat-build",
40+
visibility = ["//visibility:public"],
41+
)
42+
43+
alias(
44+
name = "crypto",
45+
actual = ":bssl-compat",
46+
visibility = ["//visibility:public"],
47+
)
48+
49+
alias(
50+
name = "ssl",
51+
actual = ":bssl-compat",
52+
visibility = ["//visibility:public"],
53+
)

0 commit comments

Comments
 (0)