Skip to content

Commit ccb63c0

Browse files
committed
squash! build,src,test,doc: enable FIPS for OpenSSL 3.0
1 parent 21b475c commit ccb63c0

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

BUILDING.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -763,15 +763,15 @@ The current version of Node.js does not support FIPS when statically linking
763763
(the default) with OpenSSL 1.1.1 but for dynamically linking it is possible
764764
to enable FIPS using the configuration flag `--openssl-is-fips`.
765765

766-
### Configuring and Building quictls/openssl for FIPS
766+
### Configuring and building quictls/openssl for FIPS
767767

768768
For quictls/openssl 3.0 it is possible to enable FIPS when dynamically linking.
769769
Node.js currently uses openssl-3.0.0+quic which can be configured as
770770
follows:
771771
```console
772772
$ git clone [email protected]:quictls/openssl.git
773773
$ cd openssl
774-
$ ./config -Werror --strict-warnings --debug --prefix=/path/to/install/dir/ shared enable-fips linux-x86_64
774+
$ ./config --prefix=/path/to/install/dir/ shared enable-fips linux-x86_64
775775
```
776776
This can be compiled and installed using the following commands:
777777
```console
@@ -790,7 +790,7 @@ use the generated FIPS configuration file (`fipsmodule.cnf`):
790790
[provider_sect]
791791
default = default_sect
792792
# The fips section name should match the section name inside the
793-
# included fipsmodule.cnf.
793+
# included /path/to/install/dir/ssl/fipsmodule.cnf.
794794
fips = fips_sect
795795
796796
[default_sect]
@@ -816,16 +816,16 @@ $ make -j8
816816
Verify the produced executable:
817817
```console
818818
$ ldd ./node
819-
linux-vdso.so.1 (0x00007ffd7917b000)
820-
libcrypto.so.81.3 => /path/to/install/dir/lib/libcrypto.so.81.3 (0x00007fd911321000)
821-
libssl.so.81.3 => /path/to/install/dir/lib/libssl.so.81.3 (0x00007fd91125e000)
822-
libdl.so.2 => /usr/lib64/libdl.so.2 (0x00007fd911232000)
823-
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007fd911039000)
824-
libm.so.6 => /usr/lib64/libm.so.6 (0x00007fd910ef3000)
825-
libgcc_s.so.1 => /usr/lib64/libgcc_s.so.1 (0x00007fd910ed9000)
826-
libpthread.so.0 => /usr/lib64/libpthread.so.0 (0x00007fd910eb5000)
827-
libc.so.6 => /usr/lib64/libc.so.6 (0x00007fd910cec000)
828-
/lib64/ld-linux-x86-64.so.2 (0x00007fd9117f2000)
819+
linux-vdso.so.1 (0x00007ffd7917b000)
820+
libcrypto.so.81.3 => /path/to/install/dir/lib/libcrypto.so.81.3 (0x00007fd911321000)
821+
libssl.so.81.3 => /path/to/install/dir/lib/libssl.so.81.3 (0x00007fd91125e000)
822+
libdl.so.2 => /usr/lib64/libdl.so.2 (0x00007fd911232000)
823+
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007fd911039000)
824+
libm.so.6 => /usr/lib64/libm.so.6 (0x00007fd910ef3000)
825+
libgcc_s.so.1 => /usr/lib64/libgcc_s.so.1 (0x00007fd910ed9000)
826+
libpthread.so.0 => /usr/lib64/libpthread.so.0 (0x00007fd910eb5000)
827+
libc.so.6 => /usr/lib64/libc.so.6 (0x00007fd910cec000)
828+
/lib64/ld-linux-x86-64.so.2 (0x00007fd9117f2000)
829829
```
830830
If the `ldd` command says that `libcrypto` cannot be found one needs to set
831831
`LD_LIBRARY_PATH` to point to the directory used above for
@@ -834,7 +834,7 @@ If the `ldd` command says that `libcrypto` cannot be found one needs to set
834834
Verify the OpenSSL version:
835835
```console
836836
$ ./node -p process.versions.openssl
837-
3.0.0-alpha15+quic
837+
3.0.0-alpha16+quic
838838
```
839839

840840
Verify that FIPS is available:
@@ -870,7 +870,7 @@ be updated. The following shows an example:
870870
```console
871871
openssl_conf = openssl_init
872872

873-
.include /path/to/install/dir/lib/ossl-modules/fips.so.cnf
873+
.include /path/to/install/dir/ssl/fipsmodule.cnf
874874

875875
[openssl_init]
876876
providers = prov

src/crypto/crypto_util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#endif // !OPENSSL_NO_ENGINE
2525
// The FIPS-related functions are only available
2626
// when the OpenSSL itself was compiled with FIPS support.
27-
#ifdef OPENSSL_FIPS
27+
#if defined(OPENSSL_FIPS) && OPENSSL_VERSION_MAJOR < 3
2828
# include <openssl/fips.h>
2929
#endif // OPENSSL_FIPS
3030

0 commit comments

Comments
 (0)