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 b8e75de

Browse filesBrowse files
stefanmbMyles Borins
authored andcommitted
crypto: fix native module compilation with FIPS
Prevent OpenSSL's fipsld from being used to link native modules because this requires the original OpenSSL source to be available after Node's installation. Fixes: #3815 PR-URL: #4023 Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
1 parent a77dcfe commit b8e75de
Copy full SHA for b8e75de

File tree

Expand file treeCollapse file tree

4 files changed

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

4 files changed

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

‎.gitignore‎

Copy file name to clipboardExpand all lines: .gitignore
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ ipch/
4343

4444
/config.mk
4545
/config.gypi
46+
/config_fips.gypi
4647
*-nodegyp*
4748
/gyp-mac-tool
4849
/dist-osx
Collapse file

‎Makefile‎

Copy file name to clipboardExpand all lines: Makefile
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ clean:
7474

7575
distclean:
7676
-rm -rf out
77-
-rm -f config.gypi icu_config.gypi
77+
-rm -f config.gypi icu_config.gypi config_fips.gypi
7878
-rm -f config.mk
7979
-rm -rf $(NODE_EXE) $(NODE_G_EXE)
8080
-rm -rf node_modules
Collapse file

‎configure‎

Copy file name to clipboardExpand all lines: configure
+10-1Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@ def configure_openssl(o):
782782
o['variables']['openssl_fips'] = options.openssl_fips
783783
fips_dir = os.path.join(root_dir, 'deps', 'openssl', 'fips')
784784
fips_ld = os.path.abspath(os.path.join(fips_dir, 'fipsld'))
785-
o['make_global_settings'] = [
785+
o['make_fips_settings'] = [
786786
['LINK', fips_ld + ' <(openssl_fips)/bin/fipsld'],
787787
]
788788
else:
@@ -1104,6 +1104,15 @@ configure_fullystatic(output)
11041104
variables = output['variables']
11051105
del output['variables']
11061106

1107+
# make_global_settings for special FIPS linking
1108+
# should not be used to compile modules in node-gyp
1109+
config_fips = { 'make_global_settings' : [] }
1110+
if 'make_fips_settings' in output:
1111+
config_fips['make_global_settings'] = output['make_fips_settings']
1112+
del output['make_fips_settings']
1113+
write('config_fips.gypi', do_not_edit +
1114+
pprint.pformat(config_fips, indent=2) + '\n')
1115+
11071116
# make_global_settings should be a root level element too
11081117
if 'make_global_settings' in output:
11091118
make_global_settings = output['make_global_settings']
Collapse file

‎tools/gyp_node.py‎

Copy file name to clipboardExpand all lines: tools/gyp_node.py
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,22 @@ def run_gyp(args):
3030
args.append(os.path.join(node_root, 'node.gyp'))
3131
common_fn = os.path.join(node_root, 'common.gypi')
3232
options_fn = os.path.join(node_root, 'config.gypi')
33+
options_fips_fn = os.path.join(node_root, 'config_fips.gypi')
3334
else:
3435
args.append(os.path.join(os.path.abspath(node_root), 'node.gyp'))
3536
common_fn = os.path.join(os.path.abspath(node_root), 'common.gypi')
3637
options_fn = os.path.join(os.path.abspath(node_root), 'config.gypi')
38+
options_fips_fn = os.path.join(os.path.abspath(node_root), 'config_fips.gypi')
3739

3840
if os.path.exists(common_fn):
3941
args.extend(['-I', common_fn])
4042

4143
if os.path.exists(options_fn):
4244
args.extend(['-I', options_fn])
4345

46+
if os.path.exists(options_fips_fn):
47+
args.extend(['-I', options_fips_fn])
48+
4449
args.append('--depth=' + node_root)
4550

4651
# There's a bug with windows which doesn't allow this feature.

0 commit comments

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