aboutsummaryrefslogtreecommitdiffstats
path: root/g10
diff options
context:
space:
mode:
Diffstat (limited to 'g10')
-rw-r--r--g10/ChangeLog13
-rw-r--r--g10/g10.c6
-rw-r--r--g10/getkey.c4
-rw-r--r--g10/keyedit.c2
-rw-r--r--g10/keygen.c16
-rw-r--r--g10/keyserver.c4
-rw-r--r--g10/revoke.c2
-rw-r--r--g10/tdbdump.c2
8 files changed, 31 insertions, 18 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index 8378f49c7..05725c02d 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,16 @@
+2003-06-07 Werner Koch <[email protected]>
+
+ * g10.c (add_notation_data): Make sure that only ascii is passed
+ to iscntrl. Noted by Christian Biere.
+ * getkey.c (classify_user_id2): Replaced isspace by spacep
+ * keygen.c (keygen_set_std_prefs): Likewise. Also for isdigit.
+ (ask_user_id): Ditto.
+ (get_parameter_algo): Ditto.
+ * keyedit.c (keyedit_menu): Ditto.
+ * tdbdump.c (import_ownertrust): Ditto. s/isxdigit/hexdigitp/.
+ * revoke.c (ask_revocation_reason):
+ * keyserver.c (keyserver_spawn): Dito.
+
2003-06-04 David Shaw <[email protected]>
* options.skel: Use new hkp://subkeys.pgp.net as sample keyserver
diff --git a/g10/g10.c b/g10/g10.c
index e4ab999c6..0a7b9dae9 100644
--- a/g10/g10.c
+++ b/g10/g10.c
@@ -2876,13 +2876,13 @@ add_notation_data( const char *string, int which )
/* we only support printable text - therefore we enforce the use
* of only printable characters (an empty value is valid) */
for( s++; *s ; s++ ) {
- if( iscntrl(*s) ) {
+ if ((*s & 0x80))
+ highbit = 1;
+ else if (iscntrl(*s)) {
log_error(_("a notation value must not use "
"any control characters\n") );
return;
}
- else if( *s & 0x80 )
- highbit = 1;
}
if( highbit ) /* must use UTF8 encoding */
diff --git a/g10/getkey.c b/g10/getkey.c
index a8c87dbdc..cebaa4c5a 100644
--- a/g10/getkey.c
+++ b/g10/getkey.c
@@ -569,7 +569,7 @@ classify_user_id2( const char *name,
memset (desc, 0, sizeof *desc);
*force_exact = 0;
/* skip leading spaces. Fixme: what is with trailing spaces? */
- for(s = name; *s && isspace(*s); s++ )
+ for(s = name; *s && spacep (s); s++ )
;
switch (*s) {
@@ -650,7 +650,7 @@ classify_user_id2( const char *name,
}
/* check if a hexadecimal number is terminated by EOS or blank */
- if (hexlength && s[hexlength] && !isspace(s[hexlength])) {
+ if (hexlength && s[hexlength] && !spacep(s+hexlength)) {
if (hexprefix) /* a "0x" prefix without correct */
return 0; /* termination is an error */
else /* The first chars looked like */
diff --git a/g10/keyedit.c b/g10/keyedit.c
index 903d62322..5a641ddbc 100644
--- a/g10/keyedit.c
+++ b/g10/keyedit.c
@@ -1100,7 +1100,7 @@ keyedit_menu( const char *username, STRLIST locusr, STRLIST commands,
cmd = cmdLIST;
else if( *answer == CONTROL_D )
cmd = cmdQUIT;
- else if( isdigit( *answer ) ) {
+ else if( digitp(answer ) ) {
cmd = cmdSELUID;
arg_number = atoi(answer);
}
diff --git a/g10/keygen.c b/g10/keygen.c
index 48ff865e5..f8fecebcc 100644
--- a/g10/keygen.c
+++ b/g10/keygen.c
@@ -244,17 +244,17 @@ keygen_set_std_prefs (const char *string,int personal)
string = "";
for (s=string; *s; s = s2) {
- if ((*s=='s' || *s == 'S') && isdigit(s[1]) ) {
+ if ((*s=='s' || *s == 'S') && digitp (s+1) ) {
val = strtoul (++s, (char**)&s2, 10);
if (set_one_pref (val, 'S', check_cipher_algo, sym, &nsym))
rc = -1;
}
- else if ((*s=='h' || *s == 'H') && isdigit(s[1]) ) {
+ else if ((*s=='h' || *s == 'H') && digitp (s+1) ) {
val = strtoul (++s, (char**)&s2, 10);
if (set_one_pref (val, 'H', check_digest_algo, hash, &nhash))
rc = -1;
}
- else if ((*s=='z' || *s == 'Z') && isdigit(s[1]) ) {
+ else if ((*s=='z' || *s == 'Z') && digitp (s+1) ) {
val = strtoul (++s, (char**)&s2, 10);
if (set_one_pref (val, 'Z', check_compress_algo, zip, &nzip))
rc = -1;
@@ -267,7 +267,7 @@ keygen_set_std_prefs (const char *string,int personal)
mdc=0;
s2=s+6;
}
- else if (isspace (*s))
+ else if (spacep (s))
s2 = s+1;
else {
log_info (_("invalid character in preference string\n"));
@@ -915,10 +915,10 @@ gen_rsa(int algo, unsigned nbits, KBNODE pub_root, KBNODE sec_root, DEK *dek,
static int
check_valid_days( const char *s )
{
- if( !isdigit(*s) )
+ if( !digitp(s) )
return 0;
for( s++; *s; s++)
- if( !isdigit(*s) )
+ if( !digitp(s) )
break;
if( !*s )
return 1;
@@ -1252,7 +1252,7 @@ ask_user_id( int mode )
if( strpbrk( aname, "<>" ) )
tty_printf(_("Invalid character in name\n"));
- else if( isdigit(*aname) )
+ else if( digitp(aname) )
tty_printf(_("Name may not start with a digit\n"));
else if( strlen(aname) < 5 )
tty_printf(_("Name must be at least 5 characters long\n"));
@@ -1522,7 +1522,7 @@ get_parameter_algo( struct para_data_s *para, enum para_name key )
struct para_data_s *r = get_parameter( para, key );
if( !r )
return -1;
- if( isdigit( *r->u.value ) )
+ if( digitp( r->u.value ) )
i = atoi( r->u.value );
else
i = string_to_pubkey_algo( r->u.value );
diff --git a/g10/keyserver.c b/g10/keyserver.c
index 4be8a1c68..6b7c91863 100644
--- a/g10/keyserver.c
+++ b/g10/keyserver.c
@@ -189,7 +189,7 @@ parse_keyserver_uri(char *uri,const char *configname,unsigned int configlineno)
ch=opt.keyserver_port;
while(*ch!='\0')
{
- if(!isdigit(*ch))
+ if(!digitp(ch))
return G10ERR_BAD_URI;
ch++;
@@ -569,7 +569,7 @@ keyserver_spawn(int action,STRLIST list,
/* remove trailing whitespace */
plen=strlen(ptr);
- while(plen>0 && isspace(ptr[plen-1]))
+ while(plen>0 && spacep(ptr+plen-1))
plen--;
plen[ptr]='\0';
diff --git a/g10/revoke.c b/g10/revoke.c
index 427fa0827..db73938e2 100644
--- a/g10/revoke.c
+++ b/g10/revoke.c
@@ -636,7 +636,7 @@ ask_revocation_reason( int key_rev, int cert_rev, int hint )
return NULL; /* cancel */
if( hint && !*answer )
n = hint;
- else if(!isdigit( *answer ) )
+ else if(!digitp( answer ) )
n = -1;
else
n = atoi(answer);
diff --git a/g10/tdbdump.c b/g10/tdbdump.c
index cd46f1f5a..b5258a914 100644
--- a/g10/tdbdump.c
+++ b/g10/tdbdump.c
@@ -153,7 +153,7 @@ import_ownertrust( const char *fname )
break; /* can't continue */
}
for(p = line; *p && *p != ':' ; p++ )
- if( !isxdigit(*p) )
+ if( !hexdigitp(p) )
break;
if( *p != ':' ) {
log_error_f(fname, _("error: missing colon\n") );