author | paulson |
Tue, 07 Jan 1997 10:19:43 +0100 | |
changeset 2481 | ee461c8bc9c3 |
parent 2455 | 9c4444bfd44e |
child 2485 | c4368c967c56 |
permissions | -rw-r--r-- |
2449 | 1 |
(* Title: HOL/Auth/Recur |
2 |
ID: $Id$ |
|
3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
|
4 |
Copyright 1996 University of Cambridge |
|
5 |
||
6 |
Inductive relation "recur" for the Recursive Authentication protocol. |
|
7 |
*) |
|
8 |
||
9 |
open Recur; |
|
10 |
||
11 |
proof_timing:=true; |
|
12 |
HOL_quantifiers := false; |
|
13 |
Pretty.setdepth 25; |
|
14 |
||
15 |
||
16 |
(** Possibility properties: traces that reach the end |
|
17 |
ONE theorem would be more elegant and faster! |
|
18 |
By induction on a list of agents (no repetitions) |
|
19 |
**) |
|
20 |
||
21 |
(*Simplest case: Alice goes directly to the server*) |
|
2481 | 22 |
goal thy |
2449 | 23 |
"!!A. A ~= Server \ |
24 |
\ ==> EX K NA. EX evs: recur lost. \ |
|
25 |
\ Says Server A {|Agent A, \ |
|
26 |
\ Crypt (shrK A) {|Key K, Agent Server, Nonce NA|}, \ |
|
27 |
\ Agent Server|} \ |
|
28 |
\ : set_of_list evs"; |
|
29 |
by (REPEAT (resolve_tac [exI,bexI] 1)); |
|
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
30 |
by (rtac (recur.Nil RS recur.RA1 RS |
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
31 |
(respond.One RSN (4,recur.RA3))) 2); |
2481 | 32 |
by (REPEAT |
33 |
(ALLGOALS (asm_simp_tac (!simpset setsolver safe_solver)) |
|
34 |
THEN |
|
35 |
REPEAT_FIRST (eq_assume_tac ORELSE' resolve_tac [refl, conjI]))); |
|
2449 | 36 |
result(); |
37 |
||
38 |
||
39 |
(*Case two: Alice, Bob and the server*) |
|
2481 | 40 |
goal thy |
2449 | 41 |
"!!A B. [| A ~= B; A ~= Server; B ~= Server |] \ |
42 |
\ ==> EX K. EX NA. EX evs: recur lost. \ |
|
43 |
\ Says B A {|Agent A, Crypt (shrK A) {|Key K, Agent B, Nonce NA|}, \ |
|
44 |
\ Agent Server|} \ |
|
45 |
\ : set_of_list evs"; |
|
46 |
by (REPEAT (resolve_tac [exI,bexI] 1)); |
|
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
47 |
by (rtac (recur.Nil RS recur.RA1 RS recur.RA2 RS |
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
48 |
(respond.One RS respond.Cons RSN (4,recur.RA3)) RS |
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
49 |
recur.RA4) 2); |
2481 | 50 |
bw HPair_def; |
2449 | 51 |
by (REPEAT |
52 |
(REPEAT_FIRST (eq_assume_tac ORELSE' resolve_tac [refl, conjI]) |
|
53 |
THEN |
|
54 |
ALLGOALS (asm_simp_tac (!simpset setsolver safe_solver)))); |
|
55 |
result(); |
|
56 |
||
57 |
||
58 |
(*Case three: Alice, Bob, Charlie and the server*) |
|
2481 | 59 |
goal thy |
2449 | 60 |
"!!A B. [| A ~= B; A ~= Server; B ~= Server |] \ |
61 |
\ ==> EX K. EX NA. EX evs: recur lost. \ |
|
62 |
\ Says B A {|Agent A, Crypt (shrK A) {|Key K, Agent B, Nonce NA|}, \ |
|
63 |
\ Agent Server|} \ |
|
64 |
\ : set_of_list evs"; |
|
65 |
by (REPEAT (resolve_tac [exI,bexI] 1)); |
|
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
66 |
by (rtac (recur.Nil RS recur.RA1 RS recur.RA2 RS recur.RA2 RS |
2449 | 67 |
(respond.One RS respond.Cons RS respond.Cons RSN |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
68 |
(4,recur.RA3)) RS recur.RA4 RS recur.RA4) 2); |
2481 | 69 |
bw HPair_def; |
2449 | 70 |
by (REPEAT (*SLOW: 37 seconds*) |
71 |
(REPEAT_FIRST (eq_assume_tac ORELSE' resolve_tac [refl, conjI]) |
|
72 |
THEN |
|
73 |
ALLGOALS (asm_simp_tac (!simpset setsolver safe_solver)))); |
|
74 |
by (ALLGOALS |
|
75 |
(SELECT_GOAL (DEPTH_SOLVE |
|
76 |
(swap_res_tac [refl, conjI, disjI1, disjI2] 1 APPEND |
|
77 |
etac not_sym 1)))); |
|
78 |
result(); |
|
79 |
||
80 |
||
81 |
||
82 |
(**** Inductive proofs about recur ****) |
|
83 |
||
84 |
(*Monotonicity*) |
|
85 |
goal thy "!!evs. lost' <= lost ==> recur lost' <= recur lost"; |
|
86 |
by (rtac subsetI 1); |
|
87 |
by (etac recur.induct 1); |
|
88 |
by (REPEAT_FIRST |
|
89 |
(best_tac (!claset addIs (impOfSubs (sees_mono RS analz_mono RS synth_mono) |
|
90 |
:: recur.intrs)))); |
|
91 |
qed "recur_mono"; |
|
92 |
||
93 |
(*Nobody sends themselves messages*) |
|
94 |
goal thy "!!evs. evs : recur lost ==> ALL A X. Says A A X ~: set_of_list evs"; |
|
95 |
by (etac recur.induct 1); |
|
96 |
by (Auto_tac()); |
|
97 |
qed_spec_mp "not_Says_to_self"; |
|
98 |
Addsimps [not_Says_to_self]; |
|
99 |
AddSEs [not_Says_to_self RSN (2, rev_notE)]; |
|
100 |
||
101 |
||
102 |
(*Simple inductive reasoning about responses*) |
|
103 |
goal thy "!!j. (j,PA,RB) : respond i ==> RB : responses i"; |
|
104 |
by (etac respond.induct 1); |
|
105 |
by (REPEAT (ares_tac responses.intrs 1)); |
|
106 |
qed "respond_imp_responses"; |
|
107 |
||
108 |
||
109 |
(** For reasoning about the encrypted portion of messages **) |
|
110 |
||
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
111 |
val RA2_analz_sees_Spy = Says_imp_sees_Spy RS analz.Inj |> standard; |
2449 | 112 |
|
113 |
goal thy "!!evs. Says C' B {|Agent B, X, Agent B, X', RA|} : set_of_list evs \ |
|
114 |
\ ==> RA : analz (sees lost Spy evs)"; |
|
115 |
by (fast_tac (!claset addSDs [Says_imp_sees_Spy RS analz.Inj]) 1); |
|
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
116 |
qed "RA4_analz_sees_Spy"; |
2449 | 117 |
|
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
118 |
(*RA2_analz... and RA4_analz... let us treat those cases using the same |
2449 | 119 |
argument as for the Fake case. This is possible for most, but not all, |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
120 |
proofs: Fake does not invent new nonces (as in RA2), and of course Fake |
2449 | 121 |
messages originate from the Spy. *) |
122 |
||
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
123 |
bind_thm ("RA2_parts_sees_Spy", |
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
124 |
RA2_analz_sees_Spy RS (impOfSubs analz_subset_parts)); |
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
125 |
bind_thm ("RA4_parts_sees_Spy", |
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
126 |
RA4_analz_sees_Spy RS (impOfSubs analz_subset_parts)); |
2449 | 127 |
|
128 |
(*We instantiate the variable to "lost". Leaving it as a Var makes proofs |
|
129 |
harder to complete, since simplification does less for us.*) |
|
130 |
val parts_Fake_tac = |
|
131 |
let val tac = forw_inst_tac [("lost","lost")] |
|
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
132 |
in tac RA2_parts_sees_Spy 4 THEN |
2449 | 133 |
forward_tac [respond_imp_responses] 5 THEN |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
134 |
tac RA4_parts_sees_Spy 6 |
2449 | 135 |
end; |
136 |
||
137 |
(*For proving the easier theorems about X ~: parts (sees lost Spy evs) *) |
|
138 |
fun parts_induct_tac i = SELECT_GOAL |
|
139 |
(DETERM (etac recur.induct 1 THEN parts_Fake_tac THEN |
|
140 |
(*Fake message*) |
|
141 |
TRY (best_tac (!claset addDs [impOfSubs analz_subset_parts, |
|
142 |
impOfSubs Fake_parts_insert] |
|
143 |
addss (!simpset)) 2)) THEN |
|
144 |
(*Base case*) |
|
145 |
fast_tac (!claset addss (!simpset)) 1 THEN |
|
146 |
ALLGOALS Asm_simp_tac) i; |
|
147 |
||
148 |
(** Theorems of the form X ~: parts (sees lost Spy evs) imply that NOBODY |
|
149 |
sends messages containing X! **) |
|
150 |
||
151 |
||
152 |
(** Spy never sees another agent's long-term key (unless initially lost) **) |
|
153 |
||
154 |
goal thy |
|
155 |
"!!evs. (j,PB,RB) : respond i \ |
|
156 |
\ ==> Key K : parts {RB} --> (EX j'. K = newK2(i,j') & j<=j')"; |
|
157 |
be respond.induct 1; |
|
158 |
by (Auto_tac()); |
|
159 |
by (best_tac (!claset addDs [Suc_leD]) 1); |
|
160 |
qed_spec_mp "Key_in_parts_respond"; |
|
161 |
||
162 |
goal thy |
|
163 |
"!!evs. evs : recur lost \ |
|
164 |
\ ==> (Key (shrK A) : parts (sees lost Spy evs)) = (A : lost)"; |
|
165 |
by (parts_induct_tac 1); |
|
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
166 |
(*RA2*) |
2449 | 167 |
by (best_tac (!claset addSEs partsEs addSDs [parts_cut] |
168 |
addss (!simpset)) 1); |
|
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
169 |
(*RA3*) |
2449 | 170 |
by (fast_tac (!claset addDs [Key_in_parts_respond] |
171 |
addss (!simpset addsimps [parts_insert_sees])) 1); |
|
172 |
qed "Spy_see_shrK"; |
|
173 |
Addsimps [Spy_see_shrK]; |
|
174 |
||
175 |
goal thy |
|
176 |
"!!evs. evs : recur lost \ |
|
177 |
\ ==> (Key (shrK A) : analz (sees lost Spy evs)) = (A : lost)"; |
|
178 |
by (auto_tac(!claset addDs [impOfSubs analz_subset_parts], !simpset)); |
|
179 |
qed "Spy_analz_shrK"; |
|
180 |
Addsimps [Spy_analz_shrK]; |
|
181 |
||
182 |
goal thy "!!A. [| Key (shrK A) : parts (sees lost Spy evs); \ |
|
183 |
\ evs : recur lost |] ==> A:lost"; |
|
184 |
by (fast_tac (!claset addDs [Spy_see_shrK]) 1); |
|
185 |
qed "Spy_see_shrK_D"; |
|
186 |
||
187 |
bind_thm ("Spy_analz_shrK_D", analz_subset_parts RS subsetD RS Spy_see_shrK_D); |
|
188 |
AddSDs [Spy_see_shrK_D, Spy_analz_shrK_D]; |
|
189 |
||
190 |
||
191 |
(*** Future keys can't be seen or used! ***) |
|
192 |
||
193 |
(*Nobody can have SEEN keys that will be generated in the future. *) |
|
194 |
goal thy "!!evs. evs : recur lost ==> \ |
|
195 |
\ length evs <= i --> \ |
|
196 |
\ Key (newK2(i,j)) ~: parts (sees lost Spy evs)"; |
|
197 |
by (parts_induct_tac 1); |
|
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
198 |
(*RA2*) |
2449 | 199 |
by (best_tac (!claset addSEs partsEs |
200 |
addSDs [parts_cut] |
|
201 |
addDs [Suc_leD] |
|
202 |
addss (!simpset addsimps [parts_insert2])) 3); |
|
203 |
(*Fake*) |
|
204 |
by (best_tac (!claset addDs [impOfSubs analz_subset_parts, |
|
205 |
impOfSubs parts_insert_subset_Un, |
|
206 |
Suc_leD] |
|
207 |
addss (!simpset)) 1); |
|
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
208 |
(*For RA3*) |
2449 | 209 |
by (asm_simp_tac (!simpset addsimps [parts_insert_sees]) 2); |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
210 |
(*RA1-RA4*) |
2449 | 211 |
by (REPEAT (best_tac (!claset addDs [Key_in_parts_respond, Suc_leD] |
212 |
addss (!simpset)) 1)); |
|
213 |
qed_spec_mp "new_keys_not_seen"; |
|
214 |
Addsimps [new_keys_not_seen]; |
|
215 |
||
216 |
(*Variant: old messages must contain old keys!*) |
|
217 |
goal thy |
|
218 |
"!!evs. [| Says A B X : set_of_list evs; \ |
|
219 |
\ Key (newK2(i,j)) : parts {X}; \ |
|
220 |
\ evs : recur lost \ |
|
221 |
\ |] ==> i < length evs"; |
|
222 |
by (rtac ccontr 1); |
|
223 |
by (dtac leI 1); |
|
224 |
by (fast_tac (!claset addSDs [new_keys_not_seen, Says_imp_sees_Spy] |
|
225 |
addIs [impOfSubs parts_mono]) 1); |
|
226 |
qed "Says_imp_old_keys"; |
|
227 |
||
228 |
||
229 |
(*** Future nonces can't be seen or used! ***) |
|
230 |
||
231 |
goal thy |
|
232 |
"!!evs. (j, PB, RB) : respond i \ |
|
233 |
\ ==> Nonce N : parts {RB} --> Nonce N : parts {PB}"; |
|
234 |
be respond.induct 1; |
|
235 |
by (Auto_tac()); |
|
236 |
qed_spec_mp "Nonce_in_parts_respond"; |
|
237 |
||
238 |
||
239 |
goal thy "!!i. evs : recur lost ==> \ |
|
240 |
\ length evs <= i --> Nonce(newN i) ~: parts (sees lost Spy evs)"; |
|
241 |
by (parts_induct_tac 1); |
|
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
242 |
(*For RA3*) |
2449 | 243 |
by (asm_simp_tac (!simpset addsimps [parts_insert_sees]) 4); |
244 |
by (deepen_tac (!claset addSDs [Says_imp_sees_Spy RS parts.Inj] |
|
245 |
addDs [Nonce_in_parts_respond, parts_cut, Suc_leD] |
|
246 |
addss (!simpset)) 0 4); |
|
247 |
(*Fake*) |
|
248 |
by (fast_tac (!claset addDs [impOfSubs analz_subset_parts, |
|
249 |
impOfSubs parts_insert_subset_Un, |
|
250 |
Suc_leD] |
|
251 |
addss (!simpset)) 1); |
|
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
252 |
(*RA1, RA2, RA4*) |
2449 | 253 |
by (REPEAT_FIRST (fast_tac (!claset |
254 |
addSEs partsEs |
|
255 |
addEs [leD RS notE] |
|
256 |
addDs [Suc_leD] |
|
257 |
addss (!simpset)))); |
|
258 |
qed_spec_mp "new_nonces_not_seen"; |
|
259 |
Addsimps [new_nonces_not_seen]; |
|
260 |
||
261 |
(*Variant: old messages must contain old nonces!*) |
|
262 |
goal thy "!!evs. [| Says A B X : set_of_list evs; \ |
|
263 |
\ Nonce (newN i) : parts {X}; \ |
|
264 |
\ evs : recur lost \ |
|
265 |
\ |] ==> i < length evs"; |
|
266 |
by (rtac ccontr 1); |
|
267 |
by (dtac leI 1); |
|
268 |
by (fast_tac (!claset addSDs [new_nonces_not_seen, Says_imp_sees_Spy] |
|
269 |
addIs [impOfSubs parts_mono]) 1); |
|
270 |
qed "Says_imp_old_nonces"; |
|
271 |
||
272 |
||
273 |
(** Nobody can have USED keys that will be generated in the future. **) |
|
274 |
||
275 |
goal thy |
|
276 |
"!!evs. (j,PB,RB) : respond i \ |
|
277 |
\ ==> K : keysFor (parts {RB}) --> (EX A. K = shrK A)"; |
|
278 |
be (respond_imp_responses RS responses.induct) 1; |
|
279 |
by (Auto_tac()); |
|
280 |
qed_spec_mp "Key_in_keysFor_parts_respond"; |
|
281 |
||
282 |
||
283 |
goal thy "!!i. evs : recur lost ==> \ |
|
284 |
\ length evs <= i --> newK2(i,j) ~: keysFor (parts (sees lost Spy evs))"; |
|
285 |
by (parts_induct_tac 1); |
|
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
286 |
(*RA3*) |
2449 | 287 |
by (fast_tac (!claset addDs [Key_in_keysFor_parts_respond, Suc_leD] |
288 |
addss (!simpset addsimps [parts_insert_sees])) 4); |
|
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
289 |
(*RA2*) |
2449 | 290 |
by (fast_tac (!claset addSEs partsEs |
291 |
addDs [Suc_leD] addss (!simpset)) 3); |
|
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
292 |
(*Fake, RA1, RA4*) |
2449 | 293 |
by (REPEAT |
294 |
(best_tac |
|
295 |
(!claset addDs [impOfSubs (analz_subset_parts RS keysFor_mono), |
|
296 |
impOfSubs (parts_insert_subset_Un RS keysFor_mono), |
|
297 |
Suc_leD] |
|
298 |
addEs [new_keys_not_seen RS not_parts_not_analz RSN(2,rev_notE)] |
|
299 |
addss (!simpset)) 1)); |
|
300 |
qed_spec_mp "new_keys_not_used"; |
|
301 |
||
302 |
||
303 |
bind_thm ("new_keys_not_analzd", |
|
304 |
[analz_subset_parts RS keysFor_mono, |
|
305 |
new_keys_not_used] MRS contra_subsetD); |
|
306 |
||
307 |
Addsimps [new_keys_not_used, new_keys_not_analzd]; |
|
308 |
||
309 |
||
310 |
||
311 |
(*** Proofs involving analz ***) |
|
312 |
||
313 |
(*For proofs involving analz. We again instantiate the variable to "lost".*) |
|
314 |
val analz_Fake_tac = |
|
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
315 |
dres_inst_tac [("lost","lost")] RA2_analz_sees_Spy 4 THEN |
2449 | 316 |
forward_tac [respond_imp_responses] 5 THEN |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
317 |
dres_inst_tac [("lost","lost")] RA4_analz_sees_Spy 6; |
2449 | 318 |
|
319 |
||
2481 | 320 |
Delsimps [image_insert]; |
321 |
||
2449 | 322 |
(** Session keys are not used to encrypt other session keys **) |
323 |
||
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
324 |
(*Version for "responses" relation. Handles case RA3 in the theorem below. |
2449 | 325 |
Note that it holds for *any* set H (not just "sees lost Spy evs") |
326 |
satisfying the inductive hypothesis.*) |
|
327 |
goal thy |
|
328 |
"!!evs. [| RB : responses i; \ |
|
329 |
\ ALL K I. (Key K : analz (Key``(newK``I) Un H)) = \ |
|
330 |
\ (K : newK``I | Key K : analz H) |] \ |
|
331 |
\ ==> ALL K I. (Key K : analz (insert RB (Key``(newK``I) Un H))) = \ |
|
332 |
\ (K : newK``I | Key K : analz (insert RB H))"; |
|
333 |
be responses.induct 1; |
|
334 |
by (ALLGOALS |
|
335 |
(asm_simp_tac |
|
336 |
(!simpset addsimps [insert_Key_singleton, insert_Key_image, |
|
337 |
Un_assoc RS sym, pushKey_newK] |
|
338 |
setloop split_tac [expand_if]))); |
|
339 |
by (fast_tac (!claset addIs [image_eqI] addss (!simpset)) 1); |
|
340 |
qed "resp_analz_image_newK_lemma"; |
|
341 |
||
342 |
(*Version for the protocol. Proof is almost trivial, thanks to the lemma.*) |
|
343 |
goal thy |
|
344 |
"!!evs. evs : recur lost ==> \ |
|
345 |
\ ALL K I. (Key K : analz (Key``(newK``I) Un (sees lost Spy evs))) = \ |
|
346 |
\ (K : newK``I | Key K : analz (sees lost Spy evs))"; |
|
347 |
by (etac recur.induct 1); |
|
2481 | 348 |
be subst 4; (*RA2: DELETE needless definition of PA!*) |
2449 | 349 |
by analz_Fake_tac; |
350 |
by (REPEAT_FIRST (ares_tac [allI, analz_image_newK_lemma])); |
|
351 |
by (ALLGOALS (asm_simp_tac (!simpset addsimps [resp_analz_image_newK_lemma]))); |
|
352 |
(*Base*) |
|
353 |
by (fast_tac (!claset addIs [image_eqI] addss (!simpset)) 1); |
|
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
354 |
(*RA4, RA2, Fake*) |
2449 | 355 |
by (REPEAT (spy_analz_tac 1)); |
356 |
val raw_analz_image_newK = result(); |
|
357 |
qed_spec_mp "analz_image_newK"; |
|
358 |
||
359 |
||
360 |
(*Instance of the lemma with H replaced by (sees lost Spy evs): |
|
361 |
[| RB : responses i; evs : recur lost |] |
|
362 |
==> Key xa : analz (insert RB (Key``newK``x Un sees lost Spy evs)) = |
|
363 |
(xa : newK``x | Key xa : analz (insert RB (sees lost Spy evs))) |
|
364 |
*) |
|
365 |
bind_thm ("resp_analz_image_newK", |
|
366 |
raw_analz_image_newK RSN |
|
367 |
(2, resp_analz_image_newK_lemma) RS spec RS spec); |
|
368 |
||
369 |
goal thy |
|
370 |
"!!evs. evs : recur lost ==> \ |
|
371 |
\ Key K : analz (insert (Key (newK x)) (sees lost Spy evs)) = \ |
|
372 |
\ (K = newK x | Key K : analz (sees lost Spy evs))"; |
|
373 |
by (asm_simp_tac (HOL_ss addsimps [pushKey_newK, analz_image_newK, |
|
374 |
insert_Key_singleton]) 1); |
|
375 |
by (Fast_tac 1); |
|
376 |
qed "analz_insert_Key_newK"; |
|
377 |
||
378 |
||
379 |
(** Nonces cannot appear before their time, even hashed! |
|
380 |
One is tempted to add the rule |
|
381 |
"Hash X : parts H ==> X : parts H" |
|
382 |
but we'd then lose theorems like Spy_see_shrK |
|
383 |
***) |
|
384 |
||
385 |
goal thy "!!i. evs : recur lost ==> \ |
|
386 |
\ length evs <= i --> \ |
|
387 |
\ (Nonce (newN i) : parts {X} --> \ |
|
388 |
\ Hash X ~: parts (sees lost Spy evs))"; |
|
389 |
be recur.induct 1; |
|
2481 | 390 |
be subst 4; (*RA2: DELETE needless definition of PA!*) |
2449 | 391 |
by parts_Fake_tac; |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
392 |
(*RA3 requires a further induction*) |
2449 | 393 |
be responses.induct 5; |
394 |
by (ALLGOALS Asm_simp_tac); |
|
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
395 |
(*RA2*) |
2449 | 396 |
by (best_tac (!claset addDs [Suc_leD, parts_cut] |
397 |
addEs [leD RS notE, |
|
398 |
new_nonces_not_seen RSN(2,rev_notE)] |
|
399 |
addss (!simpset)) 4); |
|
400 |
(*Fake*) |
|
401 |
by (best_tac (!claset addSDs [impOfSubs analz_subset_parts, |
|
402 |
impOfSubs parts_insert_subset_Un, |
|
403 |
Suc_leD] |
|
404 |
addss (!simpset)) 2); |
|
405 |
(*Five others!*) |
|
406 |
by (REPEAT (fast_tac (!claset addEs [leD RS notE] |
|
407 |
addDs [Suc_leD] |
|
408 |
addss (!simpset)) 1)); |
|
409 |
bind_thm ("Hash_new_nonces_not_seen", |
|
410 |
result() RS mp RS mp RSN (2, rev_notE)); |
|
411 |
||
412 |
||
413 |
(** The Nonce NA uniquely identifies A's message. |
|
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
414 |
This theorem applies to rounds RA1 and RA2! |
2455
9c4444bfd44e
Simplification and generalization of the guarantees.
paulson
parents:
2451
diff
changeset
|
415 |
|
9c4444bfd44e
Simplification and generalization of the guarantees.
paulson
parents:
2451
diff
changeset
|
416 |
Unicity is not used in other proofs but is desirable in its own right. |
2449 | 417 |
**) |
418 |
||
419 |
goal thy |
|
420 |
"!!evs. [| evs : recur lost; A ~: lost |] \ |
|
421 |
\ ==> EX B' P'. ALL B P. \ |
|
422 |
\ Hash {|Key(shrK A), Agent A, Agent B, Nonce NA, P|} \ |
|
423 |
\ : parts (sees lost Spy evs) --> B=B' & P=P'"; |
|
424 |
be recur.induct 1; |
|
2481 | 425 |
be subst 4; (*RA2: DELETE needless definition of PA!*) |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
426 |
(*For better simplification of RA2*) |
2449 | 427 |
by (res_inst_tac [("x1","XA")] (insert_commute RS ssubst) 4); |
428 |
by parts_Fake_tac; |
|
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
429 |
(*RA3 requires a further induction*) |
2449 | 430 |
be responses.induct 5; |
431 |
by (ALLGOALS Asm_simp_tac); |
|
432 |
by (step_tac (!claset addSEs partsEs) 1); |
|
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
433 |
(*RA3: inductive case*) |
2449 | 434 |
by (best_tac (!claset addss (!simpset)) 5); |
435 |
(*Fake*) |
|
436 |
by (best_tac (!claset addSIs [exI] |
|
437 |
addDs [impOfSubs analz_subset_parts, |
|
438 |
impOfSubs Fake_parts_insert] |
|
439 |
addss (!simpset)) 2); |
|
2481 | 440 |
(*Base*) (** LEVEL 9 **) |
2449 | 441 |
by (fast_tac (!claset addss (!simpset)) 1); |
442 |
by (ALLGOALS (simp_tac (!simpset addsimps [all_conj_distrib]))); |
|
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
443 |
(*RA1: creation of new Nonce. Move assertion into global context*) |
2449 | 444 |
by (expand_case_tac "NA = ?y" 1); |
445 |
by (best_tac (!claset addSIs [exI] |
|
446 |
addEs [Hash_new_nonces_not_seen] |
|
447 |
addss (!simpset)) 1); |
|
448 |
by (best_tac (!claset addss (!simpset)) 1); |
|
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
449 |
(*RA2: creation of new Nonce*) |
2449 | 450 |
by (expand_case_tac "NA = ?y" 1); |
451 |
by (best_tac (!claset addSIs [exI] |
|
452 |
addDs [parts_cut] |
|
453 |
addEs [Hash_new_nonces_not_seen] |
|
454 |
addss (!simpset)) 1); |
|
455 |
by (best_tac (!claset addss (!simpset)) 1); |
|
456 |
val lemma = result(); |
|
457 |
||
2481 | 458 |
goalw thy [HPair_def] |
459 |
"!!evs.[| HPair (Key(shrK A)) {|Agent A, Agent B, Nonce NA, P|} \ |
|
2449 | 460 |
\ : parts (sees lost Spy evs); \ |
2481 | 461 |
\ HPair (Key(shrK A)) {|Agent A, Agent B', Nonce NA, P'|} \ |
2449 | 462 |
\ : parts (sees lost Spy evs); \ |
463 |
\ evs : recur lost; A ~: lost |] \ |
|
464 |
\ ==> B=B' & P=P'"; |
|
2481 | 465 |
by (REPEAT (eresolve_tac partsEs 1)); |
2449 | 466 |
by (prove_unique_tac lemma 1); |
467 |
qed "unique_NA"; |
|
468 |
||
469 |
||
470 |
(*** Lemmas concerning the Server's response |
|
471 |
(relations "respond" and "responses") |
|
472 |
***) |
|
473 |
||
474 |
goal thy |
|
475 |
"!!evs. [| RB : responses i; evs : recur lost |] \ |
|
476 |
\ ==> (Key (shrK B) : analz (insert RB (sees lost Spy evs))) = (B:lost)"; |
|
477 |
be responses.induct 1; |
|
478 |
by (ALLGOALS |
|
479 |
(asm_simp_tac |
|
480 |
(!simpset addsimps [resp_analz_image_newK, insert_Key_singleton] |
|
481 |
setloop split_tac [expand_if]))); |
|
482 |
qed "shrK_in_analz_respond"; |
|
483 |
Addsimps [shrK_in_analz_respond]; |
|
484 |
||
485 |
||
486 |
goal thy |
|
487 |
"!!evs. [| RB : responses i; \ |
|
488 |
\ ALL K I. (Key K : analz (Key``(newK``I) Un H)) = \ |
|
489 |
\ (K : newK``I | Key K : analz H) |] \ |
|
490 |
\ ==> (Key K : analz (insert RB H)) --> \ |
|
491 |
\ (Key K : parts{RB} | Key K : analz H)"; |
|
492 |
be responses.induct 1; |
|
493 |
by (ALLGOALS |
|
494 |
(asm_simp_tac |
|
495 |
(!simpset addsimps [read_instantiate [("H", "?ff``?xx")] parts_insert, |
|
496 |
resp_analz_image_newK_lemma, |
|
497 |
insert_Key_singleton, insert_Key_image, |
|
498 |
Un_assoc RS sym, pushKey_newK] |
|
499 |
setloop split_tac [expand_if]))); |
|
500 |
(*The "Message" simpset gives the standard treatment of "image"*) |
|
501 |
by (simp_tac (simpset_of "Message") 1); |
|
502 |
by (fast_tac (!claset delrules [allE]) 1); |
|
503 |
qed "resp_analz_insert_lemma"; |
|
504 |
||
505 |
bind_thm ("resp_analz_insert", |
|
506 |
raw_analz_image_newK RSN |
|
507 |
(2, resp_analz_insert_lemma) RSN(2, rev_mp)); |
|
508 |
||
509 |
||
510 |
(*The Server does not send such messages. This theorem lets us avoid |
|
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
511 |
assuming B~=Server in RA4.*) |
2449 | 512 |
goal thy |
513 |
"!!evs. evs : recur lost \ |
|
514 |
\ ==> ALL C X Y P. Says Server C {|X, Agent Server, Agent C, Y, P|} \ |
|
515 |
\ ~: set_of_list evs"; |
|
516 |
by (etac recur.induct 1); |
|
517 |
be (respond.induct) 5; |
|
518 |
by (Auto_tac()); |
|
519 |
qed_spec_mp "Says_Server_not"; |
|
520 |
AddSEs [Says_Server_not RSN (2,rev_notE)]; |
|
521 |
||
522 |
||
523 |
goal thy |
|
524 |
"!!i. (j,PB,RB) : respond i \ |
|
525 |
\ ==> EX A' B'. ALL A B N. \ |
|
526 |
\ Crypt (shrK A) {|Key K, Agent B, N|} : parts {RB} \ |
|
527 |
\ --> (A'=A & B'=B) | (A'=B & B'=A)"; |
|
528 |
be respond.induct 1; |
|
529 |
by (ALLGOALS (asm_full_simp_tac (!simpset addsimps [all_conj_distrib]))); |
|
530 |
(*Base case*) |
|
531 |
by (Fast_tac 1); |
|
532 |
by (Step_tac 1); |
|
533 |
by (expand_case_tac "K = ?y" 1); |
|
534 |
by (best_tac (!claset addSIs [exI] |
|
535 |
addSEs partsEs |
|
536 |
addDs [Key_in_parts_respond] |
|
537 |
addss (!simpset)) 1); |
|
538 |
by (expand_case_tac "K = ?y" 1); |
|
539 |
by (REPEAT (ares_tac [exI] 2)); |
|
540 |
by (ex_strip_tac 1); |
|
541 |
be respond.elim 1; |
|
542 |
by (REPEAT_FIRST (etac Pair_inject ORELSE' hyp_subst_tac)); |
|
543 |
by (ALLGOALS (asm_full_simp_tac |
|
544 |
(!simpset addsimps [all_conj_distrib, ex_disj_distrib]))); |
|
545 |
by (Fast_tac 1); |
|
546 |
by (Fast_tac 1); |
|
547 |
val lemma = result(); |
|
548 |
||
549 |
goal thy |
|
550 |
"!!RB. [| Crypt (shrK A) {|Key K, Agent B, N|} : parts {RB}; \ |
|
551 |
\ Crypt (shrK A') {|Key K, Agent B', N'|} : parts {RB}; \ |
|
552 |
\ (j,PB,RB) : respond i |] \ |
|
553 |
\ ==> (A'=A & B'=B) | (A'=B & B'=A)"; |
|
2481 | 554 |
by (prove_unique_tac lemma 1); (*50 seconds??, due to the disjunctions*) |
2449 | 555 |
qed "unique_session_keys"; |
556 |
||
557 |
||
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
558 |
(** Crucial secrecy property: Spy does not see the keys sent in msg RA3 |
2449 | 559 |
Does not in itself guarantee security: an attack could violate |
560 |
the premises, e.g. by having A=Spy **) |
|
561 |
||
562 |
goal thy |
|
2481 | 563 |
"!!j. (j, HPair (Key(shrK A)) {|Agent A, B, NA, P|}, RA) : respond i \ |
2449 | 564 |
\ ==> Crypt (shrK A) {|Key (newK2 (i,j)), B, NA|} : parts {RA}"; |
565 |
be respond.elim 1; |
|
566 |
by (ALLGOALS Asm_full_simp_tac); |
|
567 |
qed "newK2_respond_lemma"; |
|
568 |
||
569 |
||
570 |
goal thy |
|
571 |
"!!evs. [| (j,PB,RB) : respond (length evs); evs : recur lost |] \ |
|
572 |
\ ==> ALL A A' N. A ~: lost & A' ~: lost --> \ |
|
573 |
\ Crypt (shrK A) {|Key K, Agent A', N|} : parts{RB} --> \ |
|
574 |
\ Key K ~: analz (insert RB (sees lost Spy evs))"; |
|
575 |
be respond.induct 1; |
|
576 |
by (forward_tac [respond_imp_responses] 2); |
|
2481 | 577 |
by (ALLGOALS (*4 MINUTES???*) |
2449 | 578 |
(asm_simp_tac |
579 |
(!simpset addsimps |
|
580 |
([analz_image_newK, not_parts_not_analz, |
|
581 |
read_instantiate [("H", "?ff``?xx")] parts_insert, |
|
582 |
Un_assoc RS sym, resp_analz_image_newK, |
|
583 |
insert_Key_singleton, analz_insert_Key_newK]) |
|
584 |
setloop split_tac [expand_if]))); |
|
585 |
by (ALLGOALS (simp_tac (simpset_of "Message"))); |
|
586 |
by (Fast_tac 1); |
|
587 |
by (step_tac (!claset addSEs [MPair_parts]) 1); |
|
588 |
(** LEVEL 6 **) |
|
589 |
by (fast_tac (!claset addDs [resp_analz_insert, Key_in_parts_respond] |
|
590 |
addSEs [new_keys_not_seen RS not_parts_not_analz |
|
591 |
RSN(2,rev_notE)] |
|
592 |
addss (!simpset)) 4); |
|
593 |
by (fast_tac (!claset addSDs [newK2_respond_lemma]) 3); |
|
594 |
by (best_tac (!claset addSEs partsEs |
|
595 |
addDs [Key_in_parts_respond] |
|
596 |
addss (!simpset)) 2); |
|
597 |
by (thin_tac "ALL x.?P(x)" 1); |
|
598 |
be respond.elim 1; |
|
599 |
by (fast_tac (!claset addss (!simpset)) 1); |
|
600 |
by (step_tac (!claset addss (!simpset)) 1); |
|
601 |
by (best_tac (!claset addSEs partsEs |
|
602 |
addDs [Key_in_parts_respond] |
|
603 |
addss (!simpset)) 1); |
|
604 |
qed_spec_mp "respond_Spy_not_see_encrypted_key"; |
|
605 |
||
606 |
||
607 |
goal thy |
|
2455
9c4444bfd44e
Simplification and generalization of the guarantees.
paulson
parents:
2451
diff
changeset
|
608 |
"!!evs. [| A ~: lost; A' ~: lost; evs : recur lost |] \ |
9c4444bfd44e
Simplification and generalization of the guarantees.
paulson
parents:
2451
diff
changeset
|
609 |
\ ==> Says Server B RB : set_of_list evs --> \ |
2449 | 610 |
\ Crypt (shrK A) {|Key K, Agent A', N|} : parts{RB} --> \ |
611 |
\ Key K ~: analz (sees lost Spy evs)"; |
|
612 |
by (etac recur.induct 1); |
|
2481 | 613 |
be subst 4; (*RA2: DELETE needless definition of PA!*) |
2449 | 614 |
by analz_Fake_tac; |
615 |
by (ALLGOALS |
|
616 |
(asm_simp_tac |
|
617 |
(!simpset addsimps [not_parts_not_analz, analz_insert_Key_newK] |
|
618 |
setloop split_tac [expand_if]))); |
|
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
619 |
(*RA4*) |
2449 | 620 |
by (spy_analz_tac 4); |
621 |
(*Fake*) |
|
622 |
by (spy_analz_tac 1); |
|
623 |
by (step_tac (!claset delrules [impCE]) 1); |
|
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
624 |
(*RA2*) |
2449 | 625 |
by (spy_analz_tac 1); |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
626 |
(*RA3, case 2: K is an old key*) |
2449 | 627 |
by (fast_tac (!claset addSDs [resp_analz_insert] |
628 |
addSEs partsEs |
|
629 |
addDs [Key_in_parts_respond] |
|
630 |
addEs [Says_imp_old_keys RS less_irrefl]) 2); |
|
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
631 |
(*RA3, case 1: use lemma previously proved by induction*) |
2449 | 632 |
by (fast_tac (!claset addSEs [respond_Spy_not_see_encrypted_key RSN |
633 |
(2,rev_notE)]) 1); |
|
634 |
bind_thm ("Spy_not_see_encrypted_key", result() RS mp RSN (2, rev_mp)); |
|
635 |
||
636 |
||
637 |
goal thy |
|
2455
9c4444bfd44e
Simplification and generalization of the guarantees.
paulson
parents:
2451
diff
changeset
|
638 |
"!!evs. [| Says Server B RB : set_of_list evs; \ |
2449 | 639 |
\ Crypt (shrK A) {|Key K, Agent A', N|} : parts{RB}; \ |
2455
9c4444bfd44e
Simplification and generalization of the guarantees.
paulson
parents:
2451
diff
changeset
|
640 |
\ C ~: {A,A',Server}; \ |
9c4444bfd44e
Simplification and generalization of the guarantees.
paulson
parents:
2451
diff
changeset
|
641 |
\ A ~: lost; A' ~: lost; evs : recur lost |] \ |
2449 | 642 |
\ ==> Key K ~: analz (sees lost C evs)"; |
643 |
by (rtac (subset_insertI RS sees_mono RS analz_mono RS contra_subsetD) 1); |
|
644 |
by (rtac (sees_lost_agent_subset_sees_Spy RS analz_mono RS contra_subsetD) 1); |
|
645 |
by (FIRSTGOAL (rtac Spy_not_see_encrypted_key)); |
|
646 |
by (REPEAT_FIRST (fast_tac (!claset addIs [recur_mono RS subsetD]))); |
|
647 |
qed "Agent_not_see_encrypted_key"; |
|
648 |
||
649 |
||
650 |
(**** Authenticity properties for Agents ****) |
|
651 |
||
2481 | 652 |
(*The response never contains Hashes*) |
653 |
(*NEEDED????????????????*) |
|
654 |
goal thy |
|
655 |
"!!evs. (j,PB,RB) : respond i \ |
|
656 |
\ ==> Hash {|Key (shrK B), M|} : parts (insert RB H) --> \ |
|
657 |
\ Hash {|Key (shrK B), M|} : parts H"; |
|
658 |
be (respond_imp_responses RS responses.induct) 1; |
|
659 |
by (Auto_tac()); |
|
660 |
bind_thm ("Hash_in_parts_respond", result() RSN (2, rev_mp)); |
|
661 |
||
2455
9c4444bfd44e
Simplification and generalization of the guarantees.
paulson
parents:
2451
diff
changeset
|
662 |
(*NEEDED????????????????*) |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
663 |
(*Only RA1 or RA2 can have caused such a part of a message to appear.*) |
2481 | 664 |
goalw thy [HPair_def] |
2449 | 665 |
"!!evs. [| Hash {|Key(shrK A), Agent A, Agent B, NA, P|} \ |
666 |
\ : parts (sees lost Spy evs); \ |
|
667 |
\ A ~: lost; evs : recur lost |] \ |
|
2481 | 668 |
\ ==> Says A B (HPair (Key(shrK A)) {|Agent A, Agent B, NA, P|}) \ |
2449 | 669 |
\ : set_of_list evs"; |
670 |
be rev_mp 1; |
|
671 |
by (parts_induct_tac 1); |
|
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
672 |
(*RA3*) |
2449 | 673 |
by (fast_tac (!claset addSDs [Hash_in_parts_respond]) 2); |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
674 |
(*RA2*) |
2455
9c4444bfd44e
Simplification and generalization of the guarantees.
paulson
parents:
2451
diff
changeset
|
675 |
by ((REPEAT o CHANGED) (*Push in XA--for more simplification*) |
2449 | 676 |
(res_inst_tac [("x1","XA")] (insert_commute RS ssubst) 1)); |
677 |
by (best_tac (!claset addSEs partsEs |
|
678 |
addDs [parts_cut] |
|
679 |
addss (!simpset)) 1); |
|
680 |
qed_spec_mp "Hash_auth_sender"; |
|
681 |
||
682 |
||
683 |
val nonce_not_seen_now = le_refl RSN (2, new_nonces_not_seen) RSN (2,rev_notE); |
|
684 |
||
685 |
||
686 |
(** These two results should subsume (for all agents) the guarantees proved |
|
687 |
separately for A and B in the Otway-Rees protocol. |
|
688 |
**) |
|
689 |
||
690 |
||
2455
9c4444bfd44e
Simplification and generalization of the guarantees.
paulson
parents:
2451
diff
changeset
|
691 |
(*Encrypted messages can only originate with the Server.*) |
2449 | 692 |
goal thy |
2455
9c4444bfd44e
Simplification and generalization of the guarantees.
paulson
parents:
2451
diff
changeset
|
693 |
"!!evs. [| A ~: lost; A ~= Spy; evs : recur lost |] \ |
9c4444bfd44e
Simplification and generalization of the guarantees.
paulson
parents:
2451
diff
changeset
|
694 |
\ ==> Crypt (shrK A) Y : parts (sees lost Spy evs) \ |
9c4444bfd44e
Simplification and generalization of the guarantees.
paulson
parents:
2451
diff
changeset
|
695 |
\ --> (EX C RC. Says Server C RC : set_of_list evs & \ |
9c4444bfd44e
Simplification and generalization of the guarantees.
paulson
parents:
2451
diff
changeset
|
696 |
\ Crypt (shrK A) Y : parts {RC})"; |
2449 | 697 |
by (parts_induct_tac 1); |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
698 |
(*RA4*) |
2455
9c4444bfd44e
Simplification and generalization of the guarantees.
paulson
parents:
2451
diff
changeset
|
699 |
by (Fast_tac 4); |
9c4444bfd44e
Simplification and generalization of the guarantees.
paulson
parents:
2451
diff
changeset
|
700 |
(*RA3*) |
9c4444bfd44e
Simplification and generalization of the guarantees.
paulson
parents:
2451
diff
changeset
|
701 |
by (full_simp_tac (!simpset addsimps [parts_insert_sees]) 3 |
9c4444bfd44e
Simplification and generalization of the guarantees.
paulson
parents:
2451
diff
changeset
|
702 |
THEN Fast_tac 3); |
9c4444bfd44e
Simplification and generalization of the guarantees.
paulson
parents:
2451
diff
changeset
|
703 |
(*RA1*) |
9c4444bfd44e
Simplification and generalization of the guarantees.
paulson
parents:
2451
diff
changeset
|
704 |
by (Fast_tac 1); |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
705 |
(*RA2: it cannot be a new Nonce, contradiction.*) |
2455
9c4444bfd44e
Simplification and generalization of the guarantees.
paulson
parents:
2451
diff
changeset
|
706 |
by ((REPEAT o CHANGED) (*Push in XA--for more simplification*) |
2449 | 707 |
(res_inst_tac [("x1","XA")] (insert_commute RS ssubst) 1)); |
708 |
by (deepen_tac (!claset delrules [impCE] |
|
709 |
addSIs [disjI2] |
|
2455
9c4444bfd44e
Simplification and generalization of the guarantees.
paulson
parents:
2451
diff
changeset
|
710 |
addSEs [MPair_parts] |
2449 | 711 |
addDs [parts_cut, parts.Body] |
712 |
addss (!simpset)) 0 1); |
|
713 |
qed_spec_mp "Crypt_imp_Server_msg"; |
|
714 |
||
715 |
||
2455
9c4444bfd44e
Simplification and generalization of the guarantees.
paulson
parents:
2451
diff
changeset
|
716 |
(*Corollary: if A receives B's message then the key came from the Server*) |
2449 | 717 |
goal thy |
718 |
"!!evs. [| Says B' A RA : set_of_list evs; \ |
|
2455
9c4444bfd44e
Simplification and generalization of the guarantees.
paulson
parents:
2451
diff
changeset
|
719 |
\ Crypt (shrK A) {|Key K, Agent A', NA|} : parts {RA}; \ |
2449 | 720 |
\ A ~: lost; A ~= Spy; evs : recur lost |] \ |
2455
9c4444bfd44e
Simplification and generalization of the guarantees.
paulson
parents:
2451
diff
changeset
|
721 |
\ ==> EX C RC. Says Server C RC : set_of_list evs & \ |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
722 |
\ Crypt (shrK A) {|Key K, Agent A', NA|} : parts {RC}"; |
2449 | 723 |
by (best_tac (!claset addSIs [Crypt_imp_Server_msg] |
724 |
addDs [Says_imp_sees_Spy RS parts.Inj RSN (2,parts_cut)] |
|
725 |
addss (!simpset)) 1); |
|
726 |
qed "Agent_trust"; |
|
727 |
||
728 |
||
2455
9c4444bfd44e
Simplification and generalization of the guarantees.
paulson
parents:
2451
diff
changeset
|
729 |
(*Overall guarantee: if A receives a certificant mentioning A' |
9c4444bfd44e
Simplification and generalization of the guarantees.
paulson
parents:
2451
diff
changeset
|
730 |
then the only other agent who knows the key is A'.*) |
2449 | 731 |
goal thy |
732 |
"!!evs. [| Says B' A RA : set_of_list evs; \ |
|
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
733 |
\ Crypt (shrK A) {|Key K, Agent A', NA|} : parts {RA}; \ |
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
734 |
\ C ~: {A,A',Server}; \ |
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
735 |
\ A ~: lost; A' ~: lost; A ~= Spy; evs : recur lost |] \ |
2449 | 736 |
\ ==> Key K ~: analz (sees lost C evs)"; |
737 |
by (dtac Agent_trust 1 THEN REPEAT_FIRST assume_tac); |
|
738 |
by (fast_tac (!claset addSEs [Agent_not_see_encrypted_key RSN(2,rev_notE)]) 1); |
|
739 |
qed "Agent_secrecy"; |
|
740 |