540 Commits

Author SHA1 Message Date
Morten Linderud
a53a6ba59c Merge branch 'morten/fix-esp'
* morten/fix-esp:
  fix esp detection with multiple mountpoints and failing udev info
2024-08-16 22:17:27 +02:00
Morten Linderud
32f8838905 Merge branch 'morten/fix-signing'
* morten/fix-signing:
  sbctl: ensure output is correct before using saved entry
  keys: ensure we compare the input/output files
  sbctl: always enroll files before we do signing operations
2024-08-16 22:17:01 +02:00
Morten Linderud
a70e461849 sbctl: ensure output is correct before using saved entry
Fixes: https://github.com/Foxboron/sbctl/issues/354

Signed-off-by: Morten Linderud <morten@linderud.pw>
2024-08-16 22:16:31 +02:00
Morten Linderud
935d7f5011 keys: ensure we compare the input/output files
We only used the path for this instead of comparing the authenticode
hashes.

Signed-off-by: Morten Linderud <morten@linderud.pw>
2024-08-16 22:16:29 +02:00
Morten Linderud
6eea63410c sbctl: always enroll files before we do signing operations
Signed-off-by: Morten Linderud <morten@linderud.pw>
2024-08-16 22:16:28 +02:00
Morten Linderud
2669fe9855 Merge remote-tracking branch 'origin/pull/363'
* origin/pull/363:
  Update staticcheck
  Allow exporting keys without efivars again
2024-08-16 22:15:03 +02:00
Cornelius Hoffmann
076034f406 Update staticcheck
switch to errors.New() for error messages without formatting to avoid this lint error:

> printf-style function with dynamic format string and no further arguments should use print-style function instead (SA1006)
2024-08-15 10:03:38 +02:00
Cornelius Hoffmann
825edf20ef Allow exporting keys without efivars again
Closes https://github.com/Foxboron/sbctl/issues/364
2024-08-15 10:03:36 +02:00
Morten Linderud
55ab027417 update staticcheck and fix gh upload
Signed-off-by: Morten Linderud <morten@linderud.pw>
2024-08-13 00:10:06 +02:00
Morten Linderud
436750b6a4 fix esp detection with multiple mountpoints and failing udev info
Fixes: https://github.com/Foxboron/sbctl/issues/207

Signed-off-by: Morten Linderud <morten@linderud.pw>
2024-08-11 15:45:24 +02:00
Morten Linderud
237ac778b3 Merge remote-tracking branch 'origin/pull/350'
* origin/pull/350:
  sbctl.8: fix typo in the man page
2024-08-05 19:22:07 +02:00
Lena
bf194cbcc9 sbctl.8: fix typo in the man page
The RSA key size is 4096, not 4098.
2024-08-05 18:46:33 +02:00
Morten Linderud
147d522bfe sbctl: fixup docs and some comments
The man page still had some /usr/share mentions

Signed-off-by: Morten Linderud <morten@linderud.pw>
2024-08-05 15:26:08 +02:00
Morten Linderud
d5bbe94b4a Merge remote-tracking branch 'origin/pull/344'
* origin/pull/344:
  bundles: disable landlock
  sign: ensure we are getting RW/RO access for the files
  lsm: Implement TruncFile
2024-08-05 14:50:29 +02:00
Morten Linderud
ff7daddd01 update go-uefi
Signed-off-by: Morten Linderud <morten@linderud.pw>
2024-08-05 14:50:13 +02:00
Morten Linderud
ff13e7c2cb sbctl: buble up error with sign-all
Signed-off-by: Morten Linderud <morten@linderud.pw>
2024-08-04 15:32:24 +02:00
Morten Linderud
3aaf00178d Merge remote-tracking branch 'origin/pull/342'
* origin/pull/342:
  sbctl: Fix human readable output being printed when using --json
2024-08-02 22:01:31 +02:00
Morten Linderud
625d396af1 Merge remote-tracking branch 'origin/pull/341'
* origin/pull/341:
  91-sbctl.install: Unconditionally remove file from database
2024-08-02 22:01:28 +02:00
Morten Linderud
e200257969 bundles: disable landlock
Signed-off-by: Morten Linderud <morten@linderud.pw>
2024-08-02 22:00:23 +02:00
Morten Linderud
0dcec78956 sign: ensure we are getting RW/RO access for the files
Signed-off-by: Morten Linderud <morten@linderud.pw>
2024-08-02 21:49:57 +02:00
Andrew Gunnerson
605f6fa0ef sbctl: Fix human readable output being printed when using --json
`PersistentPreRun` was being overwritten later in `main()`, causing
`logging.PrintOff()` to never be called.

Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2024-08-01 11:07:08 -04:00
Morten Linderud
34544d737d lsm: Implement TruncFile
We need RWFile access + O_TRUNC access

Signed-off-by: Morten Linderud <morten@linderud.pw>
2024-08-01 12:53:03 +02:00
Andrew Gunnerson
884d848112 91-sbctl.install: Unconditionally remove file from database
This partially undoes 5106d1ef8a, but
avoids that problem by ignoring non-zero exit statuses from
`sbctl remove-file`. That commit stopped the script from failing when
uninstalling a kernel where the UKI wasn't in sbctl's database. However,
it causes the UKI to never be removed from the database if UKI removal
is done by a script that runs before `91-sbctl.install`.

This is the case with systemd-ukify's `60-ukify.install` and systemd's
`90-uki-copy.install`. By the time that `91-sbctl.install` runs during
kernel removal, `90-uki-copy.install` will have already deleted the UKI.

Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2024-07-31 19:45:05 -04:00
Morten Linderud
48a3109c7f sbctl: include db_additions inn config file
Signed-off-by: Morten Linderud <morten@linderud.pw>
2024-07-31 23:40:06 +02:00
Morten Linderud
de3aafc873 setup: gate setup and check for keydir
We don't need to run --migrate if there is no sbctl installed, so check
that first and then check the keydir if there is something there
already.

Signed-off-by: Morten Linderud <morten@linderud.pw>
2024-07-31 19:53:41 +02:00