18886
|
1 |
(* ID: $Id$
|
|
2 |
Author: Giampaolo Bella, Catania University
|
|
3 |
*)
|
|
4 |
|
|
5 |
header{*The Kerberos Protocol, Version V*}
|
|
6 |
|
|
7 |
theory KerberosV imports Public begin
|
|
8 |
|
|
9 |
text{*The "u" prefix indicates theorems referring to an updated version of the protocol. The "r" suffix indicates theorems where the confidentiality assumptions are relaxed by the corresponding arguments.*}
|
|
10 |
|
20768
|
11 |
abbreviation
|
18886
|
12 |
Kas :: agent
|
20768
|
13 |
"Kas == Server"
|
18886
|
14 |
|
20768
|
15 |
Tgs :: agent
|
|
16 |
"Tgs == Friend 0"
|
18886
|
17 |
|
|
18 |
|
|
19 |
axioms
|
|
20 |
Tgs_not_bad [iff]: "Tgs \<notin> bad"
|
|
21 |
--{*Tgs is secure --- we already know that Kas is secure*}
|
|
22 |
|
|
23 |
constdefs
|
|
24 |
(* authKeys are those contained in an authTicket *)
|
|
25 |
authKeys :: "event list => key set"
|
|
26 |
"authKeys evs == {authK. \<exists>A Peer Ta.
|
|
27 |
Says Kas A \<lbrace>Crypt (shrK A) \<lbrace>Key authK, Agent Peer, Ta\<rbrace>,
|
|
28 |
Crypt (shrK Peer) \<lbrace>Agent A, Agent Peer, Key authK, Ta\<rbrace>
|
|
29 |
\<rbrace> \<in> set evs}"
|
|
30 |
|
|
31 |
(* A is the true creator of X if she has sent X and X never appeared on
|
|
32 |
the trace before this event. Recall that traces grow from head. *)
|
|
33 |
Issues :: "[agent, agent, msg, event list] => bool"
|
|
34 |
("_ Issues _ with _ on _")
|
|
35 |
"A Issues B with X on evs ==
|
|
36 |
\<exists>Y. Says A B Y \<in> set evs \<and> X \<in> parts {Y} \<and>
|
|
37 |
X \<notin> parts (spies (takeWhile (% z. z \<noteq> Says A B Y) (rev evs)))"
|
|
38 |
|
|
39 |
|
|
40 |
consts
|
|
41 |
(*Duration of the authentication key*)
|
|
42 |
authKlife :: nat
|
|
43 |
|
|
44 |
(*Duration of the service key*)
|
|
45 |
servKlife :: nat
|
|
46 |
|
|
47 |
(*Duration of an authenticator*)
|
|
48 |
authlife :: nat
|
|
49 |
|
|
50 |
(*Upper bound on the time of reaction of a server*)
|
|
51 |
replylife :: nat
|
|
52 |
|
|
53 |
specification (authKlife)
|
|
54 |
authKlife_LB [iff]: "2 \<le> authKlife"
|
|
55 |
by blast
|
|
56 |
|
|
57 |
specification (servKlife)
|
|
58 |
servKlife_LB [iff]: "2 + authKlife \<le> servKlife"
|
|
59 |
by blast
|
|
60 |
|
|
61 |
specification (authlife)
|
|
62 |
authlife_LB [iff]: "Suc 0 \<le> authlife"
|
|
63 |
by blast
|
|
64 |
|
|
65 |
specification (replylife)
|
|
66 |
replylife_LB [iff]: "Suc 0 \<le> replylife"
|
|
67 |
by blast
|
|
68 |
|
20768
|
69 |
abbreviation
|
|
70 |
(*The current time is just the length of the trace!*)
|
|
71 |
CT :: "event list=>nat"
|
|
72 |
"CT == length"
|
18886
|
73 |
|
20768
|
74 |
expiredAK :: "[nat, event list] => bool"
|
|
75 |
"expiredAK T evs == authKlife + T < CT evs"
|
18886
|
76 |
|
20768
|
77 |
expiredSK :: "[nat, event list] => bool"
|
|
78 |
"expiredSK T evs == servKlife + T < CT evs"
|
18886
|
79 |
|
20768
|
80 |
expiredA :: "[nat, event list] => bool"
|
|
81 |
"expiredA T evs == authlife + T < CT evs"
|
18886
|
82 |
|
20768
|
83 |
valid :: "[nat, nat] => bool" ("valid _ wrt _")
|
|
84 |
"valid T1 wrt T2 == T1 <= replylife + T2"
|
18886
|
85 |
|
|
86 |
(*---------------------------------------------------------------------*)
|
|
87 |
|
|
88 |
|
|
89 |
(* Predicate formalising the association between authKeys and servKeys *)
|
|
90 |
constdefs
|
|
91 |
AKcryptSK :: "[key, key, event list] => bool"
|
|
92 |
"AKcryptSK authK servK evs ==
|
|
93 |
\<exists>A B tt.
|
|
94 |
Says Tgs A \<lbrace>Crypt authK \<lbrace>Key servK, Agent B, tt\<rbrace>,
|
|
95 |
Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, tt\<rbrace> \<rbrace>
|
|
96 |
\<in> set evs"
|
|
97 |
|
|
98 |
consts
|
|
99 |
|
|
100 |
kerbV :: "event list set"
|
|
101 |
inductive "kerbV"
|
|
102 |
intros
|
|
103 |
|
|
104 |
Nil: "[] \<in> kerbV"
|
|
105 |
|
|
106 |
Fake: "\<lbrakk> evsf \<in> kerbV; X \<in> synth (analz (spies evsf)) \<rbrakk>
|
|
107 |
\<Longrightarrow> Says Spy B X # evsf \<in> kerbV"
|
|
108 |
|
|
109 |
|
|
110 |
(*Authentication phase*)
|
|
111 |
KV1: "\<lbrakk> evs1 \<in> kerbV \<rbrakk>
|
|
112 |
\<Longrightarrow> Says A Kas \<lbrace>Agent A, Agent Tgs, Number (CT evs1)\<rbrace> # evs1
|
|
113 |
\<in> kerbV"
|
|
114 |
(*Unlike version IV, authTicket is not re-encrypted*)
|
|
115 |
KV2: "\<lbrakk> evs2 \<in> kerbV; Key authK \<notin> used evs2; authK \<in> symKeys;
|
|
116 |
Says A' Kas \<lbrace>Agent A, Agent Tgs, Number T1\<rbrace> \<in> set evs2 \<rbrakk>
|
|
117 |
\<Longrightarrow> Says Kas A \<lbrace>
|
|
118 |
Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number (CT evs2)\<rbrace>,
|
|
119 |
Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Number (CT evs2)\<rbrace>
|
|
120 |
\<rbrace> # evs2 \<in> kerbV"
|
|
121 |
|
|
122 |
|
|
123 |
(* Authorisation phase *)
|
|
124 |
KV3: "\<lbrakk> evs3 \<in> kerbV; A \<noteq> Kas; A \<noteq> Tgs;
|
|
125 |
Says A Kas \<lbrace>Agent A, Agent Tgs, Number T1\<rbrace> \<in> set evs3;
|
|
126 |
Says Kas' A \<lbrace>Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta\<rbrace>,
|
|
127 |
authTicket\<rbrace> \<in> set evs3;
|
|
128 |
valid Ta wrt T1
|
|
129 |
\<rbrakk>
|
|
130 |
\<Longrightarrow> Says A Tgs \<lbrace>authTicket,
|
|
131 |
(Crypt authK \<lbrace>Agent A, Number (CT evs3)\<rbrace>),
|
|
132 |
Agent B\<rbrace> # evs3 \<in> kerbV"
|
|
133 |
(*Unlike version IV, servTicket is not re-encrypted*)
|
|
134 |
KV4: "\<lbrakk> evs4 \<in> kerbV; Key servK \<notin> used evs4; servK \<in> symKeys;
|
|
135 |
B \<noteq> Tgs; authK \<in> symKeys;
|
|
136 |
Says A' Tgs \<lbrace>
|
|
137 |
(Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK,
|
|
138 |
Number Ta\<rbrace>),
|
|
139 |
(Crypt authK \<lbrace>Agent A, Number T2\<rbrace>), Agent B\<rbrace>
|
|
140 |
\<in> set evs4;
|
|
141 |
\<not> expiredAK Ta evs4;
|
|
142 |
\<not> expiredA T2 evs4;
|
|
143 |
servKlife + (CT evs4) <= authKlife + Ta
|
|
144 |
\<rbrakk>
|
|
145 |
\<Longrightarrow> Says Tgs A \<lbrace>
|
|
146 |
Crypt authK \<lbrace>Key servK, Agent B, Number (CT evs4)\<rbrace>,
|
|
147 |
Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number (CT evs4)\<rbrace>
|
|
148 |
\<rbrace> # evs4 \<in> kerbV"
|
|
149 |
|
|
150 |
|
|
151 |
(*Service phase*)
|
|
152 |
KV5: "\<lbrakk> evs5 \<in> kerbV; authK \<in> symKeys; servK \<in> symKeys;
|
|
153 |
A \<noteq> Kas; A \<noteq> Tgs;
|
|
154 |
Says A Tgs
|
|
155 |
\<lbrace>authTicket, Crypt authK \<lbrace>Agent A, Number T2\<rbrace>,
|
|
156 |
Agent B\<rbrace>
|
|
157 |
\<in> set evs5;
|
|
158 |
Says Tgs' A \<lbrace>Crypt authK \<lbrace>Key servK, Agent B, Number Ts\<rbrace>,
|
|
159 |
servTicket\<rbrace>
|
|
160 |
\<in> set evs5;
|
|
161 |
valid Ts wrt T2 \<rbrakk>
|
|
162 |
\<Longrightarrow> Says A B \<lbrace>servTicket,
|
|
163 |
Crypt servK \<lbrace>Agent A, Number (CT evs5)\<rbrace> \<rbrace>
|
|
164 |
# evs5 \<in> kerbV"
|
|
165 |
|
|
166 |
KV6: "\<lbrakk> evs6 \<in> kerbV; B \<noteq> Kas; B \<noteq> Tgs;
|
|
167 |
Says A' B \<lbrace>
|
|
168 |
(Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace>),
|
|
169 |
(Crypt servK \<lbrace>Agent A, Number T3\<rbrace>)\<rbrace>
|
|
170 |
\<in> set evs6;
|
|
171 |
\<not> expiredSK Ts evs6;
|
|
172 |
\<not> expiredA T3 evs6
|
|
173 |
\<rbrakk>
|
|
174 |
\<Longrightarrow> Says B A (Crypt servK (Number Ta2))
|
|
175 |
# evs6 \<in> kerbV"
|
|
176 |
|
|
177 |
|
|
178 |
|
|
179 |
(* Leaking an authK... *)
|
|
180 |
Oops1:"\<lbrakk> evsO1 \<in> kerbV; A \<noteq> Spy;
|
|
181 |
Says Kas A \<lbrace>Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta\<rbrace>,
|
|
182 |
authTicket\<rbrace> \<in> set evsO1;
|
|
183 |
expiredAK Ta evsO1 \<rbrakk>
|
|
184 |
\<Longrightarrow> Notes Spy \<lbrace>Agent A, Agent Tgs, Number Ta, Key authK\<rbrace>
|
|
185 |
# evsO1 \<in> kerbV"
|
|
186 |
|
|
187 |
(*Leaking a servK... *)
|
|
188 |
Oops2: "\<lbrakk> evsO2 \<in> kerbV; A \<noteq> Spy;
|
|
189 |
Says Tgs A \<lbrace>Crypt authK \<lbrace>Key servK, Agent B, Number Ts\<rbrace>,
|
|
190 |
servTicket\<rbrace> \<in> set evsO2;
|
|
191 |
expiredSK Ts evsO2 \<rbrakk>
|
|
192 |
\<Longrightarrow> Notes Spy \<lbrace>Agent A, Agent B, Number Ts, Key servK\<rbrace>
|
|
193 |
# evsO2 \<in> kerbV"
|
|
194 |
|
|
195 |
|
|
196 |
|
|
197 |
declare Says_imp_knows_Spy [THEN parts.Inj, dest]
|
|
198 |
declare parts.Body [dest]
|
|
199 |
declare analz_into_parts [dest]
|
|
200 |
declare Fake_parts_insert_in_Un [dest]
|
|
201 |
|
|
202 |
|
|
203 |
|
|
204 |
subsection{*Lemmas about lists, for reasoning about Issues*}
|
|
205 |
|
|
206 |
lemma spies_Says_rev: "spies (evs @ [Says A B X]) = insert X (spies evs)"
|
|
207 |
apply (induct_tac "evs")
|
|
208 |
apply (induct_tac [2] "a", auto)
|
|
209 |
done
|
|
210 |
|
|
211 |
lemma spies_Gets_rev: "spies (evs @ [Gets A X]) = spies evs"
|
|
212 |
apply (induct_tac "evs")
|
|
213 |
apply (induct_tac [2] "a", auto)
|
|
214 |
done
|
|
215 |
|
|
216 |
lemma spies_Notes_rev: "spies (evs @ [Notes A X]) =
|
|
217 |
(if A:bad then insert X (spies evs) else spies evs)"
|
|
218 |
apply (induct_tac "evs")
|
|
219 |
apply (induct_tac [2] "a", auto)
|
|
220 |
done
|
|
221 |
|
|
222 |
lemma spies_evs_rev: "spies evs = spies (rev evs)"
|
|
223 |
apply (induct_tac "evs")
|
|
224 |
apply (induct_tac [2] "a")
|
|
225 |
apply (simp_all (no_asm_simp) add: spies_Says_rev spies_Gets_rev spies_Notes_rev)
|
|
226 |
done
|
|
227 |
|
|
228 |
lemmas parts_spies_evs_revD2 = spies_evs_rev [THEN equalityD2, THEN parts_mono]
|
|
229 |
|
|
230 |
lemma spies_takeWhile: "spies (takeWhile P evs) <= spies evs"
|
|
231 |
apply (induct_tac "evs")
|
|
232 |
apply (induct_tac [2] "a", auto)
|
|
233 |
txt{* Resembles @{text"used_subset_append"} in theory Event.*}
|
|
234 |
done
|
|
235 |
|
|
236 |
lemmas parts_spies_takeWhile_mono = spies_takeWhile [THEN parts_mono]
|
|
237 |
|
|
238 |
|
|
239 |
subsection{*Lemmas about @{term authKeys}*}
|
|
240 |
|
|
241 |
lemma authKeys_empty: "authKeys [] = {}"
|
|
242 |
apply (unfold authKeys_def)
|
|
243 |
apply (simp (no_asm))
|
|
244 |
done
|
|
245 |
|
|
246 |
lemma authKeys_not_insert:
|
|
247 |
"(\<forall>A Ta akey Peer.
|
|
248 |
ev \<noteq> Says Kas A \<lbrace>Crypt (shrK A) \<lbrace>akey, Agent Peer, Ta\<rbrace>,
|
|
249 |
Crypt (shrK Peer) \<lbrace>Agent A, Agent Peer, akey, Ta\<rbrace> \<rbrace>)
|
|
250 |
\<Longrightarrow> authKeys (ev # evs) = authKeys evs"
|
|
251 |
apply (unfold authKeys_def, auto)
|
|
252 |
done
|
|
253 |
|
|
254 |
lemma authKeys_insert:
|
|
255 |
"authKeys
|
|
256 |
(Says Kas A \<lbrace>Crypt (shrK A) \<lbrace>Key K, Agent Peer, Number Ta\<rbrace>,
|
|
257 |
Crypt (shrK Peer) \<lbrace>Agent A, Agent Peer, Key K, Number Ta\<rbrace> \<rbrace> # evs)
|
|
258 |
= insert K (authKeys evs)"
|
|
259 |
apply (unfold authKeys_def, auto)
|
|
260 |
done
|
|
261 |
|
|
262 |
lemma authKeys_simp:
|
|
263 |
"K \<in> authKeys
|
|
264 |
(Says Kas A \<lbrace>Crypt (shrK A) \<lbrace>Key K', Agent Peer, Number Ta\<rbrace>,
|
|
265 |
Crypt (shrK Peer) \<lbrace>Agent A, Agent Peer, Key K', Number Ta\<rbrace> \<rbrace> # evs)
|
|
266 |
\<Longrightarrow> K = K' | K \<in> authKeys evs"
|
|
267 |
apply (unfold authKeys_def, auto)
|
|
268 |
done
|
|
269 |
|
|
270 |
lemma authKeysI:
|
|
271 |
"Says Kas A \<lbrace>Crypt (shrK A) \<lbrace>Key K, Agent Tgs, Number Ta\<rbrace>,
|
|
272 |
Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key K, Number Ta\<rbrace> \<rbrace> \<in> set evs
|
|
273 |
\<Longrightarrow> K \<in> authKeys evs"
|
|
274 |
apply (unfold authKeys_def, auto)
|
|
275 |
done
|
|
276 |
|
|
277 |
lemma authKeys_used: "K \<in> authKeys evs \<Longrightarrow> Key K \<in> used evs"
|
|
278 |
apply (simp add: authKeys_def, blast)
|
|
279 |
done
|
|
280 |
|
|
281 |
|
|
282 |
subsection{*Forwarding Lemmas*}
|
|
283 |
|
|
284 |
lemma Says_ticket_parts:
|
|
285 |
"Says S A \<lbrace>Crypt K \<lbrace>SesKey, B, TimeStamp\<rbrace>, Ticket\<rbrace>
|
|
286 |
\<in> set evs \<Longrightarrow> Ticket \<in> parts (spies evs)"
|
|
287 |
apply blast
|
|
288 |
done
|
|
289 |
|
|
290 |
lemma Says_ticket_analz:
|
|
291 |
"Says S A \<lbrace>Crypt K \<lbrace>SesKey, B, TimeStamp\<rbrace>, Ticket\<rbrace>
|
|
292 |
\<in> set evs \<Longrightarrow> Ticket \<in> analz (spies evs)"
|
|
293 |
apply (blast dest: Says_imp_knows_Spy [THEN analz.Inj, THEN analz.Snd])
|
|
294 |
done
|
|
295 |
|
|
296 |
lemma Oops_range_spies1:
|
|
297 |
"\<lbrakk> Says Kas A \<lbrace>Crypt KeyA \<lbrace>Key authK, Peer, Ta\<rbrace>, authTicket\<rbrace>
|
|
298 |
\<in> set evs ;
|
|
299 |
evs \<in> kerbV \<rbrakk> \<Longrightarrow> authK \<notin> range shrK & authK \<in> symKeys"
|
|
300 |
apply (erule rev_mp)
|
|
301 |
apply (erule kerbV.induct, auto)
|
|
302 |
done
|
|
303 |
|
|
304 |
lemma Oops_range_spies2:
|
|
305 |
"\<lbrakk> Says Tgs A \<lbrace>Crypt authK \<lbrace>Key servK, Agent B, Ts\<rbrace>, servTicket\<rbrace>
|
|
306 |
\<in> set evs ;
|
|
307 |
evs \<in> kerbV \<rbrakk> \<Longrightarrow> servK \<notin> range shrK \<and> servK \<in> symKeys"
|
|
308 |
apply (erule rev_mp)
|
|
309 |
apply (erule kerbV.induct, auto)
|
|
310 |
done
|
|
311 |
|
|
312 |
|
|
313 |
(*Spy never sees another agent's shared key! (unless it's lost at start)*)
|
|
314 |
lemma Spy_see_shrK [simp]:
|
|
315 |
"evs \<in> kerbV \<Longrightarrow> (Key (shrK A) \<in> parts (spies evs)) = (A \<in> bad)"
|
|
316 |
apply (erule kerbV.induct)
|
|
317 |
apply (frule_tac [7] Says_ticket_parts)
|
|
318 |
apply (frule_tac [5] Says_ticket_parts, simp_all)
|
|
319 |
apply (blast+)
|
|
320 |
done
|
|
321 |
|
|
322 |
lemma Spy_analz_shrK [simp]:
|
|
323 |
"evs \<in> kerbV \<Longrightarrow> (Key (shrK A) \<in> analz (spies evs)) = (A \<in> bad)"
|
|
324 |
by auto
|
|
325 |
|
|
326 |
lemma Spy_see_shrK_D [dest!]:
|
|
327 |
"\<lbrakk> Key (shrK A) \<in> parts (spies evs); evs \<in> kerbV \<rbrakk> \<Longrightarrow> A:bad"
|
|
328 |
by (blast dest: Spy_see_shrK)
|
|
329 |
lemmas Spy_analz_shrK_D = analz_subset_parts [THEN subsetD, THEN Spy_see_shrK_D, dest!]
|
|
330 |
|
|
331 |
text{*Nobody can have used non-existent keys!*}
|
|
332 |
lemma new_keys_not_used [simp]:
|
|
333 |
"\<lbrakk>Key K \<notin> used evs; K \<in> symKeys; evs \<in> kerbV\<rbrakk>
|
|
334 |
\<Longrightarrow> K \<notin> keysFor (parts (spies evs))"
|
|
335 |
apply (erule rev_mp)
|
|
336 |
apply (erule kerbV.induct)
|
|
337 |
apply (frule_tac [7] Says_ticket_parts)
|
|
338 |
apply (frule_tac [5] Says_ticket_parts, simp_all)
|
|
339 |
txt{*Fake*}
|
|
340 |
apply (force dest!: keysFor_parts_insert)
|
|
341 |
txt{*Others*}
|
|
342 |
apply (force dest!: analz_shrK_Decrypt)+
|
|
343 |
done
|
|
344 |
|
|
345 |
(*Earlier, all protocol proofs declared this theorem.
|
|
346 |
But few of them actually need it! (Another is Yahalom) *)
|
|
347 |
lemma new_keys_not_analzd:
|
|
348 |
"\<lbrakk>evs \<in> kerbV; K \<in> symKeys; Key K \<notin> used evs\<rbrakk>
|
|
349 |
\<Longrightarrow> K \<notin> keysFor (analz (spies evs))"
|
|
350 |
by (blast dest: new_keys_not_used intro: keysFor_mono [THEN subsetD])
|
|
351 |
|
|
352 |
|
|
353 |
|
|
354 |
subsection{*Regularity Lemmas*}
|
|
355 |
text{*These concern the form of items passed in messages*}
|
|
356 |
|
|
357 |
text{*Describes the form of all components sent by Kas*}
|
|
358 |
lemma Says_Kas_message_form:
|
|
359 |
"\<lbrakk> Says Kas A \<lbrace>Crypt K \<lbrace>Key authK, Agent Peer, Ta\<rbrace>, authTicket\<rbrace>
|
|
360 |
\<in> set evs;
|
|
361 |
evs \<in> kerbV \<rbrakk>
|
|
362 |
\<Longrightarrow> authK \<notin> range shrK \<and> authK \<in> authKeys evs \<and> authK \<in> symKeys \<and>
|
|
363 |
authTicket = (Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Ta\<rbrace>) \<and>
|
|
364 |
K = shrK A \<and> Peer = Tgs"
|
|
365 |
apply (erule rev_mp)
|
|
366 |
apply (erule kerbV.induct)
|
|
367 |
apply (simp_all (no_asm) add: authKeys_def authKeys_insert)
|
|
368 |
apply blast+
|
|
369 |
done
|
|
370 |
|
|
371 |
|
|
372 |
|
|
373 |
(*This lemma is essential for proving Says_Tgs_message_form:
|
|
374 |
|
|
375 |
the session key authK
|
|
376 |
supplied by Kas in the authentication ticket
|
|
377 |
cannot be a long-term key!
|
|
378 |
|
|
379 |
Generalised to any session keys (both authK and servK).
|
|
380 |
*)
|
|
381 |
lemma SesKey_is_session_key:
|
|
382 |
"\<lbrakk> Crypt (shrK Tgs_B) \<lbrace>Agent A, Agent Tgs_B, Key SesKey, Number T\<rbrace>
|
|
383 |
\<in> parts (spies evs); Tgs_B \<notin> bad;
|
|
384 |
evs \<in> kerbV \<rbrakk>
|
|
385 |
\<Longrightarrow> SesKey \<notin> range shrK"
|
|
386 |
apply (erule rev_mp)
|
|
387 |
apply (erule kerbV.induct)
|
|
388 |
apply (frule_tac [7] Says_ticket_parts)
|
|
389 |
apply (frule_tac [5] Says_ticket_parts, simp_all, blast)
|
|
390 |
done
|
|
391 |
|
|
392 |
lemma authTicket_authentic:
|
|
393 |
"\<lbrakk> Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Ta\<rbrace>
|
|
394 |
\<in> parts (spies evs);
|
|
395 |
evs \<in> kerbV \<rbrakk>
|
|
396 |
\<Longrightarrow> Says Kas A \<lbrace>Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Ta\<rbrace>,
|
|
397 |
Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Ta\<rbrace>\<rbrace>
|
|
398 |
\<in> set evs"
|
|
399 |
apply (erule rev_mp)
|
|
400 |
apply (erule kerbV.induct)
|
|
401 |
apply (frule_tac [7] Says_ticket_parts)
|
|
402 |
apply (frule_tac [5] Says_ticket_parts, simp_all)
|
|
403 |
txt{*Fake, K4*}
|
|
404 |
apply (blast+)
|
|
405 |
done
|
|
406 |
|
|
407 |
lemma authTicket_crypt_authK:
|
|
408 |
"\<lbrakk> Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Number Ta\<rbrace>
|
|
409 |
\<in> parts (spies evs);
|
|
410 |
evs \<in> kerbV \<rbrakk>
|
|
411 |
\<Longrightarrow> authK \<in> authKeys evs"
|
|
412 |
apply (frule authTicket_authentic, assumption)
|
|
413 |
apply (simp (no_asm) add: authKeys_def)
|
|
414 |
apply blast
|
|
415 |
done
|
|
416 |
|
|
417 |
text{*Describes the form of servK, servTicket and authK sent by Tgs*}
|
|
418 |
lemma Says_Tgs_message_form:
|
|
419 |
"\<lbrakk> Says Tgs A \<lbrace>Crypt authK \<lbrace>Key servK, Agent B, Ts\<rbrace>, servTicket\<rbrace>
|
|
420 |
\<in> set evs;
|
|
421 |
evs \<in> kerbV \<rbrakk>
|
|
422 |
\<Longrightarrow> B \<noteq> Tgs \<and>
|
|
423 |
servK \<notin> range shrK \<and> servK \<notin> authKeys evs \<and> servK \<in> symKeys \<and>
|
|
424 |
servTicket = (Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Ts\<rbrace>) \<and>
|
|
425 |
authK \<notin> range shrK \<and> authK \<in> authKeys evs \<and> authK \<in> symKeys"
|
|
426 |
apply (erule rev_mp)
|
|
427 |
apply (erule kerbV.induct)
|
|
428 |
apply (simp_all add: authKeys_insert authKeys_not_insert authKeys_empty authKeys_simp, blast, auto)
|
|
429 |
txt{*Three subcases of Message 4*}
|
|
430 |
apply (blast dest!: authKeys_used Says_Kas_message_form)
|
|
431 |
apply (blast dest!: SesKey_is_session_key)
|
|
432 |
apply (blast dest: authTicket_crypt_authK)
|
|
433 |
done
|
|
434 |
|
|
435 |
|
|
436 |
|
|
437 |
(*
|
|
438 |
lemma authTicket_form:
|
|
439 |
lemma servTicket_form:
|
|
440 |
lemma Says_kas_message_form:
|
|
441 |
lemma Says_tgs_message_form:
|
|
442 |
|
|
443 |
cannot be proved for version V, but a new proof strategy can be used in their
|
|
444 |
place. The new strategy merely says that both the authTicket and the servTicket
|
|
445 |
are in parts and in analz as soon as they appear, using lemmas Says_ticket_parts and Says_ticket_analz.
|
|
446 |
The new strategy always lets the simplifier solve cases K3 and K5, saving on
|
|
447 |
long dedicated analyses, which seemed unavoidable. For this reason, lemma
|
|
448 |
servK_notin_authKeysD is no longer needed.
|
|
449 |
*)
|
|
450 |
|
|
451 |
subsection{*Authenticity theorems: confirm origin of sensitive messages*}
|
|
452 |
|
|
453 |
lemma authK_authentic:
|
|
454 |
"\<lbrakk> Crypt (shrK A) \<lbrace>Key authK, Peer, Ta\<rbrace>
|
|
455 |
\<in> parts (spies evs);
|
|
456 |
A \<notin> bad; evs \<in> kerbV \<rbrakk>
|
|
457 |
\<Longrightarrow> \<exists> AT. Says Kas A \<lbrace>Crypt (shrK A) \<lbrace>Key authK, Peer, Ta\<rbrace>, AT\<rbrace>
|
|
458 |
\<in> set evs"
|
|
459 |
apply (erule rev_mp)
|
|
460 |
apply (erule kerbV.induct)
|
|
461 |
apply (frule_tac [7] Says_ticket_parts)
|
|
462 |
apply (frule_tac [5] Says_ticket_parts, simp_all)
|
|
463 |
apply blast+
|
|
464 |
done
|
|
465 |
|
|
466 |
text{*If a certain encrypted message appears then it originated with Tgs*}
|
|
467 |
lemma servK_authentic:
|
|
468 |
"\<lbrakk> Crypt authK \<lbrace>Key servK, Agent B, Ts\<rbrace>
|
|
469 |
\<in> parts (spies evs);
|
|
470 |
Key authK \<notin> analz (spies evs);
|
|
471 |
authK \<notin> range shrK;
|
|
472 |
evs \<in> kerbV \<rbrakk>
|
|
473 |
\<Longrightarrow> \<exists>A ST. Says Tgs A \<lbrace>Crypt authK \<lbrace>Key servK, Agent B, Ts\<rbrace>, ST\<rbrace>
|
|
474 |
\<in> set evs"
|
|
475 |
apply (erule rev_mp)
|
|
476 |
apply (erule rev_mp)
|
|
477 |
apply (erule kerbV.induct, analz_mono_contra)
|
|
478 |
apply (frule_tac [7] Says_ticket_parts)
|
|
479 |
apply (frule_tac [5] Says_ticket_parts, simp_all)
|
|
480 |
apply blast+
|
|
481 |
done
|
|
482 |
|
|
483 |
lemma servK_authentic_bis:
|
|
484 |
"\<lbrakk> Crypt authK \<lbrace>Key servK, Agent B, Ts\<rbrace>
|
|
485 |
\<in> parts (spies evs);
|
|
486 |
Key authK \<notin> analz (spies evs);
|
|
487 |
B \<noteq> Tgs;
|
|
488 |
evs \<in> kerbV \<rbrakk>
|
|
489 |
\<Longrightarrow> \<exists>A ST. Says Tgs A \<lbrace>Crypt authK \<lbrace>Key servK, Agent B, Ts\<rbrace>, ST\<rbrace>
|
|
490 |
\<in> set evs"
|
|
491 |
apply (erule rev_mp)
|
|
492 |
apply (erule rev_mp)
|
|
493 |
apply (erule kerbV.induct, analz_mono_contra)
|
|
494 |
apply (frule_tac [7] Says_ticket_parts)
|
|
495 |
apply (frule_tac [5] Says_ticket_parts, simp_all, blast+)
|
|
496 |
done
|
|
497 |
|
|
498 |
text{*Authenticity of servK for B*}
|
|
499 |
lemma servTicket_authentic_Tgs:
|
|
500 |
"\<lbrakk> Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Ts\<rbrace>
|
|
501 |
\<in> parts (spies evs); B \<noteq> Tgs; B \<notin> bad;
|
|
502 |
evs \<in> kerbV \<rbrakk>
|
|
503 |
\<Longrightarrow> \<exists>authK.
|
|
504 |
Says Tgs A \<lbrace>Crypt authK \<lbrace>Key servK, Agent B, Ts\<rbrace>,
|
|
505 |
Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Ts\<rbrace>\<rbrace>
|
|
506 |
\<in> set evs"
|
|
507 |
apply (erule rev_mp)
|
|
508 |
apply (erule kerbV.induct)
|
|
509 |
apply (frule_tac [7] Says_ticket_parts)
|
|
510 |
apply (frule_tac [5] Says_ticket_parts, simp_all, blast+)
|
|
511 |
done
|
|
512 |
|
|
513 |
text{*Anticipated here from next subsection*}
|
|
514 |
lemma K4_imp_K2:
|
|
515 |
"\<lbrakk> Says Tgs A \<lbrace>Crypt authK \<lbrace>Key servK, Agent B, Number Ts\<rbrace>, servTicket\<rbrace>
|
|
516 |
\<in> set evs; evs \<in> kerbV\<rbrakk>
|
|
517 |
\<Longrightarrow> \<exists>Ta. Says Kas A
|
|
518 |
\<lbrace>Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta\<rbrace>,
|
|
519 |
Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Number Ta\<rbrace> \<rbrace>
|
|
520 |
\<in> set evs"
|
|
521 |
apply (erule rev_mp)
|
|
522 |
apply (erule kerbV.induct)
|
|
523 |
apply (frule_tac [7] Says_ticket_parts)
|
|
524 |
apply (frule_tac [5] Says_ticket_parts, simp_all, auto)
|
|
525 |
apply (blast dest!: Says_imp_spies [THEN parts.Inj, THEN parts.Fst, THEN authTicket_authentic])
|
|
526 |
done
|
|
527 |
|
|
528 |
text{*Anticipated here from next subsection*}
|
|
529 |
lemma u_K4_imp_K2:
|
|
530 |
"\<lbrakk> Says Tgs A \<lbrace>Crypt authK \<lbrace>Key servK, Agent B, Number Ts\<rbrace>, servTicket\<rbrace> \<in> set evs; evs \<in> kerbV\<rbrakk>
|
|
531 |
\<Longrightarrow> \<exists>Ta. Says Kas A \<lbrace>Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta\<rbrace>,
|
|
532 |
Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Number Ta\<rbrace> \<rbrace>
|
|
533 |
\<in> set evs
|
|
534 |
\<and> servKlife + Ts <= authKlife + Ta"
|
|
535 |
apply (erule rev_mp)
|
|
536 |
apply (erule kerbV.induct)
|
|
537 |
apply (frule_tac [7] Says_ticket_parts)
|
|
538 |
apply (frule_tac [5] Says_ticket_parts, simp_all, auto)
|
|
539 |
apply (blast dest!: Says_imp_spies [THEN parts.Inj, THEN parts.Fst, THEN authTicket_authentic])
|
|
540 |
done
|
|
541 |
|
|
542 |
lemma servTicket_authentic_Kas:
|
|
543 |
"\<lbrakk> Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace>
|
|
544 |
\<in> parts (spies evs); B \<noteq> Tgs; B \<notin> bad;
|
|
545 |
evs \<in> kerbV \<rbrakk>
|
|
546 |
\<Longrightarrow> \<exists>authK Ta.
|
|
547 |
Says Kas A
|
|
548 |
\<lbrace>Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta\<rbrace>,
|
|
549 |
Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Number Ta\<rbrace> \<rbrace>
|
|
550 |
\<in> set evs"
|
|
551 |
apply (blast dest!: servTicket_authentic_Tgs K4_imp_K2)
|
|
552 |
done
|
|
553 |
|
|
554 |
lemma u_servTicket_authentic_Kas:
|
|
555 |
"\<lbrakk> Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace>
|
|
556 |
\<in> parts (spies evs); B \<noteq> Tgs; B \<notin> bad;
|
|
557 |
evs \<in> kerbV \<rbrakk>
|
|
558 |
\<Longrightarrow> \<exists>authK Ta.
|
|
559 |
Says Kas A
|
|
560 |
\<lbrace>Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta\<rbrace>,
|
|
561 |
Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Number Ta\<rbrace> \<rbrace>
|
|
562 |
\<in> set evs \<and>
|
|
563 |
servKlife + Ts <= authKlife + Ta"
|
|
564 |
apply (blast dest!: servTicket_authentic_Tgs u_K4_imp_K2)
|
|
565 |
done
|
|
566 |
|
|
567 |
lemma servTicket_authentic:
|
|
568 |
"\<lbrakk> Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace>
|
|
569 |
\<in> parts (spies evs); B \<noteq> Tgs; B \<notin> bad;
|
|
570 |
evs \<in> kerbV \<rbrakk>
|
|
571 |
\<Longrightarrow> \<exists>Ta authK.
|
|
572 |
Says Kas A \<lbrace>Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta\<rbrace>,
|
|
573 |
Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Number Ta\<rbrace> \<rbrace> \<in> set evs
|
|
574 |
\<and> Says Tgs A \<lbrace>Crypt authK \<lbrace>Key servK, Agent B, Number Ts\<rbrace>,
|
|
575 |
Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace>\<rbrace>
|
|
576 |
\<in> set evs"
|
|
577 |
apply (blast dest: servTicket_authentic_Tgs K4_imp_K2)
|
|
578 |
done
|
|
579 |
|
|
580 |
lemma u_servTicket_authentic:
|
|
581 |
"\<lbrakk> Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace>
|
|
582 |
\<in> parts (spies evs); B \<noteq> Tgs; B \<notin> bad;
|
|
583 |
evs \<in> kerbV \<rbrakk>
|
|
584 |
\<Longrightarrow> \<exists>Ta authK.
|
|
585 |
Says Kas A \<lbrace>Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta\<rbrace>,
|
|
586 |
Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Number Ta\<rbrace>\<rbrace> \<in> set evs
|
|
587 |
\<and> Says Tgs A \<lbrace>Crypt authK \<lbrace>Key servK, Agent B, Number Ts\<rbrace>,
|
|
588 |
Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace>\<rbrace>
|
|
589 |
\<in> set evs
|
|
590 |
\<and> servKlife + Ts <= authKlife + Ta"
|
|
591 |
apply (blast dest: servTicket_authentic_Tgs u_K4_imp_K2)
|
|
592 |
done
|
|
593 |
|
|
594 |
lemma u_NotexpiredSK_NotexpiredAK:
|
|
595 |
"\<lbrakk> \<not> expiredSK Ts evs; servKlife + Ts <= authKlife + Ta \<rbrakk>
|
|
596 |
\<Longrightarrow> \<not> expiredAK Ta evs"
|
|
597 |
apply (blast dest: leI le_trans dest: leD)
|
|
598 |
done
|
|
599 |
|
|
600 |
|
|
601 |
subsection{* Reliability: friendly agents send somthing if something else happened*}
|
|
602 |
|
|
603 |
lemma K3_imp_K2:
|
|
604 |
"\<lbrakk> Says A Tgs
|
|
605 |
\<lbrace>authTicket, Crypt authK \<lbrace>Agent A, Number T2\<rbrace>, Agent B\<rbrace>
|
|
606 |
\<in> set evs;
|
|
607 |
A \<notin> bad; evs \<in> kerbV \<rbrakk>
|
|
608 |
\<Longrightarrow> \<exists>Ta AT. Says Kas A \<lbrace>Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Ta\<rbrace>,
|
|
609 |
AT\<rbrace> \<in> set evs"
|
|
610 |
apply (erule rev_mp)
|
|
611 |
apply (erule kerbV.induct)
|
|
612 |
apply (frule_tac [7] Says_ticket_parts)
|
|
613 |
apply (frule_tac [5] Says_ticket_parts, simp_all, blast, blast)
|
|
614 |
apply (blast dest: Says_imp_spies [THEN parts.Inj, THEN parts.Fst, THEN authK_authentic])
|
|
615 |
done
|
|
616 |
|
|
617 |
text{*Anticipated here from next subsection. An authK is encrypted by one and only one Shared key. A servK is encrypted by one and only one authK.*}
|
|
618 |
lemma Key_unique_SesKey:
|
|
619 |
"\<lbrakk> Crypt K \<lbrace>Key SesKey, Agent B, T\<rbrace>
|
|
620 |
\<in> parts (spies evs);
|
|
621 |
Crypt K' \<lbrace>Key SesKey, Agent B', T'\<rbrace>
|
|
622 |
\<in> parts (spies evs); Key SesKey \<notin> analz (spies evs);
|
|
623 |
evs \<in> kerbV \<rbrakk>
|
|
624 |
\<Longrightarrow> K=K' \<and> B=B' \<and> T=T'"
|
|
625 |
apply (erule rev_mp)
|
|
626 |
apply (erule rev_mp)
|
|
627 |
apply (erule rev_mp)
|
|
628 |
apply (erule kerbV.induct, analz_mono_contra)
|
|
629 |
apply (frule_tac [7] Says_ticket_parts)
|
|
630 |
apply (frule_tac [5] Says_ticket_parts, simp_all)
|
|
631 |
txt{*Fake, K2, K4*}
|
|
632 |
apply (blast+)
|
|
633 |
done
|
|
634 |
|
|
635 |
text{*This inevitably has an existential form in version V*}
|
|
636 |
lemma Says_K5:
|
|
637 |
"\<lbrakk> Crypt servK \<lbrace>Agent A, Number T3\<rbrace> \<in> parts (spies evs);
|
|
638 |
Says Tgs A \<lbrace>Crypt authK \<lbrace>Key servK, Agent B, Number Ts\<rbrace>,
|
|
639 |
servTicket\<rbrace> \<in> set evs;
|
|
640 |
Key servK \<notin> analz (spies evs);
|
|
641 |
A \<notin> bad; B \<notin> bad; evs \<in> kerbV \<rbrakk>
|
|
642 |
\<Longrightarrow> \<exists> ST. Says A B \<lbrace>ST, Crypt servK \<lbrace>Agent A, Number T3\<rbrace>\<rbrace> \<in> set evs"
|
|
643 |
apply (erule rev_mp)
|
|
644 |
apply (erule rev_mp)
|
|
645 |
apply (erule rev_mp)
|
|
646 |
apply (erule kerbV.induct, analz_mono_contra)
|
|
647 |
apply (frule_tac [5] Says_ticket_parts)
|
|
648 |
apply (frule_tac [7] Says_ticket_parts)
|
|
649 |
apply (simp_all (no_asm_simp) add: all_conj_distrib)
|
|
650 |
apply blast
|
|
651 |
txt{*K3*}
|
|
652 |
apply (blast dest: authK_authentic Says_Kas_message_form Says_Tgs_message_form)
|
|
653 |
txt{*K4*}
|
|
654 |
apply (force dest!: Crypt_imp_keysFor)
|
|
655 |
txt{*K5*}
|
|
656 |
apply (blast dest: Key_unique_SesKey)
|
|
657 |
done
|
|
658 |
|
|
659 |
text{*Anticipated here from next subsection*}
|
|
660 |
lemma unique_CryptKey:
|
|
661 |
"\<lbrakk> Crypt (shrK B) \<lbrace>Agent A, Agent B, Key SesKey, T\<rbrace>
|
|
662 |
\<in> parts (spies evs);
|
|
663 |
Crypt (shrK B') \<lbrace>Agent A', Agent B', Key SesKey, T'\<rbrace>
|
|
664 |
\<in> parts (spies evs); Key SesKey \<notin> analz (spies evs);
|
|
665 |
evs \<in> kerbV \<rbrakk>
|
|
666 |
\<Longrightarrow> A=A' & B=B' & T=T'"
|
|
667 |
apply (erule rev_mp)
|
|
668 |
apply (erule rev_mp)
|
|
669 |
apply (erule rev_mp)
|
|
670 |
apply (erule kerbV.induct, analz_mono_contra)
|
|
671 |
apply (frule_tac [7] Says_ticket_parts)
|
|
672 |
apply (frule_tac [5] Says_ticket_parts, simp_all)
|
|
673 |
txt{*Fake, K2, K4*}
|
|
674 |
apply (blast+)
|
|
675 |
done
|
|
676 |
|
|
677 |
lemma Says_K6:
|
|
678 |
"\<lbrakk> Crypt servK (Number T3) \<in> parts (spies evs);
|
|
679 |
Says Tgs A \<lbrace>Crypt authK \<lbrace>Key servK, Agent B, Number Ts\<rbrace>,
|
|
680 |
servTicket\<rbrace> \<in> set evs;
|
|
681 |
Key servK \<notin> analz (spies evs);
|
|
682 |
A \<notin> bad; B \<notin> bad; evs \<in> kerbV \<rbrakk>
|
|
683 |
\<Longrightarrow> Says B A (Crypt servK (Number T3)) \<in> set evs"
|
|
684 |
apply (frule Says_Tgs_message_form, assumption, clarify)
|
|
685 |
apply (erule rev_mp)
|
|
686 |
apply (erule rev_mp)
|
|
687 |
apply (erule rev_mp)
|
|
688 |
apply (erule kerbV.induct, analz_mono_contra)
|
|
689 |
apply (frule_tac [7] Says_ticket_parts)
|
|
690 |
apply (frule_tac [5] Says_ticket_parts)
|
|
691 |
apply (simp_all (no_asm_simp))
|
|
692 |
|
|
693 |
txt{*fake*}
|
|
694 |
apply blast
|
|
695 |
txt{*K4*}
|
|
696 |
apply (force dest!: Crypt_imp_keysFor, clarify)
|
|
697 |
txt{*K6*}
|
|
698 |
apply (drule Says_imp_spies [THEN parts.Inj, THEN parts.Fst])
|
|
699 |
apply (drule Says_imp_spies [THEN parts.Inj, THEN parts.Snd])
|
|
700 |
apply (blast dest!: unique_CryptKey)
|
|
701 |
done
|
|
702 |
|
|
703 |
text{*Needs a unicity theorem, hence moved here*}
|
|
704 |
lemma servK_authentic_ter:
|
|
705 |
"\<lbrakk> Says Kas A
|
|
706 |
\<lbrace>Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Ta\<rbrace>, authTicket\<rbrace> \<in> set evs;
|
|
707 |
Crypt authK \<lbrace>Key servK, Agent B, Ts\<rbrace>
|
|
708 |
\<in> parts (spies evs);
|
|
709 |
Key authK \<notin> analz (spies evs);
|
|
710 |
evs \<in> kerbV \<rbrakk>
|
|
711 |
\<Longrightarrow> Says Tgs A \<lbrace>Crypt authK \<lbrace>Key servK, Agent B, Ts\<rbrace>,
|
|
712 |
Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Ts\<rbrace> \<rbrace>
|
|
713 |
\<in> set evs"
|
|
714 |
apply (frule Says_Kas_message_form, assumption)
|
|
715 |
apply clarify
|
|
716 |
apply (erule rev_mp)
|
|
717 |
apply (erule rev_mp)
|
|
718 |
apply (erule rev_mp)
|
|
719 |
apply (erule kerbV.induct, analz_mono_contra)
|
|
720 |
apply (frule_tac [7] Says_ticket_parts)
|
|
721 |
apply (frule_tac [5] Says_ticket_parts, simp_all, blast)
|
|
722 |
txt{*K2 and K4 remain*}
|
|
723 |
apply (blast dest!: servK_authentic Says_Tgs_message_form authKeys_used)
|
|
724 |
apply (blast dest!: unique_CryptKey)
|
|
725 |
done
|
|
726 |
|
|
727 |
|
|
728 |
subsection{*Unicity Theorems*}
|
|
729 |
|
|
730 |
text{* The session key, if secure, uniquely identifies the Ticket
|
|
731 |
whether authTicket or servTicket. As a matter of fact, one can read
|
|
732 |
also Tgs in the place of B. *}
|
|
733 |
|
|
734 |
|
|
735 |
lemma unique_authKeys:
|
|
736 |
"\<lbrakk> Says Kas A
|
|
737 |
\<lbrace>Crypt Ka \<lbrace>Key authK, Agent Tgs, Ta\<rbrace>, X\<rbrace> \<in> set evs;
|
|
738 |
Says Kas A'
|
|
739 |
\<lbrace>Crypt Ka' \<lbrace>Key authK, Agent Tgs, Ta'\<rbrace>, X'\<rbrace> \<in> set evs;
|
|
740 |
evs \<in> kerbV \<rbrakk> \<Longrightarrow> A=A' \<and> Ka=Ka' \<and> Ta=Ta' \<and> X=X'"
|
|
741 |
apply (erule rev_mp)
|
|
742 |
apply (erule rev_mp)
|
|
743 |
apply (erule kerbV.induct)
|
|
744 |
apply (frule_tac [7] Says_ticket_parts)
|
|
745 |
apply (frule_tac [5] Says_ticket_parts, simp_all)
|
|
746 |
apply blast+
|
|
747 |
done
|
|
748 |
|
|
749 |
text{* servK uniquely identifies the message from Tgs *}
|
|
750 |
lemma unique_servKeys:
|
|
751 |
"\<lbrakk> Says Tgs A
|
|
752 |
\<lbrace>Crypt K \<lbrace>Key servK, Agent B, Ts\<rbrace>, X\<rbrace> \<in> set evs;
|
|
753 |
Says Tgs A'
|
|
754 |
\<lbrace>Crypt K' \<lbrace>Key servK, Agent B', Ts'\<rbrace>, X'\<rbrace> \<in> set evs;
|
|
755 |
evs \<in> kerbV \<rbrakk> \<Longrightarrow> A=A' \<and> B=B' \<and> K=K' \<and> Ts=Ts' \<and> X=X'"
|
|
756 |
apply (erule rev_mp)
|
|
757 |
apply (erule rev_mp)
|
|
758 |
apply (erule kerbV.induct)
|
|
759 |
apply (frule_tac [7] Says_ticket_parts)
|
|
760 |
apply (frule_tac [5] Says_ticket_parts, simp_all)
|
|
761 |
apply blast+
|
|
762 |
done
|
|
763 |
|
|
764 |
subsection{*Lemmas About the Predicate @{term AKcryptSK}*}
|
|
765 |
|
|
766 |
lemma not_AKcryptSK_Nil [iff]: "\<not> AKcryptSK authK servK []"
|
|
767 |
apply (simp add: AKcryptSK_def)
|
|
768 |
done
|
|
769 |
|
|
770 |
lemma AKcryptSKI:
|
|
771 |
"\<lbrakk> Says Tgs A \<lbrace>Crypt authK \<lbrace>Key servK, Agent B, tt\<rbrace>, X \<rbrace> \<in> set evs;
|
|
772 |
evs \<in> kerbV \<rbrakk> \<Longrightarrow> AKcryptSK authK servK evs"
|
|
773 |
apply (unfold AKcryptSK_def)
|
|
774 |
apply (blast dest: Says_Tgs_message_form)
|
|
775 |
done
|
|
776 |
|
|
777 |
lemma AKcryptSK_Says [simp]:
|
|
778 |
"AKcryptSK authK servK (Says S A X # evs) =
|
|
779 |
(S = Tgs \<and>
|
|
780 |
(\<exists>B tt. X = \<lbrace>Crypt authK \<lbrace>Key servK, Agent B, tt\<rbrace>,
|
|
781 |
Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, tt\<rbrace> \<rbrace>)
|
|
782 |
| AKcryptSK authK servK evs)"
|
|
783 |
apply (unfold AKcryptSK_def)
|
|
784 |
apply (simp (no_asm))
|
|
785 |
apply blast
|
|
786 |
done
|
|
787 |
|
|
788 |
lemma AKcryptSK_Notes [simp]:
|
|
789 |
"AKcryptSK authK servK (Notes A X # evs) =
|
|
790 |
AKcryptSK authK servK evs"
|
|
791 |
apply (unfold AKcryptSK_def)
|
|
792 |
apply (simp (no_asm))
|
|
793 |
done
|
|
794 |
|
|
795 |
(*A fresh authK cannot be associated with any other
|
|
796 |
(with respect to a given trace). *)
|
|
797 |
lemma Auth_fresh_not_AKcryptSK:
|
|
798 |
"\<lbrakk> Key authK \<notin> used evs; evs \<in> kerbV \<rbrakk>
|
|
799 |
\<Longrightarrow> \<not> AKcryptSK authK servK evs"
|
|
800 |
apply (unfold AKcryptSK_def)
|
|
801 |
apply (erule rev_mp)
|
|
802 |
apply (erule kerbV.induct)
|
|
803 |
apply (frule_tac [7] Says_ticket_parts)
|
|
804 |
apply (frule_tac [5] Says_ticket_parts, simp_all, blast)
|
|
805 |
done
|
|
806 |
|
|
807 |
(*A fresh servK cannot be associated with any other
|
|
808 |
(with respect to a given trace). *)
|
|
809 |
lemma Serv_fresh_not_AKcryptSK:
|
|
810 |
"Key servK \<notin> used evs \<Longrightarrow> \<not> AKcryptSK authK servK evs"
|
|
811 |
apply (unfold AKcryptSK_def, blast)
|
|
812 |
done
|
|
813 |
|
|
814 |
lemma authK_not_AKcryptSK:
|
|
815 |
"\<lbrakk> Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, tk\<rbrace>
|
|
816 |
\<in> parts (spies evs); evs \<in> kerbV \<rbrakk>
|
|
817 |
\<Longrightarrow> \<not> AKcryptSK K authK evs"
|
|
818 |
apply (erule rev_mp)
|
|
819 |
apply (erule kerbV.induct)
|
|
820 |
apply (frule_tac [7] Says_ticket_parts)
|
|
821 |
apply (frule_tac [5] Says_ticket_parts, simp_all)
|
|
822 |
txt{*Fake*}
|
|
823 |
apply blast
|
|
824 |
txt{*K2: by freshness*}
|
|
825 |
apply (simp add: AKcryptSK_def)
|
|
826 |
apply blast
|
|
827 |
txt{*K4*}
|
|
828 |
apply blast
|
|
829 |
done
|
|
830 |
|
|
831 |
text{*A secure serverkey cannot have been used to encrypt others*}
|
|
832 |
lemma servK_not_AKcryptSK:
|
|
833 |
"\<lbrakk> Crypt (shrK B) \<lbrace>Agent A, Agent B, Key SK, tt\<rbrace> \<in> parts (spies evs);
|
|
834 |
Key SK \<notin> analz (spies evs); SK \<in> symKeys;
|
|
835 |
B \<noteq> Tgs; evs \<in> kerbV \<rbrakk>
|
|
836 |
\<Longrightarrow> \<not> AKcryptSK SK K evs"
|
|
837 |
apply (erule rev_mp)
|
|
838 |
apply (erule rev_mp)
|
|
839 |
apply (erule kerbV.induct, analz_mono_contra)
|
|
840 |
apply (frule_tac [7] Says_ticket_parts)
|
|
841 |
apply (frule_tac [5] Says_ticket_parts, simp_all, blast)
|
|
842 |
txt{*K4 splits into distinct subcases*}
|
|
843 |
apply auto
|
|
844 |
txt{*servK can't have been enclosed in two certificates*}
|
|
845 |
prefer 2 apply (blast dest: unique_CryptKey)
|
|
846 |
txt{*servK is fresh and so could not have been used, by
|
|
847 |
@{text new_keys_not_used}*}
|
|
848 |
apply (force dest!: Crypt_imp_invKey_keysFor simp add: AKcryptSK_def)
|
|
849 |
done
|
|
850 |
|
|
851 |
text{*Long term keys are not issued as servKeys*}
|
|
852 |
lemma shrK_not_AKcryptSK:
|
|
853 |
"evs \<in> kerbV \<Longrightarrow> \<not> AKcryptSK K (shrK A) evs"
|
|
854 |
apply (unfold AKcryptSK_def)
|
|
855 |
apply (erule kerbV.induct)
|
|
856 |
apply (frule_tac [7] Says_ticket_parts)
|
|
857 |
apply (frule_tac [5] Says_ticket_parts, auto)
|
|
858 |
done
|
|
859 |
|
|
860 |
text{*The Tgs message associates servK with authK and therefore not with any
|
|
861 |
other key authK.*}
|
|
862 |
lemma Says_Tgs_AKcryptSK:
|
|
863 |
"\<lbrakk> Says Tgs A \<lbrace>Crypt authK \<lbrace>Key servK, Agent B, tt\<rbrace>, X \<rbrace>
|
|
864 |
\<in> set evs;
|
|
865 |
authK' \<noteq> authK; evs \<in> kerbV \<rbrakk>
|
|
866 |
\<Longrightarrow> \<not> AKcryptSK authK' servK evs"
|
|
867 |
apply (unfold AKcryptSK_def)
|
|
868 |
apply (blast dest: unique_servKeys)
|
|
869 |
done
|
|
870 |
|
|
871 |
lemma AKcryptSK_not_AKcryptSK:
|
|
872 |
"\<lbrakk> AKcryptSK authK servK evs; evs \<in> kerbV \<rbrakk>
|
|
873 |
\<Longrightarrow> \<not> AKcryptSK servK K evs"
|
|
874 |
apply (erule rev_mp)
|
|
875 |
apply (erule kerbV.induct)
|
|
876 |
apply (frule_tac [7] Says_ticket_parts)
|
|
877 |
apply (frule_tac [5] Says_ticket_parts)
|
|
878 |
apply (simp_all, safe)
|
|
879 |
txt{*K4 splits into subcases*}
|
|
880 |
(*apply simp_all*)
|
|
881 |
prefer 4 apply (blast dest!: authK_not_AKcryptSK)
|
|
882 |
txt{*servK is fresh and so could not have been used, by
|
|
883 |
@{text new_keys_not_used}*}
|
|
884 |
prefer 2
|
|
885 |
apply (force dest!: Crypt_imp_invKey_keysFor simp add: AKcryptSK_def)
|
|
886 |
txt{*Others by freshness*}
|
|
887 |
apply (blast+)
|
|
888 |
done
|
|
889 |
|
|
890 |
lemma not_different_AKcryptSK:
|
|
891 |
"\<lbrakk> AKcryptSK authK servK evs;
|
|
892 |
authK' \<noteq> authK; evs \<in> kerbV \<rbrakk>
|
|
893 |
\<Longrightarrow> \<not> AKcryptSK authK' servK evs \<and> servK \<in> symKeys"
|
|
894 |
apply (simp add: AKcryptSK_def)
|
|
895 |
apply (blast dest: unique_servKeys Says_Tgs_message_form)
|
|
896 |
done
|
|
897 |
|
|
898 |
lemma AKcryptSK_not_AKcryptSK:
|
|
899 |
"\<lbrakk> AKcryptSK authK servK evs; evs \<in> kerbV \<rbrakk>
|
|
900 |
\<Longrightarrow> \<not> AKcryptSK servK K evs"
|
|
901 |
apply (erule rev_mp)
|
|
902 |
apply (erule kerbV.induct)
|
|
903 |
apply (frule_tac [7] Says_ticket_parts)
|
|
904 |
apply (frule_tac [5] Says_ticket_parts, simp_all, safe)
|
|
905 |
txt{*K4 splits into subcases*}
|
|
906 |
apply simp_all
|
|
907 |
prefer 4 apply (blast dest!: authK_not_AKcryptSK)
|
|
908 |
txt{*servK is fresh and so could not have been used, by
|
|
909 |
@{text new_keys_not_used}*}
|
|
910 |
prefer 2
|
|
911 |
apply (force dest!: Crypt_imp_invKey_keysFor simp add: AKcryptSK_def)
|
|
912 |
txt{*Others by freshness*}
|
|
913 |
apply (blast+)
|
|
914 |
done
|
|
915 |
|
|
916 |
text{*The only session keys that can be found with the help of session keys are
|
|
917 |
those sent by Tgs in step K4. *}
|
|
918 |
|
|
919 |
text{*We take some pains to express the property
|
|
920 |
as a logical equivalence so that the simplifier can apply it.*}
|
|
921 |
lemma Key_analz_image_Key_lemma:
|
|
922 |
"P \<longrightarrow> (Key K \<in> analz (Key`KK Un H)) \<longrightarrow> (K:KK | Key K \<in> analz H)
|
|
923 |
\<Longrightarrow>
|
|
924 |
P \<longrightarrow> (Key K \<in> analz (Key`KK Un H)) = (K:KK | Key K \<in> analz H)"
|
|
925 |
by (blast intro: analz_mono [THEN subsetD])
|
|
926 |
|
|
927 |
|
|
928 |
lemma AKcryptSK_analz_insert:
|
|
929 |
"\<lbrakk> AKcryptSK K K' evs; K \<in> symKeys; evs \<in> kerbV \<rbrakk>
|
|
930 |
\<Longrightarrow> Key K' \<in> analz (insert (Key K) (spies evs))"
|
|
931 |
apply (simp add: AKcryptSK_def, clarify)
|
|
932 |
apply (drule Says_imp_spies [THEN analz.Inj, THEN analz_insertI], auto)
|
|
933 |
done
|
|
934 |
|
|
935 |
lemma authKeys_are_not_AKcryptSK:
|
|
936 |
"\<lbrakk> K \<in> authKeys evs Un range shrK; evs \<in> kerbV \<rbrakk>
|
|
937 |
\<Longrightarrow> \<forall>SK. \<not> AKcryptSK SK K evs \<and> K \<in> symKeys"
|
|
938 |
apply (simp add: authKeys_def AKcryptSK_def)
|
|
939 |
apply (blast dest: Says_Kas_message_form Says_Tgs_message_form)
|
|
940 |
done
|
|
941 |
|
|
942 |
lemma not_authKeys_not_AKcryptSK:
|
|
943 |
"\<lbrakk> K \<notin> authKeys evs;
|
|
944 |
K \<notin> range shrK; evs \<in> kerbV \<rbrakk>
|
|
945 |
\<Longrightarrow> \<forall>SK. \<not> AKcryptSK K SK evs"
|
|
946 |
apply (simp add: AKcryptSK_def)
|
|
947 |
apply (blast dest: Says_Tgs_message_form)
|
|
948 |
done
|
|
949 |
|
|
950 |
|
|
951 |
subsection{*Secrecy Theorems*}
|
|
952 |
|
|
953 |
text{*For the Oops2 case of the next theorem*}
|
|
954 |
lemma Oops2_not_AKcryptSK:
|
|
955 |
"\<lbrakk> evs \<in> kerbV;
|
|
956 |
Says Tgs A \<lbrace>Crypt authK
|
|
957 |
\<lbrace>Key servK, Agent B, Number Ts\<rbrace>, servTicket\<rbrace>
|
|
958 |
\<in> set evs \<rbrakk>
|
|
959 |
\<Longrightarrow> \<not> AKcryptSK servK SK evs"
|
|
960 |
apply (blast dest: AKcryptSKI AKcryptSK_not_AKcryptSK)
|
|
961 |
done
|
|
962 |
|
|
963 |
text{* Big simplification law for keys SK that are not crypted by keys in KK
|
|
964 |
It helps prove three, otherwise hard, facts about keys. These facts are
|
|
965 |
exploited as simplification laws for analz, and also "limit the damage"
|
|
966 |
in case of loss of a key to the spy. See ESORICS98.*}
|
|
967 |
lemma Key_analz_image_Key [rule_format (no_asm)]:
|
|
968 |
"evs \<in> kerbV \<Longrightarrow>
|
|
969 |
(\<forall>SK KK. SK \<in> symKeys & KK <= -(range shrK) \<longrightarrow>
|
|
970 |
(\<forall>K \<in> KK. \<not> AKcryptSK K SK evs) \<longrightarrow>
|
|
971 |
(Key SK \<in> analz (Key`KK Un (spies evs))) =
|
|
972 |
(SK \<in> KK | Key SK \<in> analz (spies evs)))"
|
|
973 |
apply (erule kerbV.induct)
|
|
974 |
apply (frule_tac [10] Oops_range_spies2)
|
|
975 |
apply (frule_tac [9] Oops_range_spies1)
|
|
976 |
(*Used to apply Says_tgs_message form, which is no longer available.
|
|
977 |
Instead\<dots>*)
|
|
978 |
apply (drule_tac [7] Says_ticket_analz)
|
|
979 |
(*Used to apply Says_kas_message form, which is no longer available.
|
|
980 |
Instead\<dots>*)
|
|
981 |
apply (drule_tac [5] Says_ticket_analz)
|
|
982 |
apply (safe del: impI intro!: Key_analz_image_Key_lemma [THEN impI])
|
|
983 |
txt{*Case-splits for Oops1 and message 5: the negated case simplifies using
|
|
984 |
the induction hypothesis*}
|
|
985 |
apply (case_tac [9] "AKcryptSK authK SK evsO1")
|
|
986 |
apply (case_tac [7] "AKcryptSK servK SK evs5")
|
|
987 |
apply (simp_all del: image_insert
|
|
988 |
add: analz_image_freshK_simps AKcryptSK_Says shrK_not_AKcryptSK
|
|
989 |
Oops2_not_AKcryptSK Auth_fresh_not_AKcryptSK
|
|
990 |
Serv_fresh_not_AKcryptSK Says_Tgs_AKcryptSK Spy_analz_shrK)
|
|
991 |
txt{*Fake*}
|
|
992 |
apply spy_analz
|
|
993 |
txt{*K2*}
|
|
994 |
apply blast
|
|
995 |
txt{*Cases K3 and K5 solved by the simplifier thanks to the ticket being in
|
|
996 |
analz - this strategy is new wrt version IV*}
|
|
997 |
txt{*K4*}
|
|
998 |
apply (blast dest!: authK_not_AKcryptSK)
|
|
999 |
txt{*Oops1*}
|
|
1000 |
apply clarify
|
|
1001 |
apply simp
|
|
1002 |
apply (blast dest!: AKcryptSK_analz_insert)
|
|
1003 |
done
|
|
1004 |
|
|
1005 |
text{* First simplification law for analz: no session keys encrypt
|
|
1006 |
authentication keys or shared keys. *}
|
|
1007 |
lemma analz_insert_freshK1:
|
|
1008 |
"\<lbrakk> evs \<in> kerbV; K \<in> authKeys evs Un range shrK;
|
|
1009 |
SesKey \<notin> range shrK \<rbrakk>
|
|
1010 |
\<Longrightarrow> (Key K \<in> analz (insert (Key SesKey) (spies evs))) =
|
|
1011 |
(K = SesKey | Key K \<in> analz (spies evs))"
|
|
1012 |
apply (frule authKeys_are_not_AKcryptSK, assumption)
|
|
1013 |
apply (simp del: image_insert
|
|
1014 |
add: analz_image_freshK_simps add: Key_analz_image_Key)
|
|
1015 |
done
|
|
1016 |
|
|
1017 |
|
|
1018 |
text{* Second simplification law for analz: no service keys encrypt any other keys.*}
|
|
1019 |
lemma analz_insert_freshK2:
|
|
1020 |
"\<lbrakk> evs \<in> kerbV; servK \<notin> (authKeys evs); servK \<notin> range shrK;
|
|
1021 |
K \<in> symKeys \<rbrakk>
|
|
1022 |
\<Longrightarrow> (Key K \<in> analz (insert (Key servK) (spies evs))) =
|
|
1023 |
(K = servK | Key K \<in> analz (spies evs))"
|
|
1024 |
apply (frule not_authKeys_not_AKcryptSK, assumption, assumption)
|
|
1025 |
apply (simp del: image_insert
|
|
1026 |
add: analz_image_freshK_simps add: Key_analz_image_Key)
|
|
1027 |
done
|
|
1028 |
|
|
1029 |
|
|
1030 |
text{* Third simplification law for analz: only one authentication key encrypts a certain service key.*}
|
|
1031 |
|
|
1032 |
lemma analz_insert_freshK3:
|
|
1033 |
"\<lbrakk> AKcryptSK authK servK evs;
|
|
1034 |
authK' \<noteq> authK; authK' \<notin> range shrK; evs \<in> kerbV \<rbrakk>
|
|
1035 |
\<Longrightarrow> (Key servK \<in> analz (insert (Key authK') (spies evs))) =
|
|
1036 |
(servK = authK' | Key servK \<in> analz (spies evs))"
|
|
1037 |
apply (drule_tac authK' = authK' in not_different_AKcryptSK, blast, assumption)
|
|
1038 |
apply (simp del: image_insert
|
|
1039 |
add: analz_image_freshK_simps add: Key_analz_image_Key)
|
|
1040 |
done
|
|
1041 |
|
|
1042 |
lemma analz_insert_freshK3_bis:
|
|
1043 |
"\<lbrakk> Says Tgs A \<lbrace>Crypt authK \<lbrace>Key servK, Agent B, Number Ts\<rbrace>, servTicket\<rbrace>
|
|
1044 |
\<in> set evs;
|
|
1045 |
authK \<noteq> authK'; authK' \<notin> range shrK; evs \<in> kerbV \<rbrakk>
|
|
1046 |
\<Longrightarrow> (Key servK \<in> analz (insert (Key authK') (spies evs))) =
|
|
1047 |
(servK = authK' | Key servK \<in> analz (spies evs))"
|
|
1048 |
apply (frule AKcryptSKI, assumption)
|
|
1049 |
apply (simp add: analz_insert_freshK3)
|
|
1050 |
done
|
|
1051 |
|
|
1052 |
text{*a weakness of the protocol*}
|
|
1053 |
lemma authK_compromises_servK:
|
|
1054 |
"\<lbrakk> Says Tgs A \<lbrace>Crypt authK \<lbrace>Key servK, Agent B, Number Ts\<rbrace>, servTicket\<rbrace>
|
|
1055 |
\<in> set evs; authK \<in> symKeys;
|
|
1056 |
Key authK \<in> analz (spies evs); evs \<in> kerbV \<rbrakk>
|
|
1057 |
\<Longrightarrow> Key servK \<in> analz (spies evs)"
|
|
1058 |
apply (force dest: Says_imp_spies [THEN analz.Inj, THEN analz.Fst, THEN analz.Decrypt, THEN analz.Fst])
|
|
1059 |
done
|
|
1060 |
|
|
1061 |
text{*lemma @{text servK_notin_authKeysD} not needed in version V*}
|
|
1062 |
|
|
1063 |
text{*If Spy sees the Authentication Key sent in msg K2, then
|
|
1064 |
the Key has expired.*}
|
|
1065 |
lemma Confidentiality_Kas_lemma [rule_format]:
|
|
1066 |
"\<lbrakk> authK \<in> symKeys; A \<notin> bad; evs \<in> kerbV \<rbrakk>
|
|
1067 |
\<Longrightarrow> Says Kas A
|
|
1068 |
\<lbrace>Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta\<rbrace>,
|
|
1069 |
Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Number Ta\<rbrace>\<rbrace>
|
|
1070 |
\<in> set evs \<longrightarrow>
|
|
1071 |
Key authK \<in> analz (spies evs) \<longrightarrow>
|
|
1072 |
expiredAK Ta evs"
|
|
1073 |
apply (erule kerbV.induct)
|
|
1074 |
apply (frule_tac [10] Oops_range_spies2)
|
|
1075 |
apply (frule_tac [9] Oops_range_spies1)
|
|
1076 |
apply (frule_tac [7] Says_ticket_analz)
|
|
1077 |
apply (frule_tac [5] Says_ticket_analz)
|
|
1078 |
apply (safe del: impI conjI impCE)
|
|
1079 |
apply (simp_all (no_asm_simp) add: Says_Kas_message_form less_SucI analz_insert_eq not_parts_not_analz analz_insert_freshK1 pushes)
|
|
1080 |
txt{*Fake*}
|
|
1081 |
apply spy_analz
|
|
1082 |
txt{*K2*}
|
|
1083 |
apply blast
|
|
1084 |
txt{*K4*}
|
|
1085 |
apply blast
|
|
1086 |
txt{*Oops1*}
|
|
1087 |
apply (blast dest!: unique_authKeys intro: less_SucI)
|
|
1088 |
txt{*Oops2*}
|
|
1089 |
apply (blast dest: Says_Tgs_message_form Says_Kas_message_form)
|
|
1090 |
done
|
|
1091 |
|
|
1092 |
lemma Confidentiality_Kas:
|
|
1093 |
"\<lbrakk> Says Kas A
|
|
1094 |
\<lbrace>Crypt Ka \<lbrace>Key authK, Agent Tgs, Number Ta\<rbrace>, authTicket\<rbrace>
|
|
1095 |
\<in> set evs;
|
|
1096 |
\<not> expiredAK Ta evs;
|
|
1097 |
A \<notin> bad; evs \<in> kerbV \<rbrakk>
|
|
1098 |
\<Longrightarrow> Key authK \<notin> analz (spies evs)"
|
|
1099 |
apply (blast dest: Says_Kas_message_form Confidentiality_Kas_lemma)
|
|
1100 |
done
|
|
1101 |
|
|
1102 |
text{*If Spy sees the Service Key sent in msg K4, then
|
|
1103 |
the Key has expired.*}
|
|
1104 |
|
|
1105 |
lemma Confidentiality_lemma [rule_format]:
|
|
1106 |
"\<lbrakk> Says Tgs A
|
|
1107 |
\<lbrace>Crypt authK \<lbrace>Key servK, Agent B, Number Ts\<rbrace>,
|
|
1108 |
Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace>\<rbrace>
|
|
1109 |
\<in> set evs;
|
|
1110 |
Key authK \<notin> analz (spies evs);
|
|
1111 |
servK \<in> symKeys;
|
|
1112 |
A \<notin> bad; B \<notin> bad; evs \<in> kerbV \<rbrakk>
|
|
1113 |
\<Longrightarrow> Key servK \<in> analz (spies evs) \<longrightarrow>
|
|
1114 |
expiredSK Ts evs"
|
|
1115 |
apply (erule rev_mp)
|
|
1116 |
apply (erule rev_mp)
|
|
1117 |
apply (erule kerbV.induct)
|
|
1118 |
apply (rule_tac [9] impI)+;
|
|
1119 |
--{*The Oops1 case is unusual: must simplify
|
|
1120 |
@{term "Authkey \<notin> analz (spies (ev#evs))"}, not letting
|
|
1121 |
@{text analz_mono_contra} weaken it to
|
|
1122 |
@{term "Authkey \<notin> analz (spies evs)"},
|
|
1123 |
for we then conclude @{term "authK \<noteq> authKa"}.*}
|
|
1124 |
apply analz_mono_contra
|
|
1125 |
apply (frule_tac [10] Oops_range_spies2)
|
|
1126 |
apply (frule_tac [9] Oops_range_spies1)
|
|
1127 |
apply (frule_tac [7] Says_ticket_analz)
|
|
1128 |
apply (frule_tac [5] Says_ticket_analz)
|
|
1129 |
apply (safe del: impI conjI impCE)
|
|
1130 |
apply (simp_all add: less_SucI new_keys_not_analzd Says_Kas_message_form Says_Tgs_message_form analz_insert_eq not_parts_not_analz analz_insert_freshK1 analz_insert_freshK2 analz_insert_freshK3_bis pushes)
|
|
1131 |
txt{*Fake*}
|
|
1132 |
apply spy_analz
|
|
1133 |
txt{*K2*}
|
|
1134 |
apply (blast intro: parts_insertI less_SucI)
|
|
1135 |
txt{*K4*}
|
|
1136 |
apply (blast dest: authTicket_authentic Confidentiality_Kas)
|
|
1137 |
txt{*Oops1*}
|
|
1138 |
apply (blast dest: Says_Kas_message_form Says_Tgs_message_form intro: less_SucI)
|
|
1139 |
txt{*Oops2*}
|
|
1140 |
apply (blast dest: Says_imp_spies [THEN parts.Inj] Key_unique_SesKey intro: less_SucI)
|
|
1141 |
done
|
|
1142 |
|
|
1143 |
|
|
1144 |
text{* In the real world Tgs can't check wheter authK is secure! *}
|
|
1145 |
lemma Confidentiality_Tgs:
|
|
1146 |
"\<lbrakk> Says Tgs A
|
|
1147 |
\<lbrace>Crypt authK \<lbrace>Key servK, Agent B, Number Ts\<rbrace>, servTicket\<rbrace>
|
|
1148 |
\<in> set evs;
|
|
1149 |
Key authK \<notin> analz (spies evs);
|
|
1150 |
\<not> expiredSK Ts evs;
|
|
1151 |
A \<notin> bad; B \<notin> bad; evs \<in> kerbV \<rbrakk>
|
|
1152 |
\<Longrightarrow> Key servK \<notin> analz (spies evs)"
|
|
1153 |
apply (blast dest: Says_Tgs_message_form Confidentiality_lemma)
|
|
1154 |
done
|
|
1155 |
|
|
1156 |
text{* In the real world Tgs CAN check what Kas sends! *}
|
|
1157 |
lemma Confidentiality_Tgs_bis:
|
|
1158 |
"\<lbrakk> Says Kas A
|
|
1159 |
\<lbrace>Crypt Ka \<lbrace>Key authK, Agent Tgs, Number Ta\<rbrace>, authTicket\<rbrace>
|
|
1160 |
\<in> set evs;
|
|
1161 |
Says Tgs A
|
|
1162 |
\<lbrace>Crypt authK \<lbrace>Key servK, Agent B, Number Ts\<rbrace>, servTicket\<rbrace>
|
|
1163 |
\<in> set evs;
|
|
1164 |
\<not> expiredAK Ta evs; \<not> expiredSK Ts evs;
|
|
1165 |
A \<notin> bad; B \<notin> bad; evs \<in> kerbV \<rbrakk>
|
|
1166 |
\<Longrightarrow> Key servK \<notin> analz (spies evs)"
|
|
1167 |
apply (blast dest!: Confidentiality_Kas Confidentiality_Tgs)
|
|
1168 |
done
|
|
1169 |
|
|
1170 |
text{*Most general form*}
|
|
1171 |
lemmas Confidentiality_Tgs_ter = authTicket_authentic [THEN Confidentiality_Tgs_bis]
|
|
1172 |
|
|
1173 |
lemmas Confidentiality_Auth_A = authK_authentic [THEN exE, THEN Confidentiality_Kas]
|
|
1174 |
|
|
1175 |
text{*Needs a confidentiality guarantee, hence moved here.
|
|
1176 |
Authenticity of servK for A*}
|
|
1177 |
lemma servK_authentic_bis_r:
|
|
1178 |
"\<lbrakk> Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta\<rbrace>
|
|
1179 |
\<in> parts (spies evs);
|
|
1180 |
Crypt authK \<lbrace>Key servK, Agent B, Number Ts\<rbrace>
|
|
1181 |
\<in> parts (spies evs);
|
|
1182 |
\<not> expiredAK Ta evs; A \<notin> bad; evs \<in> kerbV \<rbrakk>
|
|
1183 |
\<Longrightarrow> Says Tgs A \<lbrace>Crypt authK \<lbrace>Key servK, Agent B, Number Ts\<rbrace>,
|
|
1184 |
Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace> \<rbrace>
|
|
1185 |
\<in> set evs"
|
|
1186 |
apply (frule authK_authentic, assumption, assumption)
|
|
1187 |
apply (erule exE)
|
|
1188 |
apply (drule Confidentiality_Auth_A, assumption, assumption)
|
|
1189 |
apply (blast, assumption, assumption, assumption)
|
|
1190 |
apply (blast dest: servK_authentic_ter)
|
|
1191 |
done
|
|
1192 |
|
|
1193 |
lemma Confidentiality_Serv_A:
|
|
1194 |
"\<lbrakk> Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta\<rbrace>
|
|
1195 |
\<in> parts (spies evs);
|
|
1196 |
Crypt authK \<lbrace>Key servK, Agent B, Number Ts\<rbrace>
|
|
1197 |
\<in> parts (spies evs);
|
|
1198 |
\<not> expiredAK Ta evs; \<not> expiredSK Ts evs;
|
|
1199 |
A \<notin> bad; B \<notin> bad; B \<noteq> Tgs; evs \<in> kerbV \<rbrakk>
|
|
1200 |
\<Longrightarrow> Key servK \<notin> analz (spies evs)"
|
|
1201 |
apply (drule authK_authentic, assumption, assumption)
|
|
1202 |
apply (blast dest: Confidentiality_Kas Says_Kas_message_form servK_authentic_ter Confidentiality_Tgs_bis)
|
|
1203 |
done
|
|
1204 |
|
|
1205 |
lemma Confidentiality_B:
|
|
1206 |
"\<lbrakk> Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace>
|
|
1207 |
\<in> parts (spies evs);
|
|
1208 |
Crypt authK \<lbrace>Key servK, Agent B, Number Ts\<rbrace>
|
|
1209 |
\<in> parts (spies evs);
|
|
1210 |
Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta\<rbrace>
|
|
1211 |
\<in> parts (spies evs);
|
|
1212 |
\<not> expiredSK Ts evs; \<not> expiredAK Ta evs;
|
|
1213 |
A \<notin> bad; B \<notin> bad; B \<noteq> Tgs; evs \<in> kerbV \<rbrakk>
|
|
1214 |
\<Longrightarrow> Key servK \<notin> analz (spies evs)"
|
|
1215 |
apply (frule authK_authentic)
|
|
1216 |
apply (erule_tac [3] exE)
|
|
1217 |
apply (frule_tac [3] Confidentiality_Kas)
|
|
1218 |
apply (frule_tac [6] servTicket_authentic, auto)
|
|
1219 |
apply (blast dest!: Confidentiality_Tgs_bis dest: Says_Kas_message_form servK_authentic unique_servKeys unique_authKeys)
|
|
1220 |
done
|
|
1221 |
|
|
1222 |
lemma u_Confidentiality_B:
|
|
1223 |
"\<lbrakk> Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace>
|
|
1224 |
\<in> parts (spies evs);
|
|
1225 |
\<not> expiredSK Ts evs;
|
|
1226 |
A \<notin> bad; B \<notin> bad; B \<noteq> Tgs; evs \<in> kerbV \<rbrakk>
|
|
1227 |
\<Longrightarrow> Key servK \<notin> analz (spies evs)"
|
|
1228 |
apply (blast dest: u_servTicket_authentic u_NotexpiredSK_NotexpiredAK Confidentiality_Tgs_bis)
|
|
1229 |
done
|
|
1230 |
|
|
1231 |
|
|
1232 |
|
|
1233 |
subsection{*Parties authentication: each party verifies "the identity of
|
|
1234 |
another party who generated some data" (quoted from Neuman and Ts'o).*}
|
|
1235 |
|
|
1236 |
text{*These guarantees don't assess whether two parties agree on
|
|
1237 |
the same session key: sending a message containing a key
|
|
1238 |
doesn't a priori state knowledge of the key.*}
|
|
1239 |
|
|
1240 |
|
|
1241 |
text{*These didn't have existential form in version IV*}
|
|
1242 |
lemma B_authenticates_A:
|
|
1243 |
"\<lbrakk> Crypt servK \<lbrace>Agent A, Number T3\<rbrace> \<in> parts (spies evs);
|
|
1244 |
Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace>
|
|
1245 |
\<in> parts (spies evs);
|
|
1246 |
Key servK \<notin> analz (spies evs);
|
|
1247 |
A \<notin> bad; B \<notin> bad; B \<noteq> Tgs; evs \<in> kerbV \<rbrakk>
|
|
1248 |
\<Longrightarrow> \<exists> ST. Says A B \<lbrace>ST, Crypt servK \<lbrace>Agent A, Number T3\<rbrace> \<rbrace> \<in> set evs"
|
|
1249 |
apply (blast dest: servTicket_authentic_Tgs intro: Says_K5)
|
|
1250 |
done
|
|
1251 |
|
|
1252 |
text{*The second assumption tells B what kind of key servK is.*}
|
|
1253 |
lemma B_authenticates_A_r:
|
|
1254 |
"\<lbrakk> Crypt servK \<lbrace>Agent A, Number T3\<rbrace> \<in> parts (spies evs);
|
|
1255 |
Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace>
|
|
1256 |
\<in> parts (spies evs);
|
|
1257 |
Crypt authK \<lbrace>Key servK, Agent B, Number Ts\<rbrace>
|
|
1258 |
\<in> parts (spies evs);
|
|
1259 |
Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta\<rbrace>
|
|
1260 |
\<in> parts (spies evs);
|
|
1261 |
\<not> expiredSK Ts evs; \<not> expiredAK Ta evs;
|
|
1262 |
B \<noteq> Tgs; A \<notin> bad; B \<notin> bad; evs \<in> kerbV \<rbrakk>
|
|
1263 |
\<Longrightarrow> \<exists> ST. Says A B \<lbrace>ST, Crypt servK \<lbrace>Agent A, Number T3\<rbrace> \<rbrace> \<in> set evs"
|
|
1264 |
apply (blast intro: Says_K5 dest: Confidentiality_B servTicket_authentic_Tgs)
|
|
1265 |
done
|
|
1266 |
|
|
1267 |
text{* @{text u_B_authenticates_A} would be the same as @{text B_authenticates_A} because the
|
|
1268 |
servK confidentiality assumption is yet unrelaxed*}
|
|
1269 |
|
|
1270 |
lemma u_B_authenticates_A_r:
|
|
1271 |
"\<lbrakk> Crypt servK \<lbrace>Agent A, Number T3\<rbrace> \<in> parts (spies evs);
|
|
1272 |
Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace>
|
|
1273 |
\<in> parts (spies evs);
|
|
1274 |
\<not> expiredSK Ts evs;
|
|
1275 |
B \<noteq> Tgs; A \<notin> bad; B \<notin> bad; evs \<in> kerbV \<rbrakk>
|
|
1276 |
\<Longrightarrow> \<exists> ST. Says A B \<lbrace>ST, Crypt servK \<lbrace>Agent A, Number T3\<rbrace> \<rbrace> \<in> set evs"
|
|
1277 |
apply (blast intro: Says_K5 dest: u_Confidentiality_B servTicket_authentic_Tgs)
|
|
1278 |
done
|
|
1279 |
|
|
1280 |
lemma A_authenticates_B:
|
|
1281 |
"\<lbrakk> Crypt servK (Number T3) \<in> parts (spies evs);
|
|
1282 |
Crypt authK \<lbrace>Key servK, Agent B, Number Ts\<rbrace>
|
|
1283 |
\<in> parts (spies evs);
|
|
1284 |
Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta\<rbrace>
|
|
1285 |
\<in> parts (spies evs);
|
|
1286 |
Key authK \<notin> analz (spies evs); Key servK \<notin> analz (spies evs);
|
|
1287 |
A \<notin> bad; B \<notin> bad; evs \<in> kerbV \<rbrakk>
|
|
1288 |
\<Longrightarrow> Says B A (Crypt servK (Number T3)) \<in> set evs"
|
|
1289 |
apply (frule authK_authentic)
|
|
1290 |
apply assumption+
|
|
1291 |
apply (frule servK_authentic)
|
|
1292 |
prefer 2 apply (blast dest: authK_authentic Says_Kas_message_form)
|
|
1293 |
apply assumption+
|
|
1294 |
apply clarify
|
|
1295 |
apply (blast dest: K4_imp_K2 Key_unique_SesKey intro!: Says_K6)
|
|
1296 |
(*Single command proof: much slower!
|
|
1297 |
apply (blast dest: authK_authentic servK_authentic Says_Kas_message_form Key_unique_SesKey K4_imp_K2 intro!: Says_K6)
|
|
1298 |
*)
|
|
1299 |
done
|
|
1300 |
|
|
1301 |
lemma A_authenticates_B_r:
|
|
1302 |
"\<lbrakk> Crypt servK (Number T3) \<in> parts (spies evs);
|
|
1303 |
Crypt authK \<lbrace>Key servK, Agent B, Number Ts\<rbrace>
|
|
1304 |
\<in> parts (spies evs);
|
|
1305 |
Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta\<rbrace>
|
|
1306 |
\<in> parts (spies evs);
|
|
1307 |
\<not> expiredAK Ta evs; \<not> expiredSK Ts evs;
|
|
1308 |
A \<notin> bad; B \<notin> bad; evs \<in> kerbV \<rbrakk>
|
|
1309 |
\<Longrightarrow> Says B A (Crypt servK (Number T3)) \<in> set evs"
|
|
1310 |
apply (frule authK_authentic)
|
|
1311 |
apply (erule_tac [3] exE)
|
|
1312 |
apply (frule_tac [3] Says_Kas_message_form)
|
|
1313 |
apply (frule_tac [4] Confidentiality_Kas)
|
|
1314 |
apply (frule_tac [7] servK_authentic)
|
|
1315 |
prefer 8 apply blast
|
|
1316 |
apply (erule_tac [9] exE)
|
|
1317 |
apply (erule_tac [9] exE)
|
|
1318 |
apply (frule_tac [9] K4_imp_K2)
|
|
1319 |
apply assumption+
|
|
1320 |
apply (blast dest: Key_unique_SesKey intro!: Says_K6 dest: Confidentiality_Tgs
|
|
1321 |
)
|
|
1322 |
done
|
|
1323 |
|
|
1324 |
|
|
1325 |
|
|
1326 |
|
|
1327 |
subsection{*Parties' knowledge of session keys.
|
|
1328 |
An agent knows a session key if he used it to issue a cipher. These
|
|
1329 |
guarantees can be interpreted both in terms of key distribution
|
|
1330 |
and of non-injective agreement on the session key.*}
|
|
1331 |
|
|
1332 |
lemma Kas_Issues_A:
|
|
1333 |
"\<lbrakk> Says Kas A \<lbrace>Crypt (shrK A) \<lbrace>Key authK, Peer, Ta\<rbrace>, authTicket\<rbrace> \<in> set evs;
|
|
1334 |
evs \<in> kerbV \<rbrakk>
|
|
1335 |
\<Longrightarrow> Kas Issues A with (Crypt (shrK A) \<lbrace>Key authK, Peer, Ta\<rbrace>)
|
|
1336 |
on evs"
|
|
1337 |
apply (simp (no_asm) add: Issues_def)
|
|
1338 |
apply (rule exI)
|
|
1339 |
apply (rule conjI, assumption)
|
|
1340 |
apply (simp (no_asm))
|
|
1341 |
apply (erule rev_mp)
|
|
1342 |
apply (erule kerbV.induct)
|
|
1343 |
apply (frule_tac [5] Says_ticket_parts)
|
|
1344 |
apply (frule_tac [7] Says_ticket_parts)
|
|
1345 |
apply (simp_all (no_asm_simp) add: all_conj_distrib)
|
|
1346 |
txt{*K2*}
|
|
1347 |
apply (simp add: takeWhile_tail)
|
|
1348 |
apply (blast dest: authK_authentic parts_spies_takeWhile_mono [THEN subsetD] parts_spies_evs_revD2 [THEN subsetD])
|
|
1349 |
done
|
|
1350 |
|
|
1351 |
lemma A_authenticates_and_keydist_to_Kas:
|
|
1352 |
"\<lbrakk> Crypt (shrK A) \<lbrace>Key authK, Peer, Ta\<rbrace> \<in> parts (spies evs);
|
|
1353 |
A \<notin> bad; evs \<in> kerbV \<rbrakk>
|
|
1354 |
\<Longrightarrow> Kas Issues A with (Crypt (shrK A) \<lbrace>Key authK, Peer, Ta\<rbrace>)
|
|
1355 |
on evs"
|
|
1356 |
by (blast dest!: authK_authentic Kas_Issues_A)
|
|
1357 |
|
|
1358 |
lemma Tgs_Issues_A:
|
|
1359 |
"\<lbrakk> Says Tgs A \<lbrace>Crypt authK \<lbrace>Key servK, Agent B, Number Ts\<rbrace>, servTicket\<rbrace>
|
|
1360 |
\<in> set evs;
|
|
1361 |
Key authK \<notin> analz (spies evs); evs \<in> kerbV \<rbrakk>
|
|
1362 |
\<Longrightarrow> Tgs Issues A with
|
|
1363 |
(Crypt authK \<lbrace>Key servK, Agent B, Number Ts\<rbrace>) on evs"
|
|
1364 |
apply (simp (no_asm) add: Issues_def)
|
|
1365 |
apply (rule exI)
|
|
1366 |
apply (rule conjI, assumption)
|
|
1367 |
apply (simp (no_asm))
|
|
1368 |
apply (erule rev_mp)
|
|
1369 |
apply (erule rev_mp)
|
|
1370 |
apply (erule kerbV.induct, analz_mono_contra)
|
|
1371 |
apply (frule_tac [5] Says_ticket_parts)
|
|
1372 |
apply (frule_tac [7] Says_ticket_parts)
|
|
1373 |
apply (simp_all (no_asm_simp) add: all_conj_distrib)
|
|
1374 |
apply (simp add: takeWhile_tail)
|
|
1375 |
(*Last two thms installed only to derive authK \<notin> range shrK*)
|
|
1376 |
apply (blast dest: servK_authentic parts_spies_takeWhile_mono [THEN subsetD]
|
|
1377 |
parts_spies_evs_revD2 [THEN subsetD] authTicket_authentic
|
|
1378 |
Says_Kas_message_form)
|
|
1379 |
done
|
|
1380 |
|
|
1381 |
lemma A_authenticates_and_keydist_to_Tgs:
|
|
1382 |
"\<lbrakk> Crypt authK \<lbrace>Key servK, Agent B, Number Ts\<rbrace>
|
|
1383 |
\<in> parts (spies evs);
|
|
1384 |
Key authK \<notin> analz (spies evs); B \<noteq> Tgs; evs \<in> kerbV \<rbrakk>
|
|
1385 |
\<Longrightarrow> \<exists>A. Tgs Issues A with
|
|
1386 |
(Crypt authK \<lbrace>Key servK, Agent B, Number Ts\<rbrace>) on evs"
|
|
1387 |
by (blast dest: Tgs_Issues_A servK_authentic_bis)
|
|
1388 |
|
|
1389 |
lemma B_Issues_A:
|
|
1390 |
"\<lbrakk> Says B A (Crypt servK (Number T3)) \<in> set evs;
|
|
1391 |
Key servK \<notin> analz (spies evs);
|
|
1392 |
A \<notin> bad; B \<notin> bad; B \<noteq> Tgs; evs \<in> kerbV \<rbrakk>
|
|
1393 |
\<Longrightarrow> B Issues A with (Crypt servK (Number T3)) on evs"
|
|
1394 |
apply (simp (no_asm) add: Issues_def)
|
|
1395 |
apply (rule exI)
|
|
1396 |
apply (rule conjI, assumption)
|
|
1397 |
apply (simp (no_asm))
|
|
1398 |
apply (erule rev_mp)
|
|
1399 |
apply (erule rev_mp)
|
|
1400 |
apply (erule kerbV.induct, analz_mono_contra)
|
|
1401 |
apply (simp_all (no_asm_simp) add: all_conj_distrib)
|
|
1402 |
apply blast
|
|
1403 |
txt{*K6 requires numerous lemmas*}
|
|
1404 |
apply (simp add: takeWhile_tail)
|
|
1405 |
apply (blast intro: Says_K6 dest: servTicket_authentic
|
|
1406 |
parts_spies_takeWhile_mono [THEN subsetD]
|
|
1407 |
parts_spies_evs_revD2 [THEN subsetD])
|
|
1408 |
done
|
|
1409 |
|
|
1410 |
lemma A_authenticates_and_keydist_to_B:
|
|
1411 |
"\<lbrakk> Crypt servK (Number T3) \<in> parts (spies evs);
|
|
1412 |
Crypt authK \<lbrace>Key servK, Agent B, Number Ts\<rbrace>
|
|
1413 |
\<in> parts (spies evs);
|
|
1414 |
Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta\<rbrace>
|
|
1415 |
\<in> parts (spies evs);
|
|
1416 |
Key authK \<notin> analz (spies evs); Key servK \<notin> analz (spies evs);
|
|
1417 |
A \<notin> bad; B \<notin> bad; B \<noteq> Tgs; evs \<in> kerbV \<rbrakk>
|
|
1418 |
\<Longrightarrow> B Issues A with (Crypt servK (Number T3)) on evs"
|
|
1419 |
by (blast dest!: A_authenticates_B B_Issues_A)
|
|
1420 |
|
|
1421 |
|
|
1422 |
(*Must use \<le> rather than =, otherwise it cannot be proved inductively!*)
|
|
1423 |
(*This is too strong for version V but would hold for version IV if only B
|
|
1424 |
in K6 said a fresh timestamp.
|
|
1425 |
lemma honest_never_says_newer_timestamp:
|
|
1426 |
"\<lbrakk> (CT evs) \<le> T ; Number T \<in> parts {X}; evs \<in> kerbV \<rbrakk>
|
|
1427 |
\<Longrightarrow> \<forall> A B. A \<noteq> Spy \<longrightarrow> Says A B X \<notin> set evs"
|
|
1428 |
apply (erule rev_mp)
|
|
1429 |
apply (erule kerbV.induct)
|
|
1430 |
apply (simp_all)
|
|
1431 |
apply force
|
|
1432 |
apply force
|
|
1433 |
txt{*clarifying case K3*}
|
|
1434 |
apply (rule impI)
|
|
1435 |
apply (rule impI)
|
|
1436 |
apply (frule Suc_leD)
|
|
1437 |
apply (clarify)
|
|
1438 |
txt{*cannot solve K3 or K5 because the spy might send CT evs as authTicket
|
|
1439 |
or servTicket, which the honest agent would forward*}
|
|
1440 |
prefer 2 apply force
|
|
1441 |
prefer 4 apply force
|
|
1442 |
prefer 4 apply force
|
|
1443 |
txt{*cannot solve K6 unless B updates the timestamp - rather than bouncing T3*}
|
|
1444 |
oops
|
|
1445 |
*)
|
|
1446 |
|
|
1447 |
|
|
1448 |
text{*But can prove a less general fact conerning only authenticators!*}
|
|
1449 |
lemma honest_never_says_newer_timestamp_in_auth:
|
|
1450 |
"\<lbrakk> (CT evs) \<le> T; Number T \<in> parts {X}; A \<notin> bad; evs \<in> kerbV \<rbrakk>
|
|
1451 |
\<Longrightarrow> Says A B \<lbrace>Y, X\<rbrace> \<notin> set evs"
|
|
1452 |
apply (erule rev_mp)
|
|
1453 |
apply (erule kerbV.induct)
|
|
1454 |
apply (simp_all)
|
|
1455 |
apply force+
|
|
1456 |
done
|
|
1457 |
|
|
1458 |
lemma honest_never_says_current_timestamp_in_auth:
|
|
1459 |
"\<lbrakk> (CT evs) = T; Number T \<in> parts {X}; A \<notin> bad; evs \<in> kerbV \<rbrakk>
|
|
1460 |
\<Longrightarrow> Says A B \<lbrace>Y, X\<rbrace> \<notin> set evs"
|
|
1461 |
apply (frule eq_imp_le)
|
|
1462 |
apply (blast dest: honest_never_says_newer_timestamp_in_auth)
|
|
1463 |
done
|
|
1464 |
|
|
1465 |
|
|
1466 |
|
|
1467 |
lemma A_Issues_B:
|
|
1468 |
"\<lbrakk> Says A B \<lbrace>ST, Crypt servK \<lbrace>Agent A, Number T3\<rbrace>\<rbrace> \<in> set evs;
|
|
1469 |
Key servK \<notin> analz (spies evs);
|
|
1470 |
B \<noteq> Tgs; A \<notin> bad; B \<notin> bad; evs \<in> kerbV \<rbrakk>
|
|
1471 |
\<Longrightarrow> A Issues B with (Crypt servK \<lbrace>Agent A, Number T3\<rbrace>) on evs"
|
|
1472 |
apply (simp (no_asm) add: Issues_def)
|
|
1473 |
apply (rule exI)
|
|
1474 |
apply (rule conjI, assumption)
|
|
1475 |
apply (simp (no_asm))
|
|
1476 |
apply (erule rev_mp)
|
|
1477 |
apply (erule rev_mp)
|
|
1478 |
apply (erule kerbV.induct, analz_mono_contra)
|
|
1479 |
apply (frule_tac [7] Says_ticket_parts)
|
|
1480 |
apply (frule_tac [5] Says_ticket_parts)
|
|
1481 |
apply (simp_all (no_asm_simp))
|
|
1482 |
txt{*K5*}
|
|
1483 |
apply auto
|
|
1484 |
apply (simp add: takeWhile_tail)
|
|
1485 |
txt{*Level 15: case study necessary because the assumption doesn't state
|
|
1486 |
the form of servTicket. The guarantee becomes stronger.*}
|
|
1487 |
prefer 2 apply (simp add: takeWhile_tail)
|
|
1488 |
(**This single command of version IV...
|
|
1489 |
apply (blast dest: Says_imp_spies [THEN analz.Inj, THEN analz_Decrypt']
|
|
1490 |
K3_imp_K2 K4_trustworthy'
|
|
1491 |
parts_spies_takeWhile_mono [THEN subsetD]
|
|
1492 |
parts_spies_evs_revD2 [THEN subsetD]
|
|
1493 |
intro: Says_Auth)
|
|
1494 |
...expands as follows - including extra exE because of new form of lemmas*)
|
|
1495 |
apply (frule K3_imp_K2, assumption, assumption, erule exE, erule exE)
|
|
1496 |
apply (case_tac "Key authK \<in> analz (spies evs5)")
|
|
1497 |
apply (drule Says_imp_knows_Spy [THEN analz.Inj, THEN analz.Fst, THEN analz_Decrypt', THEN analz.Fst], assumption, assumption, simp)
|
|
1498 |
apply (frule K3_imp_K2, assumption, assumption, erule exE, erule exE)
|
|
1499 |
apply (drule Says_imp_knows_Spy [THEN parts.Inj, THEN parts.Fst])
|
|
1500 |
apply (frule servK_authentic_ter, blast, assumption+)
|
|
1501 |
apply (drule parts_spies_takeWhile_mono [THEN subsetD])
|
|
1502 |
apply (drule parts_spies_evs_revD2 [THEN subsetD])
|
|
1503 |
txt{* @{term Says_K5} closes the proof in version IV because it is clear which
|
|
1504 |
servTicket an authenticator appears with in msg 5. In version V an authenticator can appear with any item that the spy could replace the servTicket with*}
|
|
1505 |
apply (frule Says_K5, blast, assumption, assumption, assumption, assumption, erule exE)
|
|
1506 |
txt{*We need to state that an honest agent wouldn't send the wrong timestamp
|
|
1507 |
within an authenticator, wathever it is paired with*}
|
|
1508 |
apply (simp add: honest_never_says_current_timestamp_in_auth)
|
|
1509 |
done
|
|
1510 |
|
|
1511 |
lemma B_authenticates_and_keydist_to_A:
|
|
1512 |
"\<lbrakk> Crypt servK \<lbrace>Agent A, Number T3\<rbrace> \<in> parts (spies evs);
|
|
1513 |
Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace>
|
|
1514 |
\<in> parts (spies evs);
|
|
1515 |
Key servK \<notin> analz (spies evs);
|
|
1516 |
B \<noteq> Tgs; A \<notin> bad; B \<notin> bad; evs \<in> kerbV \<rbrakk>
|
|
1517 |
\<Longrightarrow> A Issues B with (Crypt servK \<lbrace>Agent A, Number T3\<rbrace>) on evs"
|
|
1518 |
by (blast dest: B_authenticates_A A_Issues_B)
|
|
1519 |
|
|
1520 |
|
|
1521 |
|
|
1522 |
subsection{*
|
|
1523 |
Novel guarantees, never studied before. Because honest agents always say
|
|
1524 |
the right timestamp in authenticators, we can prove unicity guarantees based
|
|
1525 |
exactly on timestamps. Classical unicity guarantees are based on nonces.
|
|
1526 |
Of course assuming the agent to be different from the Spy, rather than not in
|
|
1527 |
bad, would suffice below. Similar guarantees must also hold of
|
|
1528 |
Kerberos IV.*}
|
|
1529 |
|
|
1530 |
text{*Notice that an honest agent can send the same timestamp on two
|
|
1531 |
different traces of the same length, but not on the same trace!*}
|
|
1532 |
|
|
1533 |
lemma unique_timestamp_authenticator1:
|
|
1534 |
"\<lbrakk> Says A Kas \<lbrace>Agent A, Agent Tgs, Number T1\<rbrace> \<in> set evs;
|
|
1535 |
Says A Kas' \<lbrace>Agent A, Agent Tgs', Number T1\<rbrace> \<in> set evs;
|
|
1536 |
A \<notin>bad; evs \<in> kerbV \<rbrakk>
|
|
1537 |
\<Longrightarrow> Kas=Kas' \<and> Tgs=Tgs'"
|
|
1538 |
apply (erule rev_mp, erule rev_mp)
|
|
1539 |
apply (erule kerbV.induct)
|
|
1540 |
apply (simp_all, blast)
|
|
1541 |
apply auto
|
|
1542 |
apply (simp_all add: honest_never_says_current_timestamp_in_auth)
|
|
1543 |
done
|
|
1544 |
|
|
1545 |
lemma unique_timestamp_authenticator2:
|
|
1546 |
"\<lbrakk> Says A Tgs \<lbrace>AT, Crypt AK \<lbrace>Agent A, Number T2\<rbrace>, Agent B\<rbrace> \<in> set evs;
|
|
1547 |
Says A Tgs' \<lbrace>AT', Crypt AK' \<lbrace>Agent A, Number T2\<rbrace>, Agent B'\<rbrace> \<in> set evs;
|
|
1548 |
A \<notin>bad; evs \<in> kerbV \<rbrakk>
|
|
1549 |
\<Longrightarrow> Tgs=Tgs' \<and> AT=AT' \<and> AK=AK' \<and> B=B'"
|
|
1550 |
apply (erule rev_mp, erule rev_mp)
|
|
1551 |
apply (erule kerbV.induct)
|
|
1552 |
apply (simp_all, blast)
|
|
1553 |
apply auto
|
|
1554 |
apply (simp_all add: honest_never_says_current_timestamp_in_auth)
|
|
1555 |
done
|
|
1556 |
|
|
1557 |
lemma unique_timestamp_authenticator3:
|
|
1558 |
"\<lbrakk> Says A B \<lbrace>ST, Crypt SK \<lbrace>Agent A, Number T\<rbrace>\<rbrace> \<in> set evs;
|
|
1559 |
Says A B' \<lbrace>ST', Crypt SK' \<lbrace>Agent A, Number T\<rbrace>\<rbrace> \<in> set evs;
|
|
1560 |
A \<notin>bad; evs \<in> kerbV \<rbrakk>
|
|
1561 |
\<Longrightarrow> B=B' \<and> ST=ST' \<and> SK=SK'"
|
|
1562 |
apply (erule rev_mp, erule rev_mp)
|
|
1563 |
apply (erule kerbV.induct)
|
|
1564 |
apply (simp_all, blast)
|
|
1565 |
apply (auto simp add: honest_never_says_current_timestamp_in_auth)
|
|
1566 |
done
|
|
1567 |
|
|
1568 |
text{*The second part of the message is treated as an authenticator by the last
|
|
1569 |
simplification step, even if it is not an authenticator!*}
|
|
1570 |
lemma unique_timestamp_authticket:
|
|
1571 |
"\<lbrakk> Says Kas A \<lbrace>X, Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key AK, T\<rbrace>\<rbrace> \<in> set evs;
|
|
1572 |
Says Kas A' \<lbrace>X', Crypt (shrK Tgs') \<lbrace>Agent A', Agent Tgs', Key AK', T\<rbrace>\<rbrace> \<in> set evs;
|
|
1573 |
evs \<in> kerbV \<rbrakk>
|
|
1574 |
\<Longrightarrow> A=A' \<and> X=X' \<and> Tgs=Tgs' \<and> AK=AK'"
|
|
1575 |
apply (erule rev_mp, erule rev_mp)
|
|
1576 |
apply (erule kerbV.induct)
|
|
1577 |
apply (auto simp add: honest_never_says_current_timestamp_in_auth)
|
|
1578 |
done
|
|
1579 |
|
|
1580 |
text{*The second part of the message is treated as an authenticator by the last
|
|
1581 |
simplification step, even if it is not an authenticator!*}
|
|
1582 |
lemma unique_timestamp_servticket:
|
|
1583 |
"\<lbrakk> Says Tgs A \<lbrace>X, Crypt (shrK B) \<lbrace>Agent A, Agent B, Key SK, T\<rbrace>\<rbrace> \<in> set evs;
|
|
1584 |
Says Tgs A' \<lbrace>X', Crypt (shrK B') \<lbrace>Agent A', Agent B', Key SK', T\<rbrace>\<rbrace> \<in> set evs;
|
|
1585 |
evs \<in> kerbV \<rbrakk>
|
|
1586 |
\<Longrightarrow> A=A' \<and> X=X' \<and> B=B' \<and> SK=SK'"
|
|
1587 |
apply (erule rev_mp, erule rev_mp)
|
|
1588 |
apply (erule kerbV.induct)
|
|
1589 |
apply (auto simp add: honest_never_says_current_timestamp_in_auth)
|
|
1590 |
done
|
|
1591 |
|
|
1592 |
(*Uses assumption K6's assumption that B \<noteq> Kas, otherwise B should say
|
|
1593 |
fresh timestamp*)
|
|
1594 |
lemma Kas_never_says_newer_timestamp:
|
|
1595 |
"\<lbrakk> (CT evs) \<le> T; Number T \<in> parts {X}; evs \<in> kerbV \<rbrakk>
|
|
1596 |
\<Longrightarrow> \<forall> A. Says Kas A X \<notin> set evs"
|
|
1597 |
apply (erule rev_mp)
|
|
1598 |
apply (erule kerbV.induct, auto)
|
|
1599 |
done
|
|
1600 |
|
|
1601 |
lemma Kas_never_says_current_timestamp:
|
|
1602 |
"\<lbrakk> (CT evs) = T; Number T \<in> parts {X}; evs \<in> kerbV \<rbrakk>
|
|
1603 |
\<Longrightarrow> \<forall> A. Says Kas A X \<notin> set evs"
|
|
1604 |
apply (frule eq_imp_le)
|
|
1605 |
apply (blast dest: Kas_never_says_newer_timestamp)
|
|
1606 |
done
|
|
1607 |
|
|
1608 |
lemma unique_timestamp_msg2:
|
|
1609 |
"\<lbrakk> Says Kas A \<lbrace>Crypt (shrK A) \<lbrace>Key AK, Agent Tgs, T\<rbrace>, AT\<rbrace> \<in> set evs;
|
|
1610 |
Says Kas A' \<lbrace>Crypt (shrK A') \<lbrace>Key AK', Agent Tgs', T\<rbrace>, AT'\<rbrace> \<in> set evs;
|
|
1611 |
evs \<in> kerbV \<rbrakk>
|
|
1612 |
\<Longrightarrow> A=A' \<and> AK=AK' \<and> Tgs=Tgs' \<and> AT=AT'"
|
|
1613 |
apply (erule rev_mp, erule rev_mp)
|
|
1614 |
apply (erule kerbV.induct)
|
|
1615 |
apply (auto simp add: Kas_never_says_current_timestamp)
|
|
1616 |
done
|
|
1617 |
|
|
1618 |
(*Uses assumption K6's assumption that B \<noteq> Tgs, otherwise B should say
|
|
1619 |
fresh timestamp*)
|
|
1620 |
lemma Tgs_never_says_newer_timestamp:
|
|
1621 |
"\<lbrakk> (CT evs) \<le> T; Number T \<in> parts {X}; evs \<in> kerbV \<rbrakk>
|
|
1622 |
\<Longrightarrow> \<forall> A. Says Tgs A X \<notin> set evs"
|
|
1623 |
apply (erule rev_mp)
|
|
1624 |
apply (erule kerbV.induct, auto)
|
|
1625 |
done
|
|
1626 |
|
|
1627 |
lemma Tgs_never_says_current_timestamp:
|
|
1628 |
"\<lbrakk> (CT evs) = T; Number T \<in> parts {X}; evs \<in> kerbV \<rbrakk>
|
|
1629 |
\<Longrightarrow> \<forall> A. Says Tgs A X \<notin> set evs"
|
|
1630 |
apply (frule eq_imp_le)
|
|
1631 |
apply (blast dest: Tgs_never_says_newer_timestamp)
|
|
1632 |
done
|
|
1633 |
|
|
1634 |
|
|
1635 |
lemma unique_timestamp_msg4:
|
|
1636 |
"\<lbrakk> Says Tgs A \<lbrace>Crypt (shrK A) \<lbrace>Key SK, Agent B, T\<rbrace>, ST\<rbrace> \<in> set evs;
|
|
1637 |
Says Tgs A' \<lbrace>Crypt (shrK A') \<lbrace>Key SK', Agent B', T\<rbrace>, ST'\<rbrace> \<in> set evs;
|
|
1638 |
evs \<in> kerbV \<rbrakk>
|
|
1639 |
\<Longrightarrow> A=A' \<and> SK=SK' \<and> B=B' \<and> ST=ST'"
|
|
1640 |
apply (erule rev_mp, erule rev_mp)
|
|
1641 |
apply (erule kerbV.induct)
|
|
1642 |
apply (auto simp add: Tgs_never_says_current_timestamp)
|
|
1643 |
done
|
|
1644 |
|
|
1645 |
end
|