|
50 | 50 |
|
51 | 51 | OPENSSL_RECENT_VERSIONS = [
|
52 | 52 | "1.1.1k",
|
53 |
| - # "3.0.0-alpha14" |
| 53 | + "3.0.0-alpha16" |
54 | 54 | ]
|
55 | 55 |
|
56 | 56 | LIBRESSL_OLD_VERSIONS = [
|
|
147 | 147 | help="Keep original sources for debugging."
|
148 | 148 | )
|
149 | 149 |
|
150 |
| -OPENSSL_FIPS_CNF = """\ |
151 |
| -openssl_conf = openssl_init |
152 |
| -
|
153 |
| -.include {self.install_dir}/ssl/fipsinstall.cnf |
154 |
| -# .include {self.install_dir}/ssl/openssl.cnf |
155 |
| -
|
156 |
| -[openssl_init] |
157 |
| -providers = provider_sect |
158 |
| -
|
159 |
| -[provider_sect] |
160 |
| -fips = fips_sect |
161 |
| -default = default_sect |
162 |
| -
|
163 |
| -[default_sect] |
164 |
| -activate = 1 |
165 |
| -""" |
166 |
| - |
167 | 150 |
|
168 | 151 | class AbstractBuilder(object):
|
169 | 152 | library = None
|
@@ -306,12 +289,12 @@ def _unpack_src(self):
|
306 | 289 | log.info("Unpacking files to {}".format(self.build_dir))
|
307 | 290 | tf.extractall(self.build_dir, members)
|
308 | 291 |
|
309 |
| - def _build_src(self): |
| 292 | + def _build_src(self, config_args=()): |
310 | 293 | """Now build openssl"""
|
311 | 294 | log.info("Running build in {}".format(self.build_dir))
|
312 | 295 | cwd = self.build_dir
|
313 | 296 | cmd = [
|
314 |
| - "./config", |
| 297 | + "./config", *config_args, |
315 | 298 | "shared", "--debug",
|
316 | 299 | "--prefix={}".format(self.install_dir)
|
317 | 300 | ]
|
@@ -415,35 +398,19 @@ def _post_install(self):
|
415 | 398 | if self.version.startswith("3.0"):
|
416 | 399 | self._post_install_300()
|
417 | 400 |
|
| 401 | + def _build_src(self, config_args=()): |
| 402 | + if self.version.startswith("3.0"): |
| 403 | + config_args += ("enable-fips",) |
| 404 | + super()._build_src(config_args) |
| 405 | + |
418 | 406 | def _post_install_300(self):
|
419 | 407 | # create ssl/ subdir with example configs
|
420 |
| - self._subprocess_call( |
421 |
| - ["make", "-j1", "install_ssldirs"], |
422 |
| - cwd=self.build_dir |
423 |
| - ) |
424 | 408 | # Install FIPS module
|
425 |
| - # https://wiki.openssl.org/index.php/OpenSSL_3.0#Completing_the_installation_of_the_FIPS_Module |
426 |
| - fipsinstall_cnf = os.path.join( |
427 |
| - self.install_dir, "ssl", "fipsinstall.cnf" |
428 |
| - ) |
429 |
| - openssl_fips_cnf = os.path.join( |
430 |
| - self.install_dir, "ssl", "openssl-fips.cnf" |
431 |
| - ) |
432 |
| - fips_mod = os.path.join(self.lib_dir, "ossl-modules/fips.so") |
433 | 409 | self._subprocess_call(
|
434 |
| - [ |
435 |
| - self.openssl_cli, "fipsinstall", |
436 |
| - "-out", fipsinstall_cnf, |
437 |
| - "-module", fips_mod, |
438 |
| - # "-provider_name", "fips", |
439 |
| - # "-mac_name", "HMAC", |
440 |
| - # "-macopt", "digest:SHA256", |
441 |
| - # "-macopt", "hexkey:00", |
442 |
| - # "-section_name", "fips_sect" |
443 |
| - ] |
| 410 | + ["make", "-j1", "install_ssldirs", "install_fips"], |
| 411 | + cwd=self.build_dir |
444 | 412 | )
|
445 |
| - with open(openssl_fips_cnf, "w") as f: |
446 |
| - f.write(OPENSSL_FIPS_CNF.format(self=self)) |
| 413 | + |
447 | 414 | @property
|
448 | 415 | def short_version(self):
|
449 | 416 | """Short version for OpenSSL download URL"""
|
|
0 commit comments