Commit df9a15d
committed
Add a check of the OPENSSL_FIPS environment variable around FIPS initialization.
As currently implemented, when Node is compiled with FIPS support
(`./configure fips`), there is no way to disable engaging FIPS mode
during execution. This means that several functions that rely on
non-FIPS approved algorithms (e.g. md5 hashing) will fail, as will
any code that depends on them (most obviously, `npm`).
What seems needed to me is a way to explicitly enable or disable
FIPS operation each time node is invoked. The way this is done
with the openssl CLI is via the OPENSSL_FIPS environment variable.
This change adds a check to OPENSSL_FIPS where FIPS_mode_set(1)
is called (which enables FIPS mode). If Node is not compiled in
FIPS mode this call will not even be compiled since it's wrapped
with an ifdef.
Those who are trying to run Node.js in FIPS mode should be
familiar with this variable and using it will be natural.1 parent 4270e7f commit df9a15d
2 files changed
+8
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
| 309 | + | |
| 310 | + | |
309 | 311 | | |
310 | 312 | | |
311 | 313 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5522 | 5522 | | |
5523 | 5523 | | |
5524 | 5524 | | |
5525 | | - | |
5526 | | - | |
5527 | | - | |
5528 | | - | |
| 5525 | + | |
| 5526 | + | |
| 5527 | + | |
| 5528 | + | |
| 5529 | + | |
| 5530 | + | |
5529 | 5531 | | |
5530 | 5532 | | |
5531 | 5533 | | |
| |||
0 commit comments