Skip to content

Commit

Permalink
fips: fix Wasm extensions to comply with FIPS
Browse files Browse the repository at this point in the history
Signed-off-by: Kuat Yessenov <kuat@google.com>
  • Loading branch information
kyessenov authored and phlax committed Apr 26, 2023
1 parent 9197629 commit 6926f7a
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 1 deletion.
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

0 comments on commit 6926f7a

Please sign in to comment.