Home GnuPG
Diffusion GPGME 305d8668ca72

core: Detect bad passphrase error on certificate import

Description

core: Detect bad passphrase error on certificate import

* src/import.c (gpgme_op_import_result): Check fpr for NULL.
(parse_error): New.
(import_status_handler): Handle error status line.
* doc/gpgme.texi (gpgme_import_status_t): Mention that fpr can be NULL.
* tests/gpg/t-import.c (check_result): Check fpr for NULL.
* tests/run-threaded.c (delete_impres): Check fpr for NULL.

When importing an encrypted certificate a wrong passphrase may be
entered. In this case gpgsm emits a status line with a bad passphrase
error and an "invalid object" error. To make it possible for callers
to handle a wrong passphrase error more gracefully, an import status
with bad passphrase error is added to the import result for each
status line with bad passphrase error.

Details

Provenance
ikloeckerAuthored on Dec 22 2021, 12:13 PM
Parents
rM0636e229d7ed: build: Update for newer autoconf.
Branches
Unknown
Tags
Unknown
Tasks
T5713: Kleopatra: PKCS#12 Import no Error on bad passphrase