[svn] GnuPG - r5079 - branches/STABLE-BRANCH-1-4/g10

svn author wk cvs at cvs.gnupg.org
Thu Jul 16 09:40:17 CEST 2009


Author: wk
Date: 2009-07-16 09:40:16 +0200 (Thu, 16 Jul 2009)
New Revision: 5079

Modified:
   branches/STABLE-BRANCH-1-4/g10/ChangeLog
   branches/STABLE-BRANCH-1-4/g10/misc.c
Log:
Fix bug#1087.


Modified: branches/STABLE-BRANCH-1-4/g10/ChangeLog
===================================================================
--- branches/STABLE-BRANCH-1-4/g10/ChangeLog	2009-07-13 17:36:02 UTC (rev 5078)
+++ branches/STABLE-BRANCH-1-4/g10/ChangeLog	2009-07-16 07:40:16 UTC (rev 5079)
@@ -1,3 +1,8 @@
+2009-07-16  Werner Koch  <wk at g10code.com>
+
+	* misc.c (has_invalid_email_chars): Let non-ascii characters pass
+	through.  Fixes bug#1087.
+
 2009-06-24  Werner Koch  <wk at g10code.com>
 
 	* passphrase.c (passphrase_to_dek): Do not deref a PW of NULL.
@@ -13459,7 +13464,7 @@
 
 
  Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-	   2007 Free Software Foundation, Inc.
+	   2007, 2008, 2009 Free Software Foundation, Inc.
 
  This file is free software; as a special exception the author gives
  unlimited permission to copy and/or distribute it, with or without

Modified: branches/STABLE-BRANCH-1-4/g10/misc.c
===================================================================
--- branches/STABLE-BRANCH-1-4/g10/misc.c	2009-07-13 17:36:02 UTC (rev 5078)
+++ branches/STABLE-BRANCH-1-4/g10/misc.c	2009-07-16 07:40:16 UTC (rev 5079)
@@ -1132,6 +1132,16 @@
 }
 
 
+/* Check whether the string has characters not valid in an RFC-822
+   address.  To cope with OpenPGP we ignore non-ascii characters
+   so that for example umlauts are legal in an email address.  An
+   OpenPGP user ID must be utf-8 encoded but there is no strict
+   requirement for RFC-822.  Thus to avoid IDNA encoding we put the
+   address verbatim as utf-8 into the user ID under the assumption
+   that mail programs handle IDNA at a lower level and take OpenPGP
+   user IDs as utf-8.  Note that we can't do an utf-8 encoding
+   checking here because in keygen.c this function is called with the
+   native encoding and native to utf-8 encoding is only done  later.  */
 int
 has_invalid_email_chars (const char *s)
 {
@@ -1142,7 +1152,7 @@
   for ( ; *s; s++ ) 
     {
       if ( *s & 0x80 )
-        return 1;
+        continue; /* We only care about ASCII.  */
       if ( *s == '@' )
         at_seen=1;
       else if ( !at_seen && !( !!strchr( valid_chars, *s ) || *s == '+' ) )




More information about the Gnupg-commits mailing list