[Mixmaster-devel] CVS: Mix/Src mix3.h,1.10,1.11 pgpdb.c,1.6,1.7 stats.c,1.11,1.12
Brought to you by:
weaselp
From: Peter P. <we...@us...> - 2002-08-22 08:13:40
|
Update of /cvsroot/mixmaster/Mix/Src In directory usw-pr-cvs1:/tmp/cvs-serv25751/Src Modified Files: mix3.h pgpdb.c stats.c Log Message: Also list cypherpunk remailers in remailer-conf reply. Thanks to Ulf and Disastry for their help. Index: mix3.h =================================================================== RCS file: /cvsroot/mixmaster/Mix/Src/mix3.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** mix3.h 22 Aug 2002 05:18:26 -0000 1.10 --- mix3.h 22 Aug 2002 08:13:35 -0000 1.11 *************** *** 316,319 **** --- 316,320 ---- int t1_rlist(REMAILER remailer[]); int pgp_rlist(REMAILER remailer[], int n); + int pgp_rkeylist(REMAILER remailer[], int keyid[], int n); int chain_select(int hop[], char *chainstr, int maxrem, REMAILER *remailer, int type, BUFFER *feedback); Index: pgpdb.c =================================================================== RCS file: /cvsroot/mixmaster/Mix/Src/pgpdb.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** pgpdb.c 16 Aug 2002 19:03:37 -0000 1.6 --- pgpdb.c 22 Aug 2002 08:13:36 -0000 1.7 *************** *** 411,413 **** --- 411,445 ---- } + int pgp_rkeylist(REMAILER remailer[], int keyid[], int n) + /* Step through all remailers and get keyid */ + { + BUFFER *userid; + BUFFER *id; + int i, err; + int mdc, sym; + + userid = buf_new(); + id = buf_new(); + + for (i = 1; i < n; i++) { + buf_clear(userid); + buf_setf(userid, "<%s>", remailer[i].addr); + + keyid[i]=0; + if (remailer[i].flags.pgp) { + mdc = sym = 0; + buf_clear(id); + err = pgpdb_getkey(PK_VERIFY, PGP_ANY, &sym, &mdc, NULL, userid, NULL, id, NULL, NULL); + if (id->length == 8) { + /* printf("%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x %s\n", + id->data[0], id->data[1], id->data[2], id->data[3], id->data[4], id->data[5], id->data[6], id->data[7], id->data[8], remailer[i].addr); */ + keyid[i] = (((((id->data[4] << 8) + id->data[5]) << 8) + id->data[6]) << 8) + id->data[7]; + } + } + } + + buf_free(userid); + return (0); + } + #endif /* USE_PGP */ Index: stats.c =================================================================== RCS file: /cvsroot/mixmaster/Mix/Src/stats.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** stats.c 22 Aug 2002 05:25:22 -0000 1.11 --- stats.c 22 Aug 2002 08:13:36 -0000 1.12 *************** *** 218,221 **** --- 218,226 ---- BUFFER *b, *line; int flag = 0; + REMAILER remailer[MAXREM]; + int pgpkeyid[MAXREM]; + int i, num; + char tmpline[LINELEN]; + b = buf_new(); line = buf_new(); *************** *** 319,328 **** buf_nl(out); - /* FIXME if (PGP) { buf_appends(out, "SUPPORTED CPUNK (TYPE I) REMAILERS\n"); buf_nl(out); } - */ if (MIX) { buf_appends(out, "SUPPORTED MIXMASTER (TYPE II) REMAILERS\n"); --- 324,340 ---- buf_nl(out); if (PGP) { buf_appends(out, "SUPPORTED CPUNK (TYPE I) REMAILERS\n"); + num = t1_rlist(remailer); + pgp_rkeylist(remailer, pgpkeyid, num); + for (i=1; i<=num; i++) { + if (remailer[i].flags.pgp) { + snprintf(tmpline, LINELEN, "0x%08X \"%s <%s>\"\n", pgpkeyid[i], remailer[i].name, remailer[i].addr); + tmpline[LINELEN-1] = '\0'; + buf_appends(out, tmpline); + } + } buf_nl(out); } if (MIX) { buf_appends(out, "SUPPORTED MIXMASTER (TYPE II) REMAILERS\n"); |