95 lines
1.4 KiB
Plaintext
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;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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;
|
|
# 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 );
|
|
|
|
}
|
|
}
|