fix(gpg): Handle ECDH checksum error with many keys
authorShane Jaroch <chown_tee@proton.me>
Thu, 1 Jan 2026 04:35:15 +0000 (23:35 -0500)
committerShane Jaroch <chown_tee@proton.me>
Thu, 1 Jan 2026 07:33:39 +0000 (02:33 -0500)
commitbcb5f36b63467ebc5468c7136c637046f5df4448
tree74767dc4dbc955b8abb30f0050a1d3c98393c6f6
parent72f93b3c174010718c7575488b73e64ed2a2c125
fix(gpg): Handle ECDH checksum error with many keys

Allow PRIVDECRYPT to iterate all secret keys instead of failing on the
first checksum error.

Anonymous recipients caused a bug in prior versions (with ed25519 keys)
where if GPG couldn't decrypt using the first key in a user's keybox,
all push and pull operations would fail with a checksum error and exit
code 2 (EVEN IF the user had the correct key in their 2nd or 3rd slot).

The fix traps the 'error' and logs it, but lets PRIVDECRYPT continue.
The manifest's integrity is still verified by the subsequent grep.
If decryption truly fails, the script will exit safely.

Tested with GPG 2.4.8 / ed25519 keys.

Signed-off-by: Shane Jaroch <chown_tee@proton.me>
git-remote-gcrypt
tests/system-test-multikey.sh [new file with mode: 0644]