author | paulson |
Thu, 23 Jan 1997 18:14:20 +0100 | |
changeset 2550 | 8d8344bcf98a |
parent 2533 | 2d5604a51562 |
child 2560 | c57b585eecd9 |
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; |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
13 |
Pretty.setdepth 30; |
2449 | 14 |
|
15 |
||
16 |
(** Possibility properties: traces that reach the end |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
17 |
ONE theorem would be more elegant and faster! |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
18 |
By induction on a list of agents (no repetitions) |
2449 | 19 |
**) |
20 |
||
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
21 |
|
2449 | 22 |
(*Simplest case: Alice goes directly to the server*) |
2481 | 23 |
goal thy |
2449 | 24 |
"!!A. A ~= Server \ |
25 |
\ ==> EX K NA. EX evs: recur lost. \ |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
26 |
\ Says Server A {|Crypt (shrK A) {|Key K, Agent Server, Nonce NA|}, \ |
2550
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
27 |
\ Agent Server|} \ |
2449 | 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 |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
31 |
(respond.One RSN (4,recur.RA3))) 2); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
32 |
by possibility_tac; |
2449 | 33 |
result(); |
34 |
||
35 |
||
36 |
(*Case two: Alice, Bob and the server*) |
|
2481 | 37 |
goal thy |
2449 | 38 |
"!!A B. [| A ~= B; A ~= Server; B ~= Server |] \ |
2550
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
39 |
\ ==> EX K. EX NA. EX evs: recur lost. \ |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
40 |
\ Says B A {|Crypt (shrK A) {|Key K, Agent B, Nonce NA|}, \ |
2550
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
41 |
\ Agent Server|} \ |
2449 | 42 |
\ : set_of_list evs"; |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
43 |
by (cut_facts_tac [Nonce_supply2, Key_supply2] 1); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
44 |
by (REPEAT (eresolve_tac [exE, conjE] 1)); |
2449 | 45 |
by (REPEAT (resolve_tac [exI,bexI] 1)); |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
46 |
by (rtac (recur.Nil RS recur.RA1 RS recur.RA2 RS |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
47 |
(respond.One RS respond.Cons RSN (4,recur.RA3)) RS |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
48 |
recur.RA4) 2); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
49 |
by basic_possibility_tac; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
50 |
by (DEPTH_SOLVE (eresolve_tac [asm_rl, less_not_refl2, |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
51 |
less_not_refl2 RS not_sym] 1)); |
2449 | 52 |
result(); |
53 |
||
54 |
||
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
55 |
(*Case three: Alice, Bob, Charlie and the server |
2533 | 56 |
TOO SLOW to run every time! |
2481 | 57 |
goal thy |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
58 |
"!!A B. [| A ~= B; B ~= C; A ~= Server; B ~= Server; C ~= Server |] \ |
2550
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
59 |
\ ==> EX K. EX NA. EX evs: recur lost. \ |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
60 |
\ Says B A {|Crypt (shrK A) {|Key K, Agent B, Nonce NA|}, \ |
2550
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
61 |
\ Agent Server|} \ |
2449 | 62 |
\ : set_of_list evs"; |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
63 |
by (cut_facts_tac [Nonce_supply3, Key_supply3] 1); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
64 |
by (REPEAT (eresolve_tac [exE, conjE] 1)); |
2449 | 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 |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
67 |
(respond.One RS respond.Cons RS respond.Cons RSN |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
68 |
(4,recur.RA3)) RS recur.RA4 RS recur.RA4) 2); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
69 |
(*SLOW: 70 seconds*) |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
70 |
by basic_possibility_tac; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
71 |
by (DEPTH_SOLVE (swap_res_tac [refl, conjI, disjCI] 1 |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
72 |
ORELSE |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
73 |
eresolve_tac [asm_rl, less_not_refl2, |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
74 |
less_not_refl2 RS not_sym] 1)); |
2449 | 75 |
result(); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
76 |
****************) |
2449 | 77 |
|
78 |
(**** Inductive proofs about recur ****) |
|
79 |
||
80 |
(*Monotonicity*) |
|
81 |
goal thy "!!evs. lost' <= lost ==> recur lost' <= recur lost"; |
|
82 |
by (rtac subsetI 1); |
|
83 |
by (etac recur.induct 1); |
|
84 |
by (REPEAT_FIRST |
|
85 |
(best_tac (!claset addIs (impOfSubs (sees_mono RS analz_mono RS synth_mono) |
|
86 |
:: recur.intrs)))); |
|
87 |
qed "recur_mono"; |
|
88 |
||
89 |
(*Nobody sends themselves messages*) |
|
90 |
goal thy "!!evs. evs : recur lost ==> ALL A X. Says A A X ~: set_of_list evs"; |
|
91 |
by (etac recur.induct 1); |
|
92 |
by (Auto_tac()); |
|
93 |
qed_spec_mp "not_Says_to_self"; |
|
94 |
Addsimps [not_Says_to_self]; |
|
95 |
AddSEs [not_Says_to_self RSN (2, rev_notE)]; |
|
96 |
||
97 |
||
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
98 |
|
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
99 |
goal thy "!!evs. (PA,RB,KAB) : respond evs ==> Key KAB : parts{RB}"; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
100 |
by (etac respond.induct 1); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
101 |
by (ALLGOALS Simp_tac); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
102 |
qed "respond_Key_in_parts"; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
103 |
|
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
104 |
goal thy "!!evs. (PA,RB,KAB) : respond evs ==> Key KAB ~: used evs"; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
105 |
by (etac respond.induct 1); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
106 |
by (REPEAT (assume_tac 1)); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
107 |
qed "respond_imp_not_used"; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
108 |
|
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
109 |
goal thy |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
110 |
"!!evs. [| Key K : parts {RB}; (PB,RB,K') : respond evs |] \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
111 |
\ ==> Key K ~: used evs"; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
112 |
by (etac rev_mp 1); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
113 |
by (etac respond.induct 1); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
114 |
by (auto_tac(!claset addDs [Key_not_used, respond_imp_not_used], |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
115 |
!simpset)); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
116 |
qed_spec_mp "Key_in_parts_respond"; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
117 |
|
2449 | 118 |
(*Simple inductive reasoning about responses*) |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
119 |
goal thy "!!evs. (PA,RB,KAB) : respond evs ==> RB : responses evs"; |
2449 | 120 |
by (etac respond.induct 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
121 |
by (REPEAT (ares_tac (respond_imp_not_used::responses.intrs) 1)); |
2449 | 122 |
qed "respond_imp_responses"; |
123 |
||
124 |
||
125 |
(** For reasoning about the encrypted portion of messages **) |
|
126 |
||
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
127 |
val RA2_analz_sees_Spy = Says_imp_sees_Spy RS analz.Inj |> standard; |
2449 | 128 |
|
2550
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
129 |
goal thy "!!evs. Says C' B {|Crypt K X, X', RA|} : set_of_list evs \ |
2449 | 130 |
\ ==> RA : analz (sees lost Spy evs)"; |
131 |
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
|
132 |
qed "RA4_analz_sees_Spy"; |
2449 | 133 |
|
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
134 |
(*RA2_analz... and RA4_analz... let us treat those cases using the same |
2449 | 135 |
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
|
136 |
proofs: Fake does not invent new nonces (as in RA2), and of course Fake |
2449 | 137 |
messages originate from the Spy. *) |
138 |
||
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
139 |
bind_thm ("RA2_parts_sees_Spy", |
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
140 |
RA2_analz_sees_Spy RS (impOfSubs analz_subset_parts)); |
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
141 |
bind_thm ("RA4_parts_sees_Spy", |
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
142 |
RA4_analz_sees_Spy RS (impOfSubs analz_subset_parts)); |
2449 | 143 |
|
144 |
(*We instantiate the variable to "lost". Leaving it as a Var makes proofs |
|
145 |
harder to complete, since simplification does less for us.*) |
|
146 |
val parts_Fake_tac = |
|
147 |
let val tac = forw_inst_tac [("lost","lost")] |
|
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
148 |
in tac RA2_parts_sees_Spy 4 THEN |
2485
c4368c967c56
Simplification of some proofs, especially by eliminating
paulson
parents:
2481
diff
changeset
|
149 |
etac subst 4 (*RA2: DELETE needless definition of PA!*) THEN |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
150 |
forward_tac [respond_imp_responses] 5 THEN |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
151 |
tac RA4_parts_sees_Spy 6 |
2449 | 152 |
end; |
153 |
||
154 |
(*For proving the easier theorems about X ~: parts (sees lost Spy evs) *) |
|
155 |
fun parts_induct_tac i = SELECT_GOAL |
|
156 |
(DETERM (etac recur.induct 1 THEN parts_Fake_tac THEN |
|
157 |
(*Fake message*) |
|
158 |
TRY (best_tac (!claset addDs [impOfSubs analz_subset_parts, |
|
159 |
impOfSubs Fake_parts_insert] |
|
160 |
addss (!simpset)) 2)) THEN |
|
161 |
(*Base case*) |
|
162 |
fast_tac (!claset addss (!simpset)) 1 THEN |
|
163 |
ALLGOALS Asm_simp_tac) i; |
|
164 |
||
165 |
(** Theorems of the form X ~: parts (sees lost Spy evs) imply that NOBODY |
|
166 |
sends messages containing X! **) |
|
167 |
||
168 |
||
169 |
(** Spy never sees another agent's long-term key (unless initially lost) **) |
|
170 |
||
171 |
goal thy |
|
172 |
"!!evs. evs : recur lost \ |
|
173 |
\ ==> (Key (shrK A) : parts (sees lost Spy evs)) = (A : lost)"; |
|
174 |
by (parts_induct_tac 1); |
|
2550
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
175 |
by (ALLGOALS (asm_simp_tac (!simpset addsimps [parts_insert_sees]))); |
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
176 |
(*RA3*) |
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
177 |
by (fast_tac (!claset addDs [Key_in_parts_respond] |
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
178 |
addss (!simpset addsimps [parts_insert_sees])) 2); |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
179 |
(*RA2*) |
2449 | 180 |
by (best_tac (!claset addSEs partsEs addSDs [parts_cut] |
181 |
addss (!simpset)) 1); |
|
182 |
qed "Spy_see_shrK"; |
|
183 |
Addsimps [Spy_see_shrK]; |
|
184 |
||
185 |
goal thy |
|
186 |
"!!evs. evs : recur lost \ |
|
187 |
\ ==> (Key (shrK A) : analz (sees lost Spy evs)) = (A : lost)"; |
|
188 |
by (auto_tac(!claset addDs [impOfSubs analz_subset_parts], !simpset)); |
|
189 |
qed "Spy_analz_shrK"; |
|
190 |
Addsimps [Spy_analz_shrK]; |
|
191 |
||
192 |
goal thy "!!A. [| Key (shrK A) : parts (sees lost Spy evs); \ |
|
193 |
\ evs : recur lost |] ==> A:lost"; |
|
194 |
by (fast_tac (!claset addDs [Spy_see_shrK]) 1); |
|
195 |
qed "Spy_see_shrK_D"; |
|
196 |
||
197 |
bind_thm ("Spy_analz_shrK_D", analz_subset_parts RS subsetD RS Spy_see_shrK_D); |
|
198 |
AddSDs [Spy_see_shrK_D, Spy_analz_shrK_D]; |
|
199 |
||
200 |
||
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
201 |
|
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
202 |
(** Nobody can have used non-existent keys! **) |
2449 | 203 |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
204 |
goal thy |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
205 |
"!!evs. [| K : keysFor (parts {RB}); (PB,RB,K') : respond evs |] \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
206 |
\ ==> K : range shrK"; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
207 |
by (etac rev_mp 1); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
208 |
by (etac (respond_imp_responses RS responses.induct) 1); |
2449 | 209 |
by (Auto_tac()); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
210 |
qed_spec_mp "Key_in_keysFor_parts"; |
2449 | 211 |
|
212 |
||
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
213 |
goal thy "!!evs. evs : recur lost ==> \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
214 |
\ Key K ~: used evs --> K ~: keysFor (parts (sees lost Spy evs))"; |
2449 | 215 |
by (parts_induct_tac 1); |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
216 |
(*RA3*) |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
217 |
by (best_tac (!claset addDs [Key_in_keysFor_parts] |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
218 |
addss (!simpset addsimps [parts_insert_sees])) 2); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
219 |
(*Fake*) |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
220 |
by (best_tac |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
221 |
(!claset addIs [impOfSubs analz_subset_parts] |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
222 |
addDs [impOfSubs (analz_subset_parts RS keysFor_mono), |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
223 |
impOfSubs (parts_insert_subset_Un RS keysFor_mono)] |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
224 |
addss (!simpset)) 1); |
2449 | 225 |
qed_spec_mp "new_keys_not_used"; |
226 |
||
227 |
||
228 |
bind_thm ("new_keys_not_analzd", |
|
229 |
[analz_subset_parts RS keysFor_mono, |
|
230 |
new_keys_not_used] MRS contra_subsetD); |
|
231 |
||
232 |
Addsimps [new_keys_not_used, new_keys_not_analzd]; |
|
233 |
||
234 |
||
235 |
||
236 |
(*** Proofs involving analz ***) |
|
237 |
||
238 |
(*For proofs involving analz. We again instantiate the variable to "lost".*) |
|
239 |
val analz_Fake_tac = |
|
2485
c4368c967c56
Simplification of some proofs, especially by eliminating
paulson
parents:
2481
diff
changeset
|
240 |
etac subst 4 (*RA2: DELETE needless definition of PA!*) THEN |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
241 |
dres_inst_tac [("lost","lost")] RA2_analz_sees_Spy 4 THEN |
2449 | 242 |
forward_tac [respond_imp_responses] 5 THEN |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
243 |
dres_inst_tac [("lost","lost")] RA4_analz_sees_Spy 6; |
2449 | 244 |
|
245 |
||
246 |
(** Session keys are not used to encrypt other session keys **) |
|
247 |
||
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
248 |
(*Version for "responses" relation. Handles case RA3 in the theorem below. |
2449 | 249 |
Note that it holds for *any* set H (not just "sees lost Spy evs") |
250 |
satisfying the inductive hypothesis.*) |
|
251 |
goal thy |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
252 |
"!!evs. [| RB : responses evs; \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
253 |
\ ALL K KK. KK <= Compl (range shrK) --> \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
254 |
\ (Key K : analz (Key``KK Un H)) = \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
255 |
\ (K : KK | Key K : analz H) |] \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
256 |
\ ==> ALL K KK. KK <= Compl (range shrK) --> \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
257 |
\ (Key K : analz (insert RB (Key``KK Un H))) = \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
258 |
\ (K : KK | Key K : analz (insert RB H))"; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
259 |
by (etac responses.induct 1); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
260 |
by (ALLGOALS (asm_simp_tac analz_image_freshK_ss)); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
261 |
qed "resp_analz_image_freshK_lemma"; |
2449 | 262 |
|
263 |
(*Version for the protocol. Proof is almost trivial, thanks to the lemma.*) |
|
264 |
goal thy |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
265 |
"!!evs. evs : recur lost ==> \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
266 |
\ ALL K KK. KK <= Compl (range shrK) --> \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
267 |
\ (Key K : analz (Key``KK Un (sees lost Spy evs))) = \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
268 |
\ (K : KK | Key K : analz (sees lost Spy evs))"; |
2449 | 269 |
by (etac recur.induct 1); |
270 |
by analz_Fake_tac; |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
271 |
by (REPEAT_FIRST (resolve_tac [allI, impI])); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
272 |
by (REPEAT_FIRST (rtac analz_image_freshK_lemma )); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
273 |
by (ALLGOALS |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
274 |
(asm_simp_tac |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
275 |
(analz_image_freshK_ss addsimps [resp_analz_image_freshK_lemma]))); |
2449 | 276 |
(*Base*) |
277 |
by (fast_tac (!claset addIs [image_eqI] addss (!simpset)) 1); |
|
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
278 |
(*RA4, RA2, Fake*) |
2449 | 279 |
by (REPEAT (spy_analz_tac 1)); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
280 |
val raw_analz_image_freshK = result(); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
281 |
qed_spec_mp "analz_image_freshK"; |
2449 | 282 |
|
283 |
||
284 |
(*Instance of the lemma with H replaced by (sees lost Spy evs): |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
285 |
[| RB : responses evs; evs : recur lost; |] |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
286 |
==> KK <= Compl (range shrK) --> |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
287 |
Key K : analz (insert RB (Key``KK Un sees lost Spy evs)) = |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
288 |
(K : KK | Key K : analz (insert RB (sees lost Spy evs))) |
2449 | 289 |
*) |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
290 |
bind_thm ("resp_analz_image_freshK", |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
291 |
raw_analz_image_freshK RSN |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
292 |
(2, resp_analz_image_freshK_lemma) RS spec RS spec); |
2449 | 293 |
|
294 |
goal thy |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
295 |
"!!evs. [| evs : recur lost; KAB ~: range shrK |] ==> \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
296 |
\ Key K : analz (insert (Key KAB) (sees lost Spy evs)) = \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
297 |
\ (K = KAB | Key K : analz (sees lost Spy evs))"; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
298 |
by (asm_simp_tac (analz_image_freshK_ss addsimps [analz_image_freshK]) 1); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
299 |
qed "analz_insert_freshK"; |
2449 | 300 |
|
301 |
||
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
302 |
(*Everything that's hashed is already in past traffic. *) |
2550
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
303 |
goal thy "!!evs. [| Hash {|Key(shrK A), X|} : parts (sees lost Spy evs); \ |
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
304 |
\ evs : recur lost; A ~: lost |] \ |
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
305 |
\ ==> X : parts (sees lost Spy evs)"; |
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
306 |
by (etac rev_mp 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
307 |
by (etac recur.induct 1); |
2449 | 308 |
by parts_Fake_tac; |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
309 |
(*RA3 requires a further induction*) |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
310 |
by (etac responses.induct 5); |
2449 | 311 |
by (ALLGOALS Asm_simp_tac); |
312 |
(*Fake*) |
|
2485
c4368c967c56
Simplification of some proofs, especially by eliminating
paulson
parents:
2481
diff
changeset
|
313 |
by (best_tac (!claset addDs [impOfSubs analz_subset_parts, |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
314 |
impOfSubs Fake_parts_insert] |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
315 |
addss (!simpset addsimps [parts_insert_sees])) 2); |
2485
c4368c967c56
Simplification of some proofs, especially by eliminating
paulson
parents:
2481
diff
changeset
|
316 |
(*Two others*) |
c4368c967c56
Simplification of some proofs, especially by eliminating
paulson
parents:
2481
diff
changeset
|
317 |
by (REPEAT (fast_tac (!claset addss (!simpset)) 1)); |
2550
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
318 |
qed "Hash_imp_body"; |
2449 | 319 |
|
320 |
||
321 |
(** The Nonce NA uniquely identifies A's message. |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
322 |
This theorem applies to steps RA1 and RA2! |
2455
9c4444bfd44e
Simplification and generalization of the guarantees.
paulson
parents:
2451
diff
changeset
|
323 |
|
9c4444bfd44e
Simplification and generalization of the guarantees.
paulson
parents:
2451
diff
changeset
|
324 |
Unicity is not used in other proofs but is desirable in its own right. |
2449 | 325 |
**) |
326 |
||
327 |
goal thy |
|
328 |
"!!evs. [| evs : recur lost; A ~: lost |] \ |
|
329 |
\ ==> EX B' P'. ALL B P. \ |
|
330 |
\ Hash {|Key(shrK A), Agent A, Agent B, Nonce NA, P|} \ |
|
331 |
\ : parts (sees lost Spy evs) --> B=B' & P=P'"; |
|
2485
c4368c967c56
Simplification of some proofs, especially by eliminating
paulson
parents:
2481
diff
changeset
|
332 |
by (parts_induct_tac 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
333 |
by (etac responses.induct 3); |
2485
c4368c967c56
Simplification of some proofs, especially by eliminating
paulson
parents:
2481
diff
changeset
|
334 |
by (ALLGOALS (simp_tac (!simpset addsimps [all_conj_distrib]))); |
2449 | 335 |
by (step_tac (!claset addSEs partsEs) 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
336 |
(*RA1,2: creation of new Nonce. Move assertion into global context*) |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
337 |
by (ALLGOALS (expand_case_tac "NA = ?y")); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
338 |
by (REPEAT_FIRST (ares_tac [exI])); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
339 |
by (REPEAT (best_tac (!claset addSDs [Hash_imp_body] |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
340 |
addSEs sees_Spy_partsEs) 1)); |
2449 | 341 |
val lemma = result(); |
342 |
||
2481 | 343 |
goalw thy [HPair_def] |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
344 |
"!!evs.[| Hash[Key(shrK A)] {|Agent A, Agent B, Nonce NA, P|} \ |
2485
c4368c967c56
Simplification of some proofs, especially by eliminating
paulson
parents:
2481
diff
changeset
|
345 |
\ : parts (sees lost Spy evs); \ |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
346 |
\ Hash[Key(shrK A)] {|Agent A, Agent B', Nonce NA, P'|} \ |
2485
c4368c967c56
Simplification of some proofs, especially by eliminating
paulson
parents:
2481
diff
changeset
|
347 |
\ : parts (sees lost Spy evs); \ |
c4368c967c56
Simplification of some proofs, especially by eliminating
paulson
parents:
2481
diff
changeset
|
348 |
\ evs : recur lost; A ~: lost |] \ |
2449 | 349 |
\ ==> B=B' & P=P'"; |
2481 | 350 |
by (REPEAT (eresolve_tac partsEs 1)); |
2449 | 351 |
by (prove_unique_tac lemma 1); |
352 |
qed "unique_NA"; |
|
353 |
||
354 |
||
355 |
(*** Lemmas concerning the Server's response |
|
356 |
(relations "respond" and "responses") |
|
357 |
***) |
|
358 |
||
359 |
goal thy |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
360 |
"!!evs. [| RB : responses evs; evs : recur lost |] \ |
2449 | 361 |
\ ==> (Key (shrK B) : analz (insert RB (sees lost Spy evs))) = (B:lost)"; |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
362 |
by (etac responses.induct 1); |
2449 | 363 |
by (ALLGOALS |
364 |
(asm_simp_tac |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
365 |
(analz_image_freshK_ss addsimps [Spy_analz_shrK, |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
366 |
resp_analz_image_freshK]))); |
2449 | 367 |
qed "shrK_in_analz_respond"; |
368 |
Addsimps [shrK_in_analz_respond]; |
|
369 |
||
370 |
||
371 |
goal thy |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
372 |
"!!evs. [| RB : responses evs; \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
373 |
\ ALL K KK. KK <= Compl (range shrK) --> \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
374 |
\ (Key K : analz (Key``KK Un H)) = \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
375 |
\ (K : KK | Key K : analz H) |] \ |
2449 | 376 |
\ ==> (Key K : analz (insert RB H)) --> \ |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
377 |
\ (Key K : parts{RB} | Key K : analz H)"; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
378 |
by (etac responses.induct 1); |
2449 | 379 |
by (ALLGOALS |
380 |
(asm_simp_tac |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
381 |
(analz_image_freshK_ss addsimps [resp_analz_image_freshK_lemma]))); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
382 |
(*Simplification using two distinct treatments of "image"*) |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
383 |
by (simp_tac (!simpset addsimps [parts_insert2]) 1); |
2449 | 384 |
by (fast_tac (!claset delrules [allE]) 1); |
385 |
qed "resp_analz_insert_lemma"; |
|
386 |
||
387 |
bind_thm ("resp_analz_insert", |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
388 |
raw_analz_image_freshK RSN |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
389 |
(2, resp_analz_insert_lemma) RSN(2, rev_mp)); |
2449 | 390 |
|
391 |
||
392 |
(*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
|
393 |
assuming B~=Server in RA4.*) |
2449 | 394 |
goal thy |
395 |
"!!evs. evs : recur lost \ |
|
396 |
\ ==> ALL C X Y P. Says Server C {|X, Agent Server, Agent C, Y, P|} \ |
|
397 |
\ ~: set_of_list evs"; |
|
398 |
by (etac recur.induct 1); |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
399 |
by (etac (respond.induct) 5); |
2449 | 400 |
by (Auto_tac()); |
401 |
qed_spec_mp "Says_Server_not"; |
|
402 |
AddSEs [Says_Server_not RSN (2,rev_notE)]; |
|
403 |
||
404 |
||
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
405 |
(*The last key returned by respond indeed appears in a certificate*) |
2449 | 406 |
goal thy |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
407 |
"!!K. (Hash[Key(shrK A)] {|Agent A, B, NA, P|}, RA, K) : respond evs \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
408 |
\ ==> Crypt (shrK A) {|Key K, B, NA|} : parts {RA}"; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
409 |
by (etac respond.elim 1); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
410 |
by (ALLGOALS Asm_full_simp_tac); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
411 |
qed "respond_certificate"; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
412 |
|
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
413 |
|
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
414 |
goal thy |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
415 |
"!!K'. (PB,RB,KXY) : respond evs \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
416 |
\ ==> EX A' B'. ALL A B N. \ |
2449 | 417 |
\ Crypt (shrK A) {|Key K, Agent B, N|} : parts {RB} \ |
418 |
\ --> (A'=A & B'=B) | (A'=B & B'=A)"; |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
419 |
by (etac respond.induct 1); |
2449 | 420 |
by (ALLGOALS (asm_full_simp_tac (!simpset addsimps [all_conj_distrib]))); |
421 |
(*Base case*) |
|
422 |
by (Fast_tac 1); |
|
423 |
by (Step_tac 1); |
|
2550
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
424 |
by (expand_case_tac "K = KBC" 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
425 |
by (dtac respond_Key_in_parts 1); |
2449 | 426 |
by (best_tac (!claset addSIs [exI] |
427 |
addSEs partsEs |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
428 |
addDs [Key_in_parts_respond]) 1); |
2550
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
429 |
by (expand_case_tac "K = KAB" 1); |
2449 | 430 |
by (REPEAT (ares_tac [exI] 2)); |
431 |
by (ex_strip_tac 1); |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
432 |
by (dtac respond_certificate 1); |
2449 | 433 |
by (Fast_tac 1); |
434 |
val lemma = result(); |
|
435 |
||
436 |
goal thy |
|
437 |
"!!RB. [| Crypt (shrK A) {|Key K, Agent B, N|} : parts {RB}; \ |
|
438 |
\ Crypt (shrK A') {|Key K, Agent B', N'|} : parts {RB}; \ |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
439 |
\ (PB,RB,KXY) : respond evs |] \ |
2449 | 440 |
\ ==> (A'=A & B'=B) | (A'=B & B'=A)"; |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
441 |
by (prove_unique_tac lemma 1); (*50 seconds??, due to the disjunctions*) |
2449 | 442 |
qed "unique_session_keys"; |
443 |
||
444 |
||
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
445 |
(** Crucial secrecy property: Spy does not see the keys sent in msg RA3 |
2449 | 446 |
Does not in itself guarantee security: an attack could violate |
447 |
the premises, e.g. by having A=Spy **) |
|
448 |
||
449 |
goal thy |
|
2533 | 450 |
"!!evs. [| (PB,RB,KAB) : respond evs; evs : recur lost |] \ |
451 |
\ ==> ALL A A' N. A ~: lost & A' ~: lost --> \ |
|
2449 | 452 |
\ Crypt (shrK A) {|Key K, Agent A', N|} : parts{RB} --> \ |
453 |
\ Key K ~: analz (insert RB (sees lost Spy evs))"; |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
454 |
by (etac respond.induct 1); |
2449 | 455 |
by (forward_tac [respond_imp_responses] 2); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
456 |
by (forward_tac [respond_imp_not_used] 2); |
2533 | 457 |
by (ALLGOALS (*23 seconds*) |
2449 | 458 |
(asm_simp_tac |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
459 |
(analz_image_freshK_ss addsimps |
2533 | 460 |
[shrK_in_analz_respond, resp_analz_image_freshK, parts_insert2]))); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
461 |
by (ALLGOALS Simp_tac); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
462 |
by (fast_tac (!claset addIs [impOfSubs analz_subset_parts]) 1); |
2449 | 463 |
by (step_tac (!claset addSEs [MPair_parts]) 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
464 |
(** LEVEL 7 **) |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
465 |
by (fast_tac (!claset addSDs [resp_analz_insert, Key_in_parts_respond] |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
466 |
addDs [impOfSubs analz_subset_parts]) 4); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
467 |
by (fast_tac (!claset addSDs [respond_certificate]) 3); |
2449 | 468 |
by (best_tac (!claset addSEs partsEs |
469 |
addDs [Key_in_parts_respond] |
|
470 |
addss (!simpset)) 2); |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
471 |
by (dtac unique_session_keys 1); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
472 |
by (etac respond_certificate 1); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
473 |
by (assume_tac 1); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
474 |
by (Fast_tac 1); |
2533 | 475 |
qed_spec_mp "respond_Spy_not_see_session_key"; |
2449 | 476 |
|
477 |
||
478 |
goal thy |
|
2550
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
479 |
"!!evs. [| Crypt (shrK A) {|Key K, Agent A', N|} \ |
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
480 |
\ : parts (sees lost Spy evs); \ |
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
481 |
\ A ~: lost; A' ~: lost; evs : recur lost |] \ |
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
482 |
\ ==> Key K ~: analz (sees lost Spy evs)"; |
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
483 |
by (etac rev_mp 1); |
2449 | 484 |
by (etac recur.induct 1); |
485 |
by analz_Fake_tac; |
|
486 |
by (ALLGOALS |
|
487 |
(asm_simp_tac |
|
2533 | 488 |
(!simpset addsimps [parts_insert_sees, analz_insert_freshK] |
2449 | 489 |
setloop split_tac [expand_if]))); |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
490 |
(*RA4*) |
2533 | 491 |
by (spy_analz_tac 5); |
492 |
(*RA2*) |
|
493 |
by (spy_analz_tac 3); |
|
2449 | 494 |
(*Fake*) |
2533 | 495 |
by (spy_analz_tac 2); |
496 |
(*Base*) |
|
497 |
by (fast_tac (!claset addss (!simpset)) 1); |
|
498 |
(*RA3 remains*) |
|
2449 | 499 |
by (step_tac (!claset delrules [impCE]) 1); |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
500 |
(*RA3, case 2: K is an old key*) |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
501 |
by (best_tac (!claset addSDs [resp_analz_insert] |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
502 |
addSEs partsEs |
2533 | 503 |
addDs [Key_in_parts_respond] |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
504 |
addss (!simpset)) 2); |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
505 |
(*RA3, case 1: use lemma previously proved by induction*) |
2533 | 506 |
by (fast_tac (!claset addSEs [respond_Spy_not_see_session_key RSN |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
507 |
(2,rev_notE)]) 1); |
2550
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
508 |
qed "Spy_not_see_session_key"; |
2449 | 509 |
|
510 |
||
511 |
goal thy |
|
2533 | 512 |
"!!evs. [| Crypt (shrK A) {|Key K, Agent A', N|} \ |
513 |
\ : parts(sees lost Spy evs); \ |
|
514 |
\ C ~: {A,A',Server}; \ |
|
515 |
\ A ~: lost; A' ~: lost; evs : recur lost |] \ |
|
2449 | 516 |
\ ==> Key K ~: analz (sees lost C evs)"; |
517 |
by (rtac (subset_insertI RS sees_mono RS analz_mono RS contra_subsetD) 1); |
|
518 |
by (rtac (sees_lost_agent_subset_sees_Spy RS analz_mono RS contra_subsetD) 1); |
|
2533 | 519 |
by (FIRSTGOAL (rtac Spy_not_see_session_key)); |
520 |
by (REPEAT_FIRST |
|
521 |
(deepen_tac |
|
522 |
(!claset addIs (map impOfSubs [recur_mono, parts_mono, sees_mono])) 0)); |
|
523 |
qed "Agent_not_see_session_key"; |
|
2449 | 524 |
|
525 |
||
526 |
(**** Authenticity properties for Agents ****) |
|
527 |
||
2481 | 528 |
(*The response never contains Hashes*) |
529 |
goal thy |
|
2550
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
530 |
"!!evs. [| Hash {|Key (shrK B), M|} : parts (insert RB H); \ |
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
531 |
\ (PB,RB,K) : respond evs |] \ |
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
532 |
\ ==> Hash {|Key (shrK B), M|} : parts H"; |
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
533 |
by (etac rev_mp 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
534 |
by (etac (respond_imp_responses RS responses.induct) 1); |
2481 | 535 |
by (Auto_tac()); |
2550
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
536 |
qed "Hash_in_parts_respond"; |
2481 | 537 |
|
2533 | 538 |
(*Only RA1 or RA2 can have caused such a part of a message to appear. |
539 |
This result is of no use to B, who cannot verify the Hash. Moreover, |
|
540 |
it can say nothing about how recent A's message is. It might later be |
|
541 |
used to prove B's presence to A at the run's conclusion.*) |
|
2481 | 542 |
goalw thy [HPair_def] |
2449 | 543 |
"!!evs. [| Hash {|Key(shrK A), Agent A, Agent B, NA, P|} \ |
544 |
\ : parts (sees lost Spy evs); \ |
|
545 |
\ A ~: lost; evs : recur lost |] \ |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
546 |
\ ==> Says A B (Hash[Key(shrK A)] {|Agent A, Agent B, NA, P|}) \ |
2449 | 547 |
\ : set_of_list evs"; |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
548 |
by (etac rev_mp 1); |
2449 | 549 |
by (parts_induct_tac 1); |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
550 |
(*RA3*) |
2485
c4368c967c56
Simplification of some proofs, especially by eliminating
paulson
parents:
2481
diff
changeset
|
551 |
by (fast_tac (!claset addSDs [Hash_in_parts_respond]) 1); |
2449 | 552 |
qed_spec_mp "Hash_auth_sender"; |
553 |
||
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
554 |
(** These two results subsume (for all agents) the guarantees proved |
2449 | 555 |
separately for A and B in the Otway-Rees protocol. |
556 |
**) |
|
557 |
||
558 |
||
2533 | 559 |
(*Certificates can only originate with the Server.*) |
2449 | 560 |
goal thy |
2550
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
561 |
"!!evs. [| Crypt (shrK A) Y : parts (sees lost Spy evs); \ |
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
562 |
\ A ~: lost; A ~= Spy; evs : recur lost |] \ |
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
563 |
\ ==> EX C RC. Says Server C RC : set_of_list evs & \ |
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
564 |
\ Crypt (shrK A) Y : parts {RC}"; |
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
565 |
by (etac rev_mp 1); |
2449 | 566 |
by (parts_induct_tac 1); |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
567 |
(*RA4*) |
2455
9c4444bfd44e
Simplification and generalization of the guarantees.
paulson
parents:
2451
diff
changeset
|
568 |
by (Fast_tac 4); |
9c4444bfd44e
Simplification and generalization of the guarantees.
paulson
parents:
2451
diff
changeset
|
569 |
(*RA3*) |
9c4444bfd44e
Simplification and generalization of the guarantees.
paulson
parents:
2451
diff
changeset
|
570 |
by (full_simp_tac (!simpset addsimps [parts_insert_sees]) 3 |
9c4444bfd44e
Simplification and generalization of the guarantees.
paulson
parents:
2451
diff
changeset
|
571 |
THEN Fast_tac 3); |
9c4444bfd44e
Simplification and generalization of the guarantees.
paulson
parents:
2451
diff
changeset
|
572 |
(*RA1*) |
9c4444bfd44e
Simplification and generalization of the guarantees.
paulson
parents:
2451
diff
changeset
|
573 |
by (Fast_tac 1); |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
574 |
(*RA2: it cannot be a new Nonce, contradiction.*) |
2449 | 575 |
by (deepen_tac (!claset delrules [impCE] |
576 |
addSIs [disjI2] |
|
2455
9c4444bfd44e
Simplification and generalization of the guarantees.
paulson
parents:
2451
diff
changeset
|
577 |
addSEs [MPair_parts] |
2533 | 578 |
addDs [parts.Body] |
2449 | 579 |
addss (!simpset)) 0 1); |
2550
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
580 |
qed "Cert_imp_Server_msg"; |