scyther/gui/Protocols/IKE/oakley-alt.spdl
Cas Cremers f9a34f4de5 BUGFIX: Updating hashfunction usage in protocol files to new conventions.
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.
2014-01-08 15:13:16 +00:00

95 lines
1.4 KiB
Plaintext

# 1 "oakley-alt.cpp"
# 1 "<command-line>"
# 1 "oakley-alt.cpp"
# 18 "oakley-alt.cpp"
# 1 "common.h" 1
hashfunction prf, KDF;
hashfunction g, h;
# 97 "common.h"
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;
# 141 "common.h"
var Ci, Cr: Nonce;
# 150 "common.h"
recv_!SWAP1( SWAP, SWAP, KDF(Ni, Nr, h(g(r),i), Ci, Cr) );
send_!SWAP2( SWAP, SWAP, KDF(Ni, Nr, h(g(i),r), Ci, Cr) );
}
}
# 19 "oakley-alt.cpp" 2
usertype String;
const list, algo: String;
protocol oakley-alt(I, R)
{
role I {
fresh i, Ni, Ci: Nonce;
var Nr, Cr: Nonce;
var Gr: Ticket;
send_1( I, R, Ci, g(i), list, pk(R), {I, R, Ni}pk(R) );
recv_2( R, I, Cr, Ci, Gr, algo, {R, I, Nr}pk(I), prf(prf(Ni,Nr), R, I, Gr, g(i), algo) );
send_3( I, R, Ci, Cr, prf(prf(Ni,Nr), I, R, g(i), Gr, algo) );
claim( I, SKR, KDF(Ni, Nr, h(Gr,i), Ci, Cr) );
claim( I, Alive );
claim( I, Weakagree );
}
role R {
fresh r, Nr, Cr: Nonce;
var Ni, Ci: Nonce;
var Gi: Ticket;
recv_1( I, R, Ci, Gi, list, pk(R), {I, R, Ni}pk(R) );
send_2( R, I, Cr, Ci, g(r), algo, {R, I, Nr}pk(I), prf(prf(Ni,Nr), R, I, g(r), Gi, algo) );
recv_3( I, R, Ci, Cr, prf(prf(Ni,Nr), I, R, Gi, g(r), algo) );
claim( R, SKR, KDF(Ni, Nr, h(Gi,r), Ci, Cr) );
claim( R, Alive );
claim( R, Weakagree );
}
}