pstadler / keybase-gpg-github

Step-by-step guide on how to create a GPG key on keybase.io, adding it to a local GPG setup and using it with Git and GitHub.
2.64k stars 182 forks source link

gpg-agent --write-env-file obsolete #26

Closed lucymhdavies closed 5 years ago

lucymhdavies commented 6 years ago

Not sure when this happened, but running gpg-agent as per readme:

$ gpg-agent --daemon --write-env-file ~/.gnupg/.gpg-agent-info
gpg-agent[1389]: WARNING: "--write-env-file" is an obsolete option - it has no effect
$ gpg-agent --version
gpg-agent (GnuPG/MacGPG2) 2.2.3
libgcrypt 1.8.1
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Despite the fact that this is an obsolete option, the previously generated .gpg-agent-info file does work and does seem to be necessary.

i.e.

$ git commit --allow-empty -m "empty commit"

You need a passphrase to unlock the secret key for
user: "Lucy Davies <lucy@lucymhdavies.com>"
2048-bit RSA key, ID AB609F34, created 2016-10-20 (main key ID E334C5E2)

Enter passphrase:

vs

$ source ~/.gnupg/.gpg-agent-info
$ export GPG_AGENT_INFO
$ echo $GPG_AGENT_INFO
/Users/lucy/.gnupg/S.gpg-agent:1489:1
$ git commit --allow-empty -m "empty commit"

You need a passphrase to unlock the secret key for
user: "Lucy Davies <lucy@lucymhdavies.com>"
2048-bit RSA key, ID AB609F34, created 2016-10-20 (main key ID E334C5E2)

[master f357c8d] empty commit

Also, the use-standard-socket option is obsolete:

gpg-agent[8927]: /Users/lucy/.gnupg/gpg-agent.conf:1: obsolete option "use-standard-socket" - it has no effect

For now, until I can figure out how to use this newer version of gpg-agent, I've just got this in my bashrc:

# GPG agent
if test -f ~/.gnupg/.gpg-agent-info -a -n "$(pgrep gpg-agent)"; then
    # TODO: where does this 1489:1 come from?
    export GPG_AGENT_INFO=~/.gnupg/S.gpg-agent:1489:1
    GPG_TTY=$(tty)
    export GPG_TTY
else
    echo "Starting gpg-agent daemon"
    eval $(gpg-agent --daemon)
fi
pstadler commented 5 years ago

Closed with #33 I guess.

etd21 commented 2 years ago

how do you configure bashrc on windows?