GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — FIPS profile: build the validated module from git with its validated … · fredericgermain/netty-tcnative@7d4c8b7

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • boringssl-static
    • pom.xml
  • openssl-dynamic/src/main/c
    • sslcredential.c
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎boringssl-static/pom.xml‎

Copy file name to clipboardExpand all lines: boringssl-static/pom.xml
+59-17Lines changed: 59 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -118,38 +118,61 @@
118118
<properties>
119119
<boringsslCheckoutDir>${project.build.directory}/boringssl-${boringsslBranch}/boringssl</boringsslCheckoutDir>
120120
<boringsslBuildDir>${boringsslCheckoutDir}/build</boringsslBuildDir>
121-
<!-- Latest FIPS compliant boringSSL commit -->
122-
<boringsslBranch>6d503ae1cf8b2e25162435225610b8c1f063d6f4</boringsslBranch>
121+
<!-- The newest BoringCrypto module that holds a certificate: FIPS 140-3 #5244, module
122+
version 20240805, validated 2026-04-18. This sha is the head of BoringSSL's
123+
fips-20240805 branch, the tree the certificate's security policy names. Newer
124+
fips-YYYYMMDD branches exist (20250107, 20250728, 20251031, 2026xxxx) but their
125+
modules are still in the CMVP queue, so they hold no certificate anyone can cite.
126+
Any of them builds with this profile: -DboringsslBranch=<sha>. -->
127+
<boringsslBranch>1a089be69fdf568c6cf2cab05bd55f97e1f21025</boringsslBranch>
123128
<linkStatic>true</linkStatic>
124129
<msvcSslIncludeDirs>${boringsslCheckoutDir}/include</msvcSslIncludeDirs>
125130
<msvcSslLibDirs>${boringsslBuildDir}/ssl;${boringsslBuildDir}/crypto;${boringsslBuildDir}/decrepit</msvcSslLibDirs>
126131
<msvcSslLibs>ssl.lib;crypto.lib;decrepit.lib</msvcSslLibs>
127132
<jniArch>${os.detected.arch}</jniArch>
128133
<project.artifactId>netty-tcnative-boringssl-static-fips</project.artifactId>
134+
<!-- Compiler for BoringSSL itself (tcnative and APR are built with the host cc).
135+
Validation covers the toolchain as well as the source, and the version comes from
136+
the certificate's security policy: for #5244 that is clang 17.0.6, go 1.22.3,
137+
ninja 1.12.1, cmake 3.29.3, built with `ninja bcm.o`. The CI image
138+
(docker/Dockerfile.debian13) carries exactly those. clang-12 was the toolchain of
139+
an older validation and had been carried forward through two BoringSSL bumps.
140+
Override with -DfipsCC=... -DfipsCXX=... to build with something else. -->
141+
<fipsCC>clang-17</fipsCC>
142+
<fipsCXX>clang++-17</fipsCXX>
129143
</properties>
130144

131145
<build>
132146
<plugins>
133147

134-
<!-- Download the BoringSSL source -->
148+
<!-- Check out the FIPS-validated BoringSSL commit from git, the same way the default
149+
profile does. This used to download
150+
https://commondatastorage.googleapis.com/chromium-boringssl-fips/boringssl-<sha>.tar.xz
151+
but that bucket stopped being anonymously readable (403 AccessDenied on every
152+
object, 401 on the bucket itself, from several networks), so a fresh machine can
153+
no longer build this profile that way - downstream builds only kept working off
154+
download-maven-plugin's cache. The tarball is a snapshot of the tree at that
155+
commit, so checking out the same sha yields the same sources. The directory layout
156+
is kept identical to what the unpacked tarball produced, so nothing below changes. -->
135157
<plugin>
136-
<groupId>com.googlecode.maven-download-plugin</groupId>
137-
<artifactId>download-maven-plugin</artifactId>
138-
<version>1.6.8</version>
158+
<artifactId>maven-scm-plugin</artifactId>
139159
<executions>
140160
<execution>
141-
<id>install-fips-boringssl</id>
142-
<phase>process-sources</phase>
161+
<id>get-fips-boringssl</id>
162+
<phase>generate-sources</phase>
143163
<goals>
144-
<goal>wget</goal>
164+
<goal>checkout</goal>
145165
</goals>
166+
<configuration>
167+
<checkoutDirectory>${boringsslCheckoutDir}</checkoutDirectory>
168+
<connectionType>developerConnection</connectionType>
169+
<developerConnectionUrl>scm:git:${boringsslRepository}</developerConnectionUrl>
170+
<scmVersion>main</scmVersion>
171+
<scmVersionType>branch</scmVersionType>
172+
<skipCheckoutIfExists>true</skipCheckoutIfExists>
173+
</configuration>
146174
</execution>
147175
</executions>
148-
<configuration>
149-
<url>https://commondatastorage.googleapis.com/chromium-boringssl-fips/boringssl-${boringsslBranch}.tar.xz</url>
150-
<unpack>true</unpack>
151-
<outputDirectory>${project.build.directory}/boringssl-${boringsslBranch}</outputDirectory>
152-
</configuration>
153176
</plugin>
154177

155178
<plugin>
@@ -207,6 +230,12 @@
207230
<else>
208231
<echo message="Building BoringSSL" />
209232

233+
<!-- Pin the checkout to the FIPS-validated commit -->
234+
<exec executable="git" failonerror="true" dir="${boringsslCheckoutDir}" resolveexecutable="true">
235+
<arg value="checkout" />
236+
<arg value="${boringsslBranch}" />
237+
</exec>
238+
210239
<mkdir dir="${boringsslBuildDir}" />
211240

212241
<if>
@@ -234,11 +263,18 @@
234263
<property name="cmakeCxxFlags" value="-O3 -fno-omit-frame-pointer" />
235264
</else>
236265
</if>
266+
<!-- The static archives end up inside a shared library, so they must be
267+
PIC, same as the default profile asks. Without it the aarch64 link
268+
fails on libcrypto.a(crypto.cc.o): "relocation
269+
R_AARCH64_ADR_PREL_PG_HI21 against symbol stderr ... can not be used
270+
when making a shared object; recompile with -fPIC". delocate is
271+
written for PIC input, so this does not affect the FIPS module. -->
237272
<exec executable="cmake" failonerror="true" dir="${boringsslBuildDir}" resolveexecutable="true">
273+
<arg value="-DCMAKE_POSITION_INDEPENDENT_CODE=TRUE" />
238274
<arg value="-DCMAKE_BUILD_TYPE=Release" />
239275
<arg value="-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded" />
240-
<arg value="-DCMAKE_C_COMPILER=clang-12" />
241-
<arg value="-DCMAKE_CXX_COMPILER=clang++-12" />
276+
<arg value="-DCMAKE_C_COMPILER=${fipsCC}" />
277+
<arg value="-DCMAKE_CXX_COMPILER=${fipsCXX}" />
242278
<arg value="-DFIPS=1" />
243279
<arg value="-GNinja" />
244280
<arg value="${boringsslCheckoutDir}" />
@@ -257,8 +293,14 @@
257293
<if>
258294
<equals arg1="${os.detected.name}" arg2="linux" />
259295
<then>
260-
<!-- This is needed to generate bssl execute file to verify isfips property-->
296+
<!-- Only what the link and the isfips gate below need. A bare `ninja`
297+
builds every target, and the test binaries alone are most of the
298+
wall-clock time of this profile. -->
261299
<exec executable="${ninjaExecutable}" failonerror="true" dir="${boringsslBuildDir}" resolveexecutable="true">
300+
<arg value="crypto" />
301+
<arg value="ssl" />
302+
<arg value="decrepit" />
303+
<arg value="bssl" />
262304
</exec>
263305
<exec executable="./bssl" failonerror="false" dir="${boringsslBuildDir}" outputproperty="boringssl.isfips.result">
264306
<arg value="isfips" />
Collapse file

‎openssl-dynamic/src/main/c/sslcredential.c‎

Copy file name to clipboardExpand all lines: openssl-dynamic/src/main/c/sslcredential.c
+13-6Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@
3030
#define SSLCREDENTIAL_CLASSNAME "io/netty/internal/tcnative/SSLCredential"
3131

3232
// Helper functions
33+
/*
34+
* Three of the setters below exist only in newer BoringSSL: must_match_issuer from API version
35+
* 33 (fips-20250107), certificate_properties and trust_anchor_id from 36 (fips-20250728). The
36+
* FIPS profile pins the certified module, fips-20240805 = API 32, so they are gated on
37+
* BORINGSSL_API_VERSION and throw UnsupportedOperationException there, like the whole API does
38+
* on non-BoringSSL builds.
39+
*/
3340
#ifdef OPENSSL_IS_BORINGSSL
3441
static void throw_openssl_error(JNIEnv* env, const char* msg) {
3542
unsigned long err = ERR_get_error();
@@ -194,7 +201,7 @@ TCN_IMPLEMENT_CALL(void, SSLCredential, setSigningAlgorithmPrefs)(TCN_STDARGS, j
194201
}
195202

196203
TCN_IMPLEMENT_CALL(void, SSLCredential, setCertificateProperties)(TCN_STDARGS, jlong cred, jbyteArray cert_props) {
197-
#ifdef OPENSSL_IS_BORINGSSL
204+
#if defined(OPENSSL_IS_BORINGSSL) && BORINGSSL_API_VERSION >= 36
198205
SSL_CREDENTIAL* c = (SSL_CREDENTIAL*)(intptr_t)cred;
199206
TCN_CHECK_NULL(c, credential, /* void */);
200207
TCN_CHECK_NULL(cert_props, certificateProperties, /* void */);
@@ -220,7 +227,7 @@ TCN_IMPLEMENT_CALL(void, SSLCredential, setCertificateProperties)(TCN_STDARGS, j
220227
throw_openssl_error(e, "Failed to set certificate properties");
221228
}
222229
#else
223-
tcn_ThrowUnsupportedOperationException(e, "SSL_CREDENTIAL API not available.");
230+
tcn_ThrowUnsupportedOperationException(e, "SSL_CREDENTIAL_set1_certificate_properties requires BoringSSL API version 36 or newer.");
224231
#endif
225232
}
226233

@@ -256,18 +263,18 @@ TCN_IMPLEMENT_CALL(void, SSLCredential, setSignedCertTimestampList)(TCN_STDARGS,
256263
}
257264

258265
TCN_IMPLEMENT_CALL(void, SSLCredential, setMustMatchIssuer)(TCN_STDARGS, jlong cred, jboolean match) {
259-
#ifdef OPENSSL_IS_BORINGSSL
266+
#if defined(OPENSSL_IS_BORINGSSL) && BORINGSSL_API_VERSION >= 33
260267
SSL_CREDENTIAL* c = (SSL_CREDENTIAL*)(intptr_t)cred;
261268
TCN_CHECK_NULL(c, credential, /* void */);
262269
SSL_CREDENTIAL_set_must_match_issuer(c, match == JNI_TRUE ? 1 : 0);
263270
#else
264-
tcn_ThrowUnsupportedOperationException(e, "SSL_CREDENTIAL API not available.");
271+
tcn_ThrowUnsupportedOperationException(e, "SSL_CREDENTIAL_set_must_match_issuer requires BoringSSL API version 33 or newer.");
265272
#endif
266273
}
267274

268275
// Trust anchor configuration
269276
TCN_IMPLEMENT_CALL(void, SSLCredential, setTrustAnchorId)(TCN_STDARGS, jlong cred, jbyteArray id) {
270-
#ifdef OPENSSL_IS_BORINGSSL
277+
#if defined(OPENSSL_IS_BORINGSSL) && BORINGSSL_API_VERSION >= 36
271278
SSL_CREDENTIAL* c = (SSL_CREDENTIAL*)(intptr_t)cred;
272279
TCN_CHECK_NULL(c, credential, /* void */);
273280
TCN_CHECK_NULL(id, trustAnchorId, /* void */);
@@ -289,7 +296,7 @@ TCN_IMPLEMENT_CALL(void, SSLCredential, setTrustAnchorId)(TCN_STDARGS, jlong cre
289296
return;
290297
}
291298
#else
292-
tcn_ThrowUnsupportedOperationException(e, "SSL_CREDENTIAL API not available.");
299+
tcn_ThrowUnsupportedOperationException(e, "SSL_CREDENTIAL_set1_trust_anchor_id requires BoringSSL API version 36 or newer.");
293300
#endif
294301
}
295302

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.