Érico Rolim
3825a49373
Add CI via GitHub actions.
...
Arch and Void containers, initially.
2020-11-08 14:57:17 -03:00
Morten Linderud
d38b9fb122
Merge branch 'pr-35'
2020-11-08 13:35:20 +01:00
Dan Bond
8264a3e370
add staticcheck linter
2020-11-08 10:20:56 +00:00
Morten Linderud
995f61fd22
Merge branch 'pr-29'
2020-10-27 20:13:31 +01:00
Patrick Wicki
a7fd415445
main: Pass flag to all GenerateAllBundles calls
...
If bundles are generated from within signAllCmd(), it's safe to assume
that whoever called it wants the bundles to be signed too, so we pass
true.
2020-10-27 18:31:19 +01:00
Patrick Wicki
2d6238b6d9
sbctl: Implement optional signing via the -s flag
2020-10-27 18:29:31 +01:00
Modelmat
fda4f2c1ef
Use // for comments instead of #
...
Signed-off-by: Morten Linderud <morten@linderud.pw>
2020-09-19 12:48:07 +02:00
Modelmat
bff94d69c6
Replace $ prompt with # prompt for root commands
2020-09-19 20:32:59 +10:00
Morten Linderud
c7940e6000
Ensure we always turn off colors when sbctl exits
...
Signed-off-by: Morten Linderud <morten@linderud.pw>
2020-08-22 12:37:55 +02:00
Morten Linderud
dd98165fa1
Split out GetColor declerations
...
Signed-off-by: Morten Linderud <morten@linderud.pw>
2020-08-22 12:37:34 +02:00
Érico Rolim
2b09a8e645
Change PrintGenerateError signature.
...
This avoid boilerplate calls to fmt.Sprintf in the main code.
2020-07-25 18:12:42 +02:00
Érico Rolim
70976394cd
Add more error propagation to bundle generation.
...
Centralize printing error messages in the functions that generate said errors.
2020-07-25 18:12:41 +02:00
Érico Rolim
ed103661f0
Create PrintGenerateError and use it where possible.
...
It's a function for generating an error from a message and still
printing it. Helps in avoiding duplication.
2020-07-25 18:12:41 +02:00
Érico Rolim
e3d74411cd
Propagate errors through SignFile, GenerateBundle.
...
This allows the application to try and sign as many files as it can, as
well as generate as many bundles as possible, but still exit with an
exit code different from 0. SignFile would exit the application before
signing other files, while GenerateBundle would fail without reporting
it in the exit code.
2020-07-25 18:12:41 +02:00
Morten Linderud
5adc3cbafb
Merge pull request #21 from ericonr/remove
...
main: verify if files exist before removing them.
2020-07-25 18:11:00 +02:00
Érico Rolim
42bbea1822
main: verify if files exist before removing them.
...
Errors out if trying to remove-file or remove-bundle a file that isn't
in the database. Needs a better log message format.
2020-07-23 16:48:02 -03:00
Morten Linderud
9a16a81e5f
Merge pull request #11 from ericonr/doc
...
Update docs
2020-07-13 21:39:05 +02:00
Érico Rolim
4aa03109c4
Mention conversion into absolute paths in manual.
2020-07-13 16:28:37 -03:00
Morten Linderud
6c460938aa
Merge pull request #15 from ericonr/fixes
...
Fix SignFile and VerifyESP
2020-07-10 12:54:47 +02:00
Érico Rolim
2ce0f00f1c
sbctl: Warn user about file not existing.
...
This fixes an error where `sbctl verify` would claim that a file wasn't
signed when, in fact, it didn't exist.
2020-07-09 23:49:44 -03:00
Érico Rolim
7992e9feec
keys: use the correct verification in SignFile.
...
To be able to skip signing a file, we need to:
- Verify that the output is signed; AND
- Verify that the original file hasn't changed (via cksum)
This fixes an error where if you deleted the signed file from the
system, `sbctl verify` could see that the file wasn't signed (even if
the correct error would be that it didn't exist), but `sbctl sign-all`
would claim that it was already signed.
2020-07-09 23:49:16 -03:00
Morten Linderud
82a0bcaf88
sbctl: forgot ChecksumFile
...
Signed-off-by: Morten Linderud <morten@linderud.pw>
2020-07-10 00:52:58 +02:00
Morten Linderud
d397102738
sbctl: Ensure we check if original file exists before signing
...
Signed-off-by: Morten Linderud <morten@linderud.pw>
2020-07-09 16:19:05 +02:00
Morten Linderud
10a1bcc7cd
sbctl: Ensure we store checksum whenever files are signed
...
Signed-off-by: Morten Linderud <morten@linderud.pw>
2020-07-09 16:18:53 +02:00
Morten Linderud
d03440ae4c
sbctl: Add original file checksums so we know when they changed
...
Signed-off-by: Morten Linderud <morten@linderud.pw>
2020-07-09 16:07:53 +02:00
Morten Linderud
d95ff9a2fd
sbctl: Remove bundle code duplication
...
Signed-off-by: Morten Linderud <morten@linderud.pw>
2020-07-09 15:56:38 +02:00
Morten Linderud
39f77294a8
sbctl: Ensure we run filepath.Abs on all paths
...
Signed-off-by: Morten Linderud <morten@linderud.pw>
2020-07-09 15:56:11 +02:00
Érico Rolim
be707e7761
Update README with current command output.
...
- Update options in sbctl usage:
- add remove-file
- rename verify-esp to verify
- Remove Output line from list-files for signed files that replace the
original.
2020-06-24 03:10:29 -03:00
Érico Rolim
22ed72c11a
Add list-files command to manual.
2020-06-24 03:10:03 -03:00
Morten Linderud
7de0523a6a
Merge pull request #9 from ericonr/move
...
Create cmd/sbctl, move main.go there.
2020-06-21 22:08:31 +02:00
Érico Rolim
eb4bbaf84e
Create cmd/sbctl, move main.go there.
...
This allows a user or developer to build and install the command with:
- go build ./cmd/sbctl; and
- go install ./cmd/sbctl
Fixes #8
2020-06-21 16:21:56 -03:00
Morten Linderud
b0f8f6d1fe
Updates
...
Signed-off-by: Morten Linderud <morten@linderud.pw>
2020-06-21 15:50:32 +02:00
Morten Linderud
e69f770d20
Added push-aur target
...
Signed-off-by: Morten Linderud <morten@linderud.pw>
2020-06-14 15:39:55 +02:00
Morten Linderud
833e3e4338
Added better hook
...
Signed-off-by: Morten Linderud <morten@linderud.pw>
2020-06-14 15:38:24 +02:00
Morten Linderud
d30a0ced46
Merge pull request #4 from Tyilo/fish_completions
...
Add fish completions
2020-06-12 17:26:53 +02:00
Asger Hautop Drewsen
9a6398e097
Add fish completions
2020-06-12 15:52:06 +02:00
Morten Linderud
19322d2f0b
Merge pull request #3 from Tyilo/fix_go_sum
...
Fix go.sum
2020-06-12 15:34:44 +02:00
Asger Hautop Drewsen
d794c8c704
Fix go.sum
2020-06-12 15:24:37 +02:00
Morten Linderud
f6c1e805ea
Added short hands for KEK
...
Signed-off-by: Morten Linderud <morten@linderud.pw>
2020-06-12 00:13:38 +02:00
Morten Linderud
6251af874d
There was an attempt
...
Signed-off-by: Morten Linderud <morten@linderud.pw>
2020-06-11 19:22:42 +02:00
Morten Linderud
2d6dd7ad21
And some more
...
Signed-off-by: Morten Linderud <morten@linderud.pw>
2020-06-11 19:20:00 +02:00
Morten Linderud
8b2808214e
Plz go.sum
...
Signed-off-by: Morten Linderud <morten@linderud.pw>
2020-06-11 19:14:45 +02:00
Morten Linderud
b2defa2108
Fixed go.sum
...
Signed-off-by: Morten Linderud <morten@linderud.pw>
2020-06-11 19:12:13 +02:00
Morten Linderud
3279c9eed5
sbctl: Ensure we can also find gummiboot stub
...
Signed-off-by: Morten Linderud <morten@linderud.pw>
2020-06-08 19:08:43 +02:00
Morten Linderud
1833e6ac8a
sbctl: Ensure `verify` doesn't check signatures twice on files
...
Signed-off-by: Morten Linderud <morten@linderud.pw>
2020-06-08 18:43:29 +02:00
Morten Linderud
41a34ce897
sbctl: verify doesn't shell out to file
...
We can just peak at the two bytes. There isn't really any need to use
file here.
Signed-off-by: Morten Linderud <morten@linderud.pw>
2020-06-08 18:42:52 +02:00
Morten Linderud
2bf94555ba
cmd: add -g to sign-all to run generate-* sub-commands
...
Signed-off-by: Morten Linderud <morten@linderud.pw>
2020-06-07 15:30:12 +02:00
Morten Linderud
2c7b417b07
keys: ensure we are returning the UUID as a byte slice
...
Signed-off-by: Morten Linderud <morten@linderud.pw>
2020-06-07 15:29:58 +02:00
Morten Linderud
59a0e5ffd6
keys: Switch from uuidgen to google/uuid
...
Signed-off-by: Morten Linderud <morten@linderud.pw>
2020-06-07 00:00:45 +02:00
Morten Linderud
3f878c8206
Merge pull request #2 from epmills/patch-1
...
Fix sbsigntools typo in README
2020-06-05 00:31:57 +02:00