f9a34f4de5
After the new function implementation, the 'Function' type is no longer one-way by default. However, many protocol description files relied on this implicit assumption. The solution is to use 'hashfunction' declarations instead to model one-wayness. Original bug report by Binh Thanh Nguyen.
115 lines
1.3 KiB
Plaintext
115 lines
1.3 KiB
Plaintext
# 1 "sts-main.cpp"
|
|
# 1 "<command-line>"
|
|
# 1 "sts-main.cpp"
|
|
# 15 "sts-main.cpp"
|
|
# 1 "common.h" 1
|
|
|
|
|
|
|
|
|
|
hashfunction prf, KDF;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
hashfunction g, h;
|
|
# 94 "common.h"
|
|
hashfunction MAC;
|
|
|
|
|
|
protocol @oracle (DH, SWAP) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
role DH {
|
|
var i, r: Nonce;
|
|
|
|
recv_!DH1( DH, DH, h(g(r),i) );
|
|
send_!DH2( DH, DH, h(g(i),r) );
|
|
}
|
|
|
|
|
|
|
|
|
|
role SWAP {
|
|
var i, r, Ni, Nr: Nonce;
|
|
# 150 "common.h"
|
|
recv_!SWAP1( SWAP, SWAP, KDF(h(g(r),i)) );
|
|
send_!SWAP2( SWAP, SWAP, KDF(h(g(i),r)) );
|
|
|
|
}
|
|
|
|
|
|
}
|
|
# 16 "sts-main.cpp" 2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protocol @executability(O) {
|
|
|
|
|
|
role O {
|
|
var i, r: Nonce;
|
|
var I, R: Agent;
|
|
|
|
|
|
recv_!O1( O, O, {{g(r), g(i)}sk(R)}KDF(h(g(i),r)) );
|
|
send_!O2( O, O, {{g(r), g(i)}sk(R)}KDF(h(g(r),i)) );
|
|
|
|
|
|
recv_!O3( O, O, {{g(i), g(r)}sk(I)}KDF(h(g(r),i)) );
|
|
send_!O4( O, O, {{g(i), g(r)}sk(I)}KDF(h(g(i),r)) );
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protocol sts-main(I, R)
|
|
{
|
|
role I {
|
|
fresh i: Nonce;
|
|
var Gr: Ticket;
|
|
|
|
send_1( I, R, g(i) );
|
|
recv_!2( R, I, Gr, {{Gr, g(i)}sk(R)}KDF(h(Gr,i)) );
|
|
send_!3( I, R, {{g(i), Gr}sk(I)}KDF(h(Gr,i)) );
|
|
|
|
|
|
claim( I, SKR, KDF(h(Gr,i)) );
|
|
|
|
claim( I, Alive );
|
|
claim( I, Weakagree );
|
|
|
|
}
|
|
|
|
role R {
|
|
fresh r: Nonce;
|
|
var Gi: Ticket;
|
|
|
|
recv_1( I, R, Gi );
|
|
send_!2( R, I, g(r), {{g(r), Gi}sk(R)}KDF(h(Gi,r)) );
|
|
recv_!3( I, R, {{Gi, g(r)}sk(I)}KDF(h(Gi,r)) );
|
|
|
|
|
|
claim( R, SKR, KDF(h(Gi,r)) );
|
|
|
|
claim( R, Alive );
|
|
claim( R, Weakagree );
|
|
|
|
}
|
|
}
|