Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 06327e5

Browse filesBrowse files
jasnellMyles Borins
authored andcommitted
tls: use process.binding('config') to detect fips mode
When the fips mode check was added sometime in v4 it caused a regression in some edge cases (see #6114) because `process.config` can be overwritten by userland modules. This switches to using the backported process.binding('config') to fix the regression. Fixes: #6114 PR-URL: #7551 Reviewed-By: Myles Borins <myles.borins@gmail.com>
1 parent b9136c0 commit 06327e5
Copy full SHA for 06327e5

File tree

Expand file treeCollapse file tree

2 files changed

+5
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+5
-2
lines changed
Open diff view settings
Collapse file

‎lib/_tls_wrap.js‎

Copy file name to clipboardExpand all lines: lib/_tls_wrap.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const defaultSessionIdContext = getDefaultSessionIdContext();
1919
function getDefaultSessionIdContext() {
2020
var defaultText = process.argv.join(' ');
2121
/* SSL_MAX_SID_CTX_LENGTH is 128 bits */
22-
if (process.config.variables.openssl_fips) {
22+
if (process.binding('config').fipsMode) {
2323
return crypto.createHash('sha1')
2424
.update(defaultText)
2525
.digest('hex').slice(0, 32);
Collapse file

‎src/node_config.cc‎

Copy file name to clipboardExpand all lines: src/node_config.cc
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ using v8::ReadOnly;
2828
void InitConfig(Local<Object> target,
2929
Local<Value> unused,
3030
Local<Context> context) {
31-
// Environment* env = Environment::GetCurrent(context);
31+
#ifdef NODE_FIPS_MODE
32+
Environment* env = Environment::GetCurrent(context);
33+
READONLY_BOOLEAN_PROPERTY("fipsMode");
34+
#endif
3235
}
3336

3437
} // namespace node

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.