author | paulson |
Fri, 20 Dec 1996 10:23:48 +0100 | |
changeset 2454 | 92f43ed48935 |
parent 2451 | ce85a2aafc7a |
child 2516 | 4d68fbe6378b |
permissions | -rw-r--r-- |
2090 | 1 |
(* Title: HOL/Auth/OtwayRees |
2 |
ID: $Id$ |
|
3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
|
4 |
Copyright 1996 University of Cambridge |
|
5 |
||
6 |
Inductive relation "otway" for the Otway-Rees protocol. |
|
7 |
||
8 |
Simplified version with minimal encryption but explicit messages |
|
9 |
||
10 |
From page 11 of |
|
11 |
Abadi and Needham. Prudent Engineering Practice for Cryptographic Protocols. |
|
12 |
IEEE Trans. SE 22 (1), 1996 |
|
13 |
*) |
|
14 |
||
15 |
open OtwayRees_AN; |
|
16 |
||
17 |
proof_timing:=true; |
|
18 |
HOL_quantifiers := false; |
|
19 |
||
20 |
||
2331 | 21 |
(*A "possibility property": there are traces that reach the end*) |
2090 | 22 |
goal thy |
2331 | 23 |
"!!A B. [| A ~= B; A ~= Server; B ~= Server |] \ |
24 |
\ ==> EX K. EX NA. EX evs: otway lost. \ |
|
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
25 |
\ Says B A (Crypt (shrK A) {|Nonce NA, Agent A, Agent B, Key K|}) \ |
2090 | 26 |
\ : set_of_list evs"; |
27 |
by (REPEAT (resolve_tac [exI,bexI] 1)); |
|
28 |
by (rtac (otway.Nil RS otway.OR1 RS otway.OR2 RS otway.OR3 RS otway.OR4) 2); |
|
29 |
by (ALLGOALS (simp_tac (!simpset setsolver safe_solver))); |
|
30 |
by (REPEAT_FIRST (resolve_tac [refl, conjI])); |
|
31 |
by (REPEAT_FIRST (fast_tac (!claset addss (!simpset setsolver safe_solver)))); |
|
32 |
result(); |
|
33 |
||
34 |
||
35 |
(**** Inductive proofs about otway ****) |
|
36 |
||
2106 | 37 |
(*Monotonicity*) |
2090 | 38 |
goal thy "!!evs. lost' <= lost ==> otway lost' <= otway lost"; |
39 |
by (rtac subsetI 1); |
|
40 |
by (etac otway.induct 1); |
|
41 |
by (REPEAT_FIRST |
|
42 |
(best_tac (!claset addIs (impOfSubs (sees_mono RS analz_mono RS synth_mono) |
|
43 |
:: otway.intrs)))); |
|
44 |
qed "otway_mono"; |
|
45 |
||
46 |
(*Nobody sends themselves messages*) |
|
47 |
goal thy "!!evs. evs : otway lost ==> ALL A X. Says A A X ~: set_of_list evs"; |
|
48 |
by (etac otway.induct 1); |
|
49 |
by (Auto_tac()); |
|
50 |
qed_spec_mp "not_Says_to_self"; |
|
51 |
Addsimps [not_Says_to_self]; |
|
52 |
AddSEs [not_Says_to_self RSN (2, rev_notE)]; |
|
53 |
||
54 |
||
55 |
(** For reasoning about the encrypted portion of messages **) |
|
56 |
||
57 |
goal thy "!!evs. Says S B {|X, X'|} : set_of_list evs ==> \ |
|
58 |
\ X : analz (sees lost Spy evs)"; |
|
59 |
by (fast_tac (!claset addSDs [Says_imp_sees_Spy RS analz.Inj]) 1); |
|
60 |
qed "OR4_analz_sees_Spy"; |
|
61 |
||
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
62 |
goal thy "!!evs. Says Server B {|X, Crypt K' {|NB, a, Agent B, K|}|} \ |
2131 | 63 |
\ : set_of_list evs ==> K : parts (sees lost Spy evs)"; |
2090 | 64 |
by (fast_tac (!claset addSEs partsEs |
65 |
addSDs [Says_imp_sees_Spy RS parts.Inj]) 1); |
|
2131 | 66 |
qed "Oops_parts_sees_Spy"; |
2090 | 67 |
|
2131 | 68 |
(*OR4_analz_sees_Spy lets us treat those cases using the same |
2090 | 69 |
argument as for the Fake case. This is possible for most, but not all, |
2131 | 70 |
proofs, since Fake messages originate from the Spy. *) |
2090 | 71 |
|
72 |
bind_thm ("OR4_parts_sees_Spy", |
|
73 |
OR4_analz_sees_Spy RS (impOfSubs analz_subset_parts)); |
|
74 |
||
75 |
(*We instantiate the variable to "lost". Leaving it as a Var makes proofs |
|
76 |
harder to complete, since simplification does less for us.*) |
|
77 |
val parts_Fake_tac = |
|
78 |
forw_inst_tac [("lost","lost")] OR4_parts_sees_Spy 6 THEN |
|
2131 | 79 |
forw_inst_tac [("lost","lost")] Oops_parts_sees_Spy 7; |
2090 | 80 |
|
81 |
(*For proving the easier theorems about X ~: parts (sees lost Spy evs) *) |
|
82 |
fun parts_induct_tac i = SELECT_GOAL |
|
83 |
(DETERM (etac otway.induct 1 THEN parts_Fake_tac THEN |
|
84 |
(*Fake message*) |
|
85 |
TRY (best_tac (!claset addDs [impOfSubs analz_subset_parts, |
|
86 |
impOfSubs Fake_parts_insert] |
|
87 |
addss (!simpset)) 2)) THEN |
|
88 |
(*Base case*) |
|
89 |
fast_tac (!claset addss (!simpset)) 1 THEN |
|
90 |
ALLGOALS Asm_simp_tac) i; |
|
91 |
||
92 |
(** Theorems of the form X ~: parts (sees lost Spy evs) imply that NOBODY |
|
93 |
sends messages containing X! **) |
|
94 |
||
95 |
(*Spy never sees another agent's shared key! (unless it's lost at start)*) |
|
96 |
goal thy |
|
2131 | 97 |
"!!evs. evs : otway lost \ |
98 |
\ ==> (Key (shrK A) : parts (sees lost Spy evs)) = (A : lost)"; |
|
2090 | 99 |
by (parts_induct_tac 1); |
100 |
by (Auto_tac()); |
|
2131 | 101 |
qed "Spy_see_shrK"; |
102 |
Addsimps [Spy_see_shrK]; |
|
2090 | 103 |
|
2131 | 104 |
goal thy |
105 |
"!!evs. evs : otway lost \ |
|
106 |
\ ==> (Key (shrK A) : analz (sees lost Spy evs)) = (A : lost)"; |
|
107 |
by (auto_tac(!claset addDs [impOfSubs analz_subset_parts], !simpset)); |
|
108 |
qed "Spy_analz_shrK"; |
|
109 |
Addsimps [Spy_analz_shrK]; |
|
2090 | 110 |
|
2131 | 111 |
goal thy "!!A. [| Key (shrK A) : parts (sees lost Spy evs); \ |
112 |
\ evs : otway lost |] ==> A:lost"; |
|
113 |
by (fast_tac (!claset addDs [Spy_see_shrK]) 1); |
|
114 |
qed "Spy_see_shrK_D"; |
|
2090 | 115 |
|
2131 | 116 |
bind_thm ("Spy_analz_shrK_D", analz_subset_parts RS subsetD RS Spy_see_shrK_D); |
117 |
AddSDs [Spy_see_shrK_D, Spy_analz_shrK_D]; |
|
2090 | 118 |
|
119 |
||
120 |
(*** Future keys can't be seen or used! ***) |
|
121 |
||
2160 | 122 |
(*Nobody can have SEEN keys that will be generated in the future. *) |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2417
diff
changeset
|
123 |
goal thy "!!i. evs : otway lost ==> \ |
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2417
diff
changeset
|
124 |
\ length evs <= i --> Key(newK i) ~: parts (sees lost Spy evs)"; |
2090 | 125 |
by (parts_induct_tac 1); |
2264
f298678bd54a
Weaking of injectivity assumptions for newK and newN:
paulson
parents:
2166
diff
changeset
|
126 |
by (REPEAT_FIRST (best_tac (!claset addEs [leD RS notE] |
f298678bd54a
Weaking of injectivity assumptions for newK and newN:
paulson
parents:
2166
diff
changeset
|
127 |
addDs [impOfSubs analz_subset_parts, |
2090 | 128 |
impOfSubs parts_insert_subset_Un, |
129 |
Suc_leD] |
|
130 |
addss (!simpset)))); |
|
2160 | 131 |
qed_spec_mp "new_keys_not_seen"; |
2090 | 132 |
Addsimps [new_keys_not_seen]; |
133 |
||
2160 | 134 |
(*Variant: old messages must contain old keys!*) |
2090 | 135 |
goal thy |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2417
diff
changeset
|
136 |
"!!evs. [| Says A B X : set_of_list evs; \ |
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2417
diff
changeset
|
137 |
\ Key (newK i) : parts {X}; \ |
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2417
diff
changeset
|
138 |
\ evs : otway lost \ |
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2417
diff
changeset
|
139 |
\ |] ==> i < length evs"; |
2090 | 140 |
by (rtac ccontr 1); |
141 |
by (dtac leI 1); |
|
142 |
by (fast_tac (!claset addSDs [new_keys_not_seen, Says_imp_sees_Spy] |
|
143 |
addIs [impOfSubs parts_mono]) 1); |
|
144 |
qed "Says_imp_old_keys"; |
|
145 |
||
146 |
||
147 |
(*Nobody can have USED keys that will be generated in the future. |
|
148 |
...very like new_keys_not_seen*) |
|
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2417
diff
changeset
|
149 |
goal thy "!!i. evs : otway lost ==> \ |
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2417
diff
changeset
|
150 |
\ length evs <= i --> newK i ~: keysFor (parts (sees lost Spy evs))"; |
2090 | 151 |
by (parts_induct_tac 1); |
2375 | 152 |
(*Fake, OR4: these messages send unknown (X) components*) |
153 |
by (EVERY |
|
154 |
(map |
|
155 |
(best_tac |
|
2090 | 156 |
(!claset addDs [impOfSubs (analz_subset_parts RS keysFor_mono), |
157 |
impOfSubs (parts_insert_subset_Un RS keysFor_mono), |
|
158 |
Suc_leD] |
|
159 |
addEs [new_keys_not_seen RS not_parts_not_analz RSN(2,rev_notE)] |
|
2375 | 160 |
addss (!simpset))) [5,1])); |
161 |
(*Remaining subgoals*) |
|
162 |
by (REPEAT (fast_tac (!claset addDs [Suc_leD] addss (!simpset)) 1)); |
|
2160 | 163 |
qed_spec_mp "new_keys_not_used"; |
2090 | 164 |
|
165 |
bind_thm ("new_keys_not_analzd", |
|
166 |
[analz_subset_parts RS keysFor_mono, |
|
167 |
new_keys_not_used] MRS contra_subsetD); |
|
168 |
||
169 |
Addsimps [new_keys_not_used, new_keys_not_analzd]; |
|
170 |
||
171 |
||
172 |
||
173 |
(*** Proofs involving analz ***) |
|
174 |
||
2131 | 175 |
(*Describes the form of K and NA when the Server sends this message.*) |
2090 | 176 |
goal thy |
2131 | 177 |
"!!evs. [| Says Server B \ |
2331 | 178 |
\ {|Crypt (shrK A) {|NA, Agent A, Agent B, K|}, \ |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
179 |
\ Crypt (shrK B) {|NB, Agent A, Agent B, K|}|} : set_of_list evs; \ |
2331 | 180 |
\ evs : otway lost |] \ |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2417
diff
changeset
|
181 |
\ ==> (EX n. K = Key(newK n)) & \ |
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2417
diff
changeset
|
182 |
\ (EX i. NA = Nonce i) & (EX j. NB = Nonce j)"; |
2131 | 183 |
by (etac rev_mp 1); |
184 |
by (etac otway.induct 1); |
|
185 |
by (ALLGOALS (fast_tac (!claset addss (!simpset)))); |
|
186 |
qed "Says_Server_message_form"; |
|
2090 | 187 |
|
188 |
||
189 |
(*For proofs involving analz. We again instantiate the variable to "lost".*) |
|
190 |
val analz_Fake_tac = |
|
191 |
dres_inst_tac [("lost","lost")] OR4_analz_sees_Spy 6 THEN |
|
2131 | 192 |
forw_inst_tac [("lost","lost")] Says_Server_message_form 7 THEN |
193 |
assume_tac 7 THEN Full_simp_tac 7 THEN |
|
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2417
diff
changeset
|
194 |
REPEAT ((eresolve_tac [exE, conjE] ORELSE' hyp_subst_tac) 7); |
2090 | 195 |
|
196 |
||
197 |
(**** |
|
198 |
The following is to prove theorems of the form |
|
199 |
||
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2417
diff
changeset
|
200 |
Key K : analz (insert (Key (newK i)) (sees lost Spy evs)) ==> |
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2417
diff
changeset
|
201 |
Key K : analz (sees lost Spy evs) |
2090 | 202 |
|
203 |
A more general formula must be proved inductively. |
|
204 |
||
205 |
****) |
|
206 |
||
207 |
||
208 |
(** Session keys are not used to encrypt other session keys **) |
|
209 |
||
210 |
(*The equality makes the induction hypothesis easier to apply*) |
|
211 |
goal thy |
|
2331 | 212 |
"!!evs. evs : otway lost ==> \ |
2090 | 213 |
\ ALL K E. (Key K : analz (Key``(newK``E) Un (sees lost Spy evs))) = \ |
214 |
\ (K : newK``E | Key K : analz (sees lost Spy evs))"; |
|
215 |
by (etac otway.induct 1); |
|
216 |
by analz_Fake_tac; |
|
217 |
by (REPEAT_FIRST (ares_tac [allI, analz_image_newK_lemma])); |
|
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2417
diff
changeset
|
218 |
by (ALLGOALS (*Takes 18 secs*) |
2090 | 219 |
(asm_simp_tac |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2417
diff
changeset
|
220 |
(!simpset addsimps [Un_assoc RS sym, |
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2417
diff
changeset
|
221 |
insert_Key_singleton, insert_Key_image, pushKey_newK] |
2090 | 222 |
setloop split_tac [expand_if]))); |
2131 | 223 |
(*OR4, Fake*) |
224 |
by (EVERY (map spy_analz_tac [4,2])); |
|
225 |
(*Oops, OR3, Base*) |
|
2090 | 226 |
by (REPEAT (fast_tac (!claset addIs [image_eqI] addss (!simpset)) 1)); |
227 |
qed_spec_mp "analz_image_newK"; |
|
228 |
||
229 |
||
230 |
goal thy |
|
2331 | 231 |
"!!evs. evs : otway lost ==> \ |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2417
diff
changeset
|
232 |
\ Key K : analz (insert (Key(newK i)) (sees lost Spy evs)) = \ |
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2417
diff
changeset
|
233 |
\ (K = newK i | Key K : analz (sees lost Spy evs))"; |
2090 | 234 |
by (asm_simp_tac (HOL_ss addsimps [pushKey_newK, analz_image_newK, |
235 |
insert_Key_singleton]) 1); |
|
236 |
by (Fast_tac 1); |
|
237 |
qed "analz_insert_Key_newK"; |
|
238 |
||
239 |
||
240 |
(*** The Key K uniquely identifies the Server's message. **) |
|
241 |
||
242 |
goal thy |
|
2331 | 243 |
"!!evs. evs : otway lost ==> \ |
2090 | 244 |
\ EX A' B' NA' NB'. ALL A B NA NB. \ |
245 |
\ Says Server B \ |
|
2331 | 246 |
\ {|Crypt (shrK A) {|NA, Agent A, Agent B, K|}, \ |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
247 |
\ Crypt (shrK B) {|NB, Agent A, Agent B, K|}|} : set_of_list evs \ |
2090 | 248 |
\ --> A=A' & B=B' & NA=NA' & NB=NB'"; |
249 |
by (etac otway.induct 1); |
|
250 |
by (ALLGOALS (asm_simp_tac (!simpset addsimps [all_conj_distrib]))); |
|
251 |
by (Step_tac 1); |
|
252 |
(*Remaining cases: OR3 and OR4*) |
|
253 |
by (ex_strip_tac 2); |
|
254 |
by (Fast_tac 2); |
|
255 |
by (expand_case_tac "K = ?y" 1); |
|
256 |
by (REPEAT (ares_tac [refl,exI,impI,conjI] 2)); |
|
257 |
(*...we assume X is a very new message, and handle this case by contradiction*) |
|
258 |
by (fast_tac (!claset addEs [Says_imp_old_keys RS less_irrefl] |
|
259 |
delrules [conjI] (*prevent split-up into 4 subgoals*) |
|
260 |
addss (!simpset addsimps [parts_insertI])) 1); |
|
261 |
val lemma = result(); |
|
262 |
||
263 |
||
264 |
goal thy |
|
265 |
"!!evs. [| Says Server B \ |
|
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
266 |
\ {|Crypt (shrK A) {|NA, Agent A, Agent B, K|}, \ |
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
267 |
\ Crypt (shrK B) {|NB, Agent A, Agent B, K|}|} \ |
2090 | 268 |
\ : set_of_list evs; \ |
269 |
\ Says Server B' \ |
|
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
270 |
\ {|Crypt (shrK A') {|NA', Agent A', Agent B', K|}, \ |
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
271 |
\ Crypt (shrK B') {|NB', Agent A', Agent B', K|}|} \ |
2090 | 272 |
\ : set_of_list evs; \ |
273 |
\ evs : otway lost |] \ |
|
274 |
\ ==> A=A' & B=B' & NA=NA' & NB=NB'"; |
|
2417 | 275 |
by (prove_unique_tac lemma 1); |
2090 | 276 |
qed "unique_session_keys"; |
277 |
||
278 |
||
279 |
||
280 |
(**** Authenticity properties relating to NA ****) |
|
281 |
||
282 |
(*If the encrypted message appears then it originated with the Server!*) |
|
283 |
goal thy |
|
284 |
"!!evs. [| A ~: lost; evs : otway lost |] \ |
|
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
285 |
\ ==> Crypt (shrK A) {|NA, Agent A, Agent B, Key K|} \ |
2090 | 286 |
\ : parts (sees lost Spy evs) \ |
2331 | 287 |
\ --> (EX NB. Says Server B \ |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
288 |
\ {|Crypt (shrK A) {|NA, Agent A, Agent B, Key K|}, \ |
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
289 |
\ Crypt (shrK B) {|NB, Agent A, Agent B, Key K|}|} \ |
2090 | 290 |
\ : set_of_list evs)"; |
291 |
by (parts_induct_tac 1); |
|
292 |
by (ALLGOALS (asm_simp_tac (!simpset addsimps [ex_disj_distrib]))); |
|
293 |
(*OR3*) |
|
294 |
by (Fast_tac 1); |
|
295 |
qed_spec_mp "NA_Crypt_imp_Server_msg"; |
|
296 |
||
297 |
||
2454 | 298 |
(*Corollary: if A receives B's OR4 message then it originated with the Server. |
299 |
Freshness may be inferred from nonce NA.*) |
|
2090 | 300 |
goal thy |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
301 |
"!!evs. [| Says B' A (Crypt (shrK A) {|NA, Agent A, Agent B, Key K|}) \ |
2090 | 302 |
\ : set_of_list evs; \ |
303 |
\ A ~: lost; evs : otway lost |] \ |
|
304 |
\ ==> EX NB. Says Server B \ |
|
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
305 |
\ {|Crypt (shrK A) {|NA, Agent A, Agent B, Key K|}, \ |
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
306 |
\ Crypt (shrK B) {|NB, Agent A, Agent B, Key K|}|} \ |
2090 | 307 |
\ : set_of_list evs"; |
308 |
by (fast_tac (!claset addSIs [NA_Crypt_imp_Server_msg] |
|
309 |
addEs partsEs |
|
310 |
addDs [Says_imp_sees_Spy RS parts.Inj]) 1); |
|
2331 | 311 |
qed "A_trusts_OR4"; |
2090 | 312 |
|
313 |
||
314 |
(** Crucial secrecy property: Spy does not see the keys sent in msg OR3 |
|
315 |
Does not in itself guarantee security: an attack could violate |
|
316 |
the premises, e.g. by having A=Spy **) |
|
317 |
||
318 |
goal thy |
|
2166 | 319 |
"!!evs. [| A ~: lost; B ~: lost; evs : otway lost |] \ |
2090 | 320 |
\ ==> Says Server B \ |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
321 |
\ {|Crypt (shrK A) {|NA, Agent A, Agent B, Key K|}, \ |
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
322 |
\ Crypt (shrK B) {|NB, Agent A, Agent B, Key K|}|} \ |
2090 | 323 |
\ : set_of_list evs --> \ |
2131 | 324 |
\ Says B Spy {|NA, NB, Key K|} ~: set_of_list evs --> \ |
2090 | 325 |
\ Key K ~: analz (sees lost Spy evs)"; |
326 |
by (etac otway.induct 1); |
|
327 |
by analz_Fake_tac; |
|
328 |
by (ALLGOALS |
|
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2417
diff
changeset
|
329 |
(asm_simp_tac (!simpset addsimps [not_parts_not_analz, |
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2417
diff
changeset
|
330 |
analz_insert_Key_newK] |
2375 | 331 |
setloop split_tac [expand_if]))); |
2090 | 332 |
(*OR3*) |
2166 | 333 |
by (fast_tac (!claset addEs [Says_imp_old_keys RS less_irrefl] |
2090 | 334 |
addss (!simpset addsimps [parts_insert2])) 2); |
2131 | 335 |
(*OR4, Fake*) |
2375 | 336 |
by (REPEAT_FIRST spy_analz_tac); |
2131 | 337 |
(*Oops*) |
2090 | 338 |
by (fast_tac (!claset addDs [unique_session_keys] addss (!simpset)) 1); |
339 |
val lemma = result() RS mp RS mp RSN(2,rev_notE); |
|
340 |
||
341 |
goal thy |
|
2106 | 342 |
"!!evs. [| Says Server B \ |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
343 |
\ {|Crypt (shrK A) {|NA, Agent A, Agent B, K|}, \ |
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
344 |
\ Crypt (shrK B) {|NB, Agent A, Agent B, K|}|} : set_of_list evs;\ |
2131 | 345 |
\ Says B Spy {|NA, NB, K|} ~: set_of_list evs; \ |
346 |
\ A ~: lost; B ~: lost; evs : otway lost |] \ |
|
2090 | 347 |
\ ==> K ~: analz (sees lost Spy evs)"; |
348 |
by (forward_tac [Says_Server_message_form] 1 THEN assume_tac 1); |
|
349 |
by (fast_tac (!claset addSEs [lemma]) 1); |
|
350 |
qed "Spy_not_see_encrypted_key"; |
|
351 |
||
352 |
||
353 |
goal thy |
|
2106 | 354 |
"!!evs. [| C ~: {A,B,Server}; \ |
355 |
\ Says Server B \ |
|
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
356 |
\ {|Crypt (shrK A) {|NA, Agent A, Agent B, K|}, \ |
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
357 |
\ Crypt (shrK B) {|NB, Agent A, Agent B, K|}|} : set_of_list evs;\ |
2131 | 358 |
\ Says B Spy {|NA, NB, K|} ~: set_of_list evs; \ |
2090 | 359 |
\ A ~: lost; B ~: lost; evs : otway lost |] \ |
360 |
\ ==> K ~: analz (sees lost C evs)"; |
|
361 |
by (rtac (subset_insertI RS sees_mono RS analz_mono RS contra_subsetD) 1); |
|
362 |
by (rtac (sees_lost_agent_subset_sees_Spy RS analz_mono RS contra_subsetD) 1); |
|
363 |
by (FIRSTGOAL (rtac Spy_not_see_encrypted_key)); |
|
364 |
by (REPEAT_FIRST (fast_tac (!claset addIs [otway_mono RS subsetD]))); |
|
365 |
qed "Agent_not_see_encrypted_key"; |
|
366 |
||
367 |
||
368 |
(**** Authenticity properties relating to NB ****) |
|
369 |
||
370 |
(*If the encrypted message appears then it originated with the Server!*) |
|
371 |
goal thy |
|
2106 | 372 |
"!!evs. [| B ~: lost; evs : otway lost |] \ |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
373 |
\ ==> Crypt (shrK B) {|NB, Agent A, Agent B, Key K|} \ |
2106 | 374 |
\ : parts (sees lost Spy evs) \ |
2090 | 375 |
\ --> (EX NA. Says Server B \ |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
376 |
\ {|Crypt (shrK A) {|NA, Agent A, Agent B, Key K|}, \ |
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
377 |
\ Crypt (shrK B) {|NB, Agent A, Agent B, Key K|}|} \ |
2090 | 378 |
\ : set_of_list evs)"; |
379 |
by (parts_induct_tac 1); |
|
380 |
by (ALLGOALS (asm_simp_tac (!simpset addsimps [ex_disj_distrib]))); |
|
381 |
(*OR3*) |
|
382 |
by (Fast_tac 1); |
|
383 |
qed_spec_mp "NB_Crypt_imp_Server_msg"; |
|
384 |
||
385 |
||
2454 | 386 |
(*Guarantee for B: if it gets a well-formed certificate then the Server |
387 |
has sent the correct message in round 3.*) |
|
2090 | 388 |
goal thy |
2106 | 389 |
"!!evs. [| B ~: lost; evs : otway lost; \ |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
390 |
\ Says S B {|X, Crypt (shrK B) {|NB, Agent A, Agent B, Key K|}|} \ |
2106 | 391 |
\ : set_of_list evs |] \ |
392 |
\ ==> EX NA. Says Server B \ |
|
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
393 |
\ {|Crypt (shrK A) {|NA, Agent A, Agent B, Key K|}, \ |
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
394 |
\ Crypt (shrK B) {|NB, Agent A, Agent B, Key K|}|} \ |
2090 | 395 |
\ : set_of_list evs"; |
396 |
by (fast_tac (!claset addSIs [NB_Crypt_imp_Server_msg] |
|
397 |
addEs partsEs |
|
398 |
addDs [Says_imp_sees_Spy RS parts.Inj]) 1); |
|
2331 | 399 |
qed "B_trusts_OR3"; |