Page MenuHome GnuPG

Key creation problem with 2.1.16 (passphrase param)
Open, NormalPublic

Description

https://lists.gnupg.org/pipermail/gnupg-devel/2016-November/032235.html

after key creation, which usually succeeds, gpg.exe sometimes returns
error number 2, which looks like a bug.

https://lists.gnupg.org/pipermail/gnupg-devel/2016-December/032339.html

P.S.: Maybe I finally got it!

For unattended key creation you're allowed to add the passphrase to the
parameter file defined with the --gen-key command. That's what the
manual https://www.gnupg.org/documentation/manuals/gnupg.pdf tells us at
page 84 and what works with v1.4.

Passphrase: string
If you want to specify a passphrase for the secret key, enter it here.
Default is to use the Pinentry dialog to ask for a passphrase.

But with v2.1 it looks as if you nevertheless have to add a --passphrase
parameter. Otherwise the command aborts with an error 2. It looks as if
the passphrase in the file is used only for key creation but not for key
data retrieval, which happens afterwards. That's where it complains
about the missing passphrase input.

I don't know why the gen-key command still succeeds every now and then
even with a missing --passphrase parameter. Either a miracle, or that
happens when the passphrase is in the cache, which I love so much for
the confusion I expect it can cause.

Event Timeline

neal set External Link to https://lists.gnupg.org/pipermail/gnupg-devel/2016-November/032235.html.
neal added a subscriber: neal.

Workaround is to use --passphrase

werner renamed this task from Key creation problem with 2.1.16 to Key creation problem with 2.1.16 (passphrase cache).Mar 2 2017, 8:24 PM
werner renamed this task from Key creation problem with 2.1.16 (passphrase cache) to Key creation problem with 2.1.16 (passphrase param).