Skip to content

Commit e852556

Browse files
authored
bpo-38820: Test with OpenSSL 3.0.0-alpha16 (pythonGH-25942)
Also use new make target to install FIPS provider.
1 parent 698e9a8 commit e852556

File tree

2 files changed

+12
-45
lines changed

2 files changed

+12
-45
lines changed

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ jobs:
177177
strategy:
178178
fail-fast: false
179179
matrix:
180-
openssl_ver: [1.1.1k, 3.0.0-alpha15]
180+
openssl_ver: [1.1.1k, 3.0.0-alpha16]
181181
env:
182182
OPENSSL_VER: ${{ matrix.openssl_ver }}
183183
MULTISSL_DIR: ${{ github.workspace }}/multissl

Tools/ssl/multissltests.py

+11-44
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848

4949
OPENSSL_RECENT_VERSIONS = [
5050
"1.1.1k",
51-
"3.0.0-alpha15"
51+
"3.0.0-alpha16"
5252
]
5353

5454
LIBRESSL_OLD_VERSIONS = [
@@ -143,23 +143,6 @@
143143
help="Keep original sources for debugging."
144144
)
145145

146-
OPENSSL_FIPS_CNF = """\
147-
openssl_conf = openssl_init
148-
149-
.include {self.install_dir}/ssl/fipsinstall.cnf
150-
# .include {self.install_dir}/ssl/openssl.cnf
151-
152-
[openssl_init]
153-
providers = provider_sect
154-
155-
[provider_sect]
156-
fips = fips_sect
157-
default = default_sect
158-
159-
[default_sect]
160-
activate = 1
161-
"""
162-
163146

164147
class AbstractBuilder(object):
165148
library = None
@@ -304,12 +287,12 @@ def _unpack_src(self):
304287
log.info("Unpacking files to {}".format(self.build_dir))
305288
tf.extractall(self.build_dir, members)
306289

307-
def _build_src(self):
290+
def _build_src(self, config_args=()):
308291
"""Now build openssl"""
309292
log.info("Running build in {}".format(self.build_dir))
310293
cwd = self.build_dir
311294
cmd = [
312-
"./config",
295+
"./config", *config_args,
313296
"shared", "--debug",
314297
"--prefix={}".format(self.install_dir)
315298
]
@@ -417,35 +400,19 @@ def _post_install(self):
417400
if self.version.startswith("3.0"):
418401
self._post_install_300()
419402

403+
def _build_src(self, config_args=()):
404+
if self.version.startswith("3.0"):
405+
config_args += ("enable-fips",)
406+
super()._build_src(config_args)
407+
420408
def _post_install_300(self):
421409
# create ssl/ subdir with example configs
422-
self._subprocess_call(
423-
["make", "-j1", "install_ssldirs"],
424-
cwd=self.build_dir
425-
)
426410
# Install FIPS module
427-
# https://wiki.openssl.org/index.php/OpenSSL_3.0#Completing_the_installation_of_the_FIPS_Module
428-
fipsinstall_cnf = os.path.join(
429-
self.install_dir, "ssl", "fipsinstall.cnf"
430-
)
431-
openssl_fips_cnf = os.path.join(
432-
self.install_dir, "ssl", "openssl-fips.cnf"
433-
)
434-
fips_mod = os.path.join(self.lib_dir, "ossl-modules/fips.so")
435411
self._subprocess_call(
436-
[
437-
self.openssl_cli, "fipsinstall",
438-
"-out", fipsinstall_cnf,
439-
"-module", fips_mod,
440-
# "-provider_name", "fips",
441-
# "-mac_name", "HMAC",
442-
# "-macopt", "digest:SHA256",
443-
# "-macopt", "hexkey:00",
444-
# "-section_name", "fips_sect"
445-
]
412+
["make", "-j1", "install_ssldirs", "install_fips"],
413+
cwd=self.build_dir
446414
)
447-
with open(openssl_fips_cnf, "w") as f:
448-
f.write(OPENSSL_FIPS_CNF.format(self=self))
415+
449416
@property
450417
def short_version(self):
451418
"""Short version for OpenSSL download URL"""

0 commit comments

Comments
 (0)