options += ["--ro-bind", context.config.passphrase, context.config.passphrase]
if context.config.verity_key:
cmdline += ["--private-key", context.config.verity_key]
- options += ["--ro-bind", context.config.verity_key, context.config.verity_key]
+ if context.config.verity_key_source.type != KeySource.Type.file:
+ cmdline += ["--private-key-source", str(context.config.verity_key_source)]
+ if context.config.verity_key.exists():
+ options += ["--ro-bind", context.config.verity_key, context.config.verity_key]
if context.config.verity_certificate:
cmdline += ["--certificate", context.config.verity_certificate]
options += ["--ro-bind", context.config.verity_certificate, context.config.verity_certificate]
cmdline,
stdout=subprocess.PIPE,
env=context.config.environment,
- sandbox=context.sandbox(devices=not context.config.repart_offline, options=options),
+ sandbox=context.sandbox(
+ devices=(
+ not context.config.repart_offline or
+ context.config.verity_key_source.type != KeySource.Type.file
+ ),
+ options=options,
+ ),
).stdout
)
options += ["--ro-bind", context.config.passphrase, context.config.passphrase]
if context.config.verity_key:
cmdline += ["--private-key", context.config.verity_key]
- options += ["--ro-bind", context.config.verity_key, context.config.verity_key]
+ if context.config.verity_key_source.type != KeySource.Type.file:
+ cmdline += ["--private-key-source", str(context.config.verity_key_source)]
+ if context.config.verity_key.exists():
+ options += ["--ro-bind", context.config.verity_key, context.config.verity_key]
if context.config.verity_certificate:
cmdline += ["--certificate", context.config.verity_certificate]
options += ["--ro-bind", context.config.verity_certificate, context.config.verity_certificate]
run(
cmdline + ["--definitions", r],
env=env,
- sandbox=context.sandbox(devices=not context.config.repart_offline, options=options),
+ sandbox=context.sandbox(
+ devices=(
+ not context.config.repart_offline or
+ context.config.verity_key_source.type != KeySource.Type.file
+ ),
+ options=options,
+ ),
)
secure_boot_certificate: Optional[Path]
secure_boot_sign_tool: SecureBootSignTool
verity_key: Optional[Path]
+ verity_key_source: KeySource
verity_certificate: Optional[Path]
sign_expected_pcr: ConfigFeature
passphrase: Optional[Path]
),
ConfigSetting(
dest="verity_key",
- metavar="PATH",
+ metavar="KEY",
section="Validation",
- parse=config_make_path_parser(secret=True),
+ parse=config_parse_key,
paths=("mkosi.key",),
- help="Private key for signing verity signature in PEM format",
+ help="Private key for signing verity signature",
+ ),
+ ConfigSetting(
+ dest="verity_key_source",
+ section="Validation",
+ metavar="SOURCE[:ENGINE]",
+ parse=config_parse_key_source,
+ default=KeySource(type=KeySource.Type.file),
+ help="The source to use to retrieve the verity signing key",
),
ConfigSetting(
dest="verity_certificate",
SecureBoot Certificate: {none_to_none(config.secure_boot_certificate)}
SecureBoot Sign Tool: {config.secure_boot_sign_tool}
Verity Signing Key: {none_to_none(config.verity_key)}
+ Verity Signing Key Source: {config.verity_key_source}
Verity Certificate: {none_to_none(config.verity_certificate)}
Sign Expected PCRs: {config.sign_expected_pcr}
Passphrase: {none_to_none(config.passphrase)}
`VerityKey=`, `--verity-key=`
: Path to the PEM file containing the secret key for signing the verity signature, if a verity signature
- partition is added with systemd-repart.
+ partition is added with systemd-repart. When `VerityKeySource=` is specified, the input type depends on
+ the source.
+
+`VerityKeySource=`, `--verity-key-source=`
+
+: Source of `VerityKey=`, to support OpenSSL engines. E.g.:
+ `--verity-key-source=engine:pkcs11`
`VerityCertificate=`, `--verity-certificate=`