mirror of
git://git.gnupg.org/gnupg.git
synced 2025-04-17 15:44:34 +02:00
* options.h, import.c (parse_import_options, clean_sigs_from_all_uids,
import_one): Add import-minimal option. Similar to export-minimal, except it works on the way in.
This commit is contained in:
parent
debc169f88
commit
477ded81a4
@ -1,5 +1,9 @@
|
|||||||
2005-11-10 David Shaw <dshaw@jabberwocky.com>
|
2005-11-10 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
|
* options.h, import.c (parse_import_options,
|
||||||
|
clean_sigs_from_all_uids, import_one): Add import-minimal option.
|
||||||
|
Similar to export-minimal, except it works on the way in.
|
||||||
|
|
||||||
* trustdb.h, trustdb.c (clean_sigs_from_uid): Add flag to remove
|
* trustdb.h, trustdb.c (clean_sigs_from_uid): Add flag to remove
|
||||||
all non-selfsigs from key during cleaning. Change all callers.
|
all non-selfsigs from key during cleaning. Change all callers.
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ parse_export_options(char *str,unsigned int *options,int noisy)
|
|||||||
N_("remove unusable user IDs during export")},
|
N_("remove unusable user IDs during export")},
|
||||||
{"export-minimal",
|
{"export-minimal",
|
||||||
EXPORT_MINIMAL|EXPORT_CLEAN_SIGS|EXPORT_CLEAN_UIDS,NULL,
|
EXPORT_MINIMAL|EXPORT_CLEAN_SIGS|EXPORT_CLEAN_UIDS,NULL,
|
||||||
N_("export the smallest key possible")},
|
N_("remove unusable user IDs and all signatures during export")},
|
||||||
{"export-reset-subkey-passwd",EXPORT_RESET_SUBKEY_PASSWD,NULL,
|
{"export-reset-subkey-passwd",EXPORT_RESET_SUBKEY_PASSWD,NULL,
|
||||||
N_("remove the passphrase from exported subkeys")},
|
N_("remove the passphrase from exported subkeys")},
|
||||||
/* Aliases for backward compatibility */
|
/* Aliases for backward compatibility */
|
||||||
|
12
g10/import.c
12
g10/import.c
@ -107,6 +107,9 @@ parse_import_options(char *str,unsigned int *options,int noisy)
|
|||||||
N_("remove unusable signatures after import")},
|
N_("remove unusable signatures after import")},
|
||||||
{"import-clean-uids",IMPORT_CLEAN_UIDS,NULL,
|
{"import-clean-uids",IMPORT_CLEAN_UIDS,NULL,
|
||||||
N_("remove unusable user IDs after import")},
|
N_("remove unusable user IDs after import")},
|
||||||
|
{"import-minimal",
|
||||||
|
IMPORT_MINIMAL|IMPORT_CLEAN_SIGS|IMPORT_CLEAN_UIDS,NULL,
|
||||||
|
N_("remove unusable user IDs and all signatures after import")},
|
||||||
/* Aliases for backward compatibility */
|
/* Aliases for backward compatibility */
|
||||||
{"allow-local-sigs",IMPORT_LOCAL_SIGS,NULL,NULL},
|
{"allow-local-sigs",IMPORT_LOCAL_SIGS,NULL,NULL},
|
||||||
{"repair-hkp-subkey-bug",IMPORT_REPAIR_PKS_SUBKEY_BUG,NULL,NULL},
|
{"repair-hkp-subkey-bug",IMPORT_REPAIR_PKS_SUBKEY_BUG,NULL,NULL},
|
||||||
@ -667,14 +670,14 @@ check_prefs(KBNODE keyblock)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
clean_sigs_from_all_uids(KBNODE keyblock)
|
clean_sigs_from_all_uids(KBNODE keyblock,int self_only)
|
||||||
{
|
{
|
||||||
KBNODE uidnode;
|
KBNODE uidnode;
|
||||||
int deleted=0;
|
int deleted=0;
|
||||||
|
|
||||||
for(uidnode=keyblock->next;uidnode;uidnode=uidnode->next)
|
for(uidnode=keyblock->next;uidnode;uidnode=uidnode->next)
|
||||||
if(uidnode->pkt->pkttype==PKT_USER_ID)
|
if(uidnode->pkt->pkttype==PKT_USER_ID)
|
||||||
deleted+=clean_sigs_from_uid(keyblock,uidnode,opt.verbose,0);
|
deleted+=clean_sigs_from_uid(keyblock,uidnode,opt.verbose,self_only);
|
||||||
|
|
||||||
return deleted;
|
return deleted;
|
||||||
}
|
}
|
||||||
@ -746,7 +749,7 @@ import_one( const char *fname, KBNODE keyblock,
|
|||||||
the end result, but does result in less logging which might
|
the end result, but does result in less logging which might
|
||||||
confuse the user. */
|
confuse the user. */
|
||||||
if(options&IMPORT_CLEAN_SIGS)
|
if(options&IMPORT_CLEAN_SIGS)
|
||||||
clean_sigs_from_all_uids(keyblock);
|
clean_sigs_from_all_uids(keyblock,options&IMPORT_MINIMAL);
|
||||||
|
|
||||||
if(options&IMPORT_CLEAN_UIDS)
|
if(options&IMPORT_CLEAN_UIDS)
|
||||||
clean_uids_from_key(keyblock,opt.verbose);
|
clean_uids_from_key(keyblock,opt.verbose);
|
||||||
@ -899,7 +902,8 @@ import_one( const char *fname, KBNODE keyblock,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(options&IMPORT_CLEAN_SIGS)
|
if(options&IMPORT_CLEAN_SIGS)
|
||||||
n_sigs_cleaned=clean_sigs_from_all_uids(keyblock_orig);
|
n_sigs_cleaned=clean_sigs_from_all_uids(keyblock_orig,
|
||||||
|
options&IMPORT_MINIMAL);
|
||||||
|
|
||||||
if(options&IMPORT_CLEAN_UIDS)
|
if(options&IMPORT_CLEAN_UIDS)
|
||||||
n_uids_cleaned=clean_uids_from_key(keyblock_orig,opt.verbose);
|
n_uids_cleaned=clean_uids_from_key(keyblock_orig,opt.verbose);
|
||||||
|
@ -265,8 +265,9 @@ struct {
|
|||||||
#define IMPORT_FAST (1<<2)
|
#define IMPORT_FAST (1<<2)
|
||||||
#define IMPORT_SK2PK (1<<3)
|
#define IMPORT_SK2PK (1<<3)
|
||||||
#define IMPORT_MERGE_ONLY (1<<4)
|
#define IMPORT_MERGE_ONLY (1<<4)
|
||||||
#define IMPORT_CLEAN_SIGS (1<<5)
|
#define IMPORT_MINIMAL (1<<5)
|
||||||
#define IMPORT_CLEAN_UIDS (1<<6)
|
#define IMPORT_CLEAN_SIGS (1<<6)
|
||||||
|
#define IMPORT_CLEAN_UIDS (1<<7)
|
||||||
|
|
||||||
#define EXPORT_LOCAL_SIGS (1<<0)
|
#define EXPORT_LOCAL_SIGS (1<<0)
|
||||||
#define EXPORT_ATTRIBUTES (1<<1)
|
#define EXPORT_ATTRIBUTES (1<<1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user