Severity: major. The documented default ("uses default key if not specified") fails for every user with default-key in gpg.conf.
What happens.getDefaultGPGKey runs gpgconf --list-options gpg and takes field 10 of the default-key line as the key ID. gpgconf encodes a string value with a leading " and percent-escaping (gpgconf(1), the "value" field), so the ID is "ABCD... and gpg rejects it.
# gpg.conf holds the line: default-key 56163D7F3FAFF709608855BEC1A360216D007F41
SB_UNLOCK_PASSPHRASE=x secret unlocker add pgp
# Using default GPG key: "56163D7F3FAFF709608855BEC1A360216D007F41
# Error: failed to resolve GPG key fingerprint: invalid GPG key ID: invalid GPG key ID format: "56163D7F...
Without default-key in gpg.conf the fallback (first secret key) works, and --keyid works.
Correct behaviour.--help and the README say the default GPG key is used when --keyid is not given. Decode the value as gpgconf documents it: drop the leading " and percent-decode.
Definition of done
With default-key set in gpg.conf, secret unlocker add pgp uses that key.
A unit test feeds a default-key:...:"KEYID line through the parser and fails before the fix.
Model: fable-5-1
Severity: major. The documented default ("uses default key if not specified") fails for every user with `default-key` in `gpg.conf`.
**What happens.** `getDefaultGPGKey` runs `gpgconf --list-options gpg` and takes field 10 of the `default-key` line as the key ID. gpgconf encodes a string value with a leading `"` and percent-escaping (gpgconf(1), the "value" field), so the ID is `"ABCD...` and gpg rejects it.
```
# gpg.conf holds the line: default-key 56163D7F3FAFF709608855BEC1A360216D007F41
SB_UNLOCK_PASSPHRASE=x secret unlocker add pgp
# Using default GPG key: "56163D7F3FAFF709608855BEC1A360216D007F41
# Error: failed to resolve GPG key fingerprint: invalid GPG key ID: invalid GPG key ID format: "56163D7F...
```
Without `default-key` in `gpg.conf` the fallback (first secret key) works, and `--keyid` works.
**Where.** https://git.eeqj.de/sneak/secret/src/commit/ef0ae90768c8b18a829033b3ebd4cf98fcaeb3d1/internal/cli/unlockers.go#L76-L78.
**Correct behaviour.** `--help` and the README say the default GPG key is used when `--keyid` is not given. Decode the value as gpgconf documents it: drop the leading `"` and percent-decode.
**Definition of done**
- With `default-key` set in `gpg.conf`, `secret unlocker add pgp` uses that key.
- A unit test feeds a `default-key:...:"KEYID` line through the parser and fails before the fix.
Model: fable-5-1
sneak
was assigned by clawbot2026-10-13 00:30:19 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Severity: major. The documented default ("uses default key if not specified") fails for every user with
default-keyingpg.conf.What happens.
getDefaultGPGKeyrunsgpgconf --list-options gpgand takes field 10 of thedefault-keyline as the key ID. gpgconf encodes a string value with a leading"and percent-escaping (gpgconf(1), the "value" field), so the ID is"ABCD...and gpg rejects it.Without
default-keyingpg.confthe fallback (first secret key) works, and--keyidworks.Where.
Correct behaviour.
--helpand the README say the default GPG key is used when--keyidis not given. Decode the value as gpgconf documents it: drop the leading"and percent-decode.Definition of done
default-keyset ingpg.conf,secret unlocker add pgpuses that key.default-key:...:"KEYIDline through the parser and fails before the fix.Model: fable-5-1