1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

fixes for M_DEBUG, strcasecmp and RISC OS

This commit is contained in:
Stefan Bellon 2002-05-10 17:28:32 +00:00
parent fecfcb6454
commit 1935d90e1f
18 changed files with 323 additions and 246 deletions

View file

@ -1,3 +1,9 @@
2002-05-10 Stefan Bellon <sbellon@sbellon.de>
* g10.c, hkp.c, keyedit.c, keyserver.c: Replaced all occurrances
of strcasecmp with ascii_strcasecmp and all occurrances of
strncasecmp with ascii_memcasecmp.
2002-05-10 David Shaw <dshaw@jabberwocky.com>
* packet.h, getkey.c (fixup_uidnode), keyedit.c (show_prefs): Show

View file

@ -1492,7 +1492,8 @@ main( int argc, char **argv )
* may try to load an module */
if( def_cipher_string ) {
opt.def_cipher_algo = string_to_cipher_algo(def_cipher_string);
if(opt.def_cipher_algo==0 && strcasecmp(def_cipher_string,"idea")==0)
if(opt.def_cipher_algo==0 &&
ascii_strcasecmp(def_cipher_string,"idea")==0)
idea_cipher_warn(1);
m_free(def_cipher_string); def_cipher_string = NULL;
if( check_cipher_algo(opt.def_cipher_algo) )

View file

@ -77,7 +77,7 @@ hkp_ask_import( KEYDB_SEARCH_DESC *desc, void *stats_handle)
* binary mode ... how?
*/
if(strcasecmp(opt.keyserver_scheme,"x-broken-hkp")==0)
if(ascii_strcasecmp(opt.keyserver_scheme,"x-broken-hkp")==0)
hflags |= HTTP_FLAG_NO_SHUTDOWN;
sprintf(request,"x-hkp://%s%s%s/pks/lookup?op=get&search=0x%08lX",
@ -131,7 +131,7 @@ hkp_export( STRLIST users )
request = m_alloc( strlen( opt.keyserver_host ) + 100 );
if(strcasecmp(opt.keyserver_scheme,"x-broken-hkp")==0)
if(ascii_strcasecmp(opt.keyserver_scheme,"x-broken-hkp")==0)
hflags |= HTTP_FLAG_NO_SHUTDOWN;
sprintf( request, "x-hkp://%s%s%s/pks/add",
@ -305,7 +305,7 @@ parse_hkp_index(IOBUF buffer,char *line)
}
}
if(strncasecmp(line,"pub ",5)==0)
if(ascii_memcasecmp(line,"pub ",5)==0)
{
char *tok,*temp;
@ -503,7 +503,7 @@ int hkp_search(STRLIST tokens)
request=m_alloc(strlen(opt.keyserver_host) + 100 + strlen(searchurl));
if(strcasecmp(opt.keyserver_scheme,"x-broken-hkp")==0)
if(ascii_strcasecmp(opt.keyserver_scheme,"x-broken-hkp")==0)
hflags |= HTTP_FLAG_NO_SHUTDOWN;
sprintf(request,"x-hkp://%s%s%s/pks/lookup?op=index&search=%s",

View file

@ -558,13 +558,13 @@ sign_uids( KBNODE keyblock, STRLIST locusr, int *ret_modified,
if(answer[0]=='\0')
class=0x10+opt.def_cert_check_level; /* Default */
else if(strcasecmp(answer,"0")==0)
else if(ascii_strcasecmp(answer,"0")==0)
class=0x10; /* Generic */
else if(strcasecmp(answer,"1")==0)
else if(ascii_strcasecmp(answer,"1")==0)
class=0x11; /* Persona */
else if(strcasecmp(answer,"2")==0)
else if(ascii_strcasecmp(answer,"2")==0)
class=0x12; /* Casual */
else if(strcasecmp(answer,"3")==0)
else if(ascii_strcasecmp(answer,"3")==0)
class=0x13; /* Positive */
else
tty_printf(_("Invalid selection.\n"));

View file

@ -51,44 +51,44 @@ parse_keyserver_options(char *options)
do
{
if(strcasecmp(tok,"include-revoked")==0)
if(ascii_strcasecmp(tok,"include-revoked")==0)
opt.keyserver_options.include_revoked=1;
else if(strcasecmp(tok,"no-include-revoked")==0)
else if(ascii_strcasecmp(tok,"no-include-revoked")==0)
opt.keyserver_options.include_revoked=0;
else if(strcasecmp(tok,"include-disabled")==0)
else if(ascii_strcasecmp(tok,"include-disabled")==0)
opt.keyserver_options.include_disabled=1;
else if(strcasecmp(tok,"no-include-disabled")==0)
else if(ascii_strcasecmp(tok,"no-include-disabled")==0)
opt.keyserver_options.include_disabled=0;
#ifdef EXEC_TEMPFILE_ONLY
else if(strcasecmp(tok,"use-temp-files")==0 ||
strcasecmp(tok,"no-use-temp-files")==0)
else if(ascii_strcasecmp(tok,"use-temp-files")==0 ||
ascii_strcasecmp(tok,"no-use-temp-files")==0)
log_info(_("Warning: keyserver option \"%s\" is not used "
"on this platform\n"),tok);
#else
else if(strcasecmp(tok,"use-temp-files")==0)
else if(ascii_strcasecmp(tok,"use-temp-files")==0)
opt.keyserver_options.use_temp_files=1;
else if(strcasecmp(tok,"no-use-temp-files")==0)
else if(ascii_strcasecmp(tok,"no-use-temp-files")==0)
opt.keyserver_options.use_temp_files=0;
#endif
else if(strcasecmp(tok,"keep-temp-files")==0)
else if(ascii_strcasecmp(tok,"keep-temp-files")==0)
opt.keyserver_options.keep_temp_files=1;
else if(strcasecmp(tok,"no-keep-temp-files")==0)
else if(ascii_strcasecmp(tok,"no-keep-temp-files")==0)
opt.keyserver_options.keep_temp_files=0;
else if(strcasecmp(tok,"verbose")==0)
else if(ascii_strcasecmp(tok,"verbose")==0)
opt.keyserver_options.verbose++;
else if(strcasecmp(tok,"no-verbose")==0)
else if(ascii_strcasecmp(tok,"no-verbose")==0)
opt.keyserver_options.verbose--;
else if(strcasecmp(tok,"honor-http-proxy")==0)
else if(ascii_strcasecmp(tok,"honor-http-proxy")==0)
opt.honor_http_proxy=1;
else if(strcasecmp(tok,"no-honor-http-proxy")==0)
else if(ascii_strcasecmp(tok,"no-honor-http-proxy")==0)
opt.honor_http_proxy=0;
else if(strcasecmp(tok,"refresh-add-fake-v3-keyids")==0)
else if(ascii_strcasecmp(tok,"refresh-add-fake-v3-keyids")==0)
opt.keyserver_options.refresh_add_fake_v3_keyids=1;
else if(strcasecmp(tok,"no-refresh-add-fake-v3-keyids")==0)
else if(ascii_strcasecmp(tok,"no-refresh-add-fake-v3-keyids")==0)
opt.keyserver_options.refresh_add_fake_v3_keyids=0;
else if(strcasecmp(tok,"auto-key-retrieve")==0)
else if(ascii_strcasecmp(tok,"auto-key-retrieve")==0)
opt.keyserver_options.auto_key_retrieve=1;
else if(strcasecmp(tok,"no-auto-key-retrieve")==0)
else if(ascii_strcasecmp(tok,"no-auto-key-retrieve")==0)
opt.keyserver_options.auto_key_retrieve=0;
else if(strlen(tok)>0)
add_to_strlist(&opt.keyserver_options.other,tok);
@ -466,7 +466,7 @@ keyserver_spawn(int action,STRLIST list,
goto fail; /* i.e. EOF */
}
if(strncasecmp(line,"VERSION ",8)==0)
if(ascii_memcasecmp(line,"VERSION ",8)==0)
{
gotversion=1;
@ -478,16 +478,16 @@ keyserver_spawn(int action,STRLIST list,
}
}
if(strncasecmp(line,"PROGRAM ",8)==0)
if(ascii_memcasecmp(line,"PROGRAM ",8)==0)
{
line[strlen(line)-1]='\0';
if(strcasecmp(&line[8],VERSION)!=0)
if(ascii_strcasecmp(&line[8],VERSION)!=0)
log_info(_("Warning: keyserver handler from a different "
"version of GnuPG (%s)\n"),&line[8]);
}
/* Currently the only OPTION */
if(strncasecmp(line,"OPTION OUTOFBAND",16)==0)
if(ascii_memcasecmp(line,"OPTION OUTOFBAND",16)==0)
outofband=1;
}
while(line[0]!='\n');
@ -573,9 +573,9 @@ keyserver_work(int action,STRLIST list,KEYDB_SEARCH_DESC *desc,int count)
#ifndef USE_EXTERNAL_HKP
/* Use the internal HKP code */
if(strcasecmp(opt.keyserver_scheme,"x-hkp")==0 ||
strcasecmp(opt.keyserver_scheme,"hkp")==0 ||
strcasecmp(opt.keyserver_scheme,"x-broken-hkp")==0)
if(ascii_strcasecmp(opt.keyserver_scheme,"x-hkp")==0 ||
ascii_strcasecmp(opt.keyserver_scheme,"hkp")==0 ||
ascii_strcasecmp(opt.keyserver_scheme,"x-broken-hkp")==0)
{
void *stats_handle = import_new_stats_handle ();
@ -847,10 +847,10 @@ keyserver_refresh(STRLIST users)
scheme, then enable fake v3 keyid generation. */
if(opt.keyserver_options.refresh_add_fake_v3_keyids &&
opt.keyserver_scheme &&
(strcasecmp(opt.keyserver_scheme,"x-hkp")==0 ||
strcasecmp(opt.keyserver_scheme,"hkp")==0 ||
strcasecmp(opt.keyserver_scheme,"x-broken-hkp")==0 ||
strcasecmp(opt.keyserver_scheme,"mailto")==0))
(ascii_strcasecmp(opt.keyserver_scheme,"x-hkp")==0 ||
ascii_strcasecmp(opt.keyserver_scheme,"hkp")==0 ||
ascii_strcasecmp(opt.keyserver_scheme,"x-broken-hkp")==0 ||
ascii_strcasecmp(opt.keyserver_scheme,"mailto")==0))
fakev3=1;
rc=keyidlist(users,&desc,&count,fakev3);