mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
gpg: New import option "import-show".
* g10/options.h (IMPORT_SHOW): New. * g10/import.c (parse_import_options): Add "import-show". (import_one): Implement that. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
09c6f71351
commit
1e5959ec05
3 changed files with 28 additions and 3 deletions
23
g10/import.c
23
g10/import.c
|
@ -112,6 +112,9 @@ parse_import_options(char *str,unsigned int *options,int noisy)
|
|||
{"fast-import",IMPORT_FAST,NULL,
|
||||
N_("do not update the trustdb after import")},
|
||||
|
||||
{"import-show",IMPORT_SHOW,NULL,
|
||||
N_("show key during import")},
|
||||
|
||||
{"merge-only",IMPORT_MERGE_ONLY,NULL,
|
||||
N_("only accept updates to existing keys")},
|
||||
|
||||
|
@ -936,7 +939,7 @@ import_one (ctrl_t ctrl,
|
|||
import_screener_t screener, void *screener_arg)
|
||||
{
|
||||
PKT_public_key *pk;
|
||||
PKT_public_key *pk_orig;
|
||||
PKT_public_key *pk_orig = NULL;
|
||||
kbnode_t node, uidnode;
|
||||
kbnode_t keyblock_orig = NULL;
|
||||
byte fpr2[MAX_FINGERPRINT_LEN];
|
||||
|
@ -1050,6 +1053,22 @@ import_one (ctrl_t ctrl,
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* Get rid of deleted nodes. */
|
||||
commit_kbnode (&keyblock);
|
||||
|
||||
/* Show the key in the form it is merged or inserted. */
|
||||
if ((options & IMPORT_SHOW))
|
||||
{
|
||||
merge_keys_and_selfsig (keyblock);
|
||||
/* Note that we do not want to show the validity because the key
|
||||
* has not yet imported. */
|
||||
list_keyblock_direct (ctrl, keyblock, 0, 0, 1, 1);
|
||||
es_fflush (es_stdout);
|
||||
}
|
||||
|
||||
if (opt.dry_run)
|
||||
goto leave;
|
||||
|
||||
/* Do we have this key already in one of our pubrings ? */
|
||||
pk_orig = xmalloc_clear( sizeof *pk_orig );
|
||||
rc = get_pubkey_byfprint_fast (pk_orig, fpr2, fpr2len);
|
||||
|
@ -1258,7 +1277,7 @@ import_one (ctrl_t ctrl,
|
|||
keydb_release (hd); hd = NULL;
|
||||
}
|
||||
|
||||
leave:
|
||||
leave:
|
||||
if (mod_key || new_key || same_key)
|
||||
{
|
||||
/* A little explanation for this: we fill in the fingerprint
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue