From bb3cea75482cc31d3e077a0847e84cccede8d601 Mon Sep 17 00:00:00 2001 From: Cas Cremers Date: Mon, 9 Jul 2012 11:24:42 +0200 Subject: [PATCH] BUGFIX: Adversary was weakened in a previous commit wrt symmetric-key protocols. After we merged some concepts from the compromise branch, we forgot to add for the hardcoded PKI that the adversary also should have access to (some) symmetric keys. --- src/specialterm.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/specialterm.c b/src/specialterm.c index 6fcb82d..f0ccac1 100644 --- a/src/specialterm.c +++ b/src/specialterm.c @@ -30,6 +30,8 @@ #define langhide(x,y) x = levelConst(symbolSysConst(" _" y "_ ")) #define langtype(x,y) x->stype = termlistAdd(x->stype,y) #define langcons(x,y,z) x = levelConst(symbolSysConst(y)); langtype(x,z) +#define symmEveKey(a,b) knowledgeAddTerm (sys->know, makeTermEncrypt ( makeTermTuple(a, b), TERM_K ) ); + /* externally used: */ @@ -134,9 +136,13 @@ specialTermInitAfter (const System sys) knowledgeAddTerm (sys->know, AGENT_Dave); knowledgeAddTerm (sys->know, AGENT_Eve); - // Make special Eve key and add to initial knowledge + // Make special Eve keys and add to initial knowledge SKE = makeTermEncrypt (AGENT_Eve, TERM_SK); knowledgeAddTerm (sys->know, SKE); + symmEveKey (AGENT_Alice, AGENT_Eve); + symmEveKey (AGENT_Bob, AGENT_Eve); + symmEveKey (AGENT_Charlie, AGENT_Eve); + symmEveKey (AGENT_Eve, AGENT_Alice); sys->untrusted = termlistAddNew (sys->untrusted, AGENT_Eve); }