Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/v1.25] fips: fix Wasm extensions to comply with FIPS #26991

Merged
merged 1 commit into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions bazel/proxy_wasm_cpp_host.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/BUILD b/BUILD
index 69c9bda..d293092 100644
--- a/BUILD
+++ b/BUILD
@@ -88,7 +88,7 @@ cc_library(
":headers",
] + select({
"//bazel:crypto_system": [],
- "//conditions:default": ["@boringssl//:crypto"],
+ "//conditions:default": ["@envoy//bazel:boringcrypto"],
}),
alwayslink = 1,
)
8 changes: 7 additions & 1 deletion bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,13 @@ def _proxy_wasm_cpp_sdk():
external_http_archive(name = "proxy_wasm_cpp_sdk")

def _proxy_wasm_cpp_host():
external_http_archive(name = "proxy_wasm_cpp_host")
external_http_archive(
name = "proxy_wasm_cpp_host",
patch_args = ["-p1"],
patches = [
"@envoy//bazel:proxy_wasm_cpp_host.patch",
],
)

def _emsdk():
external_http_archive(
Expand Down
3 changes: 3 additions & 0 deletions changelogs/current.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ minor_behavior_changes:

bug_fixes:
# *Changes expected to improve the state of the world and are unlikely to have negative effects*
- area: tls
change: |
Fix build FIPS compliance when using both FIPS mode and Wasm extensions (``--define boringssl=fips`` and ``--define wasm=v8``).

removed_config_or_runtime:
# *Normally occurs at the end of the* :ref:`deprecation period <deprecated>`
Expand Down
1 change: 1 addition & 0 deletions source/common/version/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ envoy_cc_library(
],
["-DENVOY_SSL_VERSION=\\\"BoringSSL\\\""],
),
external_deps = ["ssl"],
deps = [
":version_includes",
"//source/common/common:macros",
Expand Down
5 changes: 5 additions & 0 deletions source/common/version/version.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
#include "absl/strings/str_split.h"
#include "absl/strings/string_view.h"

#ifdef ENVOY_SSL_FIPS
#include "openssl/crypto.h"
#endif

extern const char build_scm_revision[];
extern const char build_scm_status[];

Expand All @@ -38,6 +42,7 @@ const envoy::config::core::v3::BuildVersion& VersionInfo::buildVersion() {

bool VersionInfo::sslFipsCompliant() {
#ifdef ENVOY_SSL_FIPS
RELEASE_ASSERT(FIPS_mode() == 1, "FIPS mode must be enabled in Envoy FIPS configuration.");
return true;
#else
return false;
Expand Down