mirror of git://git.gnupg.org/gnupg.git
agent: Appropriate error code for importing key with no passwd.
* agent/cvt-openpgp.c (convert_from_openpgp_main): Return
GPG_ERR_BAD_SECKEY.
--
Backport master commit of:
21ef425e22
When non-protected case, error at gcry_pk_testkey results
GPG_ERR_BAD_PASSPHRASE. Here, it should be converted to
GPG_ERR_BAD_SECKEY, or else, user will be asked passwd even if it's
not protected.
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
8bd5172539
commit
2f98d8a0f9
|
@ -946,6 +946,8 @@ convert_from_openpgp_main (ctrl_t ctrl, gcry_sexp_t s_pgp, int dontcare_exist,
|
||||||
if (!is_protected)
|
if (!is_protected)
|
||||||
{
|
{
|
||||||
err = try_do_unprotect_cb (pi);
|
err = try_do_unprotect_cb (pi);
|
||||||
|
if (gpg_err_code (err) == GPG_ERR_BAD_PASSPHRASE)
|
||||||
|
err = gpg_error (GPG_ERR_BAD_SECKEY);
|
||||||
}
|
}
|
||||||
else if (cache_nonce)
|
else if (cache_nonce)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue