summaryrefslogtreecommitdiffstats
path: root/g10/packet.h
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2018-06-07 17:22:58 +0200
committerWerner Koch <wk@gnupg.org>2018-06-07 17:22:58 +0200
commit26bce2f01d2029ea2b8a8dbbe36118e3c83c5cba (patch)
tree553588a09643847955b5a499cb10ef9e6210b715 /g10/packet.h
parentgpg: Improve verbose output during import. (diff)
downloadgnupg2-26bce2f01d2029ea2b8a8dbbe36118e3c83c5cba.tar.xz
gnupg2-26bce2f01d2029ea2b8a8dbbe36118e3c83c5cba.zip
gpg: Fix import's repair-key duplicate signature detection.
* g10/packet.h (PKG_siganture): Add field 'help_counter'. * g10/key-check.c (sig_comparison): Take care of HELP_COUNTER. (key_check_all_keysigs): De-duplicate on a per-block base. -- The key_check_all_keysigs first does a detection of duplicate signature. This is done over all signatures at once. The problem here is for example: key uid_1 sig_uid_1.1 sig_uid_1.2 subkey_1 sig_sub_1.1 subkey_2 sig_sub_2.1 sig_sub_2.2 (duplicate of sig_sub_1.1) Now the de-duplication deletes the first signature and keeps the second. That works in most cases for foreign signature on userids but in the above constellation the code simply removes sig_sub_1.1 so that subkey_1 has no binding signature anymore. In a later step during import the missing binding is detected and subkey_1 is removed because it is not anymore valid. The sig_sub_2.2 will also be removed later because it does not check out for subkey_2 (that is as expected). The fix is to let the de-duplication work only on blocks (ie. within the signatures of a user id or a subkey). This will not detect all duplicates but that does not harm because later steps will detect and remove them. In the above case (with this patch applied) the second phase of key_check_all_keysigs will reorder key signatures and move the duplicate sig_sub_2.2 directly after sig_sub_1.1. This duplicates the signature and for cleanness we should kick the de-duplication process again. This will be done with a followup patch. GnuPG-bug-id: 3994 Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to '')
-rw-r--r--g10/packet.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/g10/packet.h b/g10/packet.h
index e8397eaee..40a8c4bf6 100644
--- a/g10/packet.h
+++ b/g10/packet.h
@@ -234,6 +234,7 @@ typedef struct
const byte *trust_regexp;
struct revocation_key *revkey;
int numrevkeys;
+ int help_counter; /* Used internally bu some fucntions. */
pka_info_t *pka_info; /* Malloced PKA data or NULL if not
available. See also flags.pka_tried. */
char *signers_uid; /* Malloced value of the SIGNERS_UID