1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

* keyserver.c (keyserver_spawn): Show log line for what keyserver action

we are taking.

* keyid.c (keystr): If printing a keyid that lacks the high 4 bytes, print
the low 4 alone. (keystr_from_desc): Handle short keyids and warn on v3
fingerprints.
This commit is contained in:
David Shaw 2004-08-23 19:20:17 +00:00
parent 9d4327ba4d
commit 10eb272a73
3 changed files with 55 additions and 22 deletions

View File

@ -1,5 +1,13 @@
2004-08-23 David Shaw <dshaw@jabberwocky.com>
* keyserver.c (keyserver_spawn): Show log line for what keyserver
action we are taking.
* keyid.c (keystr): If printing a keyid that lacks the high 4
bytes, print the low 4 alone.
(keystr_from_desc): Handle short keyids and warn on v3
fingerprints.
* keydb.h, getkey.c (get_user_id_printable): Rename to
get_user_id_native and remove the printable stuff since we're
print-ifying valid utf8 characters. Change all callers in

View File

@ -178,7 +178,10 @@ keystr(u32 *keyid)
break;
case KF_LONG:
sprintf(keyid_str,"%08lX%08lX",(ulong)keyid[0],(ulong)keyid[1]);
if(keyid[0])
sprintf(keyid_str,"%08lX%08lX",(ulong)keyid[0],(ulong)keyid[1]);
else
sprintf(keyid_str,"%08lX",(ulong)keyid[1]);
break;
case KF_0xSHORT:
@ -186,7 +189,10 @@ keystr(u32 *keyid)
break;
case KF_0xLONG:
sprintf(keyid_str,"0x%08lX%08lX",(ulong)keyid[0],(ulong)keyid[1]);
if(keyid[0])
sprintf(keyid_str,"0x%08lX%08lX",(ulong)keyid[0],(ulong)keyid[1]);
else
sprintf(keyid_str,"0x%08lX",(ulong)keyid[1]);
break;
default:
@ -215,25 +221,34 @@ keystr_from_sk(PKT_secret_key *sk)
const char *
keystr_from_desc(KEYDB_SEARCH_DESC *desc)
{
if(desc->mode==KEYDB_SEARCH_MODE_LONG_KID)
return keystr(desc->u.kid);
else if(desc->mode==KEYDB_SEARCH_MODE_FPR20)
switch(desc->mode)
{
u32 keyid[2];
case KEYDB_SEARCH_MODE_LONG_KID:
case KEYDB_SEARCH_MODE_SHORT_KID:
return keystr(desc->u.kid);
keyid[0] = (unsigned char)desc->u.fpr[12] << 24
| (unsigned char)desc->u.fpr[13] << 16
| (unsigned char)desc->u.fpr[14] << 8
| (unsigned char)desc->u.fpr[15] ;
keyid[1] = (unsigned char)desc->u.fpr[16] << 24
| (unsigned char)desc->u.fpr[17] << 16
| (unsigned char)desc->u.fpr[18] << 8
| (unsigned char)desc->u.fpr[19] ;
case KEYDB_SEARCH_MODE_FPR20:
{
u32 keyid[2];
return keystr(keyid);
keyid[0] = (unsigned char)desc->u.fpr[12] << 24
| (unsigned char)desc->u.fpr[13] << 16
| (unsigned char)desc->u.fpr[14] << 8
| (unsigned char)desc->u.fpr[15] ;
keyid[1] = (unsigned char)desc->u.fpr[16] << 24
| (unsigned char)desc->u.fpr[17] << 16
| (unsigned char)desc->u.fpr[18] << 8
| (unsigned char)desc->u.fpr[19] ;
return keystr(keyid);
}
case KEYDB_SEARCH_MODE_FPR16:
return "?v3 fpr?";
default:
BUG();
}
else
BUG();
}
/****************

View File

@ -878,6 +878,10 @@ keyserver_spawn(int action,STRLIST list,KEYDB_SEARCH_DESC *desc,
else if(desc[i].mode==KEYDB_SEARCH_MODE_SHORT_KID)
fprintf(spawn->tochild,"0x%08lX\n",
(ulong)desc[i].u.kid[1]);
log_info(_("requesting key %s from %s server %s\n"),
keystr_from_desc(&desc[i]),
keyserver->scheme,keyserver->host);
}
fprintf(spawn->tochild,"\n");
@ -1019,6 +1023,11 @@ keyserver_spawn(int action,STRLIST list,KEYDB_SEARCH_DESC *desc,
fprintf(spawn->tochild,"KEY %s END\n",key->d);
iobuf_close(buffer);
log_info(_("sending key %s to %s server %s\n"),
keystr(block->pkt->pkt.public_key->keyid),
keyserver->scheme,keyserver->host);
release_kbnode(block);
}
@ -1057,6 +1066,9 @@ keyserver_spawn(int action,STRLIST list,KEYDB_SEARCH_DESC *desc,
fprintf(spawn->tochild,"\n");
log_info(_("searching for \"%s\" from %s server %s\n"),
searchstr,keyserver->scheme,keyserver->host);
break;
}
@ -1152,11 +1164,8 @@ keyserver_spawn(int action,STRLIST list,KEYDB_SEARCH_DESC *desc,
break;
case SEARCH:
{
keyserver_search_prompt(spawn->fromchild,searchstr);
break;
}
keyserver_search_prompt(spawn->fromchild,searchstr);
break;
default:
log_fatal(_("no keyserver action!\n"));
@ -1165,6 +1174,7 @@ keyserver_spawn(int action,STRLIST list,KEYDB_SEARCH_DESC *desc,
fail:
m_free(line);
m_free(searchstr);
*prog=exec_finish(spawn);