/* -*-c-*-
*
- * $Id: mallory.c,v 1.1 2001/06/19 22:11:14 mdw Exp $
+ * $Id: mallory.c,v 1.2 2003/10/15 09:31:06 mdw Exp $
*
* An evil proxy for TrIPE
*
/*----- Revision history --------------------------------------------------*
*
* $Log: mallory.c,v $
+ * Revision 1.2 2003/10/15 09:31:06 mdw
+ * Make forking work properly.
+ *
* Revision 1.1 2001/06/19 22:11:14 mdw
* The beginnings of a malicious proxy for TrIPE.
*
#include <mLib/sub.h>
#include <mLib/tv.h>
+#include <catacomb/buf.h>
+
#include <catacomb/key.h>
#include <catacomb/mp.h>
#include <catacomb/rand.h>
#include <catacomb/rc4.h>
-#include "buf.h"
/*----- Data structures ---------------------------------------------------*/
static void nextfork(unsigned ac, char **av)
{
- unsigned i;
+ unsigned i, j;
filter *f;
forkfilt *ff;
forknode *fn, **ffn;
peer *p;
+ if (ac < 1)
+ die(1, "syntax: next:NAME:...");
for (i = 0; i < 2; i++) {
p = &peers[i];
for (f = p->f; f; f = f->next) {
if (f->func != dofork)
continue;
ff = f->state;
+ for (j = 0; j < ac; j++) {
+ if (strcmp(av[j], ff->name) == 0)
+ goto match;
+ }
+ continue;
+ match:
fn = CREATE(forknode);
for (ffn = &ff->fn; *ffn; ffn = &(*ffn)->next)
;