- Added two versions of the kao-chow protocol.

- Improved the testing scripts.
This commit is contained in:
ccremers 2005-03-08 14:07:36 +00:00
parent 560acb220d
commit 61b3aba459
6 changed files with 166 additions and 16 deletions

67
spdl/kaochow-v2.spdl Normal file
View File

@ -0,0 +1,67 @@
usertype Sessionkey;
usertype Ticket;
secret k: Function;
protocol kaochow2(I,R,S)
{
role I
{
const ni: Nonce;
var nr: Nonce;
var kir,kt: Sessionkey;
send_1 (I,S, I,R,ni);
read_3 (R,I, R, {I,R,ni,kir,kt}k(I,S), {ni, kir}kt, nr );
send_4 (I,R, {nr,kir}kt );
claim_5 (I, Nisynch);
claim_6 (I, Niagree);
claim_7 (I, Secret, kir);
}
role R
{
var ni: Nonce;
const nr: Nonce;
var kir,kt: Sessionkey;
var T: Ticket;
read_2 (S,R, T, { I,R,ni,kir,kt }k(R,S) );
send_3 (R,I, R, T, {ni, kir}kt, nr );
read_4 (I,R, {nr,kir}kt );
claim_8 (R, Nisynch);
claim_9 (R, Niagree);
claim_10 (R, Secret, kir);
}
role S
{
var ni: Nonce;
const kir, kt: Sessionkey;
read_1 (I,S, I,R,ni);
send_2 (S,R, {I,R,ni,kir,kt}k(I,S), { I,R,ni,kir,kt }k(R,S) );
}
}
const Alice,Bob,Simon,Eve: Agent;
untrusted Eve;
const ne: Nonce;
const te: Ticket;
const ke: Sessionkey;
compromised k(Eve,Eve);
compromised k(Eve,Alice);
compromised k(Eve,Bob);
compromised k(Eve,Simon);
compromised k(Alice,Eve);
compromised k(Bob,Eve);
compromised k(Simon,Eve);
run kaochow2.I(Agent,Agent,Simon);
run kaochow2.R(Agent,Agent,Simon);
run kaochow2.S(Agent,Agent,Simon);
run kaochow2.I(Agent,Agent,Simon);
run kaochow2.R(Agent,Agent,Simon);
run kaochow2.S(Agent,Agent,Simon);

70
spdl/kaochow-v3.spdl Normal file
View File

@ -0,0 +1,70 @@
usertype Sessionkey;
usertype Ticket;
usertype Timestamp;
secret k: Function;
protocol kaochow3(I,R,S)
{
role I
{
const ni: Nonce;
var nr: Nonce;
var kir,kt: Sessionkey;
var T2: Ticket;
send_1 (I,S, I,R,ni);
read_3 (R,I, R, {I,R,ni,kir,kt}k(I,S), {ni, kir}kt, nr, T2 );
send_4 (I,R, {nr,kir}kt, T2 );
claim_5 (I, Nisynch);
claim_6 (I, Niagree);
claim_7 (I, Secret, kir);
}
role R
{
var ni: Nonce;
const nr: Nonce;
var kir,kt: Sessionkey;
var T: Ticket;
const tr: Timestamp;
read_2 (S,R, T, { I,R,ni,kir,kt }k(R,S) );
send_3 (R,I, R, T, {ni, kir}kt, nr, {I,R,tr,kir}k(R,S) );
read_4 (I,R, {nr,kir}kt, {I,R,tr,kir}k(R,S) );
claim_8 (R, Nisynch);
claim_9 (R, Niagree);
claim_10 (R, Secret, kir);
}
role S
{
var ni: Nonce;
const kir, kt: Sessionkey;
read_1 (I,S, I,R,ni);
send_2 (S,R, {I,R,ni,kir,kt}k(I,S), { I,R,ni,kir,kt }k(R,S) );
}
}
const Alice,Bob,Simon,Eve: Agent;
untrusted Eve;
const ne: Nonce;
const te: Ticket;
const ke: Sessionkey;
compromised k(Eve,Eve);
compromised k(Eve,Alice);
compromised k(Eve,Bob);
compromised k(Eve,Simon);
compromised k(Alice,Eve);
compromised k(Bob,Eve);
compromised k(Simon,Eve);
run kaochow3.I(Agent,Agent,Simon);
run kaochow3.R(Agent,Agent,Simon);
run kaochow3.S(Agent,Agent,Simon);
run kaochow3.I(Agent,Agent,Simon);
run kaochow3.R(Agent,Agent,Simon);
run kaochow3.S(Agent,Agent,Simon);

View File

@ -26,7 +26,7 @@ protocol kaochow(I,R,S)
var kir: Sessionkey; var kir: Sessionkey;
var T; var T;
read_2 (S,R, { T, { I,R,ni,kir }k(R,S) }k(R,S) ); read_2 (S,R, T, { I,R,ni,kir }k(R,S) );
send_3 (R,I, T, {ni}kir, nr ); send_3 (R,I, T, {ni}kir, nr );
read_4 (I,R, {nr}kir ); read_4 (I,R, {nr}kir );

View File

@ -98,13 +98,13 @@ def ScytherEval (plist):
sys.stdout.flush() sys.stdout.flush()
sys.stderr.flush() sys.stderr.flush()
args = scythertest.default_arguments(plist, options.match, options.bounds) args = scythertest.default_arguments(plist, int(options.match), int(options.bounds))
n = len(plist) n = len(plist)
if not (n,args) in ArgumentsList: if not (n,args) in ArgumentsList:
ArgumentsList.append((n,args)) ArgumentsList.append((n,args))
print "Testing",n,"tuples using",args print "Testing",n,"tuples using",args
return scythertest.default_parsed(plist, options.match, options.bounds) return scythertest.default_parsed(plist, int(options.match), int(options.bounds))
# ScytherEval1 # ScytherEval1
# #
@ -475,29 +475,28 @@ def banner(str):
def the_great_houdini(list,width,match): def the_great_houdini(list,width,match):
global options global options
# Empty list
if list == []: if list == []:
list = protocollist.select(int(options.protocols)) the_great_houdini(protocollist.select(int(options.protocols)),width,match)
the_great_houdini(list,width,match) # Unfold sequence of tuple widths
return elif options.sequence:
if options.sequence:
options.sequence = False options.sequence = False
banner ("Testing multiple tuple widths") banner ("Testing multiple tuple widths")
for n in range(2,4): for n in range(2,4):
banner ("Testing tuple width %i" % n) banner ("Testing tuple width %i" % n)
the_great_houdini(list,n,match) the_great_houdini(list,n,match)
options.sequence = True options.sequence = True
return # Unfold matching methods
elif options.allmatch:
if options.allmatch:
options.allmatch = False options.allmatch = False
banner ("Testing multiple match methods") banner ("Testing multiple match methods")
for m in range(0,3): for m in range(0,3):
options.match = m
banner ("Testing match %i" % m) banner ("Testing match %i" % m)
the_great_houdini(list,width,m) the_great_houdini(list,width,m)
options.allmatch = True options.allmatch = True
return # Last but not least: test
else:
multiprotocol_test(list,width,match) multiprotocol_test(list,width,match)

View File

@ -1,3 +1,4 @@
#!/usr/bin/python
# #
# protocol list # protocol list
# #
@ -22,6 +23,8 @@ def from_literature():
"isoiec11770-2-13.spdl", "isoiec11770-2-13.spdl",
"kaochow-palm.spdl", "kaochow-palm.spdl",
"kaochow.spdl", "kaochow.spdl",
"kaochow-v2.spdl",
"kaochow-v3.spdl",
"ns3.spdl", "ns3.spdl",
"nsl3.spdl", "nsl3.spdl",
"nsl7.spdl", "nsl7.spdl",
@ -82,3 +85,14 @@ def select(type):
# Otherwise empty list # Otherwise empty list
return [] return []
def main():
for l in [from_literature(), from_others()]:
for p in l:
print p
print
if __name__ == '__main__':
main()

View File

@ -53,7 +53,7 @@ def default_protocols(plist):
# 1: thorough # 1: thorough
# #
def default_arguments(plist,match,bounds): def default_arguments(plist,match,bounds):
n = len(plist) n = 2 + bounds
# These bounds assume at least two protocols, otherwise # These bounds assume at least two protocols, otherwise
# stuff breaks. # stuff breaks.
if n < 2: if n < 2: