From 3c810bb4e03f3313f5c084747b3c2fd3f16845db Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Fri, 8 Apr 2016 02:43:20 +0200 Subject: [PATCH] fix FIPS regression in 4.x https://github.com/nodejs/node/pull/3755#issuecomment-207066246 --- lib/_tls_wrap.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js index e340e4a041b6ee..28e4171c30ede4 100644 --- a/lib/_tls_wrap.js +++ b/lib/_tls_wrap.js @@ -19,7 +19,13 @@ const defaultSessionIdContext = getDefaultSessionIdContext(); function getDefaultSessionIdContext() { var defaultText = process.argv.join(' '); /* SSL_MAX_SID_CTX_LENGTH is 128 bits */ - if (process.config.variables.openssl_fips) { + if ( + process.config && + 'variables' in process.config && + process.config.variables && + 'openssl_fips' in process.config.variables && + process.config.variables.openssl_fips + ) { return crypto.createHash('sha1') .update(defaultText) .digest('hex').slice(0, 32);