- Multi protocol tests over several matching methods now only report new
attacks.
This commit is contained in:
parent
61b3aba459
commit
e66c4ebd78
@ -34,6 +34,7 @@ ProtocolToFileMap = {} # maps protocol names to file names
|
|||||||
ProtocolToStatusMap = {} # maps protocol names to status: 0 all false, 1 all correct, otherwise (2) mixed
|
ProtocolToStatusMap = {} # maps protocol names to status: 0 all false, 1 all correct, otherwise (2) mixed
|
||||||
ProtocolToEffectsMap = {} # maps protocols that help create multiple flaws, to the protocol names of the flaws they caused
|
ProtocolToEffectsMap = {} # maps protocols that help create multiple flaws, to the protocol names of the flaws they caused
|
||||||
|
|
||||||
|
ReportedAttackList = [] # stores attacks that have already been reported.
|
||||||
CommandPrefix = ""
|
CommandPrefix = ""
|
||||||
ArgumentsList = [] # argument lists that have been displayed onscreen
|
ArgumentsList = [] # argument lists that have been displayed onscreen
|
||||||
|
|
||||||
@ -186,27 +187,38 @@ def ClearProgress (n,txt):
|
|||||||
|
|
||||||
|
|
||||||
def DescribeContextBrief (filep, protocols, claim, prefix):
|
def DescribeContextBrief (filep, protocols, claim, prefix):
|
||||||
|
global ReportedAttackList
|
||||||
|
|
||||||
filep.write (prefix)
|
# compute string
|
||||||
|
outstr = "\t" + claim
|
||||||
|
|
||||||
prlist = []
|
prlist = []
|
||||||
for prfile in protocols:
|
for prfile in protocols:
|
||||||
prnames = GetKeys (ProtocolToFileMap, prfile)
|
prnames = GetKeys (ProtocolToFileMap, prfile)
|
||||||
prlist = prlist + prnames
|
prlist = prlist + prnames
|
||||||
|
|
||||||
filep.write ("\t" + claim)
|
|
||||||
|
|
||||||
newprname = claim.split()[0]
|
newprname = claim.split()[0]
|
||||||
prlistclean = []
|
prlistclean = []
|
||||||
prliststr = ""
|
|
||||||
for pn in prlist:
|
for pn in prlist:
|
||||||
if pn not in prlistclean:
|
if pn not in prlistclean:
|
||||||
if pn != newprname:
|
if pn != newprname:
|
||||||
prlistclean.append(pn)
|
prlistclean.append(pn)
|
||||||
prliststr = prliststr + "\t" + pn
|
outstr = outstr + "\t" + pn
|
||||||
filep.write (prliststr)
|
|
||||||
|
# determine whether we did that already
|
||||||
|
if not outstr in ReportedAttackList:
|
||||||
|
ReportedAttackList.append(outstr)
|
||||||
|
# print
|
||||||
|
filep.write (prefix)
|
||||||
|
filep.write (outstr)
|
||||||
|
filep.write ("\n")
|
||||||
|
# a new attack!
|
||||||
|
return 1
|
||||||
|
else:
|
||||||
|
# 0 new attacks
|
||||||
|
return 0
|
||||||
|
|
||||||
filep.write ("\n")
|
|
||||||
|
|
||||||
def DescribeContext (filep, protocols, claim):
|
def DescribeContext (filep, protocols, claim):
|
||||||
def DC_Claim(cl,v):
|
def DC_Claim(cl,v):
|
||||||
@ -346,9 +358,7 @@ def SignalAttack (protocols, claim):
|
|||||||
# error log thingy. Furthermore,
|
# error log thingy. Furthermore,
|
||||||
# explicitly recreate the commandline
|
# explicitly recreate the commandline
|
||||||
# and the claim that is newly violated
|
# and the claim that is newly violated
|
||||||
DescribeContextBrief (sys.stdout, protocols, claim, outs)
|
return DescribeContextBrief (sys.stdout, protocols, claim, outs)
|
||||||
|
|
||||||
return 1
|
|
||||||
|
|
||||||
# ***********************
|
# ***********************
|
||||||
# MAIN CODE
|
# MAIN CODE
|
||||||
|
Loading…
Reference in New Issue
Block a user