Commit Graph
19 Commits
Author SHA1 Message Date
Daan De Meyer decad4826d static-destruct: Reduce transitive includes 2025-05-07 22:04:46 +09:00
Daan De Meyer 401a22bfc1 tree-wide: Make sure all headers are standalone
Let's make sure all of our headers include everything they require.
2025-04-23 10:33:38 +02:00
Yu Watanabe a8d4be01f4 sbsign: rename WIN_CERTIFICATE -> WIN_CERTIFICATE_HEADER and drop trailing flexible array
To allow building sbsign with -Werror=flex-array-member-not-at-end.
2025-04-04 20:54:53 +09:00
Yu Watanabe b8358967e6 sbsign: trivial coding style cleanups
Follow-ups for 8c0098d486.
2025-02-28 04:04:18 +09:00
Daan De Meyer d9c7d47f99 Update TODO 2025-02-27 14:55:00 +01:00
Daan De Meyer 8c0098d486 sbsign: Add support for offline signing
Add new options --prepare-offline-signing, --signed-data= and
--signed-data-signature= which allow for offline signing in a
similar manner to pesign.
2025-02-27 13:47:07 +01:00
Daan De Meyer 6f3ef02067 sbsign: Split out functions and switch to lower level APIs
Preparation for adding offline signing support. Some additional
features and fixes are included as well:

- We make sure to add an empty SMIMECAP attribute instead of a populated
  one to mimick pesign more.
- We switch to PKCS7_dataFinal() instead of PKCS7_final() as all that the
  latter does is an unnecessary copy before calling PKCS7_dataFinal().
- We add support for passing in the signing time via $SOURCE_DATE_EPOCH.
2025-02-27 13:47:05 +01:00
Daan De Meyer f0372d5883 sbsign: Copy source to dest later
Preparation for later commit.
2025-02-27 10:03:42 +01:00
Daan De Meyer ba6a904442 sbsign: Fix wrong variable being passed to log_error_errno() 2025-02-27 09:49:03 +01:00
Daan De Meyer 66584a9335 sbsign: Don't set bit in SpcPeImageData->flags
Neither sbsign nor pesign set this flag in SpcPeImageData->flags,
which is about which resources should be included specifying "Which
portions of the Windows PE file are hashed." according to the
authenticode spec. However, this is followed by "Although flags is
always present, it is ignored when calculating the file hash for both
signing and verification purposes". So as it doesn't seem to do
anything useful and the other tools don't set any of these flags
either, let's follow suite and not set this flag ourselves either.
2025-02-22 01:05:25 +01:00
Daan De Meyer 6f594acd63 sbsign: Make sure output file mode respects umask 2025-01-20 10:06:11 +01:00
Daan De Meyer 7180a3b38c sbsign: Make two debug logs into error logs 2025-01-20 10:05:18 +01:00
Lennart Poettering d66894a7a5 ask-password-api: add new "hup_fd" field to AskPasswordReq
This new field allows specification of an fd on which the password
prompt logic will look for POLLHUP events for, and if seen will abort
the query.

The usecase for this is that when we query for a pw on behalf of a
Varlink client we can abort the query automatically if the client dies.
2025-01-02 16:38:44 +01:00
Lennart Poettering c4a02a526d ask-password-api: move timeout into AskPasswordRequest structure too 2025-01-02 16:38:25 +01:00
Lennart Poettering 72068d9d25 ask-password-api: move tty_fd into AskPasswordRequest structure, too 2025-01-02 16:38:12 +01:00
Antonio Alvarez Feijoo 2a310c0ad6 sbsign: remove unused --no-pager option 2024-11-12 17:52:48 +01:00
Daan De Meyer 4b1ad0398e Introduce systemd-keyutil to do various key/certificate operations
Let's gather generic key/certificate operations in a new tool
systemd-keyutil instead of spreading them across various special
purpose tools.

Fixes #35087
2024-11-08 15:00:21 +01:00
Daan De Meyer a1d46e3078 tree-wide: Introduce --certificate-source= option
This allows loading the X.509 certificate from an OpenSSL provider
instead of a file system path. This allows loading certficates directly
from hardware tokens instead of having to export them to a file on
disk first.
2024-11-07 20:30:47 +01:00
Zbigniew Jędrzejewski-Szmek 5ffff673ac Move systemd-sbsign to its own source subdirectory
It's already two files, and I expect that more will come. It's nicer to give
its own subdirectory to maintain consistent structure.
2024-11-07 14:51:43 +01:00