aboutsummaryrefslogtreecommitdiffstats
path: root/g10/misc.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2005-07-28 18:59:36 +0000
committerWerner Koch <[email protected]>2005-07-28 18:59:36 +0000
commit986a137c58cae8dc7210ccf51cdea38ec6e8828f (patch)
tree4f847f04509fc74a1fa6db4839abd5d41c80eb9c /g10/misc.c
parentConverted all m_free to xfree etc. (diff)
downloadgnupg-986a137c58cae8dc7210ccf51cdea38ec6e8828f.tar.gz
gnupg-986a137c58cae8dc7210ccf51cdea38ec6e8828f.zip
Implemented PKA trust model
Diffstat (limited to '')
-rw-r--r--g10/misc.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/g10/misc.c b/g10/misc.c
index 380172f09..88b7b2bb1 100644
--- a/g10/misc.c
+++ b/g10/misc.c
@@ -1065,6 +1065,31 @@ unescape_percent_string (const unsigned char *s)
+int
+has_invalid_email_chars (const char *s)
+{
+ int at_seen=0;
+ static char valid_chars[] = ("01234567890_-."
+ "abcdefghijklmnopqrstuvwxyz"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZ");
+
+ for ( ; *s; s++ )
+ {
+ if ( *s & 0x80 )
+ return 1;
+ if ( *s == '@' )
+ at_seen=1;
+ else if ( !at_seen && !( !!strchr( valid_chars, *s ) || *s == '+' ) )
+ return 1;
+ else if ( at_seen && !strchr( valid_chars, *s ) )
+ return 1;
+ }
+ return 0;
+}
+
+
+
+
/* This is a helper function to load a Windows function from either of
one DLLs. */
#ifdef HAVE_W32_SYSTEM