keybase / keybase/client

pgp select fails when .gnupg is not in ~

Open
#12,968 1 comment 3 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
9.2k
Forks
1.3k
Avg merge
12h 58m
Merged PRs (30d)
56

Description

I have my `.gnupg` folder in `$HOME/.config` since that's the correct place to put config files (looking at you GNUPG.

When I tried to add my new PGP key keybase was having trouble finding the keys:
```
$ keybase pgp select
You are selecting a PGP key from your local GnuPG keychain, and
will publish a statement signed with this key to make it part of
your Keybase.io identity.

Note that GnuPG will prompt you to perform this signature.

You can also import the secret key to *local*, *encrypted* Keybase
keyring, enabling decryption and signing with the Keybase client.
To do that, use "--import" flag.

Learn more: keybase pgp help select

▶ ERROR No PGP keys available to choose from.
```
```
$ keybase pgp import -i pubkey.txt
▶ ERROR No secret key available
```

I was able to resolve this by symlinking `$HOME/.gnupg` -> `$HOME/.config/gnupg`

A more permanent fix for this should be as easy as checking if `$GNUPGHOME` exists and then looking around in there.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the implementation behind `keybase pgp select` and `keybase pgp import`, then trace how the client locates the local GnuPG keychain. Reproduce the failure with `.gnupg` under `$HOME/.config` and check handling of `$GNUPGHOME`; done means both commands find the expected keys without requiring a symlink.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.