Repository navigation
mkSignedPackages: init - #549373
mkSignedPackages: init#549373
Conversation
513b7d9 to
d7d3f0d
Compare
| uefiSigningKey, | ||
| uefiCertificate, |
There was a problem hiding this comment.
Ideally this would be a single argument to the derivation (as they should be kept consistent with each other). This applies to the whole call-stack.
There was a problem hiding this comment.
This is mechanically checked, FWIW:
I agree that it might be nice to have an abstraction here that bundles the certificate and signing key; the lack of a good universal term for it like “key pair” for raw keys is probably the main reason I didn’t try :) I think “identity” gets some use, but it feels a little vague. I suppose something like the unwieldy “certified signing key” would be an option.
However, the two do have fairly different statuses here, as we want to expose uefiCertificate publicly in the scope, but not uefiSigningKey (because we don’t want packages outside the scope to be signing things). So this is comparable to having separate .crt and .key files for a TLS server, as opposed to a bundled .p12… the ergonomics would be nicer to combine them but not sure if the conceptual clarity would suffer as a result.
There was a problem hiding this comment.
I played around with trying to unify these into a single object; although it saves a little boilerplate in the mkSignedPe callers, I think it’s probably the wrong way to go for now.
We want the certificate sans the signing key to be a derivation; either a certified key pair has to be a derivation that can “override itself” to remove the signing key (while retaining the same derivation hash), or a certified key pair is just an attribute set containing a signing key and a certificate derivation, which means that the semantics of passthru and meta get more awkward and we can’t use overrideMkDerivation like everything else does, which makes the mental model of certificates and keys as store objects less smooth.
It’s true that whenever we use uefiSigningKey we almost certainly need the uefiCertificate, but trying to couple the two together when they have very different privacy expectations seems to be a net increase in awkwardness. There’s more common boilerplate in the signed packages here than I’d like, but I think that it’ll be best to see how that shakes out when adding support for signed kernel images, external Microsoft shim signatures, etc. to get a better idea of what redundancy can be effectively reduced.
d7d3f0d to
a72f5f0
Compare
e836025 to
f3b80ee
Compare
a72f5f0 to
0dc3e4f
Compare
f3b80ee to
6c1758b
Compare
6c1758b to
914ae55
Compare
0dc3e4f to
bbd01e9
Compare
This signs the shim with the same vendor certificate that gets embedded in the shim, which is not what you want for supporting Microsoft Secure Boot keys. The Microsoft signature will require different handling in future work, and is blocked on compliance anyway, but this is still useful for having a uniform bootloader chain and MOK handling.
bbd01e9 to
3c85327
Compare
|
I’ve moved the Nix library from #545457 into this PR, so it can be reviewed alongside the packages that utilize it. I also dropped the |
Building on package introduced in #545457 (which this is stacked on top of), this PR adds a Nix library to allow the creation of basic self‐signed X.509 code signing certificates and Authenticode‐signed PE files (as used in UEFI Secure Boot), and support for signing the UEFI executables from
fwupd-efi,systemd-boot, andshim-unsignedwith a user-provided signing key. Signing of kernel images will come in a follow‐up PR. The only thing Hydra will build at present is the exampletestSignedPackagesset using an insecure test key.These signed packages will require further integration work in NixOS to enable configuration of Secure Boot setups, but could be used as‐is with custom deployment setups. Preparing for the requirements and logistics involved in support for official signing of a shim with the Microsoft Secure Boot keys is also left for future work.
This is part of the end‐to‐end NixOS boot security project, funded through NGI Fediversity Fund, a fund established by NLnet with financial support from the European Commission’s Next Generation Internet programme.
Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.