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.
131 lines
2.4 KiB
Plaintext
131 lines
2.4 KiB
Plaintext
# 1 "ikev1-sig-a-perlman1.cpp"
|
|
# 1 "<command-line>"
|
|
# 1 "ikev1-sig-a-perlman1.cpp"
|
|
# 18 "ikev1-sig-a-perlman1.cpp"
|
|
# 1 "common.h" 1
|
|
|
|
|
|
|
|
|
|
hashfunction prf, KDF;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
hashfunction g, 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;
|
|
|
|
|
|
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 "ikev1-sig-a-perlman1.cpp" 2
|
|
# 29 "ikev1-sig-a-perlman1.cpp"
|
|
usertype String;
|
|
const list, algo: String;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protocol @executability(O) {
|
|
|
|
|
|
role O {
|
|
var i, r, Ni, Nr, Ci, Cr: Nonce;
|
|
var I, R: Agent;
|
|
|
|
|
|
recv_!O1( O, O, {R}KDF(Ni, Nr, h(g(i),r), Ci, Cr), {prf(Ni, Nr, h(g(i),r), g(r), g(i), Cr, Ci, list, R)}sk(R) );
|
|
send_!O2( O, O, {R}KDF(Ni, Nr, h(g(r),i), Ci, Cr), {prf(Ni, Nr, h(g(r),i), g(r), g(i), Cr, Ci, list, R)}sk(R) );
|
|
|
|
|
|
recv_!O3( O, O, {I}KDF(Ni, Nr, h(g(r),i), Ci, Cr), {prf(Ni, Nr, h(g(r),i), g(i), g(r), Ci, Cr, list, I)}sk(I) );
|
|
send_!O4( O, O, {I}KDF(Ni, Nr, h(g(i),r), Ci, Cr), {prf(Ni, Nr, h(g(i),r), g(i), g(r), Ci, Cr, list, I)}sk(I) );
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
protocol ikev1-sig-a-perlman1(I, R)
|
|
{
|
|
|
|
role I {
|
|
fresh i, Ni, Ci: Nonce;
|
|
var Nr, Cr: Nonce;
|
|
var Gr: Ticket;
|
|
|
|
send_1( I, R, Ci, list, g(i), Ni );
|
|
recv_!2( R, I, (Ci,Cr), algo, Gr, Nr, {R}KDF(Ni, Nr, h(Gr,i), Ci, Cr), {prf(Ni, Nr, h(Gr,i), Gr, g(i), Cr, Ci, list, R)}sk(R) );
|
|
claim( I, Running, R, Ni, Nr, g(i), Gr, Ci, Cr );
|
|
send_!3( I, R, (Ci,Cr), {I}KDF(Ni, Nr, h(Gr,i), Ci, Cr), {prf(Ni, Nr, h(Gr,i), g(i), Gr, Ci, Cr, list, I)}sk(I) );
|
|
|
|
|
|
claim( I, SKR, KDF(Ni, Nr, h(Gr,i), Ci, Cr) );
|
|
|
|
claim( I, Alive );
|
|
claim( I, Weakagree );
|
|
claim( I, Commit, R, Ni, Nr, g(i), Gr, Ci, Cr );
|
|
|
|
}
|
|
|
|
role R {
|
|
fresh r, Nr, Cr: Nonce;
|
|
var Ni, Ci: Nonce;
|
|
var Gi: Ticket;
|
|
|
|
recv_1( I, R, Ci, list, Gi, Ni );
|
|
claim( R, Running, I, Ni, Nr, Gi, g(r), Ci, Cr );
|
|
send_!2( R, I, (Ci,Cr), algo, g(r), Nr, R, {R}KDF(Ni, Nr, h(Gi,r), Ci, Cr), {prf(Ni, Nr, h(Gi,r), g(r), Gi, Cr, Ci, list, R)}sk(R) );
|
|
recv_!3( I, R, (Ci,Cr), {I}KDF(Ni, Nr, h(Gi,r), Ci, Cr), {prf(Ni, Nr, h(Gi,r), Gi, g(r), Ci, Cr, list, I)}sk(I) );
|
|
|
|
|
|
claim( R, SKR, KDF(Ni, Nr, h(Gi,r), Ci, Cr) );
|
|
|
|
claim( R, Alive );
|
|
claim( R, Weakagree );
|
|
claim( R, Commit, I, Ni, Nr, Gi, g(r), Ci, Cr );
|
|
|
|
}
|
|
}
|