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.
113 lines
1.6 KiB
Plaintext
113 lines
1.6 KiB
Plaintext
# 1 "jfkr-core.cpp"
|
|
# 1 "<command-line>"
|
|
# 1 "jfkr-core.cpp"
|
|
# 15 "jfkr-core.cpp"
|
|
# 1 "common.h" 1
|
|
|
|
|
|
|
|
|
|
hashfunction prf, KDF;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
hashfunction g, h;
|
|
# 60 "common.h"
|
|
hashfunction 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;
|
|
# 150 "common.h"
|
|
recv_!SWAP1( SWAP, SWAP, KDF(h(g(r),i), Ni, Nr) );
|
|
send_!SWAP2( SWAP, SWAP, KDF(h(g(i),r), Ni, Nr) );
|
|
|
|
}
|
|
|
|
|
|
}
|
|
# 16 "jfkr-core.cpp" 2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protocol @executability(O) {
|
|
|
|
|
|
role O {
|
|
var i, r, Ni, Nr: Nonce;
|
|
var I, R: Agent;
|
|
|
|
|
|
recv_!O1( O, O, H(KDF(h(g(i),r), Ni, Nr), Nr, Ni, R) );
|
|
send_!O2( O, O, H(KDF(h(g(r),i), Ni, Nr), Nr, Ni, R) );
|
|
|
|
|
|
recv_!O3( O, O, H(KDF(h(g(r),i), Ni, Nr), Nr, Ni, I) );
|
|
send_!O4( O, O, H(KDF(h(g(i),r), Ni, Nr), Nr, Ni, I) );
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
protocol jfkr-core(I, R)
|
|
{
|
|
role I {
|
|
fresh i, Ni: Nonce;
|
|
var Nr, Gr: Ticket;
|
|
|
|
send_1( I, R, Ni, g(i) );
|
|
recv_!2( R, I, Nr, Ni, R, Gr, {Nr, Ni, Gr, g(i)}sk(R), H(KDF(h(Gr,i), Ni, Nr), Nr, Ni, R) );
|
|
send_!3( I, R, Nr, Ni, I, {Nr, Ni, Gr, g(i)}sk(I), H(KDF(h(Gr,i), Ni, Nr), Nr, Ni, I) );
|
|
|
|
|
|
claim( I, SKR, KDF(h(Gr,i), Ni, Nr) );
|
|
|
|
claim( I, Alive );
|
|
claim( I, Weakagree );
|
|
|
|
}
|
|
|
|
role R {
|
|
fresh r, Nr: Nonce;
|
|
var Ni, Gi: Ticket;
|
|
|
|
recv_1( I, R, Ni, Gi );
|
|
send_!2( R, I, Nr, Ni, R, g(r), {Nr, Ni, g(r), Gi}sk(R), H(KDF(h(Gi,r), Ni, Nr), Nr, Ni, R) );
|
|
recv_!3( I, R, Nr, Ni, I, {Nr, Ni, g(r), Gi}sk(I), H(KDF(h(Gi,r), Ni, Nr), Nr, Ni, I) );
|
|
|
|
|
|
claim( R, SKR, KDF(h(Gi,r), Ni, Nr) );
|
|
|
|
claim( R, Alive );
|
|
claim( R, Weakagree );
|
|
|
|
}
|
|
}
|