g10: Clean keyblock on initial commit.

* g10/import.c (import_one): If option import-clean is set,
also clean on initial import, not only for merge.

Signed-off-by: Marcus Brinkmann <mb@g10code.com>
GnuPG-bug-id: 2401
This commit is contained in:
Marcus Brinkmann 2017-07-21 16:03:04 +02:00
parent d8a55da715
commit 609bbdf361
1 changed files with 5 additions and 0 deletions

View File

@ -1606,6 +1606,7 @@ import_one (ctrl_t ctrl,
else if (rc ) /* Insert this key. */
{
KEYDB_HANDLE hd;
int n_sigs_cleaned, n_uids_cleaned;
hd = keydb_new ();
if (!hd)
@ -1635,6 +1636,10 @@ import_one (ctrl_t ctrl,
}
}
if ((options & IMPORT_CLEAN))
clean_key (ctrl, keyblock, opt.verbose, (options&IMPORT_MINIMAL),
&n_uids_cleaned,&n_sigs_cleaned);
rc = keydb_insert_keyblock (hd, keyblock );
if (rc)
log_error (_("error writing keyring '%s': %s\n"),