Skip to content

Commit

Permalink
squash! build: add fips target and fipsinstall action
Browse files Browse the repository at this point in the history
  • Loading branch information
danbev committed Jun 22, 2021
1 parent f521e03 commit ba291ca
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
13 changes: 2 additions & 11 deletions node.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -616,21 +616,12 @@
],
},
{
'action_name': 'copy_openssl_cnf',
'inputs': [ '<(opensslconfig)', ],
'outputs': [ '<(opensslconfig_internal)', ],
'action': [
'python', 'tools/copyfile.py',
'./deps/openssl/openssl/apps/openssl.cnf',
'<(obj_dir)/deps/openssl/openssl.cnf',
],
},
{
'action_name': 'include_fips_cnf',
'action_name': 'copy_openssl_cnf_and_include_fips_cnf',
'inputs': [ '<(opensslconfig)', ],
'outputs': [ '<(opensslconfig_internal)', ],
'action': [
'python', 'tools/enable_fips_include.py',
'<(opensslconfig)',
'<(opensslconfig_internal)',
'<(fipsconfig)',
],
Expand Down
12 changes: 8 additions & 4 deletions tools/enable_fips_include.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,16 @@

import sys

fin = open(sys.argv[1], "rt")
# Copy openssl.cnf into output directory
__import__('copyfile')

# Open the copied openssl.cnf file
fin = open(sys.argv[2], "rt")
data = fin.read()
data = data.replace('# .include fipsmodule.cnf', '.include %s' % sys.argv[2])
data = data.replace('# .include fipsmodule.cnf', '.include %s' % sys.argv[3])
data = data.replace('# fips = fips_sect', 'fips = fips_sect')
data = data.replace('# activate = 1', 'activate = 1')
fin.close()
fin = open(sys.argv[1], "wt")
fin = open(sys.argv[2], "wt")
fin.write(data)
fin.close()

0 comments on commit ba291ca

Please sign in to comment.