From a1fdbe119f8511b7c64dcd7236b4ee3835d54e44 Mon Sep 17 00:00:00 2001 From: ccremers Date: Fri, 1 Jul 2005 13:46:18 +0000 Subject: [PATCH] - Incorporated untrusted agents list ( element in attack, containing a ) - ./scyther -x... is now available. --- src/todo.txt | 8 -------- src/xmlout.c | 40 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 39 insertions(+), 9 deletions(-) diff --git a/src/todo.txt b/src/todo.txt index adca952..03c0c89 100644 --- a/src/todo.txt +++ b/src/todo.txt @@ -4,11 +4,3 @@ - Maybe it helps to fix the agents of the claim run (i.e. all different agents?, this restricts the attacks somewhat), make a switch for this. - SConstruct file should check whether ctags actually exists (avoiding errors) - -Gijs: - > Ik gebruik nu alleen wel hardcoded de naam Eve eigenlijk zouden de - > namen - > > van untrusted agents ook ergens in de XML file moeten staan. Ook - > > zou het - > > > handig zijn als de scyther command line in de XML file staat. - > > > diff --git a/src/xmlout.c b/src/xmlout.c index 9f75e21..abcd4c9 100644 --- a/src/xmlout.c +++ b/src/xmlout.c @@ -97,6 +97,13 @@ xmlOutInteger (const char *tag, const int value) xmlPrint ("<%s>%i", tag, value, tag); } +//! Print a string +void +xmlOutString (const char *tag, const char *s) +{ + xmlPrint ("<%s>%s", tag, s, tag); +} + //! Print a term in XML form (iteration inner) void xmlTermPrintInner (Term term) @@ -615,6 +622,35 @@ xmlInvolvedProtocolRoles (const System sys) } } +//! Untrusted agents +void +xmlUntrustedAgents (const System sys) +{ + xmlPrint (""); + xmlindent++; + xmlTermlistPrint (sys->untrusted); + xmlindent--; + xmlPrint (""); +} + +//! Commandline +void +xmlOutCommandline (void) +{ + int i; + + xmlPrint (""); + xmlindent++; + i = 0; + while (i < switches.argc) + { + xmlPrint ("%s", switches.argv[i]); + i++; + } + xmlindent--; + xmlPrint (""); +} + //! Global system info /** * To be used by concrete trace as well as semitrace output @@ -625,10 +661,12 @@ xmlOutSysInfo (const System sys) xmlPrint (""); xmlindent++; + xmlOutCommandline (); xmlOutInteger ("match", switches.match); xmlInitialKnowledge (sys); xmlInvolvedProtocolRoles (sys); + xmlUntrustedAgents (sys); xmlindent--; xmlPrint (""); } @@ -677,7 +715,7 @@ xmlRunInfo (const System sys, const int run) // Non-intruder run, check whether communicates with untrusted agents if (!isRunTrusted (sys, run)) { - printf(" untrustedrun=\"true\""); + printf (" untrustedrun=\"true\""); } } printf (">");