aboutsummaryrefslogtreecommitdiffstats
path: root/g10
diff options
context:
space:
mode:
Diffstat (limited to 'g10')
-rw-r--r--g10/ChangeLog6
-rw-r--r--g10/cpr.c32
-rw-r--r--g10/keygen.c9
-rw-r--r--g10/misc.c15
4 files changed, 28 insertions, 34 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index 3376111cc..1166b0fef 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,9 @@
+2009-01-08 Werner Koch <[email protected]>
+
+ * misc.c (has_invalid_email_chars): Let non-ascii pass through.
+
+ * cpr.c [USE_SHM_COPROCESSING]: Remove this code.
+
2008-12-12 Werner Koch <[email protected]>
* passphrase.c (passphrase_get): Write a STATUS_ERROR.
diff --git a/g10/cpr.c b/g10/cpr.c
index 60cc97bf6..a20a811ff 100644
--- a/g10/cpr.c
+++ b/g10/cpr.c
@@ -357,10 +357,6 @@ cpr_enabled()
{
if( opt.command_fd != -1 )
return 1;
-#ifdef USE_SHM_COPROCESSING
- if( opt.shm_coprocess )
- return 1;
-#endif
return 0;
}
@@ -371,10 +367,6 @@ cpr_get_no_help( const char *keyword, const char *prompt )
if( opt.command_fd != -1 )
return do_get_from_fd ( keyword, 0, 0 );
-#ifdef USE_SHM_COPROCESSING
- if( opt.shm_coprocess )
- return do_shm_get( keyword, 0, 0 );
-#endif
for(;;) {
p = tty_get( prompt );
return p;
@@ -388,10 +380,6 @@ cpr_get( const char *keyword, const char *prompt )
if( opt.command_fd != -1 )
return do_get_from_fd ( keyword, 0, 0 );
-#ifdef USE_SHM_COPROCESSING
- if( opt.shm_coprocess )
- return do_shm_get( keyword, 0, 0 );
-#endif
for(;;) {
p = tty_get( prompt );
if( *p=='?' && !p[1] && !(keyword && !*keyword)) {
@@ -424,10 +412,6 @@ cpr_get_hidden( const char *keyword, const char *prompt )
if( opt.command_fd != -1 )
return do_get_from_fd ( keyword, 1, 0 );
-#ifdef USE_SHM_COPROCESSING
- if( opt.shm_coprocess )
- return do_shm_get( keyword, 1, 0 );
-#endif
for(;;) {
p = tty_get_hidden( prompt );
if( *p == '?' && !p[1] ) {
@@ -444,10 +428,6 @@ cpr_kill_prompt(void)
{
if( opt.command_fd != -1 )
return;
-#ifdef USE_SHM_COPROCESSING
- if( opt.shm_coprocess )
- return;
-#endif
tty_kill_prompt();
return;
}
@@ -460,10 +440,6 @@ cpr_get_answer_is_yes( const char *keyword, const char *prompt )
if( opt.command_fd != -1 )
return !!do_get_from_fd ( keyword, 0, 1 );
-#ifdef USE_SHM_COPROCESSING
- if( opt.shm_coprocess )
- return !!do_shm_get( keyword, 0, 1 );
-#endif
for(;;) {
p = tty_get( prompt );
trim_spaces(p); /* it is okay to do this here */
@@ -488,10 +464,6 @@ cpr_get_answer_yes_no_quit( const char *keyword, const char *prompt )
if( opt.command_fd != -1 )
return !!do_get_from_fd ( keyword, 0, 1 );
-#ifdef USE_SHM_COPROCESSING
- if( opt.shm_coprocess )
- return !!do_shm_get( keyword, 0, 1 );
-#endif
for(;;) {
p = tty_get( prompt );
trim_spaces(p); /* it is okay to do this here */
@@ -520,10 +492,6 @@ cpr_get_answer_okay_cancel (const char *keyword,
if( opt.command_fd != -1 )
answer = do_get_from_fd ( keyword, 0, 0 );
-#ifdef USE_SHM_COPROCESSING
- else if( opt.shm_coprocess )
- answer = do_shm_get( keyword, 0, 0 );
-#endif
if (answer)
{
diff --git a/g10/keygen.c b/g10/keygen.c
index d60578640..6a37471cb 100644
--- a/g10/keygen.c
+++ b/g10/keygen.c
@@ -1958,6 +1958,11 @@ ask_user_id( int mode )
if ( !mode )
{
+ /* TRANSLATORS: This is the new string telling the user what
+ gpg is now going to do (i.e. ask for the parts of the user
+ ID). Note that if you do not tyranslated this string, a
+ different string will be used used, which might still have
+ a correct transaltion. */
const char *s1 =
N_("\n"
"GnuPG needs to construct a user ID to identify your key.\n"
@@ -1970,6 +1975,10 @@ ask_user_id( int mode )
the old info text. gettext has no way to tell whether
a translation is actually available, thus we need to
to compare again. */
+ /* TRANSLATORS: This string is in general not anymore used
+ but you should keep your existing translation. In case
+ the new string is not translated this old string will
+ be used. */
const char *s3 = N_("\n"
"You need a user ID to identify your key; "
"the software constructs the user ID\n"
diff --git a/g10/misc.c b/g10/misc.c
index cbaee08b5..5325faab9 100644
--- a/g10/misc.c
+++ b/g10/misc.c
@@ -1248,6 +1248,17 @@ unescape_percent_string (const unsigned char *s)
}
+/* Check whether the string has characters not valid in an RFC822
+ address. To cope with OpenPGP we ignore allow non-ascii characters
+ so that for example umlauts are legal in an email address. An
+ OpenPGP user ID must be utf-8 encoded and tehre 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 assumtiopn
+ that mail programs etc 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 becuase in keygen.c this function is called with the
+ native encoding and native to utf-8 encoding is done only after
+ checking. */
int
has_invalid_email_chars (const char *s)
{
@@ -1257,8 +1268,8 @@ has_invalid_email_chars (const char *s)
for ( ; *s; s++ )
{
- if ( *s & 0x80 )
- return 1;
+ if ( (*s & 0x80) )
+ continue; /* We only care about ASCII. */
if ( *s == '@' )
at_seen=1;
else if ( !at_seen && !( !!strchr( valid_chars, *s ) || *s == '+' ) )