|
48 | 48 |
|
49 | 49 | OPENSSL_RECENT_VERSIONS = [
|
50 | 50 | "1.1.1k",
|
51 |
| - "3.0.0-alpha15" |
| 51 | + "3.0.0-alpha16" |
52 | 52 | ]
|
53 | 53 |
|
54 | 54 | LIBRESSL_OLD_VERSIONS = [
|
|
143 | 143 | help="Keep original sources for debugging."
|
144 | 144 | )
|
145 | 145 |
|
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 |
| - |
163 | 146 |
|
164 | 147 | class AbstractBuilder(object):
|
165 | 148 | library = None
|
@@ -304,12 +287,12 @@ def _unpack_src(self):
|
304 | 287 | log.info("Unpacking files to {}".format(self.build_dir))
|
305 | 288 | tf.extractall(self.build_dir, members)
|
306 | 289 |
|
307 |
| - def _build_src(self): |
| 290 | + def _build_src(self, config_args=()): |
308 | 291 | """Now build openssl"""
|
309 | 292 | log.info("Running build in {}".format(self.build_dir))
|
310 | 293 | cwd = self.build_dir
|
311 | 294 | cmd = [
|
312 |
| - "./config", |
| 295 | + "./config", *config_args, |
313 | 296 | "shared", "--debug",
|
314 | 297 | "--prefix={}".format(self.install_dir)
|
315 | 298 | ]
|
@@ -417,35 +400,19 @@ def _post_install(self):
|
417 | 400 | if self.version.startswith("3.0"):
|
418 | 401 | self._post_install_300()
|
419 | 402 |
|
| 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 | + |
420 | 408 | def _post_install_300(self):
|
421 | 409 | # create ssl/ subdir with example configs
|
422 |
| - self._subprocess_call( |
423 |
| - ["make", "-j1", "install_ssldirs"], |
424 |
| - cwd=self.build_dir |
425 |
| - ) |
426 | 410 | # 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") |
435 | 411 | 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 |
446 | 414 | )
|
447 |
| - with open(openssl_fips_cnf, "w") as f: |
448 |
| - f.write(OPENSSL_FIPS_CNF.format(self=self)) |
| 415 | + |
449 | 416 | @property
|
450 | 417 | def short_version(self):
|
451 | 418 | """Short version for OpenSSL download URL"""
|
|
0 commit comments