Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sysupdate: Support alternative signature methods #32819

Open
DemiMarie opened this issue May 14, 2024 · 2 comments
Open

sysupdate: Support alternative signature methods #32819

DemiMarie opened this issue May 14, 2024 · 2 comments
Labels
RFE 🎁 Request for Enhancement, i.e. a feature request

Comments

@DemiMarie
Copy link

Component

No response

Is your feature request related to a problem? Please describe

systemd-sysupdate currently uses GnuPG for signature verification of downloaded files. This is annoying because GnuPG has extra attack surface that isn’t needed here. Metadata can and should be provided included in the signed hashes file.

Describe the solution you'd like

Support for ed25519 signatures.

Describe alternatives you've considered

None

The systemd version you checked that didn't have the feature you are asking for

No response

@DemiMarie DemiMarie added the RFE 🎁 Request for Enhancement, i.e. a feature request label May 14, 2024
@poettering
Copy link
Member

yeah, sounds great. has been on the todo list for a while. either something with pkcs7 or maybe something compatible with openbsd signify would be great.

Patches welcome!

@DemiMarie
Copy link
Author

I don’t think I will be able to get around to this anytime soon, unfortunately.

PKCS#7 is roughly as bad as OpenPGP in terms of parsing requirements. It happens that systemd-sysupdate needs to parse untrusted ASN.1 for HTTPS downloads to work, but ideally the download would happen in a sandbox, whereas the signature check must be outside of that sandbox. Also, I would like to see systemd-sysupdate eventually use rustls’s OpenSSL compatibility layer.

OpenSSH signatures (as generated by ssh-keygen -Y) would be another option. They do require nontrivial parsing, but the format is much simpler than ASN.1 or OpenPGP, and OpenSSH is known for its high code quality.

Another consideration is that images should be verified before being decompressed. Since images can be very large, this requires being able to verify them incrementally. signify(1) supports this by having a list of hashes (hex encoded, newline separated, and signed with ed25519) as a comment in the gzip header. If one can assume that a 1MiB chunk can fit in memory and that binary SHA512/SHA-3/Blake2b hashes are used, this means that a 64GiB compressed image takes 216 chunks, or 2MiB of hashes. More complex schemes are possible, but a system needing 64GiB OS images to be downloaded yet not having 2MiB of free RAM does not seem realistic to me 1, and less code means less attack surface.

Footnotes

  1. There may be other applications where tebibyte-sized images are worth supporting. I just don’t think this is one of those applications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFE 🎁 Request for Enhancement, i.e. a feature request
Development

No branches or pull requests

2 participants