126 lines
2.0 KiB
Plaintext
126 lines
2.0 KiB
Plaintext
|
# 1 "ikev1-psk-a.cpp"
|
||
|
# 1 "<command-line>"
|
||
|
# 1 "ikev1-psk-a.cpp"
|
||
|
# 16 "ikev1-psk-a.cpp"
|
||
|
# 1 "common.h" 1
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
hashfunction prf, KDF;
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
const g, h: Function;
|
||
|
# 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;
|
||
|
var I, R: Agent;
|
||
|
# 150 "common.h"
|
||
|
recv_!SWAP1( SWAP, SWAP, prf(k(I,R), Ni, Nr, h(g(r),i), Ci, Cr) );
|
||
|
send_!SWAP2( SWAP, SWAP, prf(k(R,I), Ni, Nr, h(g(i),r), Ci, Cr) );
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|
||
|
# 17 "ikev1-psk-a.cpp" 2
|
||
|
# 25 "ikev1-psk-a.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, prf(k(R,I), Ni, Nr, g(r), g(i), Cr, Ci, list, R) );
|
||
|
send_!O2( O, O, prf(k(I,R), Ni, Nr, g(r), g(i), Cr, Ci, list, R) );
|
||
|
|
||
|
|
||
|
recv_!O3( O, O, prf(k(I,R), Ni, Nr, g(i), g(r), Ci, Cr, list, I) );
|
||
|
send_!O4( O, O, prf(k(R,I), Ni, Nr, g(i), g(r), Ci, Cr, list, I) );
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
protocol ikev1-psk-a(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, I );
|
||
|
recv_!2( R, I, Ci, Cr, algo, Gr, Nr, R, prf(k(I,R), Ni, Nr, Gr, g(i), Cr, Ci, list, R) );
|
||
|
claim( I, Running, R, Ni, Nr, g(i), Gr, Ci, Cr );
|
||
|
send_!3( I, R, Ci, Cr, prf(k(I,R), Ni, Nr, g(i), Gr, Ci, Cr, list, I) );
|
||
|
|
||
|
|
||
|
claim( I, SKR, prf(k(I,R), 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, I );
|
||
|
claim( R, Running, I, Ni, Nr, Gi, g(r), Ci, Cr );
|
||
|
send_!2( R, I, Ci, Cr, algo, g(r), Nr, R, prf(k(R,I), Ni, Nr, g(r), Gi, Cr, Ci, list, R) );
|
||
|
recv_!3( I, R, Ci, Cr, prf(k(R,I), Ni, Nr, Gi, g(r), Ci, Cr, list, I) );
|
||
|
|
||
|
|
||
|
claim( R, SKR, prf(k(R,I), Ni, Nr, h(Gi,r), Ci, Cr) );
|
||
|
|
||
|
claim( R, Alive );
|
||
|
claim( R, Weakagree );
|
||
|
claim( R, Commit, I, Ni, Nr, Gi, g(r), Ci, Cr );
|
||
|
|
||
|
}
|
||
|
}
|