gnupg/g10 (8 files)
cvs user dshaw
cvs at cvs.gnupg.org
Mon Dec 20 06:14:23 CET 2004
Date: Monday, December 20, 2004 @ 06:19:09
Author: dshaw
Path: /cvs/gnupg/gnupg/g10
Modified: ChangeLog g10.c getkey.c keyedit.c keygen.c options.h
passphrase.c textfilter.c
* keyedit.c (keyedit_menu): Invisible alias "passwd" as "password".
* passphrase.c: Don't check for __CYGWIN__, so it is treated as a
unix-like system.
* options.h, g10.c (main), textfilter.c (standard): Use new option
--rfc2440-text to determine whether to filter "<space>\t\r\n" or just
"\r\n" before canonicalizing text line endings. Default to
"<space>\t\r\n".
--------------+
ChangeLog | 13 +++++++++++++
g10.c | 16 ++++++++++++----
getkey.c | 2 +-
keyedit.c | 30 ++++++++++++++++--------------
keygen.c | 2 +-
options.h | 3 ++-
passphrase.c | 4 ++--
textfilter.c | 23 ++++++++++++++---------
8 files changed, 61 insertions(+), 32 deletions(-)
Index: gnupg/g10/ChangeLog
diff -u gnupg/g10/ChangeLog:1.664 gnupg/g10/ChangeLog:1.665
--- gnupg/g10/ChangeLog:1.664 Sun Dec 19 06:20:07 2004
+++ gnupg/g10/ChangeLog Mon Dec 20 06:19:09 2004
@@ -1,3 +1,16 @@
+2004-12-20 David Shaw <dshaw at jabberwocky.com>
+
+ * keyedit.c (keyedit_menu): Invisible alias "passwd" as
+ "password".
+
+ * passphrase.c: Don't check for __CYGWIN__, so it is treated as a
+ unix-like system.
+
+ * options.h, g10.c (main), textfilter.c (standard): Use new option
+ --rfc2440-text to determine whether to filter "<space>\t\r\n" or
+ just "\r\n" before canonicalizing text line endings. Default to
+ "<space>\t\r\n".
+
2004-12-19 David Shaw <dshaw at jabberwocky.com>
* keygen.c (keygen_get_std_prefs): Set reference count when
Index: gnupg/g10/g10.c
diff -u gnupg/g10/g10.c:1.294 gnupg/g10/g10.c:1.295
--- gnupg/g10/g10.c:1.294 Thu Dec 16 06:16:08 2004
+++ gnupg/g10/g10.c Mon Dec 20 06:19:09 2004
@@ -201,6 +201,8 @@
oPGP6,
oPGP7,
oPGP8,
+ oRFC2440Text,
+ oNoRFC2440Text,
oCipherAlgo,
oDigestAlgo,
oCertDigestAlgo,
@@ -507,6 +509,8 @@
{ oPGP6, "pgp6", 0, "@"},
{ oPGP7, "pgp7", 0, "@"},
{ oPGP8, "pgp8", 0, "@"},
+ { oRFC2440Text, "rfc2440-text", 0, "@"},
+ { oNoRFC2440Text, "no-rfc2440-text", 0, "@"},
{ oS2KMode, "s2k-mode", 1, "@"},
{ oS2KDigest, "s2k-digest-algo", 2, "@"},
{ oS2KCipher, "s2k-cipher-algo", 2, "@"},
@@ -1668,6 +1672,7 @@
opt.min_cert_level=2;
set_screen_dimensions();
opt.keyid_format=KF_SHORT;
+ opt.rfc2440_text=1;
#if defined (_WIN32)
set_homedir ( read_w32_registry_string( NULL,
"Software\\GNU\\GnuPG", "HomeDir" ));
@@ -2090,17 +2095,18 @@
opt.force_v4_certs = 0;
opt.escape_from = 1;
break;
- case oRFC2440:
case oOpenPGP:
- /* TODO: When 2440bis becomes a RFC, these may need
- changing. */
+ case oRFC2440:
+ /* TODO: When 2440bis becomes a RFC, set new values for
+ oOpenPGP. */
+ opt.rfc2440_text=1;
opt.compliance = CO_RFC2440;
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_keys = 0; /* not mandated, but we do it */
opt.compress_sigs = 0; /* ditto. */
opt.not_dash_escaped = 0;
opt.def_cipher_algo = 0;
@@ -2117,6 +2123,8 @@
case oPGP8: opt.compliance = CO_PGP8; break;
case oGnuPG: opt.compliance = CO_GNUPG; break;
case oCompressSigs: opt.compress_sigs = 1; break;
+ case oRFC2440Text: opt.rfc2440_text=1; break;
+ case oNoRFC2440Text: opt.rfc2440_text=0; break;
case oRunAsShmCP:
#ifndef __riscos__
# ifndef USE_SHM_COPROCESSING
Index: gnupg/g10/getkey.c
diff -u gnupg/g10/getkey.c:1.121 gnupg/g10/getkey.c:1.122
--- gnupg/g10/getkey.c:1.121 Mon Nov 29 22:21:52 2004
+++ gnupg/g10/getkey.c Mon Dec 20 06:19:09 2004
@@ -2417,7 +2417,7 @@
{
char *tempkeystr=
m_strdup(keystr_from_pk(latest_key->pkt->pkt.public_key));
- log_info(_("using secondary key %s instead of primary key %s\n"),
+ log_info(_("using subkey %s instead of primary key %s\n"),
tempkeystr, keystr_from_pk(keyblock->pkt->pkt.public_key));
m_free(tempkeystr);
}
Index: gnupg/g10/keyedit.c
diff -u gnupg/g10/keyedit.c:1.163 gnupg/g10/keyedit.c:1.164
--- gnupg/g10/keyedit.c:1.163 Sun Dec 19 06:20:07 2004
+++ gnupg/g10/keyedit.c Mon Dec 20 06:19:09 2004
@@ -1292,31 +1292,31 @@
{ "list" , cmdLIST , 0, N_("list key and user IDs") },
{ "l" , cmdLIST , 0, NULL },
{ "uid" , cmdSELUID , 0, N_("select user ID N") },
- { "key" , cmdSELKEY , 0, N_("select secondary key N") },
+ { "key" , cmdSELKEY , 0, N_("select subkey N") },
{ "check" , cmdCHECK , 0, N_("list signatures") },
{ "c" , cmdCHECK , 0, NULL },
- { "sign" , cmdSIGN , KEYEDIT_NOT_SK|KEYEDIT_TAIL_MATCH, N_("sign the key") },
+ { "sign" , cmdSIGN , KEYEDIT_NOT_SK|KEYEDIT_TAIL_MATCH, N_("sign selected user IDs") },
{ "s" , cmdSIGN , KEYEDIT_NOT_SK, NULL },
/* "lsign" will never match since "sign" comes first and it is a
tail match. It is just here so it shows up in the help
menu. */
- { "lsign" , cmdNOP , 0, N_("sign the key locally") },
+ { "lsign" , cmdNOP , 0, N_("sign selected user IDs locally") },
{ "debug" , cmdDEBUG , 0, NULL },
{ "adduid" , cmdADDUID , KEYEDIT_NOT_SK|KEYEDIT_NEED_SK, N_("add a user ID") },
{ "addphoto", cmdADDPHOTO , KEYEDIT_NOT_SK|KEYEDIT_NEED_SK, N_("add a photo ID") },
{ "deluid" , cmdDELUID , KEYEDIT_NOT_SK, N_("delete user ID") },
/* delphoto is really deluid in disguise */
{ "delphoto", cmdDELUID , KEYEDIT_NOT_SK, NULL },
- { "addkey" , cmdADDKEY , KEYEDIT_NOT_SK|KEYEDIT_NEED_SK, N_("add a secondary key") },
+ { "addkey" , cmdADDKEY , KEYEDIT_NOT_SK|KEYEDIT_NEED_SK, N_("add a subkey") },
#ifdef ENABLE_CARD_SUPPORT
{ "addcardkey", cmdADDCARDKEY , KEYEDIT_NOT_SK|KEYEDIT_NEED_SK, N_("add a key to a smartcard") },
{ "keytocard", cmdKEYTOCARD , KEYEDIT_NEED_SK|KEYEDIT_ONLY_SK, N_("move a key to a smartcard")},
#endif /*ENABLE_CARD_SUPPORT*/
- { "delkey" , cmdDELKEY , KEYEDIT_NOT_SK, N_("delete a secondary key") },
+ { "delkey" , cmdDELKEY , KEYEDIT_NOT_SK, N_("delete selected subkeys") },
{ "addrevoker",cmdADDREVOKER,KEYEDIT_NOT_SK|KEYEDIT_NEED_SK, N_("add a revocation key") },
{ "delsig" , cmdDELSIG , KEYEDIT_NOT_SK, N_("delete signatures") },
- { "expire" , cmdEXPIRE , KEYEDIT_NOT_SK|KEYEDIT_NEED_SK, N_("change the expire date") },
- { "primary" , cmdPRIMARY , KEYEDIT_NOT_SK|KEYEDIT_NEED_SK, N_("flag user ID as primary")},
+ { "expire" , cmdEXPIRE , KEYEDIT_NOT_SK|KEYEDIT_NEED_SK, N_("change the expiration date") },
+ { "primary" , cmdPRIMARY , KEYEDIT_NOT_SK|KEYEDIT_NEED_SK, N_("flag a user ID as primary")},
{ "toggle" , cmdTOGGLE , KEYEDIT_NEED_SK, N_("toggle between secret and public key listing") },
{ "t" , cmdTOGGLE , KEYEDIT_NEED_SK, NULL },
{ "pref" , cmdPREF , KEYEDIT_NOT_SK, N_("list preferences (expert)")},
@@ -1326,14 +1326,16 @@
{ "updpref" , cmdSETPREF , KEYEDIT_NOT_SK|KEYEDIT_NEED_SK, NULL },
{ "keyserver",cmdPREFKS , KEYEDIT_NOT_SK|KEYEDIT_NEED_SK, N_("set preferred keyserver URL")},
{ "passwd" , cmdPASSWD , KEYEDIT_NOT_SK|KEYEDIT_NEED_SK, N_("change the passphrase") },
+ /* Alias */
+ { "password", cmdPASSWD , KEYEDIT_NOT_SK|KEYEDIT_NEED_SK, NULL },
{ "trust" , cmdTRUST , KEYEDIT_NOT_SK, N_("change the ownertrust") },
{ "revsig" , cmdREVSIG , KEYEDIT_NOT_SK, N_("revoke signatures") },
- { "revuid" , cmdREVUID , KEYEDIT_NOT_SK|KEYEDIT_NEED_SK, N_("revoke a user ID") },
+ { "revuid" , cmdREVUID , KEYEDIT_NOT_SK|KEYEDIT_NEED_SK, N_("revoke selected user IDs") },
/* Alias */
{ "revphoto", cmdREVUID , KEYEDIT_NOT_SK|KEYEDIT_NEED_SK, NULL },
- { "revkey" , cmdREVKEY , KEYEDIT_NOT_SK|KEYEDIT_NEED_SK, N_("revoke a secondary key") },
- { "disable" , cmdDISABLEKEY, KEYEDIT_NOT_SK, N_("disable a key") },
- { "enable" , cmdENABLEKEY , KEYEDIT_NOT_SK, N_("enable a key") },
+ { "revkey" , cmdREVKEY , KEYEDIT_NOT_SK|KEYEDIT_NEED_SK, N_("revoke selected subkeys") },
+ { "disable" , cmdDISABLEKEY, KEYEDIT_NOT_SK, N_("disable key") },
+ { "enable" , cmdENABLEKEY , KEYEDIT_NOT_SK, N_("enable key") },
{ "showphoto",cmdSHOWPHOTO , 0, N_("show photo ID") },
{ NULL, cmdNONE, 0, NULL }
};
@@ -3136,11 +3138,11 @@
n1 = count_selected_keys( pub_keyblock );
if( n1 > 1 ) {
- tty_printf(_("Please select at most one secondary key.\n"));
+ tty_printf(_("Please select at most one subkey.\n"));
return 0;
}
else if( n1 )
- tty_printf(_("Changing expiration time for a secondary key.\n"));
+ tty_printf(_("Changing expiration time for a subkey.\n"));
else
{
tty_printf(_("Changing expiration time for the primary key.\n"));
@@ -3683,7 +3685,7 @@
}
}
if( !node ) {
- tty_printf(_("No secondary key with index %d\n"), idx );
+ tty_printf(_("No subkey with index %d\n"), idx );
return 0;
}
}
Index: gnupg/g10/keygen.c
diff -u gnupg/g10/keygen.c:1.138 gnupg/g10/keygen.c:1.139
--- gnupg/g10/keygen.c:1.138 Sun Dec 19 06:20:07 2004
+++ gnupg/g10/keygen.c Mon Dec 20 06:19:09 2004
@@ -2952,7 +2952,7 @@
tty_printf(_("Note that this key cannot be used for "
"encryption. You may want to use\n"
"the command \"--edit-key\" to generate a "
- "secondary key for this purpose.\n") );
+ "subkey for this purpose.\n") );
}
}
}
Index: gnupg/g10/options.h
diff -u gnupg/g10/options.h:1.130 gnupg/g10/options.h:1.131
--- gnupg/g10/options.h:1.130 Sat Dec 11 05:47:33 2004
+++ gnupg/g10/options.h Mon Dec 20 06:19:09 2004
@@ -187,11 +187,12 @@
int no_homedir_creation;
struct groupitem *grouplist;
int strict;
- int mangle_dos_filenames;
+ int mangle_dos_filenames;
int enable_progress_filter;
unsigned int screen_columns;
unsigned int screen_lines;
byte *show_subpackets;
+ int rfc2440_text;
#ifdef ENABLE_CARD_SUPPORT
const char *ctapi_driver; /* Library to access the ctAPI. */
Index: gnupg/g10/passphrase.c
diff -u gnupg/g10/passphrase.c:1.73 gnupg/g10/passphrase.c:1.74
--- gnupg/g10/passphrase.c:1.73 Fri Dec 17 19:51:32 2004
+++ gnupg/g10/passphrase.c Mon Dec 20 06:19:09 2004
@@ -30,8 +30,8 @@
#include <sys/socket.h>
#include <sys/un.h>
#endif
-#if defined (_WIN32) || defined (__CYGWIN32__)
-# include <windows.h>
+#if defined (_WIN32)
+#include <windows.h>
#endif
#include <errno.h>
#ifdef HAVE_LOCALE_H
Index: gnupg/g10/textfilter.c
diff -u gnupg/g10/textfilter.c:1.17 gnupg/g10/textfilter.c:1.18
--- gnupg/g10/textfilter.c:1.17 Sat Dec 11 05:47:33 2004
+++ gnupg/g10/textfilter.c Mon Dec 20 06:19:09 2004
@@ -97,15 +97,20 @@
/* The story behind this is that 2440 says that textmode
hashes should canonicalize line endings to CRLF and remove
spaces and tabs. 2440bis-12 says to just canonicalize to
- CRLF. So, we default to the 2440bis-12 behavior, but
- revert to the strict 2440 behavior if the user specifies
- --rfc2440. In practical terms this makes no difference to
- any signatures in the real world except for a textmode
- detached signature. PGP always used the 2440bis-12 (1991)
- behavior (ignoring 2440 itself), so this actually makes us
- compatible with PGP textmode detached signatures for the
- first time. */
- if(RFC2440)
+ CRLF. 1.4.0 was released using the bis-12 behavior, but it
+ was discovered that many mail clients do not canonicalize
+ PGP/MIME signature text appropriately (and were relying on
+ GnuPG to handle trailing spaces). So, we default to the
+ 2440 behavior, but use the 2440bis-12 behavior if the user
+ specifies --no-rfc2440-text. The default will be changed
+ at some point in the future when the mail clients have been
+ upgraded. Aside from PGP/MIME and broken mail clients,
+ this makes no difference to any signatures in the real
+ world except for a textmode detached signature. PGP always
+ used the 2440bis-12 behavior (ignoring 2440 itself), so
+ this actually makes us compatible with PGP textmode
+ detached signatures for the first time. */
+ if(opt.rfc2440_text)
tfx->buffer_len=trim_trailing_chars(tfx->buffer,tfx->buffer_len,
" \t\r\n");
else
More information about the Gnupg-commits
mailing list