- Layout improvements.

This commit is contained in:
ccremers 2006-08-08 13:19:17 +00:00
parent f659cce889
commit c1b44804e1

View File

@ -23,6 +23,7 @@ def MyScyther(protocollist,filter=None):
s.verify() s.verify()
return s return s
def getCorrectIsolatedClaims(protocolset): def getCorrectIsolatedClaims(protocolset):
""" """
Given a set of protocols, determine the correct claims when run in Given a set of protocols, determine the correct claims when run in
@ -62,6 +63,7 @@ def verifyMPAlist(mpalist,claimid):
else: else:
return True return True
def constructMPAlist(protocolset,claimid,mpalist,length,start,callback): def constructMPAlist(protocolset,claimid,mpalist,length,start,callback):
""" """
Append a list of parallel protocols, without duplicates, Append a list of parallel protocols, without duplicates,
@ -83,6 +85,7 @@ def constructMPAlist(protocolset,claimid,mpalist,length,start,callback):
# list is long enough: callback # list is long enough: callback
return callback(mpalist,claimid) return callback(mpalist,claimid)
def findMPA(protocolset,protocol,claimid,maxcount=3): def findMPA(protocolset,protocol,claimid,maxcount=3):
""" """
The protocol claim is assumed to be correct. When does it break? The protocol claim is assumed to be correct. When does it break?
@ -103,6 +106,7 @@ def findMPA(protocolset,protocol,claimid,maxcount=3):
count += 1 count += 1
return None return None
def findAllMPA(protocolset,maxcount=3): def findAllMPA(protocolset,maxcount=3):
""" """
Given a set of protocols, find multi-protocol attacks Given a set of protocols, find multi-protocol attacks
@ -114,7 +118,12 @@ def findAllMPA(protocolset,maxcount=3):
if mpalist: if mpalist:
print "Darn, MPA on %s (%s) using %s" % (claimid,protocol,mpalist) print "Darn, MPA on %s (%s) using %s" % (claimid,protocol,mpalist)
if __name__ == '__main__': if __name__ == '__main__':
"""
Simple test case
"""
list = ['me.spdl','ns3.spdl','nsl3.spdl'] list = ['me.spdl','ns3.spdl','nsl3.spdl']
findAllMPA(list) findAllMPA(list)