[PATCH] Support encrypting for PGP keys without subkeys

Axel Beckert abe at deuxchevaux.org
Thu Apr 13 18:39:26 UTC 2023


I'm trying to setup pass as team password storage shared and synced
via git.

When adding the keys of other team members via "pass init", I ran into
the problem that "pass init" did add the additional key id to .gpg-id,
but did not reencrypt all the files for the new key.

It all boiled down to that the variable gpg_keys is only filled with
keys which have subkeys. But one team member has a older PGP key
without a subkey.

While it might be no more good practice to generate PGP keys without
subkey, it's still a personal user decision or possibly historic
circumstance. So IMHO pass should also work with such keys.

So I came up with the attached patch which does not only filter the
list of target keys for subkeys but also for public keys. The
remainder seems to still work as intended: Having two keys with
subkeys and one without, there are not five key ids (pub and sub) in
gpg_keys but still only the expected three.

		Kind regards, Axel
PGP: 2FF9CD59612616B5      /~\  Plain Text Ribbon Campaign, http://arc.pasp.de/
Mail: abe at deuxchevaux.org  \ /  Say No to HTML in E-Mail and Usenet
Mail+Jabber: abe at noone.org  X
https://axel.beckert.ch/   / \  I love long mails: https://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Support-encrypting-for-PGP-keys-without-subkeys.patch
Type: text/x-diff
Size: 1332 bytes
Desc: not available
URL: <http://lists.zx2c4.com/pipermail/password-store/attachments/20230413/90559d7f/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.zx2c4.com/pipermail/password-store/attachments/20230413/90559d7f/attachment.sig>

More information about the Password-Store mailing list