core: Parse skipped_v3_keys

* src/gpgme.h.in (gpgme_import_result_t): Extend with skipped_v3_keys.
* src/import.c (gpgme_op_import_result): Extend debug with new field.
(parse_import_res): Parse skipped_v3_keys.
* tests/gpg/t-support.h, tests/run-support.h (print_import_result):
Print skipped_v3_keys.

--
This makes it possible to handle this in a GUI in a future
version.

GnuPG-Bug-Id: T3776
This commit is contained in:
Andre Heinecke 2018-03-15 15:58:32 +01:00
parent e846c3daee
commit a630a1e3e7
No known key found for this signature in database
GPG Key ID: 2978E9D40CBABA5C
5 changed files with 19 additions and 7 deletions

2
NEWS
View File

@ -3,10 +3,10 @@ Noteworthy changes in version 1.10.1 (unreleased)
* Interface changes relative to the 1.10.0 release: * Interface changes relative to the 1.10.0 release:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gpgme_import_result_t EXTENDED: New field 'skipped_v3_keys'
cpp: Key::locate NEW. cpp: Key::locate NEW.
cpp: Data::toString NEW. cpp: Data::toString NEW.
Noteworthy changes in version 1.10.0 (2017-12-12) Noteworthy changes in version 1.10.0 (2017-12-12)
------------------------------------------------- -------------------------------------------------

View File

@ -1637,6 +1637,9 @@ struct _gpgme_op_import_result
/* Number of keys not imported. */ /* Number of keys not imported. */
int not_imported; int not_imported;
/* Number of v3 keys skipped. */
int skipped_v3_keys;
/* List of keys for which an import was attempted. */ /* List of keys for which an import was attempted. */
gpgme_import_status_t imports; gpgme_import_status_t imports;
}; };

View File

@ -94,8 +94,9 @@ gpgme_op_import_result (gpgme_ctx_t ctx)
TRACE_LOG3 ("%i secret keys, %i imported, %i unchanged", TRACE_LOG3 ("%i secret keys, %i imported, %i unchanged",
opd->result.secret_read, opd->result.secret_imported, opd->result.secret_read, opd->result.secret_imported,
opd->result.secret_unchanged); opd->result.secret_unchanged);
TRACE_LOG2 ("%i skipped new keys, %i not imported", TRACE_LOG3 ("%i skipped new keys, %i not imported, %i v3 skipped",
opd->result.skipped_new_keys, opd->result.not_imported); opd->result.skipped_new_keys, opd->result.not_imported,
opd->result.skipped_v3_keys);
impstat = opd->result.imports; impstat = opd->result.imports;
i = 0; i = 0;
@ -212,6 +213,10 @@ parse_import_res (char *args, gpgme_import_result_t result)
PARSE_NEXT (result->secret_unchanged); PARSE_NEXT (result->secret_unchanged);
PARSE_NEXT (result->skipped_new_keys); PARSE_NEXT (result->skipped_new_keys);
PARSE_NEXT (result->not_imported); PARSE_NEXT (result->not_imported);
if (args && *args)
{
PARSE_NEXT (result->skipped_v3_keys);
}
return 0; return 0;
} }

View File

@ -196,7 +196,8 @@ print_import_result (gpgme_import_result_t r)
" secret imported: %d\n" " secret imported: %d\n"
" secret unchanged: %d\n" " secret unchanged: %d\n"
" skipped new keys: %d\n" " skipped new keys: %d\n"
" not imported: %d\n", " not imported: %d\n"
" skipped v3 keys: %d\n",
r->considered, r->considered,
r->no_user_id, r->no_user_id,
r->imported, r->imported,
@ -210,6 +211,7 @@ print_import_result (gpgme_import_result_t r)
r->secret_imported, r->secret_imported,
r->secret_unchanged, r->secret_unchanged,
r->skipped_new_keys, r->skipped_new_keys,
r->not_imported); r->not_imported,
r->skipped_v3_keys);
} }

View File

@ -177,7 +177,8 @@ print_import_result (gpgme_import_result_t r)
" secret imported: %d\n" " secret imported: %d\n"
" secret unchanged: %d\n" " secret unchanged: %d\n"
" skipped new keys: %d\n" " skipped new keys: %d\n"
" not imported: %d\n", " not imported: %d\n"
" skipped v3 keys: %d\n",
r->considered, r->considered,
r->no_user_id, r->no_user_id,
r->imported, r->imported,
@ -191,6 +192,7 @@ print_import_result (gpgme_import_result_t r)
r->secret_imported, r->secret_imported,
r->secret_unchanged, r->secret_unchanged,
r->skipped_new_keys, r->skipped_new_keys,
r->not_imported); r->not_imported,
r->skipped_v3_keys);
} }