From 7f55ee83bb9a68b81f116f0bced70ff4e6cce848 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 27 Jul 2000 15:33:37 +0000 Subject: See ChangeLog: Thu Jul 27 17:33:04 CEST 2000 Werner Koch --- NEWS | 2 ++ THANKS | 1 + doc/gpg.sgml | 11 +++++++++++ g10/ChangeLog | 7 +++++++ g10/g10.c | 3 +++ g10/import.c | 20 ++++++++++++++++---- g10/options.h | 1 + 7 files changed, 41 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 175e52f51..e5ca648a1 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,8 @@ Noteworthy changes in the current CVS branch STABLE-BRANCH-1-0 to help the British folks to somewhat minimize the danger of this Orwellian RIP bill. + * New option --merge-only + Noteworthy changes in version 1.0.2 (2000-07-12) ---------------------------------------------- diff --git a/THANKS b/THANKS index dcd08b478..af7a1b63f 100644 --- a/THANKS +++ b/THANKS @@ -10,6 +10,7 @@ Anand Kumria wildfire@progsoc.uts.edu.au Anthony Mulcahy anthony@kcn.ne.jp Ariel T Glenn ariel@columbia.edu Bodo Moeller Bodo_Moeller@public.uni-hamburg.de +Brendan O'Dea bod@debian.org Brenno de Winter brenno@dewinter.com Brian Moore bem@cmc.net Brian Warner warner@lothar.com diff --git a/doc/gpg.sgml b/doc/gpg.sgml index 465d6d559..c55b9dc9d 100644 --- a/doc/gpg.sgml +++ b/doc/gpg.sgml @@ -462,6 +462,11 @@ keyring. The fast version does not build the trustdb; this can be done at any time with the command --update-trustdb. + + +There are a few other options which control how this command works. +Most notable here is the --merge-only options which does not insert new keys +but does only the merging of new signatures, user-IDs and subkeys. @@ -1361,6 +1366,12 @@ content of an encrypted message; using this option you can do this without handing out the secret key. + +--merge-only + +Don't insert new keys into the keyrings while doing an import. + + diff --git a/g10/ChangeLog b/g10/ChangeLog index 9a33b5bc2..c383e9029 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,10 @@ +Thu Jul 27 17:33:04 CEST 2000 Werner Koch + + * g10.c: New option --merge-only. Suggested by Brendan O'Dea. + * import.c (import_one): Implemented it here + (import_secret_one): Ditto. + (print_stats): and give some stats. + Thu Jul 27 12:01:00 CEST 2000 Werner Koch * g10.c: New options --show-session-key and --override-session-key diff --git a/g10/g10.c b/g10/g10.c index 88d5d025d..65b48f426 100644 --- a/g10/g10.c +++ b/g10/g10.c @@ -192,6 +192,7 @@ enum cmd_and_opt_values { aNull = 0, oOverrideSessionKey, oNoRandomSeedFile, oNoAutoKeyRetrieve, + oMergeOnly, oEmu3DESS2KBug, /* will be removed in 1.1 */ oEmuMDEncodeBug, aTest }; @@ -376,6 +377,7 @@ static ARGPARSE_OPTS opts[] = { { oOverrideSessionKey, "override-session-key", 2, "@" }, { oNoRandomSeedFile, "no-random-seed-file", 0, "@" }, { oNoAutoKeyRetrieve, "no-auto-key-retrieve", 0, "@" }, + { oMergeOnly, "merge-only", 0, "@" }, { oEmu3DESS2KBug, "emulate-3des-s2k-bug", 0, "@"}, { oEmuMDEncodeBug, "emulate-md-encode-bug", 0, "@"}, {0} }; @@ -928,6 +930,7 @@ main( int argc, char **argv ) case oOverrideSessionKey: opt.override_session_key = pargs.r.ret_str; break; + case oMergeOnly: opt.merge_only = 1; break; default : pargs.err = configfp? 1:2; break; } diff --git a/g10/import.c b/g10/import.c index 35007deff..10fdb9961 100644 --- a/g10/import.c +++ b/g10/import.c @@ -50,6 +50,7 @@ static struct { ulong secret_read; ulong secret_imported; ulong secret_dups; + ulong skipped_new_keys; } stats; @@ -201,6 +202,9 @@ print_stats() { if( !opt.quiet ) { log_info(_("Total number processed: %lu\n"), stats.count ); + if( stats.skipped_new_keys ) + log_info(_(" skipped new keys: %lu\n"), + stats.skipped_new_keys ); if( stats.no_user_id ) log_info(_(" w/o user IDs: %lu\n"), stats.no_user_id ); if( stats.imported || stats.imported_rsa ) { @@ -228,8 +232,8 @@ print_stats() } if( is_status_enabled() ) { - char buf[12*20]; - sprintf(buf, "%lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu", + char buf[13*20]; + sprintf(buf, "%lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu", stats.count, stats.no_user_id, stats.imported, @@ -241,7 +245,8 @@ print_stats() stats.n_revoc, stats.secret_read, stats.secret_imported, - stats.secret_dups); + stats.secret_dups, + stats.skipped_new_keys ); write_status_text( STATUS_IMPORT_RES, buf ); } } @@ -413,6 +418,13 @@ import_one( const char *fname, KBNODE keyblock, int fast ) log_error( _("key %08lX: public key not found: %s\n"), (ulong)keyid[1], g10_errstr(rc)); } + else if ( rc && opt.merge_only ) { + if( opt.verbose ) + log_info( _("key %08lX: new key - skipped\n"), (ulong)keyid[1] ); + rc = 0; + fast = 1; /* so that we don't get into the trustdb update */ + stats.skipped_new_keys++; + } else if( rc ) { /* insert this key */ /* get default resource */ if( get_keyblock_handle( NULL, 0, &kbpos ) ) { @@ -583,7 +595,7 @@ import_secret_one( const char *fname, KBNODE keyblock ) /* do we have this key already in one of our secrings ? */ rc = seckey_available( keyid ); - if( rc == G10ERR_NO_SECKEY ) { /* simply insert this key */ + if( rc == G10ERR_NO_SECKEY && !opt.merge_only ) { /* simply insert this key */ /* get default resource */ if( get_keyblock_handle( NULL, 1, &kbpos ) ) { log_error("no default secret keyring\n"); diff --git a/g10/options.h b/g10/options.h index 0476aa97d..265c50c61 100644 --- a/g10/options.h +++ b/g10/options.h @@ -93,6 +93,7 @@ struct { int auto_key_retrieve; const char *override_session_key; int show_session_key; + int merge_only; } opt; -- cgit v1.2.3