From: Jörg Behrmann Date: Fri, 11 Oct 2024 12:34:15 +0000 (+0200) Subject: ukify: Require both key and cert be set in generate_keys X-Git-Tag: v257-rc1~229^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9ba53499b97d59cc57ce763b8ba7f272a876dd25;p=thirdparty%2Fsystemd.git ukify: Require both key and cert be set in generate_keys If either is None the write in this branch of the code will fail. --- diff --git a/src/ukify/ukify.py b/src/ukify/ukify.py index 8d122aaa425..80d4bfd7e7c 100755 --- a/src/ukify/ukify.py +++ b/src/ukify/ukify.py @@ -1176,7 +1176,7 @@ def generate_keys(opts: argparse.Namespace) -> None: # This will generate keys and certificates and write them to the paths that # are specified as input paths. - if opts.sb_key or opts.sb_cert: + if opts.sb_key and opts.sb_cert: fqdn = socket.getfqdn() cn = f'SecureBoot signing key on host {fqdn}' key_pem, cert_pem = generate_key_cert_pair(