1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

* options.h, gpg.c (main), misc.c (compliance_option_string): Add

--rfc4880, and make --openpgp an alias to it.  --rfc2440 now stands
alone.  For now, use the old 2440 defaults for 4880.

* keyedit.c (keyedit_menu): Use compliance_option_string() instead of
printing the compliance modes here.
This commit is contained in:
David Shaw 2007-10-17 16:37:09 +00:00
parent a5ca9e673f
commit 1ce132213e
5 changed files with 47 additions and 9 deletions

View File

@ -1,3 +1,12 @@
2007-10-17 David Shaw <dshaw@jabberwocky.com>
* options.h, gpg.c (main), misc.c (compliance_option_string): Add
--rfc4880, and make --openpgp an alias to it. --rfc2440 now
stands alone. For now, use the old 2440 defaults for 4880.
* keyedit.c (keyedit_menu): Use compliance_option_string() instead
of printing the compliance modes here.
2007-09-02 David Shaw <dshaw@jabberwocky.com>
* import.c (collapse_uids): Significant speedup for de-duping user

View File

@ -204,6 +204,7 @@ enum cmd_and_opt_values
oGnuPG,
oRFC1991,
oRFC2440,
oRFC4880,
oOpenPGP,
oPGP2,
oPGP6,
@ -532,6 +533,7 @@ static ARGPARSE_OPTS opts[] = {
{ oGnuPG, "no-pgp8", 0, "@"},
{ oRFC1991, "rfc1991", 0, "@"},
{ oRFC2440, "rfc2440", 0, "@" },
{ oRFC4880, "rfc4880", 0, "@" },
{ oOpenPGP, "openpgp", 0, N_("use strict OpenPGP behavior")},
{ oPGP2, "pgp2", 0, N_("generate PGP 2.x compatible messages")},
{ oPGP6, "pgp6", 0, "@"},
@ -2255,11 +2257,32 @@ main (int argc, char **argv )
opt.escape_from = 1;
break;
case oOpenPGP:
case oRFC4880:
/* Note these are the same defaults as CO_RFC2440. Update
this. */
opt.compliance = CO_RFC4880;
opt.rfc2440_text=1;
opt.allow_non_selfsigned_uid = 1;
opt.allow_freeform_uid = 1;
opt.pgp2_workarounds = 0;
opt.escape_from = 0;
opt.force_v3_sigs = 0;
opt.compress_keys = 0; /* not mandated, but we do it */
opt.compress_sigs = 0; /* ditto. */
opt.not_dash_escaped = 0;
opt.def_cipher_algo = 0;
opt.def_digest_algo = 0;
opt.cert_digest_algo = 0;
opt.compress_algo = -1;
opt.s2k_mode = 3; /* iterated+salted */
opt.s2k_digest_algo = DIGEST_ALGO_SHA1;
opt.s2k_cipher_algo = CIPHER_ALGO_3DES;
break;
case oRFC2440:
/* TODO: When 2440bis becomes a RFC, set new values for
oOpenPGP. */
opt.rfc2440_text=1;
opt.compliance = CO_RFC2440;
opt.rfc2440_text=1;
opt.allow_non_selfsigned_uid = 1;
opt.allow_freeform_uid = 1;
opt.pgp2_workarounds = 0;

View File

@ -1,6 +1,6 @@
/* keyedit.c - keyedit stuff
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
* 2006 Free Software Foundation, Inc.
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
* 2007 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
@ -1790,7 +1790,7 @@ keyedit_menu( const char *username, STRLIST locusr,
{
tty_printf(
_("This command is not allowed while in %s mode.\n"),
RFC2440?"OpenPGP":PGP2?"PGP2":"RFC-1991");
compliance_option_string());
break;
}
photo=1;

View File

@ -801,8 +801,12 @@ compliance_option_string(void)
{
switch(opt.compliance)
{
case CO_RFC2440:
case CO_RFC4880:
return "--openpgp";
case CO_RFC2440:
return "--rfc2440";
case CO_RFC1991:
return "--rfc1991";
case CO_PGP2:
return "--pgp2";
case CO_PGP6:

View File

@ -1,6 +1,6 @@
/* options.h
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
* 2006 Free Software Foundation, Inc.
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
* 2007 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
@ -105,7 +105,8 @@ struct
int force_ownertrust;
enum
{
CO_GNUPG=0, CO_RFC2440, CO_RFC1991, CO_PGP2, CO_PGP6, CO_PGP7, CO_PGP8
CO_GNUPG, CO_RFC4880, CO_RFC2440, CO_RFC1991, CO_PGP2,
CO_PGP6, CO_PGP7, CO_PGP8
} compliance;
enum
{
@ -272,14 +273,15 @@ struct {
#define DBG_EXTPROG (opt.debug & DBG_EXTPROG_VALUE)
#define DBG_CARD_IO (opt.debug & DBG_CARD_IO_VALUE)
#define GNUPG (opt.compliance==CO_GNUPG)
#define RFC1991 (opt.compliance==CO_RFC1991 || opt.compliance==CO_PGP2)
#define RFC2440 (opt.compliance==CO_RFC2440)
#define RFC4880 (opt.compliance==CO_RFC4880)
#define PGP2 (opt.compliance==CO_PGP2)
#define PGP6 (opt.compliance==CO_PGP6)
#define PGP7 (opt.compliance==CO_PGP7)
#define PGP8 (opt.compliance==CO_PGP8)
#define PGPX (PGP2 || PGP6 || PGP7 || PGP8)
/* Various option flags. Note that there should be no common string
names between the IMPORT_ and EXPORT_ flags as they can be mixed in