aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Heinecke <[email protected]>2018-03-15 14:58:32 +0000
committerAndre Heinecke <[email protected]>2018-03-15 15:23:18 +0000
commita630a1e3e74c926163864b013cb164b4cd1866fc (patch)
treea3bcae0322c81ff5be44893ceef3072e7fe21821
parentdocs: TODO (diff)
downloadgpgme-a630a1e3e74c926163864b013cb164b4cd1866fc.tar.gz
gpgme-a630a1e3e74c926163864b013cb164b4cd1866fc.zip
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
-rw-r--r--NEWS2
-rw-r--r--src/gpgme.h.in3
-rw-r--r--src/import.c9
-rw-r--r--tests/gpg/t-support.h6
-rw-r--r--tests/run-support.h6
5 files changed, 19 insertions, 7 deletions
diff --git a/NEWS b/NEWS
index 1a342b18..c172697c 100644
--- a/NEWS
+++ b/NEWS
@@ -3,10 +3,10 @@ Noteworthy changes in version 1.10.1 (unreleased)
* Interface changes relative to the 1.10.0 release:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ gpgme_import_result_t EXTENDED: New field 'skipped_v3_keys'
cpp: Key::locate NEW.
cpp: Data::toString NEW.
-
Noteworthy changes in version 1.10.0 (2017-12-12)
-------------------------------------------------
diff --git a/src/gpgme.h.in b/src/gpgme.h.in
index ff80023e..73f2c94c 100644
--- a/src/gpgme.h.in
+++ b/src/gpgme.h.in
@@ -1637,6 +1637,9 @@ struct _gpgme_op_import_result
/* Number of keys not imported. */
int not_imported;
+ /* Number of v3 keys skipped. */
+ int skipped_v3_keys;
+
/* List of keys for which an import was attempted. */
gpgme_import_status_t imports;
};
diff --git a/src/import.c b/src/import.c
index 386ca722..f0d9d9fa 100644
--- a/src/import.c
+++ b/src/import.c
@@ -94,8 +94,9 @@ gpgme_op_import_result (gpgme_ctx_t ctx)
TRACE_LOG3 ("%i secret keys, %i imported, %i unchanged",
opd->result.secret_read, opd->result.secret_imported,
opd->result.secret_unchanged);
- TRACE_LOG2 ("%i skipped new keys, %i not imported",
- opd->result.skipped_new_keys, opd->result.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_v3_keys);
impstat = opd->result.imports;
i = 0;
@@ -212,6 +213,10 @@ parse_import_res (char *args, gpgme_import_result_t result)
PARSE_NEXT (result->secret_unchanged);
PARSE_NEXT (result->skipped_new_keys);
PARSE_NEXT (result->not_imported);
+ if (args && *args)
+ {
+ PARSE_NEXT (result->skipped_v3_keys);
+ }
return 0;
}
diff --git a/tests/gpg/t-support.h b/tests/gpg/t-support.h
index f6dec682..ef5766a3 100644
--- a/tests/gpg/t-support.h
+++ b/tests/gpg/t-support.h
@@ -196,7 +196,8 @@ print_import_result (gpgme_import_result_t r)
" secret imported: %d\n"
" secret unchanged: %d\n"
" skipped new keys: %d\n"
- " not imported: %d\n",
+ " not imported: %d\n"
+ " skipped v3 keys: %d\n",
r->considered,
r->no_user_id,
r->imported,
@@ -210,6 +211,7 @@ print_import_result (gpgme_import_result_t r)
r->secret_imported,
r->secret_unchanged,
r->skipped_new_keys,
- r->not_imported);
+ r->not_imported,
+ r->skipped_v3_keys);
}
diff --git a/tests/run-support.h b/tests/run-support.h
index 6a2170b0..6c713a9a 100644
--- a/tests/run-support.h
+++ b/tests/run-support.h
@@ -177,7 +177,8 @@ print_import_result (gpgme_import_result_t r)
" secret imported: %d\n"
" secret unchanged: %d\n"
" skipped new keys: %d\n"
- " not imported: %d\n",
+ " not imported: %d\n"
+ " skipped v3 keys: %d\n",
r->considered,
r->no_user_id,
r->imported,
@@ -191,6 +192,7 @@ print_import_result (gpgme_import_result_t r)
r->secret_imported,
r->secret_unchanged,
r->skipped_new_keys,
- r->not_imported);
+ r->not_imported,
+ r->skipped_v3_keys);
}