-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvf-b02-DecentRaServer.pv
197 lines (156 loc) · 8.54 KB
/
vf-b02-DecentRaServer.pv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
(***************************** library Expansions ******************************)
(***************************** CV_Common_Declarations ******************************)
expand CV_Common_Declarations(bitstringbot, bottom, emptyStr, keyseed, cleartext, ciphertext).
(***************************** CV_DSA ******************************)
expand CV_det_signature_types(spkey, sskey, signinput, signature, StrToSignin).
expand CV_det_signature_args(keyseed, spkey, sskey, signinput, signature, sskgen, spkgen, sign, checksign, getmess, getkey).
(***************************** CV_RSA ******************************)
expand CV_public_key_enc_types(pkey, skey, aenc_seed).
expand CV_public_key_enc_args(keyseed, bitstringbot, bottom, pkey, skey, cleartext, ciphertext, aenc_seed, skgen, pkgen, aenc, aenc_r, adec, ainjbot, aZ).
(***************************** CV_AEAD ******************************)
expand CV_keygen_types(key).
expand CV_keygen_args(keyseed, key, kgen).
expand CV_AEAD_types(key, add_data, nonce, enc_seed, zero_nonce, dummy_key, IncrNonce).
expand CV_AEAD_args(key, bitstringbot, bottom, bitstring, ciphertext, bitstring, enc_seed, enc, enc_r, dec, sinjbot, sZ, dummy_key).
(***************************** DecentRA_EnclaveBas ******************************)
expand Decent_Enclave_Basics(spkey, enclaveProg, enclaveHash, HashEnclave, SPKey2Bitstr, EventSubType).
expand Decent_ECDH_Key(key, ecskey, ecpkey, ecpkgen, signinput, DiHeValG, DiHeExp, EcDiHeToKey, EcDiHeKeyGen, EcPKeyToSignin).
(***************************** DecentRA_LocAtt ******************************)
expand Decent_Local_Attestation(
(** CV_ macros **) keyseed, sskey, spkey, sign, signinput, signature,
(** Encl Basics **) enclaveProg, enclaveHash, HashEnclave,
(** ECHD Key **) ecpkey,
(** This. Rep **) LocAttRep, GetLocAttSignedRep).
(***************************** DecentRA_IasRep ******************************)
expand Decent_IAS_Report(
(** CV_ macros **) keyseed, sskey, spkey, sskgen, spkgen, sign, getmess, checksign, signinput, signature,
(** Encl Basics **) enclaveProg, enclaveHash, HashEnclave,
(** This. Vars **) iasRepKeySeed, encPrvsKeySeed,
(** This. Quote **) EnclaveQuoteSignin, GetEnclaveSignedQuote_intr, GetEnclaveSignedQuote,
(** This. Rep **) IasRep2Signin, GetSignedIasRep_intr, GetSignedIasRep,
(** This. Proc **) IasIssueRep, IasProc_intr).
(***************************** DecentRA Lists ******************************)
expand Decent_Auth_List(enclaveHash, AuthListItem, AuthListNewItem, AuthList, AuthListInsert, AuthListEmpty, AuthListIsIn, AuthListToStr).
(***************************** DecentRA_DecentSvr ******************************)
expand Decent_Decent_Server(
(** CV_ macros **) keyseed, sskey, spkey, sskgen, spkgen, getmess, sign, checksign, signinput, signature, emptyStr, key, bitstring, ciphertext, nonce, enc, dec, sinjbot, bottom, zero_nonce, IncrNonce,
(** Encl Basics **) enclaveProg, enclaveHash, HashEnclave, SPKey2Bitstr,
(** ECHD Key **) ecskey, ecpkey, ecpkgen, EcDiHeKeyGen,
(** LocAtt Rep **) LocAttRep, GetLocAttSignedRep,
(** Ias Rep **) encPrvsKeySeed, GetEnclaveSignedQuote_intr, IasRep2Signin,
(** Lists **) AuthList, AuthListNewItem, AuthListIsIn,
(** This. Vars **) enclaveDecentSvr, decentSvrName,
(** This. SvrCert **) DecentSvrSignin, GetDecentSvrCert,
(** This. AppCert **) DecentAppSignin, GetDecentAppCert,
(** This. MalProc **) MaliciousSvrProc_intr,
(** This. SvrProc **) DecentSvrIssueCert, DecentSvrProc_intr, DecentSvrProcP2_intr).
(***************************** DecentRA_DecentApp ******************************)
expand Decent_Decent_App(
(** CV_ macros **) keyseed, sskey, spkey, sskgen, spkgen, getmess, sign, checksign, signinput, signature, StrToSignin, emptyStr, key, cleartext, ciphertext, nonce, enc, dec, sinjbot, bottom, zero_nonce, IncrNonce,
(** Encl Basics **) enclaveProg, enclaveHash, HashEnclave, SPKey2Bitstr, EventSubType,
(** ECHD Key **) ecskey, ecpkey, ecpkgen, EcDiHeKeyGen, EcPKeyToSignin,
(** LocAtt Rep **) LocAttRep, GetLocAttSignedRep,
(** Decent Svr **) DecentSvrSignin, DecentAppSignin, IasRep2Signin,
(** Lists **) AuthList, AuthListNewItem, AuthListIsIn,
(** This.Event **) DecentAppInit, DecentAppGotRels, DecentAppAccPeer, DecentAppGotMsg, DecentVrfyAppReqCert, DecentVrfyIssueCert,
(** This.attaProc **) DecentApp_Malicious_Proc_intr,
(** This.VrfyProc **) DecentVrfy_Proc_intr, DecentVrfy_ProcP2_intr,
(** This.RecvProc **) DecentRevc_Proc_intr, DecentRevc_ProcP2_intr,
(** This.AppProc1 **) DecentApp_X_X_Svr_ProcP4_intr, DecentApp_X_Auls_Svr_ProcP3_intr, DecentApp_Auls_Auls_Svr_ProcP2_intr, DecentApp_Auls_Auls_Svr_Proc_intr,
(** This.AppProc2 **) DecentApp_X_Vrfy_Svr_ProcP3_intr, DecentApp_Auls_Vrfy_Svr_ProcP2_intr, DecentApp_Auls_Vrfy_Svr_Proc_intr,
(** This.AppProc3 **) DecentApp_Vrfy_Auls_Svr_ProcP3_intr, DecentApp_Vrfy_Auls_Svr_ProcP2_intr, DecentApp_Vrfy_Auls_Svr_Proc_intr,
(** This.AppProc4 **) DecentApp_Vrfy_Vrfy_Svr_ProcP3_intr, DecentApp_Vrfy_Vrfy_Svr_ProcP2_intr, DecentApp_Vrfy_Vrfy_Svr_Proc_intr,
(** This.AppProc5 **) DecentApp_X_X_Clt_ProcP4_intr, DecentApp_X_Auls_Clt_ProcP3_intr, DecentApp_Auls_Auls_Clt_ProcP2_intr, DecentApp_Auls_Auls_Clt_Proc_intr,
(** This.AppProc6 **) DecentApp_X_Vrfy_Clt_ProcP3_intr, DecentApp_Auls_Vrfy_Clt_ProcP2_intr, DecentApp_Auls_Vrfy_Clt_Proc_intr,
(** This.AppProc7 **) DecentApp_Vrfy_Auls_Clt_ProcP3_intr, DecentApp_Vrfy_Auls_Clt_ProcP2_intr, DecentApp_Vrfy_Auls_Clt_Proc_intr,
(** This.AppProc8 **) DecentApp_Vrfy_Vrfy_Clt_ProcP3_intr, DecentApp_Vrfy_Vrfy_Clt_ProcP2_intr, DecentApp_Vrfy_Vrfy_Clt_Proc_intr
).
(*============================================================================*)
(******************************* For this process *****************************)
(* Settings:*)
set attacker = active.
set redundantHypElim = true.
(* Channels: *)
free svrIasCh : channel.
free appSvrCh : channel.
free peerCh : channel.
free recvCh : channel.
free attackCh : channel.
(* Decent App Materials *)
const enclaveRecv : enclaveProg.
const enclaveRecvName : bitstring.
const enclaveA : enclaveProg.
const enclaveAName : bitstring.
const enclaveB : enclaveProg.
const enclaveBName : bitstring.
const enclaveD : enclaveProg.
const malDecentSvr : enclaveProg.
(******************************* Secrecy assumptions *****************************)
not attacker(iasRepKeySeed).
not attacker(encPrvsKeySeed).
not attacker(new localRepKey).
not attacker(new decentSvrKeySeed).
not attacker(new enclaveKeySeed).
not attacker(sskgen(iasRepKeySeed)).
not attacker(sskgen(encPrvsKeySeed)).
not attacker(sskgen(new localRepKey)).
not attacker(sskgen(new decentSvrKeySeed)).
not attacker(sskgen(new enclaveKeySeed)).
not attacker(new decentSvrEcKey1).
not attacker(new enclaveEcKey1).
not attacker(EcDiHeToKey(DiHeExp(DiHeExp(DiHeValG, new decentSvrEcKey1), new enclaveEcKey1))).
not attacker(EcDiHeToKey(DiHeExp(DiHeExp(DiHeValG, new enclaveEcKey1), new decentSvrEcKey1))).
(******************************* Queries *****************************)
(* Query 1 *)
query anyKeyIssued : spkey, anyAuLsIssued : AuthList,
anyKeyReq : spkey, anyAuLsLoaded : AuthList;
inj-event(DecentSvrIssueCert(enclaveDecentSvr, HashEnclave(enclaveA), new localRepKey, anyKeyIssued, anyAuLsIssued)) ==>
(
inj-event(DecentAppInit(enclaveA, anyKeyReq, anyAuLsLoaded)) ==>
(
(anyKeyIssued = anyKeyReq) && (anyAuLsIssued = anyAuLsLoaded)
)
).
process
let pub_iasRepSPKey : spkey = spkgen(iasRepKeySeed) in
let pub_encPrvsKey : spkey = spkgen(encPrvsKeySeed) in
let revcListA = (HashEnclave(enclaveD), HashEnclave(enclaveD)) in
(* IAS Server A *)
(!IasProc_intr(svrIasCh, iasRepKeySeed, pub_encPrvsKey))
(* An enclave platform *)
|
(!
(
new localRepKey : keyseed;
(!
(
new decentSvrKeySeed : keyseed;
new decentSvrEcKey1 : ecskey;
DecentSvrProc_intr(enclaveDecentSvr, decentSvrKeySeed, svrIasCh, appSvrCh, pub_iasRepSPKey, encPrvsKeySeed, localRepKey, decentSvrEcKey1)
)
)
|
(!
(
in(attackCh, someAuls : AuthList);
new enclaveKeySeed : keyseed;
new enclaveEcKey1 : ecskey;
DecentRevc_Proc_intr(enclaveA, appSvrCh, recvCh,
pub_iasRepSPKey, localRepKey, enclaveKeySeed, decentSvrName, someAuls, revcListA,
enclaveEcKey1)
)
)
(* Malicious Part: *)
(* Malicious Decent Server & App *)
|
(!
(
new malSvrKeyseed : keyseed;
new malSvrEcKey1 : ecskey;
out(attackCh, malSvrKeyseed);
out(attackCh, malSvrEcKey1);
MaliciousSvrProc_intr(malDecentSvr, malSvrKeyseed, svrIasCh, attackCh, encPrvsKeySeed, localRepKey, malSvrEcKey1)
)
)
)
)