Home GnuPG
Diffusion GnuPG 2f98d8a0f92d

agent: Appropriate error code for importing key with no passwd.

Description

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:
21ef425e222ddfa460b37dece63adb67ff2e4dd1

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>

Details

Provenance
gniibeAuthored on Jun 4 2021, 6:44 AM
Parents
rG8bd5172539e1: dirmngr: Remove useless code.
Branches
Unknown
Tags
Unknown