getsops / sops

Simple and flexible tool for managing secrets
https://getsops.io/
Mozilla Public License 2.0
16.58k stars 865 forks source link

pgp: don't shorten key fingerprints #1522

Open tilpner opened 3 months ago

tilpner commented 3 months ago

As @mammothbane already identified in #1365, the pgp module is stripping the trailing exclamation mark from fingerprints that pgp uses to identify specific subkeys. Because the shortened fingerprint refers to the whole key instead of just the subkey, I can't decrypt any secrets I encrypt for that subkey.

According to the doc comment, this was meant for compatibility with older GPG versions. I don't know which incompatibilities @hiddeco was referring to here, or if they are still relevant.

https://github.com/getsops/sops/blob/1c46d2492192cc55bc33baf6b9b78889fe3e795a/pgp/keysource.go#L633-L635

Fixes #1365