- Added function to determine command line.

This commit is contained in:
ccremers 2004-11-18 16:18:23 +00:00
parent 6ebc61fca6
commit a0d90b9ec4

View File

@ -40,16 +40,21 @@ SkipList = [
# LIBS # LIBS
# *********************** # ***********************
# CommandLine
#
# Yield the commandline to test, given a list of protocols
def CommandLine (plist):
linelist = " ".join(plist)
return "cat " + linelist + " | " + CommandPrefix
# ScytherEval # ScytherEval
# #
# Take the list of protocols in plist, and give them to Scyther. # Take the list of protocols in plist, and give them to Scyther.
# Returns a dictionary of claim -> bool; where 1 means that it is # Returns a dictionary of claim -> bool; where 1 means that it is
# correct, and 0 means that it is false (i.e. there exists an attack) # correct, and 0 means that it is false (i.e. there exists an attack)
def ScytherEval (plist): def ScytherEval (plist):
linelist = " ".join(plist) scout = commands.getoutput(CommandLine (plist))
commandline = "cat " + linelist + " | " + CommandPrefix
scout = commands.getoutput(commandline)
lines = scout.splitlines() lines = scout.splitlines()
results = {} results = {}
for line in lines: for line in lines:
@ -215,7 +220,7 @@ for tline in inp:
# Wooh! It was correct before # Wooh! It was correct before
ClearProgress (TupleCount, safetxt) ClearProgress (TupleCount, safetxt)
newattacks = newattacks + 1 newattacks = newattacks + 1
print "We found a new flaw:", claim, " using",CommandPrefix,"and",protocols print "We found a new flaw:", claim, " using",CommandLine( protocols)
# #
# TODO # TODO
# #