1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-11-09 21:28:51 +01:00

* gpgkeys_curl.c, gpgkeys_ldap.c, gpgkeys_hkp.c, ksutil.c: Rename all

str(n)casecmp to ascii_str(n)casecmp.  We want the locale-independent
ones here.
This commit is contained in:
David Shaw 2007-04-16 22:43:29 +00:00
parent 20af3fea15
commit e7c72ccc2f
5 changed files with 48 additions and 38 deletions

View File

@ -1,3 +1,9 @@
2007-04-16 David Shaw <dshaw@jabberwocky.com>
* gpgkeys_curl.c, gpgkeys_ldap.c, gpgkeys_hkp.c, ksutil.c: Rename
all str(n)casecmp to ascii_str(n)casecmp. We want the
locale-independent ones here.
2007-03-13 David Shaw <dshaw@jabberwocky.com> 2007-03-13 David Shaw <dshaw@jabberwocky.com>
* gpgkeys_curl.c (main): Use curl_version_info to verify that the * gpgkeys_curl.c (main): Use curl_version_info to verify that the

View File

@ -44,6 +44,7 @@
#else #else
#include "curl-shim.h" #include "curl-shim.h"
#endif #endif
#include "compat.h"
#include "keyserver.h" #include "keyserver.h"
#include "ksutil.h" #include "ksutil.h"
@ -204,13 +205,13 @@ main(int argc,char *argv[])
option[MAX_OPTION]='\0'; option[MAX_OPTION]='\0';
if(strncasecmp(option,"no-",3)==0) if(ascii_strncasecmp(option,"no-",3)==0)
{ {
no=1; no=1;
start=&option[3]; start=&option[3];
} }
if(strncasecmp(start,"http-proxy",10)==0) if(ascii_strncasecmp(start,"http-proxy",10)==0)
{ {
/* Safe to not check the return code of strdup() here. /* Safe to not check the return code of strdup() here.
If it fails, we simply won't use a proxy. */ If it fails, we simply won't use a proxy. */
@ -228,7 +229,7 @@ main(int argc,char *argv[])
} }
} }
} }
else if(strncasecmp(start,"follow-redirects",16)==0) else if(ascii_strncasecmp(start,"follow-redirects",16)==0)
{ {
if(no) if(no)
follow_redirects=0; follow_redirects=0;
@ -275,7 +276,7 @@ main(int argc,char *argv[])
print a nicer error message. */ print a nicer error message. */
curldata=curl_version_info(CURLVERSION_NOW); curldata=curl_version_info(CURLVERSION_NOW);
for(i=0;curldata->protocols[i];i++) for(i=0;curldata->protocols[i];i++)
if(strcasecmp(curldata->protocols[i],opt->scheme)==0) if(ascii_strcasecmp(curldata->protocols[i],opt->scheme)==0)
break; break;
if(curldata->protocols[i]==NULL) if(curldata->protocols[i]==NULL)

View File

@ -1,5 +1,5 @@
/* gpgkeys_hkp.c - talk to an HKP keyserver /* gpgkeys_hkp.c - talk to an HKP keyserver
* Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 * Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006,
* 2007 Free Software Foundation, Inc. * 2007 Free Software Foundation, Inc.
* *
* This file is part of GnuPG. * This file is part of GnuPG.
@ -45,6 +45,7 @@
#else #else
#include "curl-shim.h" #include "curl-shim.h"
#endif #endif
#include "compat.h"
#include "keyserver.h" #include "keyserver.h"
#include "ksutil.h" #include "ksutil.h"
@ -597,13 +598,13 @@ main(int argc,char *argv[])
option[MAX_OPTION]='\0'; option[MAX_OPTION]='\0';
if(strncasecmp(option,"no-",3)==0) if(ascii_strncasecmp(option,"no-",3)==0)
{ {
no=1; no=1;
start=&option[3]; start=&option[3];
} }
if(strncasecmp(start,"http-proxy",10)==0) if(ascii_strncasecmp(start,"http-proxy",10)==0)
{ {
if(no) if(no)
{ {
@ -620,7 +621,7 @@ main(int argc,char *argv[])
} }
} }
#if 0 #if 0
else if(strcasecmp(start,"try-dns-srv")==0) else if(ascii_strcasecmp(start,"try-dns-srv")==0)
{ {
if(no) if(no)
http_flags&=~HTTP_FLAG_TRY_SRV; http_flags&=~HTTP_FLAG_TRY_SRV;

View File

@ -1,5 +1,6 @@
/* gpgkeys_ldap.c - talk to a LDAP keyserver /* gpgkeys_ldap.c - talk to a LDAP keyserver
* Copyright (C) 2001, 2002, 2004, 2005, 2006 Free Software Foundation, Inc. * Copyright (C) 2001, 2002, 2004, 2005, 2006,
* 2007 Free Software Foundation, Inc.
* *
* This file is part of GnuPG. * This file is part of GnuPG.
* *
@ -131,7 +132,7 @@ key_in_keylist(const char *key,struct keylist *list)
while(keyptr!=NULL) while(keyptr!=NULL)
{ {
if(strcasecmp(key,keyptr->str)==0) if(ascii_strcasecmp(key,keyptr->str)==0)
return 1; return 1;
keyptr=keyptr->next; keyptr=keyptr->next;
@ -270,7 +271,7 @@ make_one_attr(LDAPMod ***modlist,char *attr,const char *value)
/* Search modlist for the attribute we're playing with. */ /* Search modlist for the attribute we're playing with. */
for(m=*modlist;*m;m++) for(m=*modlist;*m;m++)
{ {
if(strcasecmp((*m)->mod_type,attr)==0) if(ascii_strcasecmp((*m)->mod_type,attr)==0)
{ {
char **ptr=(*m)->mod_values; char **ptr=(*m)->mod_values;
int numvalues=0; int numvalues=0;
@ -1478,9 +1479,9 @@ search_key(const char *searchkey)
{ {
/* The LDAP server doesn't exactly handle this /* The LDAP server doesn't exactly handle this
well. */ well. */
if(strcasecmp(vals[0],"RSA")==0) if(ascii_strcasecmp(vals[0],"RSA")==0)
fprintf(output,"1"); fprintf(output,"1");
else if(strcasecmp(vals[0],"DSS/DH")==0) else if(ascii_strcasecmp(vals[0],"DSS/DH")==0)
fprintf(output,"17"); fprintf(output,"17");
ldap_value_free(vals); ldap_value_free(vals);
} }
@ -1561,7 +1562,7 @@ search_key(const char *searchkey)
vals=ldap_get_values(ldap,uids,"pgpcertid"); vals=ldap_get_values(ldap,uids,"pgpcertid");
if(vals!=NULL) if(vals!=NULL)
{ {
if(strcasecmp(certid[0],vals[0])==0) if(ascii_strcasecmp(certid[0],vals[0])==0)
{ {
char **uidvals; char **uidvals;
@ -1863,25 +1864,25 @@ main(int argc,char *argv[])
optionstr[MAX_OPTION]='\0'; optionstr[MAX_OPTION]='\0';
if(strncasecmp(optionstr,"no-",3)==0) if(ascii_strncasecmp(optionstr,"no-",3)==0)
{ {
no=1; no=1;
start=&optionstr[3]; start=&optionstr[3];
} }
if(strncasecmp(start,"tls",3)==0) if(ascii_strncasecmp(start,"tls",3)==0)
{ {
if(no) if(no)
use_tls=0; use_tls=0;
else if(start[3]=='=') else if(start[3]=='=')
{ {
if(strcasecmp(&start[4],"no")==0) if(ascii_strcasecmp(&start[4],"no")==0)
use_tls=0; use_tls=0;
else if(strcasecmp(&start[4],"try")==0) else if(ascii_strcasecmp(&start[4],"try")==0)
use_tls=1; use_tls=1;
else if(strcasecmp(&start[4],"warn")==0) else if(ascii_strcasecmp(&start[4],"warn")==0)
use_tls=2; use_tls=2;
else if(strcasecmp(&start[4],"require")==0) else if(ascii_strcasecmp(&start[4],"require")==0)
use_tls=3; use_tls=3;
else else
use_tls=1; use_tls=1;
@ -1889,7 +1890,7 @@ main(int argc,char *argv[])
else if(start[3]=='\0') else if(start[3]=='\0')
use_tls=1; use_tls=1;
} }
else if(strncasecmp(start,"basedn",6)==0) else if(ascii_strncasecmp(start,"basedn",6)==0)
{ {
if(no) if(no)
{ {
@ -1911,7 +1912,7 @@ main(int argc,char *argv[])
real_ldap=1; real_ldap=1;
} }
} }
else if(strncasecmp(start,"binddn",6)==0) else if(ascii_strncasecmp(start,"binddn",6)==0)
{ {
if(no) if(no)
{ {
@ -1933,7 +1934,7 @@ main(int argc,char *argv[])
real_ldap=1; real_ldap=1;
} }
} }
else if(strncasecmp(start,"bindpw",6)==0) else if(ascii_strncasecmp(start,"bindpw",6)==0)
{ {
if(no) if(no)
{ {
@ -1967,7 +1968,7 @@ main(int argc,char *argv[])
goto fail; goto fail;
} }
if(strcasecmp(opt->scheme,"ldaps")==0) if(ascii_strcasecmp(opt->scheme,"ldaps")==0)
{ {
port=636; port=636;
use_ssl=1; use_ssl=1;

View File

@ -1,5 +1,5 @@
/* ksutil.c - general keyserver utility functions /* ksutil.c - general keyserver utility functions
* Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. * Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
* *
* This file is part of GnuPG. * This file is part of GnuPG.
* *
@ -42,6 +42,7 @@
#else #else
#include "curl-shim.h" #include "curl-shim.h"
#endif #endif
#include "compat.h"
#include "keyserver.h" #include "keyserver.h"
#include "ksutil.h" #include "ksutil.h"
@ -149,13 +150,13 @@ parse_ks_options(char *line,struct ks_options *opt)
{ {
command[MAX_COMMAND]='\0'; command[MAX_COMMAND]='\0';
if(strcasecmp(command,"get")==0) if(ascii_strcasecmp(command,"get")==0)
opt->action=KS_GET; opt->action=KS_GET;
else if(strcasecmp(command,"getname")==0) else if(ascii_strcasecmp(command,"getname")==0)
opt->action=KS_GETNAME; opt->action=KS_GETNAME;
else if(strcasecmp(command,"send")==0) else if(ascii_strcasecmp(command,"send")==0)
opt->action=KS_SEND; opt->action=KS_SEND;
else if(strcasecmp(command,"search")==0) else if(ascii_strcasecmp(command,"search")==0)
opt->action=KS_SEARCH; opt->action=KS_SEARCH;
return 0; return 0;
@ -236,13 +237,13 @@ parse_ks_options(char *line,struct ks_options *opt)
option[MAX_OPTION]='\0'; option[MAX_OPTION]='\0';
if(strncasecmp(option,"no-",3)==0) if(ascii_strncasecmp(option,"no-",3)==0)
{ {
no=1; no=1;
start=&option[3]; start=&option[3];
} }
if(strncasecmp(start,"verbose",7)==0) if(ascii_strncasecmp(start,"verbose",7)==0)
{ {
if(no) if(no)
opt->verbose=0; opt->verbose=0;
@ -251,35 +252,35 @@ parse_ks_options(char *line,struct ks_options *opt)
else else
opt->verbose++; opt->verbose++;
} }
else if(strcasecmp(start,"include-disabled")==0) else if(ascii_strcasecmp(start,"include-disabled")==0)
{ {
if(no) if(no)
opt->flags.include_disabled=0; opt->flags.include_disabled=0;
else else
opt->flags.include_disabled=1; opt->flags.include_disabled=1;
} }
else if(strcasecmp(start,"include-revoked")==0) else if(ascii_strcasecmp(start,"include-revoked")==0)
{ {
if(no) if(no)
opt->flags.include_revoked=0; opt->flags.include_revoked=0;
else else
opt->flags.include_revoked=1; opt->flags.include_revoked=1;
} }
else if(strcasecmp(start,"include-subkeys")==0) else if(ascii_strcasecmp(start,"include-subkeys")==0)
{ {
if(no) if(no)
opt->flags.include_subkeys=0; opt->flags.include_subkeys=0;
else else
opt->flags.include_subkeys=1; opt->flags.include_subkeys=1;
} }
else if(strcasecmp(start,"check-cert")==0) else if(ascii_strcasecmp(start,"check-cert")==0)
{ {
if(no) if(no)
opt->flags.check_cert=0; opt->flags.check_cert=0;
else else
opt->flags.check_cert=1; opt->flags.check_cert=1;
} }
else if(strncasecmp(start,"debug",5)==0) else if(ascii_strncasecmp(start,"debug",5)==0)
{ {
if(no) if(no)
opt->debug=0; opt->debug=0;
@ -288,7 +289,7 @@ parse_ks_options(char *line,struct ks_options *opt)
else if(start[5]=='\0') else if(start[5]=='\0')
opt->debug=1; opt->debug=1;
} }
else if(strncasecmp(start,"timeout",7)==0) else if(ascii_strncasecmp(start,"timeout",7)==0)
{ {
if(no) if(no)
opt->timeout=0; opt->timeout=0;
@ -297,7 +298,7 @@ parse_ks_options(char *line,struct ks_options *opt)
else if(start[7]=='\0') else if(start[7]=='\0')
opt->timeout=DEFAULT_KEYSERVER_TIMEOUT; opt->timeout=DEFAULT_KEYSERVER_TIMEOUT;
} }
else if(strncasecmp(start,"ca-cert-file",12)==0) else if(ascii_strncasecmp(start,"ca-cert-file",12)==0)
{ {
if(no) if(no)
{ {