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