aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2004-11-26 15:51:37 +0000
committerDavid Shaw <[email protected]>2004-11-26 15:51:37 +0000
commit6dedf7a068e617b7d5af94fece868c86f7cdff55 (patch)
tree0a0d8b0ac74d03cd123ccc9bb38e86c00e9c2e73
parent* options.h, export.c (parse_export_options, do_export_stream): Add (diff)
downloadgnupg-6dedf7a068e617b7d5af94fece868c86f7cdff55.tar.gz
gnupg-6dedf7a068e617b7d5af94fece868c86f7cdff55.zip
* 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.
Diffstat (limited to '')
-rw-r--r--g10/ChangeLog7
-rw-r--r--g10/export.c16
-rw-r--r--g10/g10.c6
-rw-r--r--g10/import.c12
-rw-r--r--g10/options.h10
5 files changed, 32 insertions, 19 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index 3e5681a05..94be194bf 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,10 @@
+2004-11-26 David Shaw <[email protected]>
+
+ * 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 <[email protected]>
* options.h, export.c (parse_export_options, do_export_stream):
diff --git a/g10/export.c b/g10/export.c
index 40e5b4424..f56019b37 100644
--- a/g10/export.c
+++ b/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
diff --git a/g10/g10.c b/g10/g10.c
index 2f9633c48..2a17214d9 100644
--- a/g10/g10.c
+++ b/g10/g10.c
@@ -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;
diff --git a/g10/import.c b/g10/import.c
index dc7ef5b9a..283be207d 100644
--- a/g10/import.c
+++ b/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
diff --git a/g10/options.h b/g10/options.h
index 7f71a7032..e8463f0e8 100644
--- a/g10/options.h
+++ b/g10/options.h
@@ -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)