Keep unlocker list working when unlocker metadata is corrupt (closes #42)
check / check (push) Successful in 1m12s
check / check (push) Successful in 1m12s
PGPUnlocker.GetID() panicked when its metadata could not be read or parsed, which took down `secret unlocker list` for every unlocker. It now warns with the unlocker's directory and returns `pgp-unknown`; metadata with an empty GPG key ID counts as corrupt too. ListUnlockers now skips, with a warning, an unlocker whose metadata file cannot be checked for, read or parsed, as it already did for a missing one. The listing's ID lookup skips such a directory without warning again. This is the first half of the issue only. Passing the mnemonic in memory moved to #60. Model: opus-5-5 Co-authored-by: clawbot <sneak+clawbot@sneak.cloud>
This commit was merged in pull request #61.
This commit is contained in:
@@ -25,6 +25,12 @@ Bring the repo into policy compliance in one commit:
|
||||
|
||||
# Completed Steps
|
||||
|
||||
- 2026-10-04: A PGP unlocker whose metadata has no usable GPG key ID
|
||||
no longer panics: `GetID()` warns with the unlocker's directory and
|
||||
returns `pgp-unknown`. `ListUnlockers` skips, with a warning, an
|
||||
unlocker whose metadata file cannot be checked for, read or parsed
|
||||
instead of failing, so `secret unlocker list` still lists the others;
|
||||
the listing's ID lookup no longer warns about that directory again.
|
||||
- 2026-10-03: `secret mv` rejects a move whose destination is the
|
||||
source (`mv --force x x`, `mv --force work:x work:`, or an empty
|
||||
destination, which defaults to the source name) before changing
|
||||
@@ -160,8 +166,6 @@ Bring the repo into policy compliance in one commit:
|
||||
- Timing attacks: bytes.Equal passphrase compare (cli/init.go:
|
||||
209-216); non-constant-time public key compare (vault.go:95-100).
|
||||
- High priority:
|
||||
- Return errors instead of panicking on corrupted metadata
|
||||
(pgpunlocker.go:116, keychainunlocker.go:141).
|
||||
- Secure temporary file handling and cleanup.
|
||||
- Print cobra usage only for argument errors, not internal
|
||||
failures.
|
||||
|
||||
Reference in New Issue
Block a user