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

Wizard fails when there are no PGP keys #1693

Closed
AnomalRoil opened this issue Jan 8, 2021 · 2 comments · Fixed by #1699
Closed

Wizard fails when there are no PGP keys #1693

AnomalRoil opened this issue Jan 8, 2021 · 2 comments · Fixed by #1699
Assignees
Labels
bug Defects gpg GPG related ux User experience / User Interface related
Milestone

Comments

@AnomalRoil
Copy link
Member

Summary

Running gopass with no secret keys in the keystore will fail after successful key creation (with a custom passphrase, not even a prompt to use my own?!?):

anomalroil@TLD20:~$ gpg -K
anomalroil@TLD20:~$ gopass
It seems you are new to gopass. Do you want to run the onboarding wizard? [Y/n/q]: y
[init] Initializing a new password store ...
[init] [init] No useable crypto keys. Generating new key pair
[init] [init] [crypto] Key generation may take up to a few minutes
[init] [init] [crypto] Creating key pair ...
[init] [init] [crypto] WARNING: We are about to generate some GPG keys.
[init] [init] [crypto] However, the GPG program can sometimes lock up, displaying the following:
"We need to generate a lot of random bytes."
If this happens, please see the following tips:
https://github.com/gopasspw/gopass/blob/master/docs/entropy.md
What is your name? [anomalroil]: Testou
What is your email? []: test@test.com
Continue? [Y/n/q]: y
[init] [init] [crypto] -> OK
[init] [init] [crypto] Passphrase: many tingly maternal scenic

Error: failed to run onboarding wizard: failed to create new private key: failed to create a useable key pair

And yet it created the keypair:

anomalroil@TLD20:~$ gpg -K
gpg: checking the trustdb
gpg: marginals needed: 3  completes needed: 1  trust model: pgp
gpg: depth: 0  valid:   2  signed:   0  trust: 0-, 0q, 0n, 0m, 0f, 2u
/home/anomalroil/.gnupg/pubring.kbx
-----------------------------------
sec   rsa2048 2021-01-08 [SCEA]
      2C12748C437F7833CB53454DADE652F8C8984545
uid           [ultimate] Testou <test@test.com>
ssb   rsa2048 2021-01-08 [SEA]

And the next invocation of gopass works:

anomalroil@TLD20:~$ gopass
It seems you are new to gopass. Do you want to run the onboarding wizard? [Y/n/q]: y
[init] Initializing a new password store ...
[ 0] Local store
[ 1] Create a Team
[ 2] Join an existing Team

Select action [0]: 0
0
[init] [init] [local] Initializing your local store ...
Please select a private key for encrypting secrets:
[0] gpg - 0xADE652F8C8984545 - Testou <test@test.com>
Please enter the number of a key (0-0, [q]uit) [0]: 0
Please enter an email address for password store git config []: test@test.com
[init] [init] [local]  -> OK
[init] [init] [local] Configuring your local store ...
[init] [init] [local] Do you want to add a git remote? [y/N/q]: n
[init] [init] [local]  -> OK
gopass> quit

To reproduce, specify a new GNUPGHOME in an empty directory to have no private key:

$ mkdir ~/testou
$ GNUPGHOME=~/testou gopass
@AnomalRoil AnomalRoil added bug Defects gpg GPG related ux User experience / User Interface related labels Jan 8, 2021
@dominikschulz
Copy link
Member

There are only two hard things in Computer Science: cache invalidation and naming things.

This time it's cache invalidation.

dominikschulz added a commit to dominikschulz/gopass that referenced this issue Jan 12, 2021
Fixes gopasspw#1693

RELEASE_NOTES=[BUGFIX] Invalidate GPG key list after generation

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
@dominikschulz dominikschulz added this to the 1.10.2 milestone Jan 12, 2021
@dominikschulz dominikschulz self-assigned this Jan 12, 2021
@dominikschulz
Copy link
Member

Files #1698 for asking for a passphrase.

dominikschulz added a commit to dominikschulz/gopass that referenced this issue Jan 12, 2021
Fixes gopasspw#1693

RELEASE_NOTES=[BUGFIX] Invalidate GPG key list after generation

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
dominikschulz added a commit that referenced this issue Jan 12, 2021
Fixes #1693

RELEASE_NOTES=[BUGFIX] Invalidate GPG key list after generation

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
kpitt pushed a commit to kpitt/gopass that referenced this issue Jul 21, 2022
Fixes gopasspw#1693

RELEASE_NOTES=[BUGFIX] Invalidate GPG key list after generation

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Defects gpg GPG related ux User experience / User Interface related
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants