2005-05-17 15:01:48 +01:00
|
|
|
# Otway Rees
|
|
|
|
#
|
|
|
|
# Modelled after the description in the SPORE library
|
|
|
|
# http://www.lsv.ens-cachan.fr/spore/otwayRees.html
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# Note:
|
|
|
|
# This protocol uses a ticket so scyther will only be able to verify
|
|
|
|
# the protocol using the ARACHNE engine (-a) and type 2 matching (-m2)
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
secret const k : Function;
|
|
|
|
|
|
|
|
usertype String,SessionKey,Ticket;
|
|
|
|
|
|
|
|
protocol otwayrees(I,R,S)
|
|
|
|
{
|
2005-05-23 13:35:58 +01:00
|
|
|
role I
|
|
|
|
{
|
|
|
|
const Ni : Nonce;
|
|
|
|
const M : String;
|
|
|
|
var Kir : SessionKey;
|
2005-05-17 15:01:48 +01:00
|
|
|
|
2005-05-23 13:35:58 +01:00
|
|
|
send_1(I,R, M,I,R,{Ni,M,I,R}k(I,S) );
|
|
|
|
read_4(R,I, M,{Ni,Kir}k(I,S) );
|
2005-05-17 15:01:48 +01:00
|
|
|
|
2005-05-23 13:35:58 +01:00
|
|
|
claim_I1(I, Secret,Kir);
|
2005-05-17 15:01:48 +01:00
|
|
|
#claim_I2(I, Nisynch);
|
2005-05-23 13:35:58 +01:00
|
|
|
}
|
2005-05-17 15:01:48 +01:00
|
|
|
|
2005-05-23 13:35:58 +01:00
|
|
|
role R
|
|
|
|
{
|
|
|
|
var M : String;
|
|
|
|
const Nr : Nonce;
|
|
|
|
var Kir : SessionKey;
|
|
|
|
var T1,T2: Ticket;
|
2005-05-17 15:01:48 +01:00
|
|
|
|
2005-05-23 13:35:58 +01:00
|
|
|
read_1(I,R, M,I,R, T1 );
|
|
|
|
send_2(R,S, M,I,R, T1, { Nr,M,I,R }k(R,S) );
|
|
|
|
read_3(S,R, M, T2, { Nr,Kir }k(R,S) );
|
|
|
|
send_4(R,I, M, T2 );
|
2005-05-17 15:01:48 +01:00
|
|
|
|
2005-05-23 13:35:58 +01:00
|
|
|
claim_R1(R, Secret,Kir);
|
2005-05-17 15:01:48 +01:00
|
|
|
#claim_R2(R, Nisynch);
|
2005-05-23 13:35:58 +01:00
|
|
|
}
|
2005-05-17 15:01:48 +01:00
|
|
|
|
2005-05-23 13:35:58 +01:00
|
|
|
role S
|
|
|
|
{
|
|
|
|
var Ni,Nr : Nonce;
|
|
|
|
var M : String;
|
|
|
|
const Kir : SessionKey;
|
|
|
|
|
|
|
|
read_2(R,S, M,I,R, { Ni,M,I,R}k(I,S), { Nr,M,I,R }k(R,S) );
|
|
|
|
send_3(S,R, M, { Ni,Kir }k(I,S) , { Nr,Kir }k(R,S) );
|
|
|
|
}
|
2005-05-17 15:01:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
const Alice, Bob, Eve, Simon: Agent;
|
|
|
|
|
|
|
|
untrusted Eve;
|
|
|
|
compromised k(Eve,Simon);
|
|
|
|
|
|
|
|
run otwayrees.A(Alice, Agent, Simon);
|
|
|
|
run otwayrees.B(Agent, Bob, Simon);
|
|
|
|
run otwayrees.S(Agent, Agent, Simon);
|
|
|
|
|
|
|
|
run otwayrees.A(Agent, Agent, Simon);
|
|
|
|
run otwayrees.B(Agent, Agent, Simon);
|
|
|
|
run otwayrees.S(Agent, Agent, Simon);
|
|
|
|
|