MPA: More detailed reporting of results.

This commit is contained in:
Cas Cremers 2010-11-15 10:18:01 +01:00
parent 31a1635a07
commit 135fbaf726

View File

@ -128,20 +128,25 @@ def getCorrectIsolatedClaims(protocolset,options=None):
pbar = ProgressBar(widgets=widgets, maxval=len(protocolset)) pbar = ProgressBar(widgets=widgets, maxval=len(protocolset))
pbar.start() pbar.start()
count = 0 count = 0
cpcount = 0
for protocol in protocolset: for protocol in protocolset:
# verify protocol in isolation # verify protocol in isolation
s = MyScyther([protocol],options=options) s = MyScyther([protocol],options=options)
# investigate the results # investigate the results
goodprotocols.append(protocol) goodprotocols.append(protocol)
allfalse = True
for claim in s.claims: for claim in s.claims:
if claim.okay: if claim.okay:
correctclaims.append((protocol,claim.id)) correctclaims.append((protocol,claim.id))
allfalse = False
count += 1 count += 1
return (goodprotocols,correctclaims) if not allfalse:
cpcount += 1
if not OPTS.plain: if not OPTS.plain:
pbar.update(count) pbar.update(count)
if not OPTS.plain: if not OPTS.plain:
pbar.finish() pbar.finish()
return (goodprotocols,correctclaims,cpcount)
def verifyMPAlist(mpalist,claimid,options=None): def verifyMPAlist(mpalist,claimid,options=None):
@ -225,8 +230,8 @@ def findAllMPA(protocolset,maxcount=3,options="",mpaoptions=""):
FOUND = [] FOUND = []
# Find all correct claims in each protocol # Find all correct claims in each protocol
(protocolset,correct) = getCorrectIsolatedClaims(protocolset,options) (protocolset,correct,cpcount) = getCorrectIsolatedClaims(protocolset,options)
print "Investigating %i correct claims." % (len(correct)) print "Investigating %i correct claims in %i protocols." % (len(correct), cpcount)
# For all these claims... # For all these claims...
if not OPTS.plain: if not OPTS.plain:
widgets = ['Scanning for MPA attacks: ', Percentage(), ' ', widgets = ['Scanning for MPA attacks: ', Percentage(), ' ',