author | paulson |
Tue, 13 Feb 2001 13:16:27 +0100 | |
changeset 11104 | f2024fed9f0c |
parent 10833 | c0844a30ea4e |
child 11185 | 1b737b4c2108 |
permissions | -rw-r--r-- |
6452 | 1 |
(* Title: HOL/Auth/KerberosIV |
2 |
ID: $Id$ |
|
3 |
Author: Giampaolo Bella, Cambridge University Computer Laboratory |
|
4 |
Copyright 1998 University of Cambridge |
|
5 |
||
6 |
The Kerberos protocol, version IV. |
|
7 |
*) |
|
8 |
||
9 |
Pretty.setdepth 20; |
|
9000 | 10 |
set timing; |
6452 | 11 |
|
12 |
AddIffs [AuthLife_LB, ServLife_LB, AutcLife_LB, RespLife_LB, Tgs_not_bad]; |
|
13 |
||
14 |
||
15 |
(** Reversed traces **) |
|
16 |
||
17 |
Goal "spies (evs @ [Says A B X]) = insert X (spies evs)"; |
|
18 |
by (induct_tac "evs" 1); |
|
19 |
by (induct_tac "a" 2); |
|
20 |
by Auto_tac; |
|
21 |
qed "spies_Says_rev"; |
|
22 |
||
23 |
Goal "spies (evs @ [Gets A X]) = spies evs"; |
|
24 |
by (induct_tac "evs" 1); |
|
25 |
by (induct_tac "a" 2); |
|
26 |
by Auto_tac; |
|
27 |
qed "spies_Gets_rev"; |
|
28 |
||
29 |
Goal "spies (evs @ [Notes A X]) = \ |
|
30 |
\ (if A:bad then insert X (spies evs) else spies evs)"; |
|
31 |
by (induct_tac "evs" 1); |
|
32 |
by (induct_tac "a" 2); |
|
33 |
by Auto_tac; |
|
34 |
qed "spies_Notes_rev"; |
|
35 |
||
36 |
Goal "spies evs = spies (rev evs)"; |
|
37 |
by (induct_tac "evs" 1); |
|
38 |
by (induct_tac "a" 2); |
|
39 |
by (ALLGOALS |
|
40 |
(asm_simp_tac (simpset() addsimps [spies_Says_rev, spies_Gets_rev, |
|
41 |
spies_Notes_rev]))); |
|
42 |
qed "spies_evs_rev"; |
|
43 |
bind_thm ("parts_spies_evs_revD2", spies_evs_rev RS equalityD2 RS parts_mono); |
|
44 |
||
45 |
Goal "spies (takeWhile P evs) <= spies evs"; |
|
46 |
by (induct_tac "evs" 1); |
|
47 |
by (induct_tac "a" 2); |
|
48 |
by Auto_tac; |
|
49 |
(* Resembles "used_subset_append" in Event.ML*) |
|
50 |
qed "spies_takeWhile"; |
|
51 |
bind_thm ("parts_spies_takeWhile_mono", spies_takeWhile RS parts_mono); |
|
52 |
||
53 |
Goal "~P(x) --> takeWhile P (xs @ [x]) = takeWhile P xs"; |
|
54 |
by (induct_tac "xs" 1); |
|
55 |
by Auto_tac; |
|
56 |
qed "takeWhile_tail"; |
|
57 |
||
58 |
||
59 |
(*****************LEMMAS ABOUT AuthKeys****************) |
|
60 |
||
61 |
Goalw [AuthKeys_def] "AuthKeys [] = {}"; |
|
62 |
by (Simp_tac 1); |
|
63 |
qed "AuthKeys_empty"; |
|
64 |
||
65 |
Goalw [AuthKeys_def] |
|
66 |
"(ALL A Tk akey Peer. \ |
|
67 |
\ ev ~= Says Kas A (Crypt (shrK A) {|akey, Agent Peer, Tk, \ |
|
68 |
\ (Crypt (shrK Peer) {|Agent A, Agent Peer, akey, Tk|})|}))\ |
|
69 |
\ ==> AuthKeys (ev # evs) = AuthKeys evs"; |
|
70 |
by Auto_tac; |
|
71 |
qed "AuthKeys_not_insert"; |
|
72 |
||
73 |
Goalw [AuthKeys_def] |
|
74 |
"AuthKeys \ |
|
75 |
\ (Says Kas A (Crypt (shrK A) {|Key K, Agent Peer, Number Tk, \ |
|
76 |
\ (Crypt (shrK Peer) {|Agent A, Agent Peer, Key K, Number Tk|})|}) # evs) \ |
|
77 |
\ = insert K (AuthKeys evs)"; |
|
78 |
by Auto_tac; |
|
79 |
qed "AuthKeys_insert"; |
|
80 |
||
81 |
Goalw [AuthKeys_def] |
|
82 |
"K : AuthKeys \ |
|
83 |
\ (Says Kas A (Crypt (shrK A) {|Key K', Agent Peer, Number Tk, \ |
|
84 |
\ (Crypt (shrK Peer) {|Agent A, Agent Peer, Key K', Number Tk|})|}) # evs) \ |
|
85 |
\ ==> K = K' | K : AuthKeys evs"; |
|
86 |
by Auto_tac; |
|
87 |
qed "AuthKeys_simp"; |
|
88 |
||
89 |
Goalw [AuthKeys_def] |
|
90 |
"Says Kas A (Crypt (shrK A) {|Key K, Agent Tgs, Number Tk, \ |
|
91 |
\ (Crypt (shrK Tgs) {|Agent A, Agent Tgs, Key K, Number Tk|})|}) : set evs \ |
|
92 |
\ ==> K : AuthKeys evs"; |
|
93 |
by Auto_tac; |
|
94 |
qed "AuthKeysI"; |
|
95 |
||
96 |
Goalw [AuthKeys_def] "K : AuthKeys evs ==> Key K : used evs"; |
|
97 |
by (Simp_tac 1); |
|
98 |
by (blast_tac (claset() addSEs spies_partsEs) 1); |
|
99 |
qed "AuthKeys_used"; |
|
100 |
||
101 |
||
102 |
(**** FORWARDING LEMMAS ****) |
|
103 |
||
104 |
(*--For reasoning about the encrypted portion of message K3--*) |
|
105 |
Goal "Says Kas' A (Crypt KeyA {|AuthKey, Peer, Tk, AuthTicket|}) \ |
|
106 |
\ : set evs ==> AuthTicket : parts (spies evs)"; |
|
107 |
by (blast_tac (claset() addSEs spies_partsEs) 1); |
|
108 |
qed "K3_msg_in_parts_spies"; |
|
109 |
||
110 |
Goal "Says Kas A (Crypt KeyA {|AuthKey, Peer, Tk, AuthTicket|}) \ |
|
111 |
\ : set evs ==> AuthKey : parts (spies evs)"; |
|
112 |
by (blast_tac (claset() addSEs spies_partsEs) 1); |
|
113 |
qed "Oops_parts_spies1"; |
|
114 |
||
115 |
Goal "[| Says Kas A (Crypt KeyA {|Key AuthKey, Peer, Tk, AuthTicket|}) \ |
|
116 |
\ : set evs ;\ |
|
117 |
\ evs : kerberos |] ==> AuthKey ~: range shrK"; |
|
118 |
by (etac rev_mp 1); |
|
119 |
by (etac kerberos.induct 1); |
|
120 |
by Auto_tac; |
|
121 |
qed "Oops_range_spies1"; |
|
122 |
||
123 |
(*--For reasoning about the encrypted portion of message K5--*) |
|
124 |
Goal "Says Tgs' A (Crypt AuthKey {|ServKey, Agent B, Tt, ServTicket|})\ |
|
125 |
\ : set evs ==> ServTicket : parts (spies evs)"; |
|
126 |
by (blast_tac (claset() addSEs spies_partsEs) 1); |
|
127 |
qed "K5_msg_in_parts_spies"; |
|
128 |
||
129 |
Goal "Says Tgs A (Crypt AuthKey {|ServKey, Agent B, Tt, ServTicket|})\ |
|
130 |
\ : set evs ==> ServKey : parts (spies evs)"; |
|
131 |
by (blast_tac (claset() addSEs spies_partsEs) 1); |
|
132 |
qed "Oops_parts_spies2"; |
|
133 |
||
134 |
Goal "[| Says Tgs A (Crypt AuthKey {|Key ServKey, Agent B, Tt, ServTicket|}) \ |
|
135 |
\ : set evs ;\ |
|
136 |
\ evs : kerberos |] ==> ServKey ~: range shrK"; |
|
137 |
by (etac rev_mp 1); |
|
138 |
by (etac kerberos.induct 1); |
|
139 |
by Auto_tac; |
|
140 |
qed "Oops_range_spies2"; |
|
141 |
||
142 |
Goal "Says S A (Crypt K {|SesKey, B, TimeStamp, Ticket|}) : set evs \ |
|
143 |
\ ==> Ticket : parts (spies evs)"; |
|
144 |
by (blast_tac (claset() addSEs spies_partsEs) 1); |
|
145 |
qed "Says_ticket_in_parts_spies"; |
|
146 |
(*Replaces both K3_msg_in_parts_spies and K5_msg_in_parts_spies*) |
|
147 |
||
148 |
fun parts_induct_tac i = |
|
149 |
etac kerberos.induct i THEN |
|
150 |
REPEAT (FIRSTGOAL analz_mono_contra_tac) THEN |
|
7499 | 151 |
ftac K3_msg_in_parts_spies (i+4) THEN |
152 |
ftac K5_msg_in_parts_spies (i+6) THEN |
|
153 |
ftac Oops_parts_spies1 (i+8) THEN |
|
154 |
ftac Oops_parts_spies2 (i+9) THEN |
|
6452 | 155 |
prove_simple_subgoals_tac 1; |
156 |
||
157 |
||
158 |
(*Spy never sees another agent's shared key! (unless it's lost at start)*) |
|
159 |
Goal "evs : kerberos ==> (Key (shrK A) : parts (spies evs)) = (A : bad)"; |
|
160 |
by (parts_induct_tac 1); |
|
161 |
by (Fake_parts_insert_tac 1); |
|
162 |
by (ALLGOALS Blast_tac); |
|
163 |
qed "Spy_see_shrK"; |
|
164 |
Addsimps [Spy_see_shrK]; |
|
165 |
||
166 |
Goal "evs : kerberos ==> (Key (shrK A) : analz (spies evs)) = (A : bad)"; |
|
167 |
by (auto_tac (claset() addDs [impOfSubs analz_subset_parts], simpset())); |
|
168 |
qed "Spy_analz_shrK"; |
|
169 |
Addsimps [Spy_analz_shrK]; |
|
170 |
||
171 |
Goal "[| Key (shrK A) : parts (spies evs); evs : kerberos |] ==> A:bad"; |
|
172 |
by (blast_tac (claset() addDs [Spy_see_shrK]) 1); |
|
173 |
qed "Spy_see_shrK_D"; |
|
174 |
bind_thm ("Spy_analz_shrK_D", analz_subset_parts RS subsetD RS Spy_see_shrK_D); |
|
175 |
AddSDs [Spy_see_shrK_D, Spy_analz_shrK_D]; |
|
176 |
||
177 |
(*Nobody can have used non-existent keys!*) |
|
178 |
Goal "evs : kerberos ==> \ |
|
179 |
\ Key K ~: used evs --> K ~: keysFor (parts (spies evs))"; |
|
180 |
by (parts_induct_tac 1); |
|
181 |
(*Fake*) |
|
182 |
by (best_tac |
|
183 |
(claset() addSDs [impOfSubs (parts_insert_subset_Un RS keysFor_mono)] |
|
184 |
addIs [impOfSubs analz_subset_parts] |
|
185 |
addDs [impOfSubs (analz_subset_parts RS keysFor_mono)] |
|
186 |
addss (simpset())) 1); |
|
187 |
(*Others*) |
|
188 |
by (ALLGOALS (blast_tac (claset() addSEs spies_partsEs))); |
|
189 |
qed_spec_mp "new_keys_not_used"; |
|
190 |
||
191 |
bind_thm ("new_keys_not_analzd", |
|
192 |
[analz_subset_parts RS keysFor_mono, |
|
193 |
new_keys_not_used] MRS contra_subsetD); |
|
194 |
||
195 |
Addsimps [new_keys_not_used, new_keys_not_analzd]; |
|
196 |
||
197 |
||
198 |
(*********************** REGULARITY LEMMAS ***********************) |
|
199 |
(* concerning the form of items passed in messages *) |
|
200 |
(*****************************************************************) |
|
201 |
||
202 |
(*Describes the form of AuthKey, AuthTicket, and K sent by Kas*) |
|
203 |
Goal "[| Says Kas A (Crypt K {|Key AuthKey, Agent Peer, Tk, AuthTicket|}) \ |
|
204 |
\ : set evs; \ |
|
205 |
\ evs : kerberos |] \ |
|
206 |
\ ==> AuthKey ~: range shrK & AuthKey : AuthKeys evs & \ |
|
207 |
\ AuthTicket = (Crypt (shrK Tgs) {|Agent A, Agent Tgs, Key AuthKey, Tk|} ) &\ |
|
208 |
\ K = shrK A & Peer = Tgs"; |
|
209 |
by (etac rev_mp 1); |
|
210 |
by (etac kerberos.induct 1); |
|
211 |
by (ALLGOALS (simp_tac (simpset() addsimps [AuthKeys_def, AuthKeys_insert]))); |
|
212 |
by (ALLGOALS Blast_tac); |
|
213 |
qed "Says_Kas_message_form"; |
|
214 |
||
215 |
(*This lemma is essential for proving Says_Tgs_message_form: |
|
216 |
||
217 |
the session key AuthKey |
|
218 |
supplied by Kas in the authentication ticket |
|
219 |
cannot be a long-term key! |
|
220 |
||
221 |
Generalised to any session keys (both AuthKey and ServKey). |
|
222 |
*) |
|
223 |
Goal "[| Crypt (shrK Tgs_B) {|Agent A, Agent Tgs_B, Key SesKey, Number T|}\ |
|
224 |
\ : parts (spies evs); Tgs_B ~: bad;\ |
|
225 |
\ evs : kerberos |] \ |
|
226 |
\ ==> SesKey ~: range shrK"; |
|
227 |
by (etac rev_mp 1); |
|
228 |
by (parts_induct_tac 1); |
|
229 |
by (Fake_parts_insert_tac 1); |
|
230 |
qed "SesKey_is_session_key"; |
|
231 |
||
232 |
Goal "[| Crypt (shrK Tgs) {|Agent A, Agent Tgs, Key AuthKey, Tk|} \ |
|
233 |
\ : parts (spies evs); \ |
|
234 |
\ evs : kerberos |] \ |
|
235 |
\ ==> Says Kas A (Crypt (shrK A) {|Key AuthKey, Agent Tgs, Tk, \ |
|
236 |
\ Crypt (shrK Tgs) {|Agent A, Agent Tgs, Key AuthKey, Tk|}|}) \ |
|
237 |
\ : set evs"; |
|
238 |
by (etac rev_mp 1); |
|
239 |
by (parts_induct_tac 1); |
|
240 |
(*Fake*) |
|
241 |
by (Fake_parts_insert_tac 1); |
|
242 |
(*K4*) |
|
243 |
by (Blast_tac 1); |
|
244 |
qed "A_trusts_AuthTicket"; |
|
245 |
||
246 |
Goal "[| Crypt (shrK Tgs) {|Agent A, Agent Tgs, Key AuthKey, Number Tk|}\ |
|
247 |
\ : parts (spies evs);\ |
|
248 |
\ evs : kerberos |] \ |
|
249 |
\ ==> AuthKey : AuthKeys evs"; |
|
7499 | 250 |
by (ftac A_trusts_AuthTicket 1); |
6452 | 251 |
by (assume_tac 1); |
252 |
by (simp_tac (simpset() addsimps [AuthKeys_def]) 1); |
|
253 |
by (Blast_tac 1); |
|
254 |
qed "AuthTicket_crypt_AuthKey"; |
|
255 |
||
256 |
(*Describes the form of ServKey, ServTicket and AuthKey sent by Tgs*) |
|
257 |
Goal "[| Says Tgs A (Crypt AuthKey {|Key ServKey, Agent B, Tt, ServTicket|})\ |
|
258 |
\ : set evs; \ |
|
259 |
\ evs : kerberos |] \ |
|
260 |
\ ==> B ~= Tgs & ServKey ~: range shrK & ServKey ~: AuthKeys evs &\ |
|
261 |
\ ServTicket = (Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Tt|} ) & \ |
|
262 |
\ AuthKey ~: range shrK & AuthKey : AuthKeys evs"; |
|
263 |
by (etac rev_mp 1); |
|
264 |
by (etac kerberos.induct 1); |
|
265 |
by (ALLGOALS |
|
266 |
(asm_full_simp_tac |
|
267 |
(simpset() addsimps [AuthKeys_insert, AuthKeys_not_insert, |
|
268 |
AuthKeys_empty, AuthKeys_simp]))); |
|
269 |
by (blast_tac (claset() addEs spies_partsEs) 1); |
|
270 |
by Auto_tac; |
|
271 |
by (blast_tac (claset() addSDs [AuthKeys_used, Says_Kas_message_form]) 1); |
|
272 |
by (blast_tac (claset() addSDs [SesKey_is_session_key] |
|
273 |
addEs spies_partsEs) 1); |
|
274 |
by (blast_tac (claset() addDs [AuthTicket_crypt_AuthKey] |
|
275 |
addEs spies_partsEs) 1); |
|
276 |
qed "Says_Tgs_message_form"; |
|
277 |
||
278 |
(*If a certain encrypted message appears then it originated with Kas*) |
|
279 |
Goal "[| Crypt (shrK A) {|Key AuthKey, Peer, Tk, AuthTicket|} \ |
|
280 |
\ : parts (spies evs); \ |
|
281 |
\ A ~: bad; evs : kerberos |] \ |
|
282 |
\ ==> Says Kas A (Crypt (shrK A) {|Key AuthKey, Peer, Tk, AuthTicket|}) \ |
|
283 |
\ : set evs"; |
|
284 |
by (etac rev_mp 1); |
|
285 |
by (parts_induct_tac 1); |
|
286 |
(*Fake*) |
|
287 |
by (Fake_parts_insert_tac 1); |
|
288 |
(*K4*) |
|
289 |
by (blast_tac (claset() addSDs [Says_imp_spies RS parts.Inj RS parts.Fst, |
|
290 |
A_trusts_AuthTicket RS Says_Kas_message_form]) |
|
291 |
1); |
|
292 |
qed "A_trusts_AuthKey"; |
|
293 |
||
294 |
||
295 |
(*If a certain encrypted message appears then it originated with Tgs*) |
|
296 |
Goal "[| Crypt AuthKey {|Key ServKey, Agent B, Tt, ServTicket|} \ |
|
297 |
\ : parts (spies evs); \ |
|
298 |
\ Key AuthKey ~: analz (spies evs); \ |
|
299 |
\ AuthKey ~: range shrK; \ |
|
300 |
\ evs : kerberos |] \ |
|
301 |
\==> EX A. Says Tgs A (Crypt AuthKey {|Key ServKey, Agent B, Tt, ServTicket|})\ |
|
302 |
\ : set evs"; |
|
303 |
by (etac rev_mp 1); |
|
304 |
by (etac rev_mp 1); |
|
305 |
by (parts_induct_tac 1); |
|
306 |
(*Fake*) |
|
307 |
by (Fake_parts_insert_tac 1); |
|
308 |
(*K2*) |
|
309 |
by (Blast_tac 1); |
|
310 |
(*K4*) |
|
311 |
by Auto_tac; |
|
312 |
qed "A_trusts_K4"; |
|
313 |
||
314 |
Goal "[| Crypt (shrK A) {|Key AuthKey, Agent Tgs, Tk, AuthTicket|} \ |
|
315 |
\ : parts (spies evs); \ |
|
316 |
\ A ~: bad; \ |
|
317 |
\ evs : kerberos |] \ |
|
318 |
\ ==> AuthKey ~: range shrK & \ |
|
319 |
\ AuthTicket = Crypt (shrK Tgs) {|Agent A, Agent Tgs, Key AuthKey, Tk|}"; |
|
320 |
by (etac rev_mp 1); |
|
321 |
by (parts_induct_tac 1); |
|
322 |
by (Fake_parts_insert_tac 1); |
|
323 |
by (Blast_tac 1); |
|
324 |
qed "AuthTicket_form"; |
|
325 |
||
326 |
(* This form holds also over an AuthTicket, but is not needed below. *) |
|
327 |
Goal "[| Crypt AuthKey {|Key ServKey, Agent B, Tt, ServTicket|} \ |
|
328 |
\ : parts (spies evs); \ |
|
329 |
\ Key AuthKey ~: analz (spies evs); \ |
|
330 |
\ evs : kerberos |] \ |
|
331 |
\ ==> ServKey ~: range shrK & \ |
|
332 |
\ (EX A. ServTicket = Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Tt|})"; |
|
333 |
by (etac rev_mp 1); |
|
334 |
by (etac rev_mp 1); |
|
335 |
by (parts_induct_tac 1); |
|
336 |
by (Fake_parts_insert_tac 1); |
|
337 |
qed "ServTicket_form"; |
|
338 |
||
339 |
Goal "[| Says Kas' A (Crypt (shrK A) \ |
|
340 |
\ {|Key AuthKey, Agent Tgs, Tk, AuthTicket|} ) : set evs; \ |
|
341 |
\ evs : kerberos |] \ |
|
342 |
\ ==> AuthKey ~: range shrK & \ |
|
343 |
\ AuthTicket = \ |
|
344 |
\ Crypt (shrK Tgs) {|Agent A, Agent Tgs, Key AuthKey, Tk|}\ |
|
345 |
\ | AuthTicket : analz (spies evs)"; |
|
346 |
by (case_tac "A : bad" 1); |
|
347 |
by (force_tac (claset() addSDs [Says_imp_spies RS analz.Inj], simpset()) 1); |
|
348 |
by (forward_tac [Says_imp_spies RS parts.Inj] 1); |
|
349 |
by (blast_tac (claset() addSDs [AuthTicket_form]) 1); |
|
350 |
qed "Says_kas_message_form"; |
|
351 |
(* Essentially the same as AuthTicket_form *) |
|
352 |
||
353 |
Goal "[| Says Tgs' A (Crypt AuthKey \ |
|
354 |
\ {|Key ServKey, Agent B, Tt, ServTicket|} ) : set evs; \ |
|
355 |
\ evs : kerberos |] \ |
|
356 |
\ ==> ServKey ~: range shrK & \ |
|
357 |
\ (EX A. ServTicket = \ |
|
358 |
\ Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Tt|}) \ |
|
359 |
\ | ServTicket : analz (spies evs)"; |
|
360 |
by (case_tac "Key AuthKey : analz (spies evs)" 1); |
|
11104 | 361 |
by (blast_tac (claset() addDs [Says_imp_spies RS analz.Inj]) 1); |
6452 | 362 |
by (forward_tac [Says_imp_spies RS parts.Inj] 1); |
363 |
by (blast_tac (claset() addSDs [ServTicket_form]) 1); |
|
364 |
qed "Says_tgs_message_form"; |
|
365 |
(* This form MUST be used in analz_sees_tac below *) |
|
366 |
||
367 |
||
368 |
(*****************UNICITY THEOREMS****************) |
|
369 |
||
370 |
(* The session key, if secure, uniquely identifies the Ticket |
|
371 |
whether AuthTicket or ServTicket. As a matter of fact, one can read |
|
372 |
also Tgs in the place of B. *) |
|
373 |
||
374 |
Goal "[| Crypt (shrK B) {|Agent A, Agent B, Key SesKey, T|} \ |
|
375 |
\ : parts (spies evs); \ |
|
376 |
\ Crypt (shrK B') {|Agent A', Agent B', Key SesKey, T'|} \ |
|
11104 | 377 |
\ : parts (spies evs); Key SesKey ~: analz (spies evs); \ |
378 |
\ evs : kerberos |] \ |
|
6452 | 379 |
\ ==> A=A' & B=B' & T=T'"; |
11104 | 380 |
by (etac rev_mp 1); |
381 |
by (etac rev_mp 1); |
|
382 |
by (etac rev_mp 1); |
|
383 |
by (parts_induct_tac 1); |
|
384 |
(*Fake, K2, K4*) |
|
385 |
by (Fake_parts_insert_tac 1); |
|
386 |
by (REPEAT (blast_tac (claset() addSEs knows_Spy_partsEs) 1)); |
|
6452 | 387 |
qed "unique_CryptKey"; |
388 |
||
389 |
(*An AuthKey is encrypted by one and only one Shared key. |
|
390 |
A ServKey is encrypted by one and only one AuthKey. |
|
391 |
*) |
|
392 |
Goal "[| Crypt K {|Key SesKey, Agent B, T, Ticket|} \ |
|
393 |
\ : parts (spies evs); \ |
|
394 |
\ Crypt K' {|Key SesKey, Agent B', T', Ticket'|} \ |
|
11104 | 395 |
\ : parts (spies evs); Key SesKey ~: analz (spies evs); \ |
396 |
\ evs : kerberos |] \ |
|
6452 | 397 |
\ ==> K=K' & B=B' & T=T' & Ticket=Ticket'"; |
11104 | 398 |
by (etac rev_mp 1); |
399 |
by (etac rev_mp 1); |
|
400 |
by (etac rev_mp 1); |
|
401 |
by (parts_induct_tac 1); |
|
402 |
(*Fake, K2, K4*) |
|
403 |
by (Fake_parts_insert_tac 1); |
|
404 |
by (REPEAT (blast_tac (claset() addSEs knows_Spy_partsEs) 1)); |
|
6452 | 405 |
qed "Key_unique_SesKey"; |
406 |
||
407 |
||
408 |
(* |
|
409 |
At reception of any message mentioning A, Kas associates shrK A with |
|
410 |
a new AuthKey. Realistic, as the user gets a new AuthKey at each login. |
|
411 |
Similarly, at reception of any message mentioning an AuthKey |
|
412 |
(a legitimate user could make several requests to Tgs - by K3), Tgs |
|
413 |
associates it with a new ServKey. |
|
414 |
||
415 |
Therefore, a goal like |
|
416 |
||
417 |
"evs : kerberos \ |
|
418 |
\ ==> Key Kc ~: analz (spies evs) --> \ |
|
419 |
\ (EX K' B' T' Ticket'. ALL K B T Ticket. \ |
|
420 |
\ Crypt Kc {|Key K, Agent B, T, Ticket|} \ |
|
421 |
\ : parts (spies evs) --> K=K' & B=B' & T=T' & Ticket=Ticket')"; |
|
422 |
||
423 |
would fail on the K2 and K4 cases. |
|
424 |
*) |
|
425 |
||
426 |
Goal "[| Says Kas A \ |
|
427 |
\ (Crypt Ka {|Key AuthKey, Agent Tgs, Tk, X|}) : set evs; \ |
|
428 |
\ Says Kas A' \ |
|
429 |
\ (Crypt Ka' {|Key AuthKey, Agent Tgs, Tk', X'|}) : set evs; \ |
|
430 |
\ evs : kerberos |] ==> A=A' & Ka=Ka' & Tk=Tk' & X=X'"; |
|
11104 | 431 |
by (etac rev_mp 1); |
432 |
by (etac rev_mp 1); |
|
433 |
by (parts_induct_tac 1); |
|
434 |
(*K2*) |
|
435 |
by (blast_tac (claset() addSEs knows_Spy_partsEs) 1); |
|
6452 | 436 |
qed "unique_AuthKeys"; |
437 |
||
438 |
(* ServKey uniquely identifies the message from Tgs *) |
|
439 |
Goal "[| Says Tgs A \ |
|
440 |
\ (Crypt K {|Key ServKey, Agent B, Tt, X|}) : set evs; \ |
|
441 |
\ Says Tgs A' \ |
|
442 |
\ (Crypt K' {|Key ServKey, Agent B', Tt', X'|}) : set evs; \ |
|
443 |
\ evs : kerberos |] ==> A=A' & B=B' & K=K' & Tt=Tt' & X=X'"; |
|
11104 | 444 |
by (etac rev_mp 1); |
445 |
by (etac rev_mp 1); |
|
446 |
by (parts_induct_tac 1); |
|
447 |
(*K4*) |
|
448 |
by (blast_tac (claset() addSEs knows_Spy_partsEs) 1); |
|
6452 | 449 |
qed "unique_ServKeys"; |
450 |
||
451 |
||
452 |
(*****************LEMMAS ABOUT the predicate KeyCryptKey****************) |
|
453 |
||
454 |
Goalw [KeyCryptKey_def] "~ KeyCryptKey AuthKey ServKey []"; |
|
455 |
by (Simp_tac 1); |
|
456 |
qed "not_KeyCryptKey_Nil"; |
|
457 |
AddIffs [not_KeyCryptKey_Nil]; |
|
458 |
||
459 |
Goalw [KeyCryptKey_def] |
|
460 |
"[| Says Tgs A (Crypt AuthKey {|Key ServKey, Agent B, tt, X |}) \ |
|
461 |
\ : set evs; \ |
|
462 |
\ evs : kerberos |] ==> KeyCryptKey AuthKey ServKey evs"; |
|
7499 | 463 |
by (ftac Says_Tgs_message_form 1); |
6452 | 464 |
by (assume_tac 1); |
465 |
by (Blast_tac 1); |
|
466 |
qed "KeyCryptKeyI"; |
|
467 |
||
468 |
Goalw [KeyCryptKey_def] |
|
469 |
"KeyCryptKey AuthKey ServKey (Says S A X # evs) = \ |
|
470 |
\ (Tgs = S & \ |
|
471 |
\ (EX B tt. X = Crypt AuthKey \ |
|
472 |
\ {|Key ServKey, Agent B, tt, \ |
|
473 |
\ Crypt (shrK B) {|Agent A, Agent B, Key ServKey, tt|} |}) \ |
|
474 |
\ | KeyCryptKey AuthKey ServKey evs)"; |
|
475 |
by (Simp_tac 1); |
|
476 |
by (Blast_tac 1); |
|
477 |
qed "KeyCryptKey_Says"; |
|
478 |
Addsimps [KeyCryptKey_Says]; |
|
479 |
||
480 |
(*A fresh AuthKey cannot be associated with any other |
|
481 |
(with respect to a given trace). *) |
|
482 |
Goalw [KeyCryptKey_def] |
|
483 |
"[| Key AuthKey ~: used evs; evs : kerberos |] \ |
|
484 |
\ ==> ~ KeyCryptKey AuthKey ServKey evs"; |
|
485 |
by (etac rev_mp 1); |
|
486 |
by (parts_induct_tac 1); |
|
487 |
by (Asm_full_simp_tac 1); |
|
488 |
by (blast_tac (claset() addSEs spies_partsEs) 1); |
|
489 |
qed "Auth_fresh_not_KeyCryptKey"; |
|
490 |
||
491 |
(*A fresh ServKey cannot be associated with any other |
|
492 |
(with respect to a given trace). *) |
|
493 |
Goalw [KeyCryptKey_def] |
|
494 |
"Key ServKey ~: used evs ==> ~ KeyCryptKey AuthKey ServKey evs"; |
|
495 |
by (blast_tac (claset() addSEs spies_partsEs) 1); |
|
496 |
qed "Serv_fresh_not_KeyCryptKey"; |
|
497 |
||
498 |
Goalw [KeyCryptKey_def] |
|
499 |
"[| Crypt (shrK Tgs) {|Agent A, Agent Tgs, Key AuthKey, tk|}\ |
|
500 |
\ : parts (spies evs); evs : kerberos |] \ |
|
501 |
\ ==> ~ KeyCryptKey K AuthKey evs"; |
|
502 |
by (etac rev_mp 1); |
|
503 |
by (parts_induct_tac 1); |
|
504 |
(*K4*) |
|
505 |
by (blast_tac (claset() addEs spies_partsEs) 3); |
|
506 |
(*K2: by freshness*) |
|
507 |
by (blast_tac (claset() addEs spies_partsEs) 2); |
|
508 |
by (Fake_parts_insert_tac 1); |
|
509 |
qed "AuthKey_not_KeyCryptKey"; |
|
510 |
||
511 |
(*A secure serverkey cannot have been used to encrypt others*) |
|
512 |
Goalw [KeyCryptKey_def] |
|
513 |
"[| Crypt (shrK B) {|Agent A, Agent B, Key ServKey, tt|} \ |
|
514 |
\ : parts (spies evs); \ |
|
515 |
\ Key ServKey ~: analz (spies evs); \ |
|
516 |
\ B ~= Tgs; evs : kerberos |] \ |
|
517 |
\ ==> ~ KeyCryptKey ServKey K evs"; |
|
518 |
by (etac rev_mp 1); |
|
519 |
by (etac rev_mp 1); |
|
520 |
by (parts_induct_tac 1); |
|
521 |
by (Fake_parts_insert_tac 1); |
|
522 |
(*K4 splits into distinct subcases*) |
|
523 |
by (Step_tac 1); |
|
524 |
by (ALLGOALS Asm_full_simp_tac); |
|
525 |
(*ServKey can't have been enclosed in two certificates*) |
|
526 |
by (blast_tac (claset() addSDs [Says_imp_spies RS parts.Inj] |
|
527 |
addSEs [MPair_parts] |
|
528 |
addDs [unique_CryptKey]) 4); |
|
529 |
(*ServKey is fresh and so could not have been used, by new_keys_not_used*) |
|
530 |
by (force_tac (claset() addSDs [Says_imp_spies RS parts.Inj, |
|
531 |
Crypt_imp_invKey_keysFor], |
|
532 |
simpset()) 2); |
|
533 |
(*Others by freshness*) |
|
534 |
by (REPEAT (blast_tac (claset() addSEs spies_partsEs) 1)); |
|
535 |
qed "ServKey_not_KeyCryptKey"; |
|
536 |
||
537 |
(*Long term keys are not issued as ServKeys*) |
|
538 |
Goalw [KeyCryptKey_def] |
|
539 |
"evs : kerberos ==> ~ KeyCryptKey K (shrK A) evs"; |
|
540 |
by (parts_induct_tac 1); |
|
541 |
qed "shrK_not_KeyCryptKey"; |
|
542 |
||
543 |
(*The Tgs message associates ServKey with AuthKey and therefore not with any |
|
544 |
other key AuthKey.*) |
|
545 |
Goalw [KeyCryptKey_def] |
|
546 |
"[| Says Tgs A (Crypt AuthKey {|Key ServKey, Agent B, tt, X |}) \ |
|
547 |
\ : set evs; \ |
|
548 |
\ AuthKey' ~= AuthKey; evs : kerberos |] \ |
|
549 |
\ ==> ~ KeyCryptKey AuthKey' ServKey evs"; |
|
550 |
by (blast_tac (claset() addDs [unique_ServKeys]) 1); |
|
551 |
qed "Says_Tgs_KeyCryptKey"; |
|
552 |
||
553 |
Goal "[| KeyCryptKey AuthKey ServKey evs; evs : kerberos |] \ |
|
554 |
\ ==> ~ KeyCryptKey ServKey K evs"; |
|
555 |
by (etac rev_mp 1); |
|
556 |
by (parts_induct_tac 1); |
|
557 |
by (Step_tac 1); |
|
558 |
by (ALLGOALS Asm_full_simp_tac); |
|
559 |
(*K4 splits into subcases*) |
|
560 |
by (blast_tac (claset() addEs spies_partsEs |
|
561 |
addSDs [AuthKey_not_KeyCryptKey]) 4); |
|
562 |
(*ServKey is fresh and so could not have been used, by new_keys_not_used*) |
|
563 |
by (force_tac (claset() addSDs [Says_imp_spies RS parts.Inj, |
|
564 |
Crypt_imp_invKey_keysFor], |
|
565 |
simpset() addsimps [KeyCryptKey_def]) 2); |
|
566 |
(*Others by freshness*) |
|
567 |
by (REPEAT (blast_tac (claset() addSEs spies_partsEs) 1)); |
|
568 |
qed "KeyCryptKey_not_KeyCryptKey"; |
|
569 |
||
570 |
(*The only session keys that can be found with the help of session keys are |
|
571 |
those sent by Tgs in step K4. *) |
|
572 |
||
573 |
(*We take some pains to express the property |
|
574 |
as a logical equivalence so that the simplifier can apply it.*) |
|
10833 | 575 |
Goal "P --> (Key K : analz (Key`KK Un H)) --> (K:KK | Key K : analz H) \ |
6452 | 576 |
\ ==> \ |
10833 | 577 |
\ P --> (Key K : analz (Key`KK Un H)) = (K:KK | Key K : analz H)"; |
6452 | 578 |
by (blast_tac (claset() addIs [impOfSubs analz_mono]) 1); |
579 |
qed "Key_analz_image_Key_lemma"; |
|
580 |
||
581 |
Goal "[| KeyCryptKey K K' evs; evs : kerberos |] \ |
|
582 |
\ ==> Key K' : analz (insert (Key K) (spies evs))"; |
|
583 |
by (full_simp_tac (simpset() addsimps [KeyCryptKey_def]) 1); |
|
584 |
by (Clarify_tac 1); |
|
585 |
by (dresolve_tac [Says_imp_spies RS analz.Inj RS analz_insertI] 1); |
|
586 |
by Auto_tac; |
|
587 |
qed "KeyCryptKey_analz_insert"; |
|
588 |
||
589 |
Goal "[| K : AuthKeys evs Un range shrK; evs : kerberos |] \ |
|
590 |
\ ==> ALL SK. ~ KeyCryptKey SK K evs"; |
|
591 |
by (asm_full_simp_tac (simpset() addsimps [KeyCryptKey_def]) 1); |
|
592 |
by (blast_tac (claset() addDs [Says_Tgs_message_form]) 1); |
|
593 |
qed "AuthKeys_are_not_KeyCryptKey"; |
|
594 |
||
595 |
Goal "[| K ~: AuthKeys evs; \ |
|
596 |
\ K ~: range shrK; evs : kerberos |] \ |
|
597 |
\ ==> ALL SK. ~ KeyCryptKey K SK evs"; |
|
598 |
by (asm_full_simp_tac (simpset() addsimps [KeyCryptKey_def]) 1); |
|
599 |
by (blast_tac (claset() addDs [Says_Tgs_message_form]) 1); |
|
600 |
qed "not_AuthKeys_not_KeyCryptKey"; |
|
601 |
||
602 |
||
603 |
(*****************SECRECY THEOREMS****************) |
|
604 |
||
605 |
(*For proofs involving analz.*) |
|
606 |
val analz_sees_tac = |
|
607 |
EVERY |
|
608 |
[REPEAT (FIRSTGOAL analz_mono_contra_tac), |
|
7499 | 609 |
ftac Oops_range_spies2 10, |
610 |
ftac Oops_range_spies1 9, |
|
611 |
ftac Says_tgs_message_form 7, |
|
612 |
ftac Says_kas_message_form 5, |
|
6452 | 613 |
REPEAT_FIRST (eresolve_tac [asm_rl, conjE, disjE, exE] |
614 |
ORELSE' hyp_subst_tac)]; |
|
615 |
||
616 |
Goal "[| KK <= -(range shrK); Key K : analz (spies evs); evs: kerberos |] \ |
|
10833 | 617 |
\ ==> Key K : analz (Key ` KK Un spies evs)"; |
6452 | 618 |
by (blast_tac (claset() addDs [impOfSubs analz_mono]) 1); |
619 |
qed "analz_mono_KK"; |
|
620 |
||
8954
4fbdda40bb5f
rewrote a very long proof (Key_analz_image_Key) because it had stopped working
paulson
parents:
8741
diff
changeset
|
621 |
(*For the Oops2 case of the next theorem*) |
4fbdda40bb5f
rewrote a very long proof (Key_analz_image_Key) because it had stopped working
paulson
parents:
8741
diff
changeset
|
622 |
Goal "[| evs : kerberos; \ |
4fbdda40bb5f
rewrote a very long proof (Key_analz_image_Key) because it had stopped working
paulson
parents:
8741
diff
changeset
|
623 |
\ Says Tgs A (Crypt AuthKey \ |
4fbdda40bb5f
rewrote a very long proof (Key_analz_image_Key) because it had stopped working
paulson
parents:
8741
diff
changeset
|
624 |
\ {|Key ServKey, Agent B, Number Tt, ServTicket|}) \ |
4fbdda40bb5f
rewrote a very long proof (Key_analz_image_Key) because it had stopped working
paulson
parents:
8741
diff
changeset
|
625 |
\ : set evs |] \ |
4fbdda40bb5f
rewrote a very long proof (Key_analz_image_Key) because it had stopped working
paulson
parents:
8741
diff
changeset
|
626 |
\ ==> ~ KeyCryptKey ServKey SK evs"; |
4fbdda40bb5f
rewrote a very long proof (Key_analz_image_Key) because it had stopped working
paulson
parents:
8741
diff
changeset
|
627 |
by (blast_tac (claset() addDs [KeyCryptKeyI, KeyCryptKey_not_KeyCryptKey]) 1); |
4fbdda40bb5f
rewrote a very long proof (Key_analz_image_Key) because it had stopped working
paulson
parents:
8741
diff
changeset
|
628 |
qed "Oops2_not_KeyCryptKey"; |
4fbdda40bb5f
rewrote a very long proof (Key_analz_image_Key) because it had stopped working
paulson
parents:
8741
diff
changeset
|
629 |
|
4fbdda40bb5f
rewrote a very long proof (Key_analz_image_Key) because it had stopped working
paulson
parents:
8741
diff
changeset
|
630 |
|
6452 | 631 |
(* Big simplification law for keys SK that are not crypted by keys in KK *) |
632 |
(* It helps prove three, otherwise hard, facts about keys. These facts are *) |
|
633 |
(* exploited as simplification laws for analz, and also "limit the damage" *) |
|
634 |
(* in case of loss of a key to the spy. See ESORICS98. *) |
|
8954
4fbdda40bb5f
rewrote a very long proof (Key_analz_image_Key) because it had stopped working
paulson
parents:
8741
diff
changeset
|
635 |
(* [simplified by LCP] *) |
6452 | 636 |
Goal "evs : kerberos ==> \ |
637 |
\ (ALL SK KK. KK <= -(range shrK) --> \ |
|
638 |
\ (ALL K: KK. ~ KeyCryptKey K SK evs) --> \ |
|
10833 | 639 |
\ (Key SK : analz (Key`KK Un (spies evs))) = \ |
6452 | 640 |
\ (SK : KK | Key SK : analz (spies evs)))"; |
641 |
by (etac kerberos.induct 1); |
|
642 |
by analz_sees_tac; |
|
643 |
by (REPEAT_FIRST (rtac allI)); |
|
644 |
by (REPEAT_FIRST (rtac (Key_analz_image_Key_lemma RS impI))); |
|
8954
4fbdda40bb5f
rewrote a very long proof (Key_analz_image_Key) because it had stopped working
paulson
parents:
8741
diff
changeset
|
645 |
(*Case-splits for Oops1 & 5: the negated case simplifies using the ind hyp*) |
4fbdda40bb5f
rewrote a very long proof (Key_analz_image_Key) because it had stopped working
paulson
parents:
8741
diff
changeset
|
646 |
by (case_tac "KeyCryptKey AuthKey SK evsO1" 11); |
4fbdda40bb5f
rewrote a very long proof (Key_analz_image_Key) because it had stopped working
paulson
parents:
8741
diff
changeset
|
647 |
by (case_tac "KeyCryptKey ServKey SK evs5" 8); |
6452 | 648 |
by (ALLGOALS |
649 |
(asm_simp_tac |
|
650 |
(analz_image_freshK_ss addsimps |
|
8954
4fbdda40bb5f
rewrote a very long proof (Key_analz_image_Key) because it had stopped working
paulson
parents:
8741
diff
changeset
|
651 |
[KeyCryptKey_Says, shrK_not_KeyCryptKey, Oops2_not_KeyCryptKey, |
6452 | 652 |
Auth_fresh_not_KeyCryptKey, Serv_fresh_not_KeyCryptKey, |
653 |
Says_Tgs_KeyCryptKey, Spy_analz_shrK]))); |
|
654 |
(*Fake*) |
|
655 |
by (spy_analz_tac 1); |
|
656 |
(* Base + K2 done by the simplifier! *) |
|
657 |
(*K3*) |
|
658 |
by (Blast_tac 1); |
|
659 |
(*K4*) |
|
660 |
by (blast_tac (claset() addEs spies_partsEs |
|
661 |
addSDs [AuthKey_not_KeyCryptKey]) 1); |
|
662 |
(*K5*) |
|
663 |
by (case_tac "Key ServKey : analz (spies evs5)" 1); |
|
664 |
(*If ServKey is compromised then the result follows directly...*) |
|
665 |
by (asm_simp_tac |
|
666 |
(simpset() addsimps [analz_insert_eq, |
|
667 |
impOfSubs (Un_upper2 RS analz_mono)]) 1); |
|
668 |
(*...therefore ServKey is uncompromised.*) |
|
669 |
(*The KeyCryptKey ServKey SK evs5 case leads to a contradiction.*) |
|
670 |
by (blast_tac (claset() addSEs [ServKey_not_KeyCryptKey RSN(2, rev_notE)] |
|
671 |
addEs spies_partsEs delrules [allE, ballE]) 1); |
|
8954
4fbdda40bb5f
rewrote a very long proof (Key_analz_image_Key) because it had stopped working
paulson
parents:
8741
diff
changeset
|
672 |
(** Level 13: Oops1 **) |
4fbdda40bb5f
rewrote a very long proof (Key_analz_image_Key) because it had stopped working
paulson
parents:
8741
diff
changeset
|
673 |
by (Asm_full_simp_tac 1); |
6452 | 674 |
by (blast_tac (claset() addSDs [KeyCryptKey_analz_insert]) 1); |
675 |
qed_spec_mp "Key_analz_image_Key"; |
|
676 |
||
677 |
||
678 |
(* First simplification law for analz: no session keys encrypt *) |
|
679 |
(* authentication keys or shared keys. *) |
|
680 |
Goal "[| evs : kerberos; K : (AuthKeys evs) Un range shrK; \ |
|
681 |
\ SesKey ~: range shrK |] \ |
|
682 |
\ ==> Key K : analz (insert (Key SesKey) (spies evs)) = \ |
|
683 |
\ (K = SesKey | Key K : analz (spies evs))"; |
|
7499 | 684 |
by (ftac AuthKeys_are_not_KeyCryptKey 1 THEN assume_tac 1); |
6452 | 685 |
by (asm_full_simp_tac (analz_image_freshK_ss addsimps [Key_analz_image_Key]) 1); |
686 |
qed "analz_insert_freshK1"; |
|
687 |
||
688 |
||
689 |
(* Second simplification law for analz: no service keys encrypt *) |
|
690 |
(* any other keys. *) |
|
691 |
Goal "[| evs : kerberos; ServKey ~: (AuthKeys evs); ServKey ~: range shrK|]\ |
|
692 |
\ ==> Key K : analz (insert (Key ServKey) (spies evs)) = \ |
|
693 |
\ (K = ServKey | Key K : analz (spies evs))"; |
|
7499 | 694 |
by (ftac not_AuthKeys_not_KeyCryptKey 1 |
6452 | 695 |
THEN assume_tac 1 |
696 |
THEN assume_tac 1); |
|
697 |
by (asm_full_simp_tac (analz_image_freshK_ss addsimps [Key_analz_image_Key]) 1); |
|
698 |
qed "analz_insert_freshK2"; |
|
699 |
||
700 |
||
701 |
(* Third simplification law for analz: only one authentication key *) |
|
702 |
(* encrypts a certain service key. *) |
|
703 |
Goal |
|
704 |
"[| Says Tgs A \ |
|
705 |
\ (Crypt AuthKey {|Key ServKey, Agent B, Number Tt, ServTicket|}) \ |
|
706 |
\ : set evs; \ |
|
707 |
\ AuthKey ~= AuthKey'; AuthKey' ~: range shrK; evs : kerberos |] \ |
|
708 |
\ ==> Key ServKey : analz (insert (Key AuthKey') (spies evs)) = \ |
|
709 |
\ (ServKey = AuthKey' | Key ServKey : analz (spies evs))"; |
|
710 |
by (dres_inst_tac [("AuthKey'","AuthKey'")] Says_Tgs_KeyCryptKey 1); |
|
711 |
by (Blast_tac 1); |
|
712 |
by (assume_tac 1); |
|
713 |
by (asm_full_simp_tac (analz_image_freshK_ss addsimps [Key_analz_image_Key]) 1); |
|
714 |
qed "analz_insert_freshK3"; |
|
715 |
||
716 |
||
717 |
(*a weakness of the protocol*) |
|
718 |
Goal "[| Says Tgs A \ |
|
719 |
\ (Crypt AuthKey {|Key ServKey, Agent B, Number Tt, ServTicket|}) \ |
|
720 |
\ : set evs; \ |
|
721 |
\ Key AuthKey : analz (spies evs); evs : kerberos |] \ |
|
722 |
\ ==> Key ServKey : analz (spies evs)"; |
|
723 |
by (force_tac (claset() addDs [Says_imp_spies RS analz.Inj RS |
|
724 |
analz.Decrypt RS analz.Fst], |
|
725 |
simpset()) 1); |
|
726 |
qed "AuthKey_compromises_ServKey"; |
|
727 |
||
728 |
||
729 |
(********************** Guarantees for Kas *****************************) |
|
730 |
Goal "[| Crypt AuthKey {|Key ServKey, Agent B, Tt, \ |
|
731 |
\ Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Tt|}|}\ |
|
732 |
\ : parts (spies evs); \ |
|
733 |
\ Key ServKey ~: analz (spies evs); \ |
|
734 |
\ B ~= Tgs; evs : kerberos |] \ |
|
735 |
\ ==> ServKey ~: AuthKeys evs"; |
|
736 |
by (etac rev_mp 1); |
|
737 |
by (etac rev_mp 1); |
|
738 |
by (asm_full_simp_tac (simpset() addsimps [AuthKeys_def]) 1); |
|
739 |
by (parts_induct_tac 1); |
|
740 |
by (Fake_parts_insert_tac 1); |
|
741 |
by (ALLGOALS (blast_tac (claset() addSEs spies_partsEs))); |
|
742 |
bind_thm ("ServKey_notin_AuthKeys", result() RSN (2, rev_notE)); |
|
743 |
bind_thm ("ServKey_notin_AuthKeysD", result()); |
|
744 |
||
745 |
||
746 |
(** If Spy sees the Authentication Key sent in msg K2, then |
|
747 |
the Key has expired **) |
|
748 |
Goal "[| A ~: bad; evs : kerberos |] \ |
|
749 |
\ ==> Says Kas A \ |
|
750 |
\ (Crypt (shrK A) \ |
|
751 |
\ {|Key AuthKey, Agent Tgs, Number Tk, \ |
|
752 |
\ Crypt (shrK Tgs) {|Agent A, Agent Tgs, Key AuthKey, Number Tk|}|})\ |
|
753 |
\ : set evs --> \ |
|
754 |
\ Key AuthKey : analz (spies evs) --> \ |
|
755 |
\ ExpirAuth Tk evs"; |
|
756 |
by (etac kerberos.induct 1); |
|
757 |
by analz_sees_tac; |
|
758 |
by (ALLGOALS |
|
759 |
(asm_simp_tac |
|
8741
61bc5ed22b62
removal of less_SucI, le_SucI from default simpset
paulson
parents:
7499
diff
changeset
|
760 |
(simpset() addsimps ([Says_Kas_message_form, less_SucI, |
6452 | 761 |
analz_insert_eq, not_parts_not_analz, |
762 |
analz_insert_freshK1] @ pushes)))); |
|
763 |
(*Fake*) |
|
764 |
by (spy_analz_tac 1); |
|
765 |
(*K2*) |
|
766 |
by (blast_tac (claset() addSEs spies_partsEs |
|
767 |
addIs [parts_insertI, impOfSubs analz_subset_parts, less_SucI]) 1); |
|
768 |
(*K4*) |
|
769 |
by (blast_tac (claset() addSEs spies_partsEs) 1); |
|
770 |
(*Level 8: K5*) |
|
771 |
by (blast_tac (claset() addEs [ServKey_notin_AuthKeys] |
|
772 |
addDs [Says_Kas_message_form, |
|
773 |
Says_imp_spies RS parts.Inj] |
|
774 |
addIs [less_SucI]) 1); |
|
775 |
(*Oops1*) |
|
776 |
by (blast_tac (claset() addDs [unique_AuthKeys] addIs [less_SucI]) 1); |
|
777 |
(*Oops2*) |
|
778 |
by (blast_tac (claset() addDs [Says_Tgs_message_form, |
|
779 |
Says_Kas_message_form]) 1); |
|
780 |
val lemma = result() RS mp RS mp RSN(1,rev_notE); |
|
781 |
||
782 |
||
783 |
Goal "[| Says Kas A \ |
|
784 |
\ (Crypt Ka {|Key AuthKey, Agent Tgs, Number Tk, AuthTicket|}) \ |
|
785 |
\ : set evs; \ |
|
786 |
\ ~ ExpirAuth Tk evs; \ |
|
787 |
\ A ~: bad; evs : kerberos |] \ |
|
788 |
\ ==> Key AuthKey ~: analz (spies evs)"; |
|
7499 | 789 |
by (ftac Says_Kas_message_form 1 THEN assume_tac 1); |
6452 | 790 |
by (blast_tac (claset() addSDs [lemma]) 1); |
791 |
qed "Confidentiality_Kas"; |
|
792 |
||
793 |
||
794 |
||
795 |
||
796 |
||
797 |
||
798 |
(********************** Guarantees for Tgs *****************************) |
|
799 |
||
800 |
(** If Spy sees the Service Key sent in msg K4, then |
|
801 |
the Key has expired **) |
|
802 |
Goal "[| A ~: bad; B ~: bad; B ~= Tgs; evs : kerberos |] \ |
|
803 |
\ ==> Key AuthKey ~: analz (spies evs) --> \ |
|
804 |
\ Says Tgs A \ |
|
805 |
\ (Crypt AuthKey \ |
|
806 |
\ {|Key ServKey, Agent B, Number Tt, \ |
|
807 |
\ Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Number Tt|}|})\ |
|
808 |
\ : set evs --> \ |
|
809 |
\ Key ServKey : analz (spies evs) --> \ |
|
810 |
\ ExpirServ Tt evs"; |
|
811 |
by (etac kerberos.induct 1); |
|
812 |
(*The Oops1 case is unusual: must simplify Authkey ~: analz (spies (ev#evs)) |
|
813 |
rather than weakening it to Authkey ~: analz (spies evs), for we then |
|
814 |
conclude AuthKey ~= AuthKeya.*) |
|
815 |
by (Clarify_tac 9); |
|
816 |
by analz_sees_tac; |
|
817 |
by (rotate_tac ~1 11); |
|
818 |
by (ALLGOALS |
|
819 |
(asm_full_simp_tac |
|
8741
61bc5ed22b62
removal of less_SucI, le_SucI from default simpset
paulson
parents:
7499
diff
changeset
|
820 |
(simpset() addsimps [less_SucI, |
61bc5ed22b62
removal of less_SucI, le_SucI from default simpset
paulson
parents:
7499
diff
changeset
|
821 |
Says_Kas_message_form, Says_Tgs_message_form, |
61bc5ed22b62
removal of less_SucI, le_SucI from default simpset
paulson
parents:
7499
diff
changeset
|
822 |
analz_insert_eq, not_parts_not_analz, |
61bc5ed22b62
removal of less_SucI, le_SucI from default simpset
paulson
parents:
7499
diff
changeset
|
823 |
analz_insert_freshK1, analz_insert_freshK2] |
61bc5ed22b62
removal of less_SucI, le_SucI from default simpset
paulson
parents:
7499
diff
changeset
|
824 |
@ pushes))); |
6452 | 825 |
(*Fake*) |
826 |
by (spy_analz_tac 1); |
|
827 |
(*K2*) |
|
828 |
by (blast_tac (claset() addSEs spies_partsEs |
|
829 |
addIs [parts_insertI, impOfSubs analz_subset_parts, less_SucI]) 1); |
|
830 |
(*K4*) |
|
831 |
by (case_tac "A ~= Aa" 1); |
|
832 |
by (blast_tac (claset() addSEs spies_partsEs |
|
833 |
addIs [less_SucI]) 1); |
|
834 |
by (blast_tac (claset() addDs [Says_imp_spies RS parts.Inj RS parts.Fst, |
|
835 |
A_trusts_AuthTicket, |
|
836 |
Confidentiality_Kas, |
|
837 |
impOfSubs analz_subset_parts]) 1); |
|
838 |
by (ALLGOALS Clarify_tac); |
|
839 |
(*Oops2*) |
|
840 |
by (blast_tac (claset() addDs [Says_imp_spies RS parts.Inj, |
|
841 |
Key_unique_SesKey] addIs [less_SucI]) 3); |
|
842 |
(** Level 12 **) |
|
843 |
(*Oops1*) |
|
7499 | 844 |
by (ftac Says_Kas_message_form 2); |
6452 | 845 |
by (assume_tac 2); |
846 |
by (blast_tac (claset() addDs [analz_insert_freshK3, |
|
847 |
Says_Kas_message_form, Says_Tgs_message_form] |
|
848 |
addIs [less_SucI]) 2); |
|
849 |
(** Level 16 **) |
|
850 |
by (thin_tac "Says Aa Tgs ?X : set ?evs" 1); |
|
851 |
by (forward_tac [Says_imp_spies RS parts.Inj RS ServKey_notin_AuthKeysD] 1); |
|
852 |
by (assume_tac 1 THEN Blast_tac 1 THEN assume_tac 1); |
|
853 |
by (rotate_tac ~1 1); |
|
854 |
by (asm_full_simp_tac (simpset() addsimps [analz_insert_freshK2]) 1); |
|
855 |
by (etac disjE 1); |
|
856 |
by (blast_tac (claset() addDs [Says_imp_spies RS parts.Inj, |
|
857 |
Key_unique_SesKey]) 1); |
|
858 |
by (blast_tac (claset() addIs [less_SucI]) 1); |
|
859 |
val lemma = result() RS mp RS mp RS mp RSN(1,rev_notE); |
|
860 |
||
861 |
||
862 |
(* In the real world Tgs can't check wheter AuthKey is secure! *) |
|
863 |
Goal |
|
864 |
"[| Says Tgs A \ |
|
865 |
\ (Crypt AuthKey {|Key ServKey, Agent B, Number Tt, ServTicket|}) \ |
|
866 |
\ : set evs; \ |
|
867 |
\ Key AuthKey ~: analz (spies evs); \ |
|
868 |
\ ~ ExpirServ Tt evs; \ |
|
869 |
\ A ~: bad; B ~: bad; B ~= Tgs; evs : kerberos |] \ |
|
870 |
\ ==> Key ServKey ~: analz (spies evs)"; |
|
7499 | 871 |
by (ftac Says_Tgs_message_form 1 THEN assume_tac 1); |
6452 | 872 |
by (blast_tac (claset() addDs [lemma]) 1); |
873 |
qed "Confidentiality_Tgs1"; |
|
874 |
||
875 |
(* In the real world Tgs CAN check what Kas sends! *) |
|
876 |
Goal |
|
877 |
"[| Says Kas A \ |
|
878 |
\ (Crypt Ka {|Key AuthKey, Agent Tgs, Number Tk, AuthTicket|}) \ |
|
879 |
\ : set evs; \ |
|
880 |
\ Says Tgs A \ |
|
881 |
\ (Crypt AuthKey {|Key ServKey, Agent B, Number Tt, ServTicket|}) \ |
|
882 |
\ : set evs; \ |
|
883 |
\ ~ ExpirAuth Tk evs; ~ ExpirServ Tt evs; \ |
|
884 |
\ A ~: bad; B ~: bad; B ~= Tgs; evs : kerberos |] \ |
|
885 |
\ ==> Key ServKey ~: analz (spies evs)"; |
|
886 |
by (blast_tac (claset() addSDs [Confidentiality_Kas, |
|
887 |
Confidentiality_Tgs1]) 1); |
|
888 |
qed "Confidentiality_Tgs2"; |
|
889 |
||
890 |
(*Most general form*) |
|
891 |
val Confidentiality_Tgs3 = A_trusts_AuthTicket RS Confidentiality_Tgs2; |
|
892 |
||
893 |
||
894 |
(********************** Guarantees for Alice *****************************) |
|
895 |
||
896 |
val Confidentiality_Auth_A = A_trusts_AuthKey RS Confidentiality_Kas; |
|
897 |
||
898 |
Goal |
|
899 |
"[| Says Kas A \ |
|
900 |
\ (Crypt (shrK A) {|Key AuthKey, Agent Tgs, Tk, AuthTicket|}) : set evs;\ |
|
901 |
\ Crypt AuthKey {|Key ServKey, Agent B, Tt, ServTicket|} \ |
|
902 |
\ : parts (spies evs); \ |
|
903 |
\ Key AuthKey ~: analz (spies evs); \ |
|
904 |
\ evs : kerberos |] \ |
|
905 |
\==> Says Tgs A (Crypt AuthKey {|Key ServKey, Agent B, Tt, ServTicket|})\ |
|
906 |
\ : set evs"; |
|
7499 | 907 |
by (ftac Says_Kas_message_form 1 THEN assume_tac 1); |
6452 | 908 |
by (etac rev_mp 1); |
909 |
by (etac rev_mp 1); |
|
910 |
by (etac rev_mp 1); |
|
911 |
by (parts_induct_tac 1); |
|
912 |
by (Fake_parts_insert_tac 1); |
|
913 |
(*K2 and K4 remain*) |
|
914 |
by (blast_tac (claset() addEs spies_partsEs addSEs [MPair_parts] |
|
915 |
addSDs [unique_CryptKey]) 2); |
|
916 |
by (blast_tac (claset() addSDs [A_trusts_K4, Says_Tgs_message_form, |
|
917 |
AuthKeys_used]) 1); |
|
918 |
qed "A_trusts_K4_bis"; |
|
919 |
||
920 |
||
921 |
Goal "[| Crypt (shrK A) {|Key AuthKey, Agent Tgs, Number Tk, AuthTicket|} \ |
|
922 |
\ : parts (spies evs); \ |
|
923 |
\ Crypt AuthKey {|Key ServKey, Agent B, Number Tt, ServTicket|} \ |
|
924 |
\ : parts (spies evs); \ |
|
925 |
\ ~ ExpirAuth Tk evs; ~ ExpirServ Tt evs; \ |
|
926 |
\ A ~: bad; B ~: bad; B ~= Tgs; evs : kerberos |] \ |
|
927 |
\ ==> Key ServKey ~: analz (spies evs)"; |
|
928 |
by (dtac A_trusts_AuthKey 1); |
|
929 |
by (assume_tac 1); |
|
930 |
by (assume_tac 1); |
|
931 |
by (blast_tac (claset() addDs [Confidentiality_Kas, |
|
932 |
Says_Kas_message_form, |
|
933 |
A_trusts_K4_bis, Confidentiality_Tgs2]) 1); |
|
934 |
qed "Confidentiality_Serv_A"; |
|
935 |
||
936 |
||
937 |
(********************** Guarantees for Bob *****************************) |
|
938 |
(* Theorems for the refined model have suffix "refined" *) |
|
939 |
||
940 |
Goal |
|
941 |
"[| Says Tgs A (Crypt AuthKey {|Key ServKey, Agent B, Number Tt, ServTicket|})\ |
|
942 |
\ : set evs; evs : kerberos|] \ |
|
943 |
\ ==> EX Tk. Says Kas A (Crypt (shrK A) {|Key AuthKey, Agent Tgs, Number Tk,\ |
|
944 |
\ Crypt (shrK Tgs) {|Agent A, Agent Tgs, Key AuthKey, Number Tk|}|})\ |
|
945 |
\ : set evs"; |
|
946 |
by (etac rev_mp 1); |
|
947 |
by (parts_induct_tac 1); |
|
948 |
by Auto_tac; |
|
949 |
by (blast_tac (claset() addSDs [Says_imp_spies RS parts.Inj RS parts.Fst RS |
|
950 |
A_trusts_AuthTicket]) 1); |
|
951 |
qed "K4_imp_K2"; |
|
952 |
||
953 |
Goal |
|
954 |
"[| Says Tgs A (Crypt AuthKey {|Key ServKey, Agent B, Number Tt, ServTicket|})\ |
|
955 |
\ : set evs; evs : kerberos|] \ |
|
956 |
\ ==> EX Tk. (Says Kas A (Crypt (shrK A) {|Key AuthKey, Agent Tgs, Number Tk,\ |
|
957 |
\ Crypt (shrK Tgs) {|Agent A, Agent Tgs, Key AuthKey, Number Tk|}|})\ |
|
958 |
\ : set evs \ |
|
959 |
\ & ServLife + Tt <= AuthLife + Tk)"; |
|
960 |
by (etac rev_mp 1); |
|
961 |
by (parts_induct_tac 1); |
|
962 |
by Auto_tac; |
|
963 |
by (blast_tac (claset() addSDs [Says_imp_spies RS parts.Inj RS parts.Fst RS |
|
964 |
A_trusts_AuthTicket]) 1); |
|
965 |
qed "K4_imp_K2_refined"; |
|
966 |
||
967 |
Goal "[| Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Tt|} \ |
|
968 |
\ : parts (spies evs); B ~= Tgs; B ~: bad; \ |
|
969 |
\ evs : kerberos |] \ |
|
970 |
\==> EX AuthKey. \ |
|
971 |
\ Says Tgs A (Crypt AuthKey {|Key ServKey, Agent B, Tt, \ |
|
972 |
\ Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Tt|}|}) \ |
|
973 |
\ : set evs"; |
|
974 |
by (etac rev_mp 1); |
|
975 |
by (parts_induct_tac 1); |
|
976 |
by (Fake_parts_insert_tac 1); |
|
977 |
by (Blast_tac 1); |
|
978 |
qed "B_trusts_ServKey"; |
|
979 |
||
980 |
Goal "[| Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Number Tt|} \ |
|
981 |
\ : parts (spies evs); B ~= Tgs; B ~: bad; \ |
|
982 |
\ evs : kerberos |] \ |
|
983 |
\ ==> EX AuthKey Tk. Says Kas A (Crypt (shrK A) {|Key AuthKey, Agent Tgs, Number Tk,\ |
|
984 |
\ Crypt (shrK Tgs) {|Agent A, Agent Tgs, Key AuthKey, Number Tk|}|})\ |
|
985 |
\ : set evs"; |
|
986 |
by (blast_tac (claset() addSDs [B_trusts_ServKey, K4_imp_K2]) 1); |
|
987 |
qed "B_trusts_ServTicket_Kas"; |
|
988 |
||
989 |
Goal "[| Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Number Tt|} \ |
|
990 |
\ : parts (spies evs); B ~= Tgs; B ~: bad; \ |
|
991 |
\ evs : kerberos |] \ |
|
992 |
\ ==> EX AuthKey Tk. (Says Kas A (Crypt (shrK A) {|Key AuthKey, Agent Tgs, Number Tk,\ |
|
993 |
\ Crypt (shrK Tgs) {|Agent A, Agent Tgs, Key AuthKey, Number Tk|}|})\ |
|
994 |
\ : set evs \ |
|
995 |
\ & ServLife + Tt <= AuthLife + Tk)"; |
|
996 |
by (blast_tac (claset() addSDs [B_trusts_ServKey,K4_imp_K2_refined]) 1); |
|
997 |
qed "B_trusts_ServTicket_Kas_refined"; |
|
998 |
||
999 |
Goal "[| Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Number Tt|} \ |
|
1000 |
\ : parts (spies evs); B ~= Tgs; B ~: bad; \ |
|
1001 |
\ evs : kerberos |] \ |
|
1002 |
\==> EX Tk AuthKey. \ |
|
1003 |
\ Says Kas A (Crypt (shrK A) {|Key AuthKey, Agent Tgs, Number Tk, \ |
|
1004 |
\ Crypt (shrK Tgs) {|Agent A, Agent Tgs, Key AuthKey, Number Tk|}|})\ |
|
1005 |
\ : set evs \ |
|
1006 |
\ & Says Tgs A (Crypt AuthKey {|Key ServKey, Agent B, Number Tt, \ |
|
1007 |
\ Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Number Tt|}|}) \ |
|
1008 |
\ : set evs"; |
|
7499 | 1009 |
by (ftac B_trusts_ServKey 1); |
6452 | 1010 |
by (etac exE 4); |
7499 | 1011 |
by (ftac K4_imp_K2 4); |
6452 | 1012 |
by (Blast_tac 5); |
1013 |
by (ALLGOALS assume_tac); |
|
1014 |
qed "B_trusts_ServTicket"; |
|
1015 |
||
1016 |
Goal "[| Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Number Tt|} \ |
|
1017 |
\ : parts (spies evs); B ~= Tgs; B ~: bad; \ |
|
1018 |
\ evs : kerberos |] \ |
|
1019 |
\==> EX Tk AuthKey. \ |
|
1020 |
\ (Says Kas A (Crypt (shrK A) {|Key AuthKey, Agent Tgs, Number Tk, \ |
|
1021 |
\ Crypt (shrK Tgs) {|Agent A, Agent Tgs, Key AuthKey, Number Tk|}|})\ |
|
1022 |
\ : set evs \ |
|
1023 |
\ & Says Tgs A (Crypt AuthKey {|Key ServKey, Agent B, Number Tt, \ |
|
1024 |
\ Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Number Tt|}|}) \ |
|
1025 |
\ : set evs \ |
|
1026 |
\ & ServLife + Tt <= AuthLife + Tk)"; |
|
7499 | 1027 |
by (ftac B_trusts_ServKey 1); |
6452 | 1028 |
by (etac exE 4); |
7499 | 1029 |
by (ftac K4_imp_K2_refined 4); |
6452 | 1030 |
by (Blast_tac 5); |
1031 |
by (ALLGOALS assume_tac); |
|
1032 |
qed "B_trusts_ServTicket_refined"; |
|
1033 |
||
1034 |
||
1035 |
Goal "[| ~ ExpirServ Tt evs; ServLife + Tt <= AuthLife + Tk |] \ |
|
1036 |
\ ==> ~ ExpirAuth Tk evs"; |
|
1037 |
by (blast_tac (claset() addDs [leI,le_trans] addEs [leE]) 1); |
|
1038 |
qed "NotExpirServ_NotExpirAuth_refined"; |
|
1039 |
||
1040 |
||
1041 |
Goal "[| Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Number Tt|} \ |
|
1042 |
\ : parts (spies evs); \ |
|
1043 |
\ Crypt AuthKey {|Key ServKey, Agent B, Number Tt, ServTicket|} \ |
|
1044 |
\ : parts (spies evs); \ |
|
1045 |
\ Crypt (shrK A) {|Key AuthKey, Agent Tgs, Number Tk, AuthTicket|}\ |
|
1046 |
\ : parts (spies evs); \ |
|
1047 |
\ ~ ExpirServ Tt evs; ~ ExpirAuth Tk evs; \ |
|
1048 |
\ A ~: bad; B ~: bad; B ~= Tgs; evs : kerberos |] \ |
|
1049 |
\ ==> Key ServKey ~: analz (spies evs)"; |
|
7499 | 1050 |
by (ftac A_trusts_AuthKey 1); |
1051 |
by (ftac Confidentiality_Kas 3); |
|
1052 |
by (ftac B_trusts_ServTicket 6); |
|
6452 | 1053 |
by (etac exE 9); |
1054 |
by (etac exE 9); |
|
7499 | 1055 |
by (ftac Says_Kas_message_form 9); |
6452 | 1056 |
by (blast_tac (claset() addDs [A_trusts_K4, |
1057 |
unique_ServKeys, unique_AuthKeys, |
|
1058 |
Confidentiality_Tgs2]) 10); |
|
1059 |
by (ALLGOALS assume_tac); |
|
1060 |
(* |
|
1061 |
The proof above executes in 8 secs. It can be done in one command in 50 secs: |
|
1062 |
by (blast_tac (claset() addDs [A_trusts_AuthKey, A_trusts_K4, |
|
1063 |
Says_Kas_message_form, B_trusts_ServTicket, |
|
1064 |
unique_ServKeys, unique_AuthKeys, |
|
1065 |
Confidentiality_Kas, |
|
1066 |
Confidentiality_Tgs2]) 1); |
|
1067 |
*) |
|
1068 |
qed "Confidentiality_B"; |
|
1069 |
||
1070 |
||
1071 |
(*Most general form -- only for refined model! *) |
|
1072 |
Goal "[| Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Number Tt|} \ |
|
1073 |
\ : parts (spies evs); \ |
|
1074 |
\ ~ ExpirServ Tt evs; \ |
|
1075 |
\ A ~: bad; B ~: bad; B ~= Tgs; evs : kerberos |] \ |
|
1076 |
\ ==> Key ServKey ~: analz (spies evs)"; |
|
1077 |
by (blast_tac (claset() addDs [B_trusts_ServTicket_refined, |
|
1078 |
NotExpirServ_NotExpirAuth_refined, |
|
1079 |
Confidentiality_Tgs2]) 1); |
|
1080 |
qed "Confidentiality_B_refined"; |
|
1081 |
||
1082 |
||
1083 |
(********************** Authenticity theorems *****************************) |
|
1084 |
||
1085 |
(***1. Session Keys authenticity: they originated with servers.***) |
|
1086 |
||
1087 |
(*Authenticity of AuthKey for A: "A_trusts_AuthKey"*) |
|
1088 |
||
1089 |
(*Authenticity of ServKey for A: "A_trusts_ServKey"*) |
|
1090 |
Goal "[| Crypt (shrK A) {|Key AuthKey, Agent Tgs, Number Tk, AuthTicket|} \ |
|
1091 |
\ : parts (spies evs); \ |
|
1092 |
\ Crypt AuthKey {|Key ServKey, Agent B, Number Tt, ServTicket|} \ |
|
1093 |
\ : parts (spies evs); \ |
|
1094 |
\ ~ ExpirAuth Tk evs; A ~: bad; evs : kerberos |] \ |
|
1095 |
\==>Says Tgs A (Crypt AuthKey {|Key ServKey, Agent B, Number Tt, ServTicket|})\ |
|
1096 |
\ : set evs"; |
|
7499 | 1097 |
by (ftac A_trusts_AuthKey 1 THEN assume_tac 1 THEN assume_tac 1); |
6452 | 1098 |
by (blast_tac (claset() addDs [Confidentiality_Auth_A, A_trusts_K4_bis]) 1); |
1099 |
qed "A_trusts_ServKey"; |
|
1100 |
(*Note: requires a temporal check*) |
|
1101 |
||
1102 |
||
1103 |
(*Authenticity of ServKey for B: "B_trusts_ServKey"*) |
|
1104 |
||
1105 |
(***2. Parties authenticity: each party verifies "the identity of |
|
1106 |
another party who generated some data" (quoted from Neuman & Ts'o).***) |
|
1107 |
||
1108 |
(*These guarantees don't assess whether two parties agree on |
|
1109 |
the same session key: sending a message containing a key |
|
1110 |
doesn't a priori state knowledge of the key.***) |
|
1111 |
||
1112 |
(*B checks authenticity of A: theorems "A_Authenticity", |
|
1113 |
"A_authenticity_refined" *) |
|
1114 |
Goal "[| Crypt ServKey {|Agent A, Number Ta|} : parts (spies evs); \ |
|
1115 |
\ Says Tgs A (Crypt AuthKey {|Key ServKey, Agent B, Number Tt, \ |
|
1116 |
\ ServTicket|}) : set evs; \ |
|
1117 |
\ Key ServKey ~: analz (spies evs); \ |
|
1118 |
\ A ~: bad; B ~: bad; evs : kerberos |] \ |
|
1119 |
\==> Says A B {|ServTicket, Crypt ServKey {|Agent A, Number Ta|}|} : set evs"; |
|
1120 |
by (etac rev_mp 1); |
|
1121 |
by (etac rev_mp 1); |
|
1122 |
by (etac rev_mp 1); |
|
1123 |
by (etac kerberos.induct 1); |
|
7499 | 1124 |
by (ftac Says_ticket_in_parts_spies 5); |
1125 |
by (ftac Says_ticket_in_parts_spies 7); |
|
6452 | 1126 |
by (REPEAT (FIRSTGOAL analz_mono_contra_tac)); |
1127 |
by (ALLGOALS (asm_simp_tac (simpset() addsimps [all_conj_distrib]))); |
|
1128 |
by (Fake_parts_insert_tac 1); |
|
1129 |
(*K3*) |
|
1130 |
by (blast_tac (claset() addEs spies_partsEs |
|
1131 |
addDs [A_trusts_AuthKey, |
|
1132 |
Says_Kas_message_form, |
|
1133 |
Says_Tgs_message_form]) 1); |
|
1134 |
(*K4*) |
|
1135 |
by (force_tac (claset() addSDs [Crypt_imp_keysFor], simpset()) 1); |
|
1136 |
(*K5*) |
|
1137 |
by (blast_tac (claset() addDs [Key_unique_SesKey] addEs spies_partsEs) 1); |
|
1138 |
qed "Says_Auth"; |
|
1139 |
||
1140 |
(*The second assumption tells B what kind of key ServKey is.*) |
|
1141 |
Goal "[| Crypt ServKey {|Agent A, Number Ta|} : parts (spies evs); \ |
|
1142 |
\ Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Number Tt|} \ |
|
1143 |
\ : parts (spies evs); \ |
|
1144 |
\ Crypt AuthKey {|Key ServKey, Agent B, Number Tt, ServTicket|} \ |
|
1145 |
\ : parts (spies evs); \ |
|
1146 |
\ Crypt (shrK A) {|Key AuthKey, Agent Tgs, Number Tk, AuthTicket|} \ |
|
1147 |
\ : parts (spies evs); \ |
|
1148 |
\ ~ ExpirServ Tt evs; ~ ExpirAuth Tk evs; \ |
|
1149 |
\ B ~= Tgs; A ~: bad; B ~: bad; evs : kerberos |] \ |
|
1150 |
\ ==> Says A B {|Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Number Tt|},\ |
|
1151 |
\ Crypt ServKey {|Agent A, Number Ta|} |} : set evs"; |
|
7499 | 1152 |
by (ftac Confidentiality_B 1); |
1153 |
by (ftac B_trusts_ServKey 9); |
|
6452 | 1154 |
by (etac exE 12); |
1155 |
by (blast_tac (claset() addSDs [Says_imp_spies RS parts.Inj, Key_unique_SesKey] |
|
1156 |
addSIs [Says_Auth]) 12); |
|
1157 |
by (ALLGOALS assume_tac); |
|
1158 |
qed "A_Authenticity"; |
|
1159 |
||
1160 |
(*Stronger form in the refined model*) |
|
1161 |
Goal "[| Crypt ServKey {|Agent A, Number Ta2|} : parts (spies evs); \ |
|
1162 |
\ Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Number Tt|} \ |
|
1163 |
\ : parts (spies evs); \ |
|
1164 |
\ ~ ExpirServ Tt evs; \ |
|
1165 |
\ B ~= Tgs; A ~: bad; B ~: bad; evs : kerberos |] \ |
|
1166 |
\ ==> Says A B {|Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Number Tt|},\ |
|
1167 |
\ Crypt ServKey {|Agent A, Number Ta2|} |} : set evs"; |
|
7499 | 1168 |
by (ftac Confidentiality_B_refined 1); |
1169 |
by (ftac B_trusts_ServKey 6); |
|
6452 | 1170 |
by (etac exE 9); |
1171 |
by (blast_tac (claset() addSDs [Says_imp_spies RS parts.Inj, Key_unique_SesKey] |
|
1172 |
addSIs [Says_Auth]) 9); |
|
1173 |
by (ALLGOALS assume_tac); |
|
1174 |
qed "A_Authenticity_refined"; |
|
1175 |
||
1176 |
||
1177 |
(*A checks authenticity of B: theorem "B_authenticity"*) |
|
1178 |
||
1179 |
Goal "[| Crypt ServKey (Number Ta) : parts (spies evs); \ |
|
1180 |
\ Says Tgs A (Crypt AuthKey {|Key ServKey, Agent B, Number Tt, \ |
|
1181 |
\ ServTicket|}) : set evs; \ |
|
1182 |
\ Key ServKey ~: analz (spies evs); \ |
|
1183 |
\ A ~: bad; B ~: bad; evs : kerberos |] \ |
|
1184 |
\ ==> Says B A (Crypt ServKey (Number Ta)) : set evs"; |
|
1185 |
by (etac rev_mp 1); |
|
1186 |
by (etac rev_mp 1); |
|
1187 |
by (etac rev_mp 1); |
|
1188 |
by (etac kerberos.induct 1); |
|
7499 | 1189 |
by (ftac Says_ticket_in_parts_spies 5); |
1190 |
by (ftac Says_ticket_in_parts_spies 7); |
|
6452 | 1191 |
by (REPEAT (FIRSTGOAL analz_mono_contra_tac)); |
1192 |
by (ALLGOALS Asm_simp_tac); |
|
1193 |
by (Fake_parts_insert_tac 1); |
|
1194 |
by (force_tac (claset() addSDs [Crypt_imp_keysFor], simpset()) 1); |
|
1195 |
by (Clarify_tac 1); |
|
7499 | 1196 |
by (ftac Says_Tgs_message_form 1 THEN assume_tac 1); |
6452 | 1197 |
by (Clarify_tac 1); (*PROOF FAILED if omitted*) |
1198 |
by (blast_tac (claset() addDs [unique_CryptKey] addEs spies_partsEs) 1); |
|
1199 |
qed "Says_K6"; |
|
1200 |
||
1201 |
Goal "[| Crypt AuthKey {|Key ServKey, Agent B, T, ServTicket|} \ |
|
1202 |
\ : parts (spies evs); \ |
|
1203 |
\ Key AuthKey ~: analz (spies evs); AuthKey ~: range shrK; \ |
|
1204 |
\ evs : kerberos |] \ |
|
1205 |
\ ==> EX A. Says Tgs A (Crypt AuthKey {|Key ServKey, Agent B, T, ServTicket|})\ |
|
1206 |
\ : set evs"; |
|
1207 |
by (etac rev_mp 1); |
|
1208 |
by (etac rev_mp 1); |
|
1209 |
by (parts_induct_tac 1); |
|
1210 |
by (Fake_parts_insert_tac 1); |
|
1211 |
by (Blast_tac 1); |
|
1212 |
by (Blast_tac 1); |
|
1213 |
qed "K4_trustworthy"; |
|
1214 |
||
1215 |
Goal "[| Crypt ServKey (Number Ta) : parts (spies evs); \ |
|
1216 |
\ Crypt AuthKey {|Key ServKey, Agent B, Number Tt, ServTicket|} \ |
|
1217 |
\ : parts (spies evs); \ |
|
1218 |
\ Crypt (shrK A) {|Key AuthKey, Agent Tgs, Number Tk, AuthTicket|}\ |
|
1219 |
\ : parts (spies evs); \ |
|
1220 |
\ ~ ExpirAuth Tk evs; ~ ExpirServ Tt evs; \ |
|
1221 |
\ A ~: bad; B ~: bad; B ~= Tgs; evs : kerberos |] \ |
|
1222 |
\ ==> Says B A (Crypt ServKey (Number Ta)) : set evs"; |
|
7499 | 1223 |
by (ftac A_trusts_AuthKey 1); |
1224 |
by (ftac Says_Kas_message_form 3); |
|
1225 |
by (ftac Confidentiality_Kas 4); |
|
1226 |
by (ftac K4_trustworthy 7); |
|
6452 | 1227 |
by (Blast_tac 8); |
1228 |
by (etac exE 9); |
|
7499 | 1229 |
by (ftac K4_imp_K2 9); |
6452 | 1230 |
by (blast_tac (claset() addDs [Says_imp_spies RS parts.Inj, Key_unique_SesKey] |
1231 |
addSIs [Says_K6] |
|
1232 |
addSEs [Confidentiality_Tgs1 RSN (2,rev_notE)]) 10); |
|
1233 |
by (ALLGOALS assume_tac); |
|
1234 |
qed "B_Authenticity"; |
|
1235 |
||
1236 |
||
1237 |
(***3. Parties' knowledge of session keys. A knows a session key if she |
|
1238 |
used it to build a cipher.***) |
|
1239 |
||
1240 |
Goal "[| Says B A (Crypt ServKey (Number Ta)) : set evs; \ |
|
1241 |
\ Key ServKey ~: analz (spies evs); \ |
|
1242 |
\ A ~: bad; B ~: bad; B ~= Tgs; evs : kerberos |] \ |
|
1243 |
\ ==> B Issues A with (Crypt ServKey (Number Ta)) on evs"; |
|
1244 |
by (simp_tac (simpset() addsimps [Issues_def]) 1); |
|
1245 |
by (rtac exI 1); |
|
1246 |
by (rtac conjI 1); |
|
1247 |
by (assume_tac 1); |
|
1248 |
by (Simp_tac 1); |
|
1249 |
by (etac rev_mp 1); |
|
1250 |
by (etac rev_mp 1); |
|
1251 |
by (etac kerberos.induct 1); |
|
7499 | 1252 |
by (ftac Says_ticket_in_parts_spies 5); |
1253 |
by (ftac Says_ticket_in_parts_spies 7); |
|
6452 | 1254 |
by (REPEAT (FIRSTGOAL analz_mono_contra_tac)); |
1255 |
by (ALLGOALS (asm_simp_tac (simpset() addsimps [all_conj_distrib]))); |
|
1256 |
by (Fake_parts_insert_tac 1); |
|
1257 |
(*K6 requires numerous lemmas*) |
|
1258 |
by (asm_full_simp_tac (simpset() addsimps [takeWhile_tail]) 1); |
|
1259 |
by (blast_tac (claset() addDs [B_trusts_ServTicket, |
|
1260 |
impOfSubs parts_spies_takeWhile_mono, |
|
1261 |
impOfSubs parts_spies_evs_revD2] |
|
1262 |
addIs [Says_K6] |
|
1263 |
addEs spies_partsEs) 1); |
|
1264 |
qed "B_Knows_B_Knows_ServKey_lemma"; |
|
1265 |
(*Key ServKey ~: analz (spies evs) could be relaxed by Confidentiality_B |
|
1266 |
but this is irrelevant because B knows what he knows! *) |
|
1267 |
||
1268 |
Goal "[| Says B A (Crypt ServKey (Number Ta)) : set evs; \ |
|
1269 |
\ Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Number Tt|}\ |
|
1270 |
\ : parts (spies evs);\ |
|
1271 |
\ Crypt AuthKey {|Key ServKey, Agent B, Number Tt, ServTicket|}\ |
|
1272 |
\ : parts (spies evs);\ |
|
1273 |
\ Crypt (shrK A) {|Key AuthKey, Agent Tgs, Number Tk, AuthTicket|}\ |
|
1274 |
\ : parts (spies evs); \ |
|
1275 |
\ ~ ExpirServ Tt evs; ~ ExpirAuth Tk evs; \ |
|
1276 |
\ A ~: bad; B ~: bad; B ~= Tgs; evs : kerberos |] \ |
|
1277 |
\ ==> B Issues A with (Crypt ServKey (Number Ta)) on evs"; |
|
1278 |
by (blast_tac (claset() addSDs [Confidentiality_B, |
|
1279 |
B_Knows_B_Knows_ServKey_lemma]) 1); |
|
1280 |
qed "B_Knows_B_Knows_ServKey"; |
|
1281 |
||
1282 |
Goal "[| Says B A (Crypt ServKey (Number Ta)) : set evs; \ |
|
1283 |
\ Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Number Tt|}\ |
|
1284 |
\ : parts (spies evs);\ |
|
1285 |
\ ~ ExpirServ Tt evs; \ |
|
1286 |
\ A ~: bad; B ~: bad; B ~= Tgs; evs : kerberos |] \ |
|
1287 |
\ ==> B Issues A with (Crypt ServKey (Number Ta)) on evs"; |
|
1288 |
by (blast_tac (claset() addSDs [Confidentiality_B_refined, |
|
1289 |
B_Knows_B_Knows_ServKey_lemma]) 1); |
|
1290 |
qed "B_Knows_B_Knows_ServKey_refined"; |
|
1291 |
||
1292 |
||
1293 |
Goal "[| Crypt ServKey (Number Ta) : parts (spies evs); \ |
|
1294 |
\ Crypt AuthKey {|Key ServKey, Agent B, Number Tt, ServTicket|} \ |
|
1295 |
\ : parts (spies evs); \ |
|
1296 |
\ Crypt (shrK A) {|Key AuthKey, Agent Tgs, Number Tk, AuthTicket|}\ |
|
1297 |
\ : parts (spies evs); \ |
|
1298 |
\ ~ ExpirAuth Tk evs; ~ ExpirServ Tt evs; \ |
|
1299 |
\ A ~: bad; B ~: bad; B ~= Tgs; evs : kerberos |] \ |
|
1300 |
\ ==> B Issues A with (Crypt ServKey (Number Ta)) on evs"; |
|
1301 |
by (blast_tac (claset() addSDs [B_Authenticity, Confidentiality_Serv_A, |
|
1302 |
B_Knows_B_Knows_ServKey_lemma]) 1); |
|
1303 |
qed "A_Knows_B_Knows_ServKey"; |
|
1304 |
||
1305 |
Goal "[| Says A Tgs \ |
|
1306 |
\ {|AuthTicket, Crypt AuthKey {|Agent A, Number Ta|}, Agent B|}\ |
|
1307 |
\ : set evs; \ |
|
1308 |
\ A ~: bad; evs : kerberos |] \ |
|
1309 |
\ ==> EX Tk. Says Kas A (Crypt (shrK A) \ |
|
1310 |
\ {|Key AuthKey, Agent Tgs, Tk, AuthTicket|}) \ |
|
1311 |
\ : set evs"; |
|
1312 |
by (etac rev_mp 1); |
|
1313 |
by (parts_induct_tac 1); |
|
1314 |
by (Fake_parts_insert_tac 1); |
|
1315 |
by (Blast_tac 1); |
|
1316 |
by (blast_tac (claset() addDs [Says_imp_spies RS parts.Inj RS |
|
1317 |
A_trusts_AuthKey]) 1); |
|
1318 |
qed "K3_imp_K2"; |
|
1319 |
||
1320 |
Goal "[| Crypt AuthKey {|Key ServKey, Agent B, Number Tt, ServTicket|} \ |
|
1321 |
\ : parts (spies evs); \ |
|
1322 |
\ Says Kas A (Crypt (shrK A) \ |
|
1323 |
\ {|Key AuthKey, Agent Tgs, Tk, AuthTicket|}) \ |
|
1324 |
\ : set evs; \ |
|
1325 |
\ Key AuthKey ~: analz (spies evs); \ |
|
1326 |
\ B ~= Tgs; A ~: bad; B ~: bad; evs : kerberos |] \ |
|
1327 |
\ ==> Says Tgs A (Crypt AuthKey \ |
|
1328 |
\ {|Key ServKey, Agent B, Number Tt, ServTicket|}) \ |
|
1329 |
\ : set evs"; |
|
1330 |
by (etac rev_mp 1); |
|
1331 |
by (etac rev_mp 1); |
|
1332 |
by (etac rev_mp 1); |
|
1333 |
by (parts_induct_tac 1); |
|
1334 |
by (Fake_parts_insert_tac 1); |
|
1335 |
by (force_tac (claset() addSDs [Crypt_imp_keysFor], simpset()) 1); |
|
1336 |
by (blast_tac (claset() addDs [Says_imp_spies RS parts.Inj RS parts.Fst RS |
|
1337 |
A_trusts_AuthTicket, unique_AuthKeys]) 1); |
|
1338 |
qed "K4_trustworthy'"; |
|
1339 |
||
1340 |
Goal "[| Says A B {|ServTicket, Crypt ServKey {|Agent A, Number Ta|}|} \ |
|
1341 |
\ : set evs; \ |
|
1342 |
\ Key ServKey ~: analz (spies evs); \ |
|
1343 |
\ B ~= Tgs; A ~: bad; B ~: bad; evs : kerberos |] \ |
|
1344 |
\ ==> A Issues B with (Crypt ServKey {|Agent A, Number Ta|}) on evs"; |
|
1345 |
by (simp_tac (simpset() addsimps [Issues_def]) 1); |
|
1346 |
by (rtac exI 1); |
|
1347 |
by (rtac conjI 1); |
|
1348 |
by (assume_tac 1); |
|
1349 |
by (Simp_tac 1); |
|
1350 |
by (etac rev_mp 1); |
|
1351 |
by (etac rev_mp 1); |
|
1352 |
by (etac kerberos.induct 1); |
|
7499 | 1353 |
by (ftac Says_ticket_in_parts_spies 5); |
1354 |
by (ftac Says_ticket_in_parts_spies 7); |
|
6452 | 1355 |
by (REPEAT (FIRSTGOAL analz_mono_contra_tac)); |
1356 |
by (ALLGOALS Asm_simp_tac); |
|
1357 |
by (Clarify_tac 1); |
|
1358 |
(*K6*) |
|
1359 |
by Auto_tac; |
|
1360 |
by (asm_full_simp_tac (simpset() addsimps [takeWhile_tail]) 1); |
|
1361 |
(*Level 15: case study necessary because the assumption doesn't state |
|
1362 |
the form of ServTicket. The guarantee becomes stronger.*) |
|
1363 |
by (case_tac "Key AuthKey : analz (spies evs5)" 1); |
|
1364 |
by (force_tac (claset() addDs [Says_imp_spies RS analz.Inj RS |
|
1365 |
analz.Decrypt RS analz.Fst], |
|
1366 |
simpset()) 1); |
|
1367 |
by (blast_tac (claset() addDs [K3_imp_K2, K4_trustworthy', |
|
1368 |
impOfSubs parts_spies_takeWhile_mono, |
|
1369 |
impOfSubs parts_spies_evs_revD2] |
|
1370 |
addIs [Says_Auth] |
|
1371 |
addEs spies_partsEs) 1); |
|
1372 |
by (asm_full_simp_tac (simpset() addsimps [takeWhile_tail]) 1); |
|
1373 |
qed "A_Knows_A_Knows_ServKey_lemma"; |
|
1374 |
||
1375 |
Goal "[| Says A B {|ServTicket, Crypt ServKey {|Agent A, Number Ta|}|} \ |
|
1376 |
\ : set evs; \ |
|
1377 |
\ Crypt (shrK A) {|Key AuthKey, Agent Tgs, Number Tk, AuthTicket|}\ |
|
1378 |
\ : parts (spies evs);\ |
|
1379 |
\ Crypt AuthKey {|Key ServKey, Agent B, Number Tt, ServTicket|}\ |
|
1380 |
\ : parts (spies evs); \ |
|
1381 |
\ ~ ExpirAuth Tk evs; ~ ExpirServ Tt evs;\ |
|
1382 |
\ B ~= Tgs; A ~: bad; B ~: bad; evs : kerberos |] \ |
|
1383 |
\ ==> A Issues B with (Crypt ServKey {|Agent A, Number Ta|}) on evs"; |
|
1384 |
by (blast_tac (claset() addSDs [Confidentiality_Serv_A, |
|
1385 |
A_Knows_A_Knows_ServKey_lemma]) 1); |
|
1386 |
qed "A_Knows_A_Knows_ServKey"; |
|
1387 |
||
1388 |
Goal "[| Crypt ServKey {|Agent A, Number Ta|} : parts (spies evs); \ |
|
1389 |
\ Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Number Tt|} \ |
|
1390 |
\ : parts (spies evs); \ |
|
1391 |
\ Crypt AuthKey {|Key ServKey, Agent B, Number Tt, ServTicket|} \ |
|
1392 |
\ : parts (spies evs); \ |
|
1393 |
\ Crypt (shrK A) {|Key AuthKey, Agent Tgs, Number Tk, AuthTicket|} \ |
|
1394 |
\ : parts (spies evs); \ |
|
1395 |
\ ~ ExpirServ Tt evs; ~ ExpirAuth Tk evs; \ |
|
1396 |
\ B ~= Tgs; A ~: bad; B ~: bad; evs : kerberos |] \ |
|
1397 |
\ ==> A Issues B with (Crypt ServKey {|Agent A, Number Ta|}) on evs"; |
|
1398 |
by (blast_tac (claset() addDs [A_Authenticity, Confidentiality_B, |
|
1399 |
A_Knows_A_Knows_ServKey_lemma]) 1); |
|
1400 |
qed "B_Knows_A_Knows_ServKey"; |
|
1401 |
||
1402 |
||
1403 |
Goal "[| Crypt ServKey {|Agent A, Number Ta|} : parts (spies evs); \ |
|
1404 |
\ Crypt (shrK B) {|Agent A, Agent B, Key ServKey, Number Tt|} \ |
|
1405 |
\ : parts (spies evs); \ |
|
1406 |
\ ~ ExpirServ Tt evs; \ |
|
1407 |
\ B ~= Tgs; A ~: bad; B ~: bad; evs : kerberos |] \ |
|
1408 |
\ ==> A Issues B with (Crypt ServKey {|Agent A, Number Ta|}) on evs"; |
|
1409 |
by (blast_tac (claset() addDs [A_Authenticity_refined, |
|
1410 |
Confidentiality_B_refined, |
|
1411 |
A_Knows_A_Knows_ServKey_lemma]) 1); |
|
1412 |
qed "B_Knows_A_Knows_ServKey_refined"; |