Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Team function for importing a public key with sync (or via updates) is broken #2762

Open
jensklose opened this issue Jan 9, 2024 · 0 comments
Assignees
Labels
bug Defects

Comments

@jensklose
Copy link

Summary

Failed to decode public key user@email.address: public key "user@email.address" not found
A new recipient that was added with gopass and his public key is already provided in the key folder can not be imported with gopass sync.

Steps To Reproduce

  • load a public key from keyserver gpg --search-keys user@email.address
  • add the new user to a store as recipient gopass recipients add user@email.address
  • answer the questions in a proper way
  • check that the success like:
Reencrypting existing secrets. This may take some time ...
Starting reencrypt
] 75 / 75 [Goooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooopass] 100.00%

Added 1 recipients
You need to run 'gopass sync' to push these changes
  • delete the gpg key from your local keyring: gpg --delete-key user@email.address
  • check that the gpg key is not in your local keyring gpg -k user@email.address
    - gopass sync error message:
[luna]
   gitfs pull and push ... OK (no changes)❌ Failed to decode public key user@email.address: public key "user@email.address" not found
   done

Expected behavior

Gopass should, like in the past, ask me if I want to import the new key.

Environment

  • OS: Ubuntu 22.04
  • OS version: Linux dea399yw 5.15.90.1-microsoft-standard-WSL2 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
  • gopass Version: gopass 1.15.11 go1.21.4 linux amd64
  • Installation method: gopass repo, download

Additional context

I did a little more research and found out the following:

  • the new recipient was added with the email (UID) in the root folder .gpg-id
  • the public key added with the short version of the keyId in the .public-keys folder

This seems the to be the root cause. By the way, it should always be the ID, because the UID is not unique enough.

The not matching behavior is also visible in the recipient list after adding the user. Then there is a blanc line, but with a number in front.

[ 3] 0xCBE8D00CAAAAAAA - Some User <some@user.com>
[ 4]
[ 5] 0x72E598CF2AAAAAAA - Other User <other@user.com>
@dominikschulz dominikschulz added the bug Defects label Jan 13, 2024
@dominikschulz dominikschulz self-assigned this Jan 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Defects
Projects
None yet
Development

No branches or pull requests

2 participants