11cb0ef41Sopenharmony_ci# Copyright 2008 the V8 project authors. All rights reserved.
21cb0ef41Sopenharmony_ci# Redistribution and use in source and binary forms, with or without
31cb0ef41Sopenharmony_ci# modification, are permitted provided that the following conditions are
41cb0ef41Sopenharmony_ci# met:
51cb0ef41Sopenharmony_ci#
61cb0ef41Sopenharmony_ci#     * Redistributions of source code must retain the above copyright
71cb0ef41Sopenharmony_ci#       notice, this list of conditions and the following disclaimer.
81cb0ef41Sopenharmony_ci#     * Redistributions in binary form must reproduce the above
91cb0ef41Sopenharmony_ci#       copyright notice, this list of conditions and the following
101cb0ef41Sopenharmony_ci#       disclaimer in the documentation and/or other materials provided
111cb0ef41Sopenharmony_ci#       with the distribution.
121cb0ef41Sopenharmony_ci#     * Neither the name of Google Inc. nor the names of its
131cb0ef41Sopenharmony_ci#       contributors may be used to endorse or promote products derived
141cb0ef41Sopenharmony_ci#       from this software without specific prior written permission.
151cb0ef41Sopenharmony_ci#
161cb0ef41Sopenharmony_ci# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
171cb0ef41Sopenharmony_ci# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
181cb0ef41Sopenharmony_ci# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
191cb0ef41Sopenharmony_ci# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
201cb0ef41Sopenharmony_ci# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
211cb0ef41Sopenharmony_ci# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
221cb0ef41Sopenharmony_ci# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
231cb0ef41Sopenharmony_ci# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
241cb0ef41Sopenharmony_ci# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
251cb0ef41Sopenharmony_ci# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
261cb0ef41Sopenharmony_ci# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
271cb0ef41Sopenharmony_ci
281cb0ef41Sopenharmony_ciimport sys
291cb0ef41Sopenharmony_ci
301cb0ef41Sopenharmony_ci# Copy openssl.cnf into output directory
311cb0ef41Sopenharmony_ci__import__('copyfile')
321cb0ef41Sopenharmony_ci
331cb0ef41Sopenharmony_ci# Open the copied openssl.cnf file
341cb0ef41Sopenharmony_cifin = open(sys.argv[2], "rt")
351cb0ef41Sopenharmony_cidata = fin.read()
361cb0ef41Sopenharmony_cidata = data.replace('# .include fipsmodule.cnf', '.include %s' % sys.argv[3])
371cb0ef41Sopenharmony_cidata = data.replace('# fips = fips_sect', 'fips = fips_sect')
381cb0ef41Sopenharmony_cidata = data.replace('# activate = 1', 'activate = 1')
391cb0ef41Sopenharmony_cifin.close()
401cb0ef41Sopenharmony_cifin = open(sys.argv[2], "wt")
411cb0ef41Sopenharmony_cifin.write(data)
421cb0ef41Sopenharmony_cifin.close()
43