- Added '--check' switch, to see whether your protocol terminates at all
if there is no intruder. - Restructered many switches.
This commit is contained in:
parent
a50245734d
commit
3b897c3872
@ -2958,6 +2958,20 @@ add_claim_specifics (const Claimlist cl, const Roledef rd)
|
|||||||
cl->count = statesIncrease (cl->count);
|
cl->count = statesIncrease (cl->count);
|
||||||
goal_add (rd->message, 0, cl->ev, 0); // Assumption that all claims are in run 0
|
goal_add (rd->message, 0, cl->ev, 0); // Assumption that all claims are in run 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cl->type == CLAIM_Reachable)
|
||||||
|
{
|
||||||
|
if (switches.check)
|
||||||
|
{
|
||||||
|
// For reachability claims in check mode, we restrict the number of runs to the number of roles of this protocol
|
||||||
|
Protocol protocol;
|
||||||
|
int rolecount;
|
||||||
|
|
||||||
|
protocol = (Protocol) cl->protocol;
|
||||||
|
rolecount = termlistLength (protocol->rolenames);
|
||||||
|
switches.runs = rolecount;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Count a false claim
|
//! Count a false claim
|
||||||
|
187
src/switches.c
187
src/switches.c
@ -78,6 +78,7 @@ switchesInit (int argc, char **argv)
|
|||||||
switches.removeclaims = false; // default: leave claims from spdl file
|
switches.removeclaims = false; // default: leave claims from spdl file
|
||||||
switches.addreachableclaim = false; // add 'reachable' claims
|
switches.addreachableclaim = false; // add 'reachable' claims
|
||||||
switches.addallclaims = false; // add all sorts of claims
|
switches.addallclaims = false; // add all sorts of claims
|
||||||
|
switches.check = false; // check the protocol for termination etc. (default off)
|
||||||
|
|
||||||
// Output
|
// Output
|
||||||
switches.output = SUMMARY; // default is to show a summary
|
switches.output = SUMMARY; // default is to show a summary
|
||||||
@ -376,7 +377,7 @@ switcher (const int process, int index, int commandline)
|
|||||||
/* ==================
|
/* ==================
|
||||||
* Generic options
|
* Generic options
|
||||||
*/
|
*/
|
||||||
if (detect ('A', "arachne", 0))
|
if (detect (' ', "arachne", 0))
|
||||||
{
|
{
|
||||||
if (!process)
|
if (!process)
|
||||||
{
|
{
|
||||||
@ -392,14 +393,14 @@ switcher (const int process, int index, int commandline)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (detect ('M', "modelchecker", 0))
|
if (detect (' ', "modelchecker", 0))
|
||||||
{
|
{
|
||||||
if (!process)
|
if (!process)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Discourage
|
* Discourage
|
||||||
*
|
*
|
||||||
helptext ("-M,--modelchecker",
|
helptext (" --modelchecker",
|
||||||
"select Model checking engine [Arachne]");
|
"select Model checking engine [Arachne]");
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
@ -439,11 +440,14 @@ switcher (const int process, int index, int commandline)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (detect ('p', "proof", 0))
|
if (detect (' ', "proof", 0))
|
||||||
{
|
{
|
||||||
if (!process)
|
if (!process)
|
||||||
{
|
{
|
||||||
helptext ("-p,--proof", "show explicit proof");
|
/*
|
||||||
|
* discourage: not very readable for non-experts yet
|
||||||
|
helptext (" --proof", "show explicit proof");
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -453,12 +457,76 @@ switcher (const int process, int index, int commandline)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (detect ('c', "class", 0))
|
if (detect (' ', "remove-claims", 0))
|
||||||
{
|
{
|
||||||
if (!process)
|
if (!process)
|
||||||
{
|
{
|
||||||
helptext ("-c,--class",
|
/* discourage:
|
||||||
"generate full class (show uninstantiated variables)");
|
*
|
||||||
|
* Causes all existing claims in the specification to be skipped.
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
switches.removeclaims = true;
|
||||||
|
return index;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (detect ('c', "check", 0))
|
||||||
|
{
|
||||||
|
if (!process)
|
||||||
|
{
|
||||||
|
helptext ("-c, --check",
|
||||||
|
"disable intruder and run statespace check. For correct protocols, end of roles should be reachable");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
switches.check = true; // check (influences the number of runs after scanning the spdl file, setting it to the protocol role count)
|
||||||
|
switches.intruder = false; // disable intruder
|
||||||
|
switches.removeclaims = true; // remove parsed claims
|
||||||
|
switches.addreachableclaim = true; // add reachability claims
|
||||||
|
return index;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (detect ('a', "auto-claims", 0))
|
||||||
|
{
|
||||||
|
if (!process)
|
||||||
|
{
|
||||||
|
helptext ("-a, --auto-claims",
|
||||||
|
"ignore any existing claims and automatically generate claims");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
switches.removeclaims = true;
|
||||||
|
switches.addallclaims = true;
|
||||||
|
return index;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (detect ('s', "state-space", 0))
|
||||||
|
{
|
||||||
|
if (!process)
|
||||||
|
{
|
||||||
|
helptext ("-s, --state-space",
|
||||||
|
"ignore any existing claims and add 'reachable' claims to generate the full state space");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
switches.removeclaims = true; // remove parsed claims
|
||||||
|
switches.addreachableclaim = true; // add reachability claims
|
||||||
|
switches.prune = 0; // do not prune anything
|
||||||
|
return index;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (detect ('C', "class", 0))
|
||||||
|
{
|
||||||
|
if (!process)
|
||||||
|
{
|
||||||
|
helptext ("-C, --class",
|
||||||
|
"generate full class (show uninstantiated variables in state output)");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -480,53 +548,6 @@ switcher (const int process, int index, int commandline)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (detect (' ', "remove-claims", 0))
|
|
||||||
{
|
|
||||||
if (!process)
|
|
||||||
{
|
|
||||||
/* discourage:
|
|
||||||
*
|
|
||||||
* Causes all existing claims in the specification to be skipped.
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
switches.removeclaims = true;
|
|
||||||
return index;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (detect ('C', "generate-claims", 0))
|
|
||||||
{
|
|
||||||
if (!process)
|
|
||||||
{
|
|
||||||
helptext ("-C,--generate-claims",
|
|
||||||
"ignore any existing claims and automatically generate new claims");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
switches.removeclaims = true;
|
|
||||||
switches.addallclaims = true;
|
|
||||||
return index;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (detect ('G', "generate-semibundles", 0))
|
|
||||||
{
|
|
||||||
if (!process)
|
|
||||||
{
|
|
||||||
helptext ("-G,--generate-statespace",
|
|
||||||
"ignore any existing claims and add 'reachable' claims to generate the full state space");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
switches.removeclaims = true; // remove parsed claims
|
|
||||||
switches.addreachableclaim = true; // add reachability claims
|
|
||||||
switches.prune = 0; // do not prune anything
|
|
||||||
return index;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ==================
|
/* ==================
|
||||||
* Bounding options
|
* Bounding options
|
||||||
*/
|
*/
|
||||||
@ -540,7 +561,7 @@ switcher (const int process, int index, int commandline)
|
|||||||
if (!process)
|
if (!process)
|
||||||
{
|
{
|
||||||
helptext ("-m, --match=<int>",
|
helptext ("-m, --match=<int>",
|
||||||
"matching method [0] (0:Typed,1:Basic,2:Typeless)");
|
"type matching method [0] 0: No type-flaws allowed, 1: Allow basic type-flaws only, 2: Allow all type-flaws");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -602,12 +623,12 @@ switcher (const int process, int index, int commandline)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (detect ('a', "all-attacks", 0))
|
if (detect ('A', "all-attacks", 0))
|
||||||
{
|
{
|
||||||
if (!process)
|
if (!process)
|
||||||
{
|
{
|
||||||
helptext ("-a,--all-attacks",
|
helptext ("-A,- -all-attacks",
|
||||||
"generate all attacks instead of just one");
|
"generate all attacks within the state space instead of just one");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -631,12 +652,12 @@ switcher (const int process, int index, int commandline)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (detect ('P', "prune", 1))
|
if (detect (' ', "prune", 1))
|
||||||
{
|
{
|
||||||
if (!process)
|
if (!process)
|
||||||
{
|
{
|
||||||
/* not very important
|
/* not very important
|
||||||
helptext ("-P,--prune=<int>", "pruning method when an attack is found [2]");
|
helptext (" --prune=<int>", "pruning method when an attack is found [2]");
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -721,15 +742,13 @@ switcher (const int process, int index, int commandline)
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (detect ('L', "latex", 0))
|
/* obsolete, worked for modelchecker
|
||||||
|
*
|
||||||
|
if (detect (' ', "latex", 0))
|
||||||
{
|
{
|
||||||
if (!process)
|
if (!process)
|
||||||
{
|
{
|
||||||
/*
|
helptext (" --latex", "output attacks in LaTeX format [ASCII]");
|
||||||
* Obsolete
|
|
||||||
*
|
|
||||||
helptext ("-L,--latex", "output attacks in LaTeX format [ASCII]");
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -742,12 +761,8 @@ switcher (const int process, int index, int commandline)
|
|||||||
{
|
{
|
||||||
if (!process)
|
if (!process)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
* Obsolete
|
|
||||||
*
|
|
||||||
helptext ("--state-space",
|
helptext ("--state-space",
|
||||||
"output state space graph (in DOT format)");
|
"output state space graph (in DOT format)");
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -755,6 +770,7 @@ switcher (const int process, int index, int commandline)
|
|||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
/* ==================
|
/* ==================
|
||||||
* Arachne only
|
* Arachne only
|
||||||
@ -766,12 +782,12 @@ switcher (const int process, int index, int commandline)
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (detect ('G', "goal-select", 1))
|
if (detect (' ', "goal-select", 1))
|
||||||
{
|
{
|
||||||
if (!process)
|
if (!process)
|
||||||
{
|
{
|
||||||
/* discourage: hide
|
/* discourage: hide
|
||||||
helptext ("-G,--goal-select=<int>",
|
helptext (" --goal-select=<int>",
|
||||||
"use goal selection method <int> [3]");
|
"use goal selection method <int> [3]");
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
@ -796,7 +812,7 @@ switcher (const int process, int index, int commandline)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (detect (' ', "no-intruder", 0))
|
if (detect (' ', "disable-intruder", 0))
|
||||||
{
|
{
|
||||||
if (!process)
|
if (!process)
|
||||||
{
|
{
|
||||||
@ -846,7 +862,7 @@ switcher (const int process, int index, int commandline)
|
|||||||
{
|
{
|
||||||
if (!process)
|
if (!process)
|
||||||
{
|
{
|
||||||
/* fairly technical, untested pruning */
|
/* fairly technical */
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -895,7 +911,7 @@ switcher (const int process, int index, int commandline)
|
|||||||
if (!process)
|
if (!process)
|
||||||
printf ("Misc. switches:\n");
|
printf ("Misc. switches:\n");
|
||||||
|
|
||||||
if (detect ('E', "echo", 0))
|
if (detect (' ', "echo", 0))
|
||||||
{
|
{
|
||||||
if (!process)
|
if (!process)
|
||||||
{
|
{
|
||||||
@ -913,24 +929,7 @@ switcher (const int process, int index, int commandline)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (detect ('S', "summary", 0))
|
if (detect (' ', "progress-bar", 0))
|
||||||
{
|
|
||||||
if (!process)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* This is now the default
|
|
||||||
*
|
|
||||||
helptext ("-S,--summary", "show summary only: omit attack details");
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
switches.output = SUMMARY;
|
|
||||||
return index;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (detect ('b', "progress-bar", 0))
|
|
||||||
{
|
{
|
||||||
if (!process)
|
if (!process)
|
||||||
{
|
{
|
||||||
|
@ -56,6 +56,7 @@ struct switchdata
|
|||||||
int removeclaims; //!< Remove any claims in the spdl file
|
int removeclaims; //!< Remove any claims in the spdl file
|
||||||
int addreachableclaim; //!< Adds 'reachable' claims to each role
|
int addreachableclaim; //!< Adds 'reachable' claims to each role
|
||||||
int addallclaims; //!< Adds all sorts of claims to the roles
|
int addallclaims; //!< Adds all sorts of claims to the roles
|
||||||
|
int check; //!< Check protocol correctness
|
||||||
|
|
||||||
// Output
|
// Output
|
||||||
int output; //!< From enum outputs: what should be produced. Default ATTACK.
|
int output; //!< From enum outputs: what should be produced. Default ATTACK.
|
||||||
|
Loading…
Reference in New Issue
Block a user