I was able to set a passphrase to previously passphrase-less private key with
"passwd" command in --edit-key shell.
Now it is impossible to remove a passphrase the same way. I know it worked in
earlier releases.
$ gpg --edit-key andrey.utkin@decent.im
gpg (GnuPG) 2.1.16; Copyright (C) 2016 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Secret key is available.
sec rsa4096/98C4BB0899DBBA85
created: 2015-11-16 expires: never usage: SC trust: ultimate validity: ultimate
ssb rsa4096/8C77911D55D27C24
created: 2015-11-16 expires: never usage: E
[ultimate] (1). Andrey Utkin (Jabber) <andrey.utkin@decent.im>
gpg> passwd
Please enter the passphrase to unlock the OpenPGP secret key:
"Andrey Utkin (Jabber) <andrey.utkin@decent.im>"
4096-bit RSA key, ID 98C4BB0899DBBA85,
created 2015-11-16.
Passphrase:
gpg: key 98C4BB0899DBBA85/98C4BB0899DBBA85: error changing passphrase: No
passphrase given
Please enter the passphrase to unlock the OpenPGP secret key:
"Andrey Utkin (Jabber) <andrey.utkin@decent.im>"
4096-bit RSA key, ID 8C77911D55D27C24,
created 2015-11-16 (main key ID 98C4BB0899DBBA85).
Passphrase:
gpg: key 98C4BB0899DBBA85/8C77911D55D27C24: error changing passphrase: No
passphrase given
gpg> save
Key not changed so no update needed.
$ gpg --passwd andrey.utkin@decent.im
gpg (GnuPG) 2.1.16; Copyright (C) 2016 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Please enter the passphrase to unlock the OpenPGP secret key:
"Andrey Utkin (Jabber) <andrey.utkin@decent.im>"
4096-bit RSA key, ID 98C4BB0899DBBA85,
created 2015-11-16.
Passphrase:
gpg: key 98C4BB0899DBBA85/98C4BB0899DBBA85: error changing passphrase: No
passphrase given
Please enter the passphrase to unlock the OpenPGP secret key:
"Andrey Utkin (Jabber) <andrey.utkin@decent.im>"
4096-bit RSA key, ID 8C77911D55D27C24,
created 2015-11-16 (main key ID 98C4BB0899DBBA85).
Passphrase:
gpg: key 98C4BB0899DBBA85/8C77911D55D27C24: error changing passphrase: No
passphrase given
gpg: error changing the passphrase for 'andrey.utkin@decent.im': No passphrase given
This is quite embarrassing issue. I'd love to contribute a bunch of functional
tests for this and similar topics, but don't see a framework for such tests in
git repo, would appreciate some help with that.