-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix FIPS regression in 4.x #6110
Conversation
process.config.variables && | ||
'openssl_fips' in process.config.variables && | ||
process.config.variables.openssl_fips | ||
) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can simply be:
if (process.config && process.config.variables && process.config.variables.openssl_fips)
Using the in
syntax is not common in core.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the feedback! will update now.
FWIW I was guarding against the case where they are truthy but perhaps not an object (lacking the required attribute).
Small nit but generally this is ok. My apologies, however, in that I wasn't clear on my first note. Fixes to |
Per request, created new PRs against v4.x-staging and v5.x (couldn't find a v5.x-staging). |
Thank you @sneak ... I appreciate it. Just an FYI, We use the |
Makes perfect sense. Glad to help - may my hours lost yesterday not bite anyone else using mocha/supertest/whatever broke it. (I know the people upstream of the app I am using are going to hit this same bug when they upgrade their node version.) |
Checklist
Affected core subsystem(s)
tiny change to lib/_tls_wrap.js
Description of change
This fixes a regression introduced in 4.2.4 where under certain circumstances (I believe mocha test framework, but didn't isolate) the code in getDefaultSessionIdContext() would throw an exception because process.config.variables was undefined and thus doesn't have attributes to access.
Why the project's libs in use were mucking about in process.config like that we'll never know, but this defensive patch makes it work again (like in 4.2.3).
#3755 (comment)