mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-21 14:47:03 +01:00
* options.h, export.c (parse_export_options, do_export_stream), import.c
(parse_import_options, import_keys_internal): Make the import-options and export-options distinct since they can be mixed together as part of keyserver-options.
This commit is contained in:
parent
9a70afe2b3
commit
6dedf7a068
@ -1,3 +1,10 @@
|
||||
2004-11-26 David Shaw <dshaw@jabberwocky.com>
|
||||
|
||||
* options.h, export.c (parse_export_options, do_export_stream),
|
||||
import.c (parse_import_options, import_keys_internal): Make the
|
||||
import-options and export-options distinct since they can be mixed
|
||||
together as part of keyserver-options.
|
||||
|
||||
2004-11-24 David Shaw <dshaw@jabberwocky.com>
|
||||
|
||||
* options.h, export.c (parse_export_options, do_export_stream):
|
||||
|
16
g10/export.c
16
g10/export.c
@ -45,10 +45,14 @@ parse_export_options(char *str,unsigned int *options,int noisy)
|
||||
{
|
||||
struct parse_options export_opts[]=
|
||||
{
|
||||
{"include-local-sigs",EXPORT_INCLUDE_LOCAL_SIGS,NULL},
|
||||
{"include-attributes",EXPORT_INCLUDE_ATTRIBUTES,NULL},
|
||||
{"include-sensitive-revkeys",EXPORT_INCLUDE_SENSITIVE_REVKEYS,NULL},
|
||||
{"export-local-sigs",EXPORT_LOCAL_SIGS,NULL},
|
||||
{"export-attributes",EXPORT_ATTRIBUTES,NULL},
|
||||
{"export-sensitive-revkeys",EXPORT_SENSITIVE_REVKEYS,NULL},
|
||||
{"export-minimal",EXPORT_MINIMAL,NULL},
|
||||
/* Aliases for backward compatibility */
|
||||
{"include-local-sigs",EXPORT_LOCAL_SIGS,NULL},
|
||||
{"include-attributes",EXPORT_ATTRIBUTES,NULL},
|
||||
{"include-sensitive-revkeys",EXPORT_SENSITIVE_REVKEYS,NULL},
|
||||
{NULL,0,NULL}
|
||||
/* add tags for include revoked and disabled? */
|
||||
};
|
||||
@ -318,7 +322,7 @@ do_export_stream( IOBUF out, STRLIST users, int secret,
|
||||
continue;
|
||||
|
||||
/* do not export packets which are marked as not exportable */
|
||||
if(!(options&EXPORT_INCLUDE_LOCAL_SIGS)
|
||||
if(!(options&EXPORT_LOCAL_SIGS)
|
||||
&& !node->pkt->pkt.signature->flags.exportable)
|
||||
continue; /* not exportable */
|
||||
|
||||
@ -326,7 +330,7 @@ do_export_stream( IOBUF out, STRLIST users, int secret,
|
||||
key unless the user wants us to. Note that we do
|
||||
export these when issuing the actual revocation
|
||||
(see revoke.c). */
|
||||
if(!(options&EXPORT_INCLUDE_SENSITIVE_REVKEYS)
|
||||
if(!(options&EXPORT_SENSITIVE_REVKEYS)
|
||||
&& node->pkt->pkt.signature->revkey)
|
||||
{
|
||||
int i;
|
||||
@ -341,7 +345,7 @@ do_export_stream( IOBUF out, STRLIST users, int secret,
|
||||
}
|
||||
|
||||
/* Don't export attribs? */
|
||||
if( !(options&EXPORT_INCLUDE_ATTRIBUTES) &&
|
||||
if( !(options&EXPORT_ATTRIBUTES) &&
|
||||
node->pkt->pkttype == PKT_USER_ID &&
|
||||
node->pkt->pkt.user_id->attrib_data ) {
|
||||
/* Skip until we get to something that is not an attrib
|
||||
|
@ -1655,9 +1655,9 @@ main( int argc, char **argv )
|
||||
opt.force_v3_sigs = 1;
|
||||
opt.escape_from = 1;
|
||||
opt.import_options=IMPORT_SK2PK;
|
||||
opt.export_options=EXPORT_INCLUDE_ATTRIBUTES;
|
||||
opt.export_options=EXPORT_ATTRIBUTES;
|
||||
opt.keyserver_options.import_options=IMPORT_REPAIR_PKS_SUBKEY_BUG;
|
||||
opt.keyserver_options.export_options=EXPORT_INCLUDE_ATTRIBUTES;
|
||||
opt.keyserver_options.export_options=EXPORT_ATTRIBUTES;
|
||||
opt.keyserver_options.options=
|
||||
KEYSERVER_INCLUDE_SUBKEYS|KEYSERVER_INCLUDE_REVOKED|KEYSERVER_TRY_DNS_SRV|KEYSERVER_HONOR_KEYSERVER_URL;
|
||||
opt.verify_options=
|
||||
@ -3254,7 +3254,7 @@ main( int argc, char **argv )
|
||||
break;
|
||||
|
||||
case aFastImport:
|
||||
opt.import_options |= IMPORT_FAST_IMPORT;
|
||||
opt.import_options |= IMPORT_FAST;
|
||||
case aImport:
|
||||
import_keys( argc? argv:NULL, argc, NULL, opt.import_options );
|
||||
break;
|
||||
|
12
g10/import.c
12
g10/import.c
@ -88,12 +88,14 @@ parse_import_options(char *str,unsigned int *options,int noisy)
|
||||
{
|
||||
struct parse_options import_opts[]=
|
||||
{
|
||||
{"allow-local-sigs",IMPORT_ALLOW_LOCAL_SIGS,NULL},
|
||||
{"repair-hkp-subkey-bug",IMPORT_REPAIR_PKS_SUBKEY_BUG,NULL},
|
||||
{"import-local-sigs",IMPORT_LOCAL_SIGS,NULL},
|
||||
{"repair-pks-subkey-bug",IMPORT_REPAIR_PKS_SUBKEY_BUG,NULL},
|
||||
{"fast-import",IMPORT_FAST_IMPORT,NULL},
|
||||
{"fast-import",IMPORT_FAST,NULL},
|
||||
{"convert-sk-to-pk",IMPORT_SK2PK,NULL},
|
||||
{"merge-only",IMPORT_MERGE_ONLY,NULL},
|
||||
/* Aliases for backward compatibility */
|
||||
{"allow-local-sigs",IMPORT_LOCAL_SIGS,NULL},
|
||||
{"repair-hkp-subkey-bug",IMPORT_REPAIR_PKS_SUBKEY_BUG,NULL},
|
||||
{NULL,0,NULL}
|
||||
};
|
||||
|
||||
@ -195,7 +197,7 @@ import_keys_internal( IOBUF inp, char **fnames, int nnames,
|
||||
that was other than a selfsig, or any revocation), then
|
||||
update/check the trustdb if the user specified by setting
|
||||
interactive or by not setting no-auto-check-trustdb */
|
||||
if (!(options&IMPORT_FAST_IMPORT) && trustdb_pending_check())
|
||||
if (!(options&IMPORT_FAST) && trustdb_pending_check())
|
||||
{
|
||||
if (opt.interactive)
|
||||
update_trustdb();
|
||||
@ -1493,7 +1495,7 @@ delete_inv_parts( const char *fname, KBNODE keyblock,
|
||||
delete_kbnode( node ); /* build_packet() can't handle this */
|
||||
else if( node->pkt->pkttype == PKT_SIGNATURE &&
|
||||
!node->pkt->pkt.signature->flags.exportable &&
|
||||
!(options&IMPORT_ALLOW_LOCAL_SIGS) &&
|
||||
!(options&IMPORT_LOCAL_SIGS) &&
|
||||
seckey_available( node->pkt->pkt.signature->keyid ) )
|
||||
{
|
||||
/* here we violate the rfc a bit by still allowing
|
||||
|
@ -245,15 +245,15 @@ struct {
|
||||
names between the IMPORT_ and EXPORT_ flags as they can be mixed in
|
||||
the keyserver-options option. */
|
||||
|
||||
#define IMPORT_ALLOW_LOCAL_SIGS (1<<0)
|
||||
#define IMPORT_LOCAL_SIGS (1<<0)
|
||||
#define IMPORT_REPAIR_PKS_SUBKEY_BUG (1<<1)
|
||||
#define IMPORT_FAST_IMPORT (1<<2)
|
||||
#define IMPORT_FAST (1<<2)
|
||||
#define IMPORT_SK2PK (1<<3)
|
||||
#define IMPORT_MERGE_ONLY (1<<4)
|
||||
|
||||
#define EXPORT_INCLUDE_LOCAL_SIGS (1<<0)
|
||||
#define EXPORT_INCLUDE_ATTRIBUTES (1<<1)
|
||||
#define EXPORT_INCLUDE_SENSITIVE_REVKEYS (1<<2)
|
||||
#define EXPORT_LOCAL_SIGS (1<<0)
|
||||
#define EXPORT_ATTRIBUTES (1<<1)
|
||||
#define EXPORT_SENSITIVE_REVKEYS (1<<2)
|
||||
#define EXPORT_MINIMAL (1<<3)
|
||||
|
||||
#define LIST_SHOW_PHOTOS (1<<0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user