gpg: Do not try the import fallback if the options are already used.
authorWerner Koch <wk@gnupg.org>
Tue, 9 Jul 2019 09:13:51 +0000 (11:13 +0200)
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Thu, 22 Aug 2019 19:11:59 +0000 (20:11 +0100)
* g10/import.c (import_one): Check options.

Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit 3c2cf5ea952015a441ee5701c41dadc63be60d87)

Gbp-Pq: Topic from-2.2.17
Gbp-Pq: Name gpg-Do-not-try-the-import-fallback-if-the-options-are-alr.patch

g10/import.c

index d509c8cfadacc109f0cfc1f0773be1f64f8d8b35..12f8f28fcdc2ae8d09547694d7d8ddffdd23861c 100644 (file)
@@ -2310,7 +2310,9 @@ import_one (ctrl_t ctrl,
                          from_sk, silent, screener, screener_arg,
                          origin, url, r_valid);
   if (gpg_err_code (err) == GPG_ERR_TOO_LARGE
-      && gpg_err_source (err) == GPG_ERR_SOURCE_KEYBOX)
+      && gpg_err_source (err) == GPG_ERR_SOURCE_KEYBOX
+      && ((options & (IMPORT_SELF_SIGS_ONLY | IMPORT_CLEAN))
+          != (IMPORT_SELF_SIGS_ONLY | IMPORT_CLEAN)))
     {
       /* We hit the maximum image length.  Ask the wrapper to do
        * everything again but this time with some extra options.  */