author | paulson |
Mon, 05 May 1997 12:15:53 +0200 | |
changeset 3102 | 4d01cdc119d2 |
parent 2837 | dee1c7f1f576 |
child 3121 | cbb6c0c1c58a |
permissions | -rw-r--r-- |
1941 | 1 |
(* Title: HOL/Auth/OtwayRees |
2 |
ID: $Id$ |
|
3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
|
4 |
Copyright 1996 University of Cambridge |
|
5 |
||
6 |
Inductive relation "otway" for the Otway-Rees protocol. |
|
7 |
||
2014
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
8 |
Version that encrypts Nonce NB |
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
9 |
|
1941 | 10 |
From page 244 of |
11 |
Burrows, Abadi and Needham. A Logic of Authentication. |
|
12 |
Proc. Royal Soc. 426 (1989) |
|
13 |
*) |
|
14 |
||
15 |
open OtwayRees; |
|
16 |
||
17 |
proof_timing:=true; |
|
18 |
HOL_quantifiers := false; |
|
19 |
||
3102 | 20 |
(*Replacing the variable by a constant improves search speed by 50%!*) |
21 |
val Says_imp_sees_Spy' = |
|
22 |
read_instantiate_sg (sign_of thy) [("lost","lost")] Says_imp_sees_Spy; |
|
23 |
||
1996
33c42cae3dd0
Uses the improved enemy_analz_tac of Shared.ML, with simpler proofs
paulson
parents:
1967
diff
changeset
|
24 |
|
2328 | 25 |
(*A "possibility property": there are traces that reach the end*) |
1996
33c42cae3dd0
Uses the improved enemy_analz_tac of Shared.ML, with simpler proofs
paulson
parents:
1967
diff
changeset
|
26 |
goal thy |
33c42cae3dd0
Uses the improved enemy_analz_tac of Shared.ML, with simpler proofs
paulson
parents:
1967
diff
changeset
|
27 |
"!!A B. [| A ~= B; A ~= Server; B ~= Server |] \ |
2032 | 28 |
\ ==> EX K. EX NA. EX evs: otway lost. \ |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
29 |
\ Says B A {|Nonce NA, Crypt (shrK A) {|Nonce NA, Key K|}|} \ |
2014
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
30 |
\ : set_of_list evs"; |
1996
33c42cae3dd0
Uses the improved enemy_analz_tac of Shared.ML, with simpler proofs
paulson
parents:
1967
diff
changeset
|
31 |
by (REPEAT (resolve_tac [exI,bexI] 1)); |
2032 | 32 |
by (rtac (otway.Nil RS otway.OR1 RS otway.OR2 RS otway.OR3 RS otway.OR4) 2); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
33 |
by possibility_tac; |
2014
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
34 |
result(); |
1996
33c42cae3dd0
Uses the improved enemy_analz_tac of Shared.ML, with simpler proofs
paulson
parents:
1967
diff
changeset
|
35 |
|
33c42cae3dd0
Uses the improved enemy_analz_tac of Shared.ML, with simpler proofs
paulson
parents:
1967
diff
changeset
|
36 |
|
1941 | 37 |
(**** Inductive proofs about otway ****) |
38 |
||
2104
f5c9a91e4b50
Replaced excluded_middle_tac by case_tac; tidied proofs
paulson
parents:
2071
diff
changeset
|
39 |
(*Monotonicity*) |
2032 | 40 |
goal thy "!!evs. lost' <= lost ==> otway lost' <= otway lost"; |
41 |
by (rtac subsetI 1); |
|
42 |
by (etac otway.induct 1); |
|
3102 | 43 |
by (ALLGOALS |
44 |
(blast_tac (!claset addIs (impOfSubs(sees_mono RS analz_mono RS synth_mono) |
|
2032 | 45 |
:: otway.intrs)))); |
46 |
qed "otway_mono"; |
|
47 |
||
1941 | 48 |
(*Nobody sends themselves messages*) |
2032 | 49 |
goal thy "!!evs. evs : otway lost ==> ALL A X. Says A A X ~: set_of_list evs"; |
50 |
by (etac otway.induct 1); |
|
1941 | 51 |
by (Auto_tac()); |
52 |
qed_spec_mp "not_Says_to_self"; |
|
53 |
Addsimps [not_Says_to_self]; |
|
54 |
AddSEs [not_Says_to_self RSN (2, rev_notE)]; |
|
55 |
||
56 |
||
57 |
(** For reasoning about the encrypted portion of messages **) |
|
58 |
||
2135 | 59 |
goal thy "!!evs. Says A' B {|N, Agent A, Agent B, X|} : set_of_list evs \ |
60 |
\ ==> X : analz (sees lost Spy evs)"; |
|
3102 | 61 |
by (blast_tac (!claset addSDs [Says_imp_sees_Spy' RS analz.Inj]) 1); |
2032 | 62 |
qed "OR2_analz_sees_Spy"; |
1941 | 63 |
|
2837
dee1c7f1f576
Trivial renamings (for consistency with CSFW papers)
paulson
parents:
2637
diff
changeset
|
64 |
goal thy "!!evs. Says S' B {|N, X, Crypt (shrK B) X'|} : set_of_list evs \ |
2135 | 65 |
\ ==> X : analz (sees lost Spy evs)"; |
3102 | 66 |
by (blast_tac (!claset addSDs [Says_imp_sees_Spy' RS analz.Inj]) 1); |
2032 | 67 |
qed "OR4_analz_sees_Spy"; |
1941 | 68 |
|
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
69 |
goal thy "!!evs. Says Server B {|NA, X, Crypt K' {|NB,K|}|} : set_of_list evs \ |
2135 | 70 |
\ ==> K : parts (sees lost Spy evs)"; |
3102 | 71 |
by (blast_tac (!claset addSEs sees_Spy_partsEs) 1); |
2135 | 72 |
qed "Oops_parts_sees_Spy"; |
1941 | 73 |
|
74 |
(*OR2_analz... and OR4_analz... let us treat those cases using the same |
|
1964 | 75 |
argument as for the Fake case. This is possible for most, but not all, |
76 |
proofs: Fake does not invent new nonces (as in OR2), and of course Fake |
|
2032 | 77 |
messages originate from the Spy. *) |
1964 | 78 |
|
2032 | 79 |
bind_thm ("OR2_parts_sees_Spy", |
80 |
OR2_analz_sees_Spy RS (impOfSubs analz_subset_parts)); |
|
81 |
bind_thm ("OR4_parts_sees_Spy", |
|
82 |
OR4_analz_sees_Spy RS (impOfSubs analz_subset_parts)); |
|
83 |
||
84 |
(*We instantiate the variable to "lost". Leaving it as a Var makes proofs |
|
85 |
harder to complete, since simplification does less for us.*) |
|
2014
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
86 |
val parts_Fake_tac = |
2032 | 87 |
let val tac = forw_inst_tac [("lost","lost")] |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
88 |
in tac OR2_parts_sees_Spy 4 THEN |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
89 |
tac OR4_parts_sees_Spy 6 THEN |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
90 |
tac Oops_parts_sees_Spy 7 |
2032 | 91 |
end; |
1941 | 92 |
|
2064 | 93 |
(*For proving the easier theorems about X ~: parts (sees lost Spy evs) *) |
94 |
fun parts_induct_tac i = SELECT_GOAL |
|
95 |
(DETERM (etac otway.induct 1 THEN parts_Fake_tac THEN |
|
2171 | 96 |
(*Fake message*) |
97 |
TRY (best_tac (!claset addDs [impOfSubs analz_subset_parts, |
|
98 |
impOfSubs Fake_parts_insert] |
|
2637
e9b203f854ae
reflecting my recent changes of the simplifier and classical reasoner
oheimb
parents:
2516
diff
changeset
|
99 |
unsafe_addss (!simpset)) 2)) THEN |
2064 | 100 |
(*Base case*) |
2637
e9b203f854ae
reflecting my recent changes of the simplifier and classical reasoner
oheimb
parents:
2516
diff
changeset
|
101 |
fast_tac (!claset unsafe_addss (!simpset)) 1 THEN |
2064 | 102 |
ALLGOALS Asm_simp_tac) i; |
1941 | 103 |
|
2032 | 104 |
(** Theorems of the form X ~: parts (sees lost Spy evs) imply that NOBODY |
2014
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
105 |
sends messages containing X! **) |
1941 | 106 |
|
2064 | 107 |
(*Spy never sees another agent's shared key! (unless it's lost at start)*) |
1941 | 108 |
goal thy |
2135 | 109 |
"!!evs. evs : otway lost \ |
110 |
\ ==> (Key (shrK A) : parts (sees lost Spy evs)) = (A : lost)"; |
|
2064 | 111 |
by (parts_induct_tac 1); |
1941 | 112 |
by (Auto_tac()); |
2135 | 113 |
qed "Spy_see_shrK"; |
114 |
Addsimps [Spy_see_shrK]; |
|
1941 | 115 |
|
2135 | 116 |
goal thy |
117 |
"!!evs. evs : otway lost \ |
|
118 |
\ ==> (Key (shrK A) : analz (sees lost Spy evs)) = (A : lost)"; |
|
119 |
by (auto_tac(!claset addDs [impOfSubs analz_subset_parts], !simpset)); |
|
120 |
qed "Spy_analz_shrK"; |
|
121 |
Addsimps [Spy_analz_shrK]; |
|
1941 | 122 |
|
2135 | 123 |
goal thy "!!A. [| Key (shrK A) : parts (sees lost Spy evs); \ |
124 |
\ evs : otway lost |] ==> A:lost"; |
|
3102 | 125 |
by (blast_tac (!claset addDs [Spy_see_shrK]) 1); |
2135 | 126 |
qed "Spy_see_shrK_D"; |
1941 | 127 |
|
2135 | 128 |
bind_thm ("Spy_analz_shrK_D", analz_subset_parts RS subsetD RS Spy_see_shrK_D); |
129 |
AddSDs [Spy_see_shrK_D, Spy_analz_shrK_D]; |
|
1941 | 130 |
|
131 |
||
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
132 |
(*Nobody can have used non-existent keys!*) |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
133 |
goal thy "!!evs. evs : otway lost ==> \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
134 |
\ Key K ~: used evs --> K ~: keysFor (parts (sees lost Spy evs))"; |
2160 | 135 |
by (parts_induct_tac 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
136 |
(*Fake*) |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
137 |
by (best_tac |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
138 |
(!claset addIs [impOfSubs analz_subset_parts] |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
139 |
addDs [impOfSubs (analz_subset_parts RS keysFor_mono), |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
140 |
impOfSubs (parts_insert_subset_Un RS keysFor_mono)] |
2637
e9b203f854ae
reflecting my recent changes of the simplifier and classical reasoner
oheimb
parents:
2516
diff
changeset
|
141 |
unsafe_addss (!simpset)) 1); |
3102 | 142 |
by (ALLGOALS Blast_tac); |
2160 | 143 |
qed_spec_mp "new_keys_not_used"; |
1941 | 144 |
|
145 |
bind_thm ("new_keys_not_analzd", |
|
2032 | 146 |
[analz_subset_parts RS keysFor_mono, |
147 |
new_keys_not_used] MRS contra_subsetD); |
|
1941 | 148 |
|
149 |
Addsimps [new_keys_not_used, new_keys_not_analzd]; |
|
150 |
||
151 |
||
2064 | 152 |
|
153 |
(*** Proofs involving analz ***) |
|
154 |
||
2135 | 155 |
(*Describes the form of K and NA when the Server sends this message. Also |
156 |
for Oops case.*) |
|
2064 | 157 |
goal thy |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
158 |
"!!evs. [| Says Server B \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
159 |
\ {|NA, X, Crypt (shrK B) {|NB, Key K|}|} : set_of_list evs; \ |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2417
diff
changeset
|
160 |
\ evs : otway lost |] \ |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
161 |
\ ==> K ~: range shrK & (EX i. NA = Nonce i) & (EX j. NB = Nonce j)"; |
2135 | 162 |
by (etac rev_mp 1); |
163 |
by (etac otway.induct 1); |
|
3102 | 164 |
by (ALLGOALS Simp_tac); |
165 |
by (ALLGOALS Blast_tac); |
|
2135 | 166 |
qed "Says_Server_message_form"; |
2064 | 167 |
|
168 |
||
169 |
(*For proofs involving analz. We again instantiate the variable to "lost".*) |
|
170 |
val analz_Fake_tac = |
|
171 |
dres_inst_tac [("lost","lost")] OR2_analz_sees_Spy 4 THEN |
|
172 |
dres_inst_tac [("lost","lost")] OR4_analz_sees_Spy 6 THEN |
|
2135 | 173 |
forw_inst_tac [("lost","lost")] Says_Server_message_form 7 THEN |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
174 |
assume_tac 7 THEN |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2417
diff
changeset
|
175 |
REPEAT ((eresolve_tac [exE, conjE] ORELSE' hyp_subst_tac) 7); |
1941 | 176 |
|
177 |
||
178 |
(**** |
|
179 |
The following is to prove theorems of the form |
|
180 |
||
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
181 |
Key K : analz (insert (Key KAB) (sees lost Spy evs)) ==> |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2417
diff
changeset
|
182 |
Key K : analz (sees lost Spy evs) |
1941 | 183 |
|
184 |
A more general formula must be proved inductively. |
|
185 |
****) |
|
186 |
||
187 |
||
188 |
(** Session keys are not used to encrypt other session keys **) |
|
189 |
||
2014
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
190 |
(*The equality makes the induction hypothesis easier to apply*) |
1941 | 191 |
goal thy |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
192 |
"!!evs. evs : otway lost ==> \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
193 |
\ ALL K KK. KK <= Compl (range shrK) --> \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
194 |
\ (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:
2451
diff
changeset
|
195 |
\ (K : KK | Key K : analz (sees lost Spy evs))"; |
2032 | 196 |
by (etac otway.induct 1); |
2064 | 197 |
by analz_Fake_tac; |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
198 |
by (REPEAT_FIRST (resolve_tac [allI, impI])); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
199 |
by (REPEAT_FIRST (rtac analz_image_freshK_lemma )); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
200 |
by (ALLGOALS (asm_simp_tac analz_image_freshK_ss)); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
201 |
(*Base*) |
3102 | 202 |
by (Blast_tac 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
203 |
(*Fake, OR2, OR4*) |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
204 |
by (REPEAT (spy_analz_tac 1)); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
205 |
qed_spec_mp "analz_image_freshK"; |
1941 | 206 |
|
207 |
||
208 |
goal thy |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
209 |
"!!evs. [| evs : otway lost; KAB ~: range shrK |] ==> \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
210 |
\ 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:
2451
diff
changeset
|
211 |
\ (K = KAB | Key K : analz (sees lost Spy evs))"; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
212 |
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:
2451
diff
changeset
|
213 |
qed "analz_insert_freshK"; |
1941 | 214 |
|
215 |
||
2026
0df5a96bf77e
Last working version prior to introduction of "lost"
paulson
parents:
2014
diff
changeset
|
216 |
(*** The Key K uniquely identifies the Server's message. **) |
2014
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
217 |
|
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
218 |
goal thy |
2135 | 219 |
"!!evs. evs : otway lost ==> \ |
220 |
\ EX B' NA' NB' X'. ALL B NA NB X. \ |
|
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
221 |
\ Says Server B {|NA, X, Crypt (shrK B) {|NB, K|}|} : set_of_list evs --> \ |
2135 | 222 |
\ B=B' & NA=NA' & NB=NB' & X=X'"; |
2032 | 223 |
by (etac otway.induct 1); |
2014
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
224 |
by (ALLGOALS (asm_simp_tac (!simpset addsimps [all_conj_distrib]))); |
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
225 |
by (Step_tac 1); |
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
226 |
(*Remaining cases: OR3 and OR4*) |
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
227 |
by (ex_strip_tac 2); |
3102 | 228 |
by (Best_tac 2); |
2064 | 229 |
by (expand_case_tac "K = ?y" 1); |
230 |
by (REPEAT (ares_tac [refl,exI,impI,conjI] 2)); |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
231 |
(*...we assume X is a recent message, and handle this case by contradiction*) |
3102 | 232 |
by (blast_tac (!claset addSEs sees_Spy_partsEs |
233 |
delrules [conjI] (*no split-up into 4 subgoals*)) 1); |
|
2014
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
234 |
val lemma = result(); |
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
235 |
|
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
236 |
goal thy |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
237 |
"!!evs. [| Says Server B {|NA, X, Crypt (shrK B) {|NB, K|}|} \ |
2014
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
238 |
\ : set_of_list evs; \ |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
239 |
\ Says Server B' {|NA',X',Crypt (shrK B') {|NB',K|}|} \ |
2014
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
240 |
\ : set_of_list evs; \ |
2135 | 241 |
\ evs : otway lost |] ==> X=X' & B=B' & NA=NA' & NB=NB'"; |
2417 | 242 |
by (prove_unique_tac lemma 1); |
2014
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
243 |
qed "unique_session_keys"; |
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
244 |
|
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
245 |
|
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
246 |
|
2048 | 247 |
(**** Authenticity properties relating to NA ****) |
2014
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
248 |
|
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
249 |
(*Only OR1 can have caused such a part of a message to appear.*) |
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
250 |
goal thy |
2064 | 251 |
"!!evs. [| A ~: lost; evs : otway lost |] \ |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
252 |
\ ==> Crypt (shrK A) {|NA, Agent A, Agent B|} \ |
2064 | 253 |
\ : parts (sees lost Spy evs) --> \ |
254 |
\ Says A B {|NA, Agent A, Agent B, \ |
|
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
255 |
\ Crypt (shrK A) {|NA, Agent A, Agent B|}|} \ |
2014
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
256 |
\ : set_of_list evs"; |
2064 | 257 |
by (parts_induct_tac 1); |
2014
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
258 |
qed_spec_mp "Crypt_imp_OR1"; |
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
259 |
|
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
260 |
|
2064 | 261 |
(** The Nonce NA uniquely identifies A's message. **) |
2014
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
262 |
|
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
263 |
goal thy |
2032 | 264 |
"!!evs. [| evs : otway lost; A ~: lost |] \ |
2014
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
265 |
\ ==> EX B'. ALL B. \ |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
266 |
\ Crypt (shrK A) {|NA, Agent A, Agent B|} : parts (sees lost Spy evs) \ |
2048 | 267 |
\ --> B = B'"; |
2064 | 268 |
by (parts_induct_tac 1); |
269 |
by (simp_tac (!simpset addsimps [all_conj_distrib]) 1); |
|
2026
0df5a96bf77e
Last working version prior to introduction of "lost"
paulson
parents:
2014
diff
changeset
|
270 |
(*OR1: creation of new Nonce. Move assertion into global context*) |
2064 | 271 |
by (expand_case_tac "NA = ?y" 1); |
3102 | 272 |
by (blast_tac (!claset addSEs sees_Spy_partsEs) 1); |
2014
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
273 |
val lemma = result(); |
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
274 |
|
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
275 |
goal thy |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
276 |
"!!evs.[| Crypt (shrK A) {|NA, Agent A, Agent B|}: parts(sees lost Spy evs); \ |
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
277 |
\ Crypt (shrK A) {|NA, Agent A, Agent C|}: parts(sees lost Spy evs); \ |
2048 | 278 |
\ evs : otway lost; A ~: lost |] \ |
2014
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
279 |
\ ==> B = C"; |
2417 | 280 |
by (prove_unique_tac lemma 1); |
2048 | 281 |
qed "unique_NA"; |
2014
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
282 |
|
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
283 |
|
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
284 |
(*It is impossible to re-use a nonce in both OR1 and OR2. This holds because |
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
285 |
OR2 encrypts Nonce NB. It prevents the attack that can occur in the |
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
286 |
over-simplified version of this protocol: see OtwayRees_Bad.*) |
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
287 |
goal thy |
2328 | 288 |
"!!evs. [| A ~: lost; evs : otway lost |] \ |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
289 |
\ ==> Crypt (shrK A) {|NA, Agent A, Agent B|} \ |
2328 | 290 |
\ : parts (sees lost Spy evs) --> \ |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
291 |
\ Crypt (shrK A) {|NA', NA, Agent A', Agent A|} \ |
2032 | 292 |
\ ~: parts (sees lost Spy evs)"; |
2071
0debdc018d26
Put in a simpler and *much* faster proof of no_nonce_OR1_OR2
paulson
parents:
2064
diff
changeset
|
293 |
by (parts_induct_tac 1); |
3102 | 294 |
by (REPEAT (blast_tac (!claset addSEs sees_Spy_partsEs |
295 |
addSDs [impOfSubs parts_insert_subset_Un]) 1)); |
|
2014
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
296 |
qed_spec_mp"no_nonce_OR1_OR2"; |
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
297 |
|
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
298 |
|
2053 | 299 |
(*Crucial property: If the encrypted message appears, and A has used NA |
300 |
to start a run, then it originated with the Server!*) |
|
2014
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
301 |
goal thy |
2048 | 302 |
"!!evs. [| A ~: lost; A ~= Spy; evs : otway lost |] \ |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
303 |
\ ==> Crypt (shrK A) {|NA, Key K|} : parts (sees lost Spy evs) \ |
2048 | 304 |
\ --> Says A B {|NA, Agent A, Agent B, \ |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
305 |
\ Crypt (shrK A) {|NA, Agent A, Agent B|}|} \ |
2048 | 306 |
\ : set_of_list evs --> \ |
307 |
\ (EX NB. Says Server B \ |
|
308 |
\ {|NA, \ |
|
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
309 |
\ Crypt (shrK A) {|NA, Key K|}, \ |
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
310 |
\ Crypt (shrK B) {|NB, Key K|}|} \ |
2014
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
311 |
\ : set_of_list evs)"; |
2064 | 312 |
by (parts_induct_tac 1); |
2014
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
313 |
(*OR1: it cannot be a new Nonce, contradiction.*) |
3102 | 314 |
by (blast_tac (!claset addSIs [parts_insertI] addSEs sees_Spy_partsEs) 1); |
2064 | 315 |
(*OR3 and OR4*) |
2014
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
316 |
(*OR4*) |
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
317 |
by (REPEAT (Safe_step_tac 2)); |
3102 | 318 |
by (REPEAT (blast_tac (!claset addSDs [parts_cut]) 3)); |
2014
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
319 |
by (fast_tac (!claset addSIs [Crypt_imp_OR1] |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
320 |
addEs sees_Spy_partsEs) 2); |
2064 | 321 |
(*OR3*) (** LEVEL 5 **) |
322 |
by (asm_simp_tac (!simpset addsimps [ex_disj_distrib]) 1); |
|
2014
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
323 |
by (step_tac (!claset delrules [disjCI, impCE]) 1); |
3102 | 324 |
by (blast_tac (!claset addSEs [MPair_parts] |
325 |
addSDs [Says_imp_sees_Spy' RS parts.Inj] |
|
2014
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
326 |
addEs [no_nonce_OR1_OR2 RSN (2, rev_notE)] |
2048 | 327 |
delrules [conjI] (*stop split-up into 4 subgoals*)) 2); |
3102 | 328 |
by (blast_tac (!claset addSDs [Says_imp_sees_Spy' RS parts.Inj] |
2048 | 329 |
addSEs [MPair_parts] |
3102 | 330 |
addIs [unique_NA]) 1); |
2048 | 331 |
qed_spec_mp "NA_Crypt_imp_Server_msg"; |
2014
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
332 |
|
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
333 |
|
2053 | 334 |
(*Corollary: if A receives B's OR4 message and the nonce NA agrees |
2014
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
335 |
then the key really did come from the Server! CANNOT prove this of the |
2048 | 336 |
bad form of this protocol, even though we can prove |
2032 | 337 |
Spy_not_see_encrypted_key*) |
2014
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
338 |
goal thy |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
339 |
"!!evs. [| Says B' A {|NA, Crypt (shrK A) {|NA, Key K|}|} \ |
2053 | 340 |
\ : set_of_list evs; \ |
341 |
\ Says A B {|NA, Agent A, Agent B, \ |
|
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
342 |
\ Crypt (shrK A) {|NA, Agent A, Agent B|}|} \ |
2053 | 343 |
\ : set_of_list evs; \ |
344 |
\ A ~: lost; A ~= Spy; evs : otway lost |] \ |
|
345 |
\ ==> EX NB. Says Server B \ |
|
2048 | 346 |
\ {|NA, \ |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
347 |
\ Crypt (shrK A) {|NA, Key K|}, \ |
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
348 |
\ Crypt (shrK B) {|NB, Key K|}|} \ |
2053 | 349 |
\ : set_of_list evs"; |
3102 | 350 |
by (blast_tac (!claset addSIs [NA_Crypt_imp_Server_msg] |
351 |
addEs sees_Spy_partsEs) 1); |
|
2328 | 352 |
qed "A_trusts_OR4"; |
2014
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
353 |
|
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
354 |
|
2048 | 355 |
(** Crucial secrecy property: Spy does not see the keys sent in msg OR3 |
356 |
Does not in itself guarantee security: an attack could violate |
|
357 |
the premises, e.g. by having A=Spy **) |
|
2014
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
358 |
|
1941 | 359 |
goal thy |
2166 | 360 |
"!!evs. [| A ~: lost; B ~: lost; evs : otway lost |] \ |
2048 | 361 |
\ ==> Says Server B \ |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
362 |
\ {|NA, Crypt (shrK A) {|NA, Key K|}, \ |
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
363 |
\ Crypt (shrK B) {|NB, Key K|}|} : set_of_list evs --> \ |
2135 | 364 |
\ Says B Spy {|NA, NB, Key K|} ~: set_of_list evs --> \ |
2048 | 365 |
\ Key K ~: analz (sees lost Spy evs)"; |
2032 | 366 |
by (etac otway.induct 1); |
2064 | 367 |
by analz_Fake_tac; |
1964 | 368 |
by (ALLGOALS |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
369 |
(asm_simp_tac (!simpset addcongs [conj_cong] |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
370 |
addsimps [not_parts_not_analz, analz_insert_freshK] |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
371 |
setloop split_tac [expand_if]))); |
1941 | 372 |
(*OR3*) |
3102 | 373 |
by (blast_tac (!claset delrules [impCE] |
374 |
addSEs sees_Spy_partsEs |
|
375 |
addIs [impOfSubs analz_subset_parts]) 3); |
|
2135 | 376 |
(*OR4, OR2, Fake*) |
2375 | 377 |
by (REPEAT_FIRST spy_analz_tac); |
2135 | 378 |
(*Oops*) (** LEVEL 5 **) |
3102 | 379 |
by (blast_tac (!claset addSDs [unique_session_keys]) 1); |
2014
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
380 |
val lemma = result() RS mp RS mp RSN(2,rev_notE); |
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
381 |
|
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
382 |
goal thy |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
383 |
"!!evs. [| Says Server B \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
384 |
\ {|NA, Crypt (shrK A) {|NA, Key K|}, \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
385 |
\ Crypt (shrK B) {|NB, Key K|}|} : set_of_list evs; \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
386 |
\ Says B Spy {|NA, NB, Key K|} ~: set_of_list evs; \ |
2032 | 387 |
\ A ~: lost; B ~: lost; evs : otway lost |] \ |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
388 |
\ ==> Key K ~: analz (sees lost Spy evs)"; |
2014
5be4c8ca7b25
Correction of protocol; addition of Reveal message; proofs of
paulson
parents:
1999
diff
changeset
|
389 |
by (forward_tac [Says_Server_message_form] 1 THEN assume_tac 1); |
3102 | 390 |
by (blast_tac (!claset addSEs [lemma]) 1); |
2032 | 391 |
qed "Spy_not_see_encrypted_key"; |
392 |
||
1945 | 393 |
|
2032 | 394 |
goal thy |
2048 | 395 |
"!!evs. [| C ~: {A,B,Server}; \ |
396 |
\ Says Server B \ |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
397 |
\ {|NA, Crypt (shrK A) {|NA, Key K|}, \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
398 |
\ Crypt (shrK B) {|NB, Key K|}|} : set_of_list evs; \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
399 |
\ Says B Spy {|NA, NB, Key K|} ~: set_of_list evs; \ |
2032 | 400 |
\ A ~: lost; B ~: lost; evs : otway lost |] \ |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
401 |
\ ==> Key K ~: analz (sees lost C evs)"; |
2032 | 402 |
by (rtac (subset_insertI RS sees_mono RS analz_mono RS contra_subsetD) 1); |
403 |
by (rtac (sees_lost_agent_subset_sees_Spy RS analz_mono RS contra_subsetD) 1); |
|
404 |
by (FIRSTGOAL (rtac Spy_not_see_encrypted_key)); |
|
3102 | 405 |
by (REPEAT_FIRST (blast_tac (!claset addIs [otway_mono RS subsetD]))); |
2032 | 406 |
qed "Agent_not_see_encrypted_key"; |
1945 | 407 |
|
408 |
||
2048 | 409 |
(**** Authenticity properties relating to NB ****) |
410 |
||
411 |
(*Only OR2 can have caused such a part of a message to appear. We do not |
|
2194
63a68a3a8a76
Removal of an obsolete result, and authentication of
paulson
parents:
2171
diff
changeset
|
412 |
know anything about X: it does NOT have to have the right form.*) |
2048 | 413 |
goal thy |
414 |
"!!evs. [| B ~: lost; evs : otway lost |] \ |
|
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
415 |
\ ==> Crypt (shrK B) {|NA, NB, Agent A, Agent B|} \ |
2048 | 416 |
\ : parts (sees lost Spy evs) --> \ |
2194
63a68a3a8a76
Removal of an obsolete result, and authentication of
paulson
parents:
2171
diff
changeset
|
417 |
\ (EX X. Says B Server \ |
63a68a3a8a76
Removal of an obsolete result, and authentication of
paulson
parents:
2171
diff
changeset
|
418 |
\ {|NA, Agent A, Agent B, X, \ |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
419 |
\ Crypt (shrK B) {|NA, NB, Agent A, Agent B|}|} \ |
2048 | 420 |
\ : set_of_list evs)"; |
2064 | 421 |
by (parts_induct_tac 1); |
3102 | 422 |
by (ALLGOALS Blast_tac); |
2194
63a68a3a8a76
Removal of an obsolete result, and authentication of
paulson
parents:
2171
diff
changeset
|
423 |
bind_thm ("Crypt_imp_OR2", result() RSN (2,rev_mp) RS exE); |
2048 | 424 |
|
425 |
||
426 |
(** The Nonce NB uniquely identifies B's message. **) |
|
427 |
||
428 |
goal thy |
|
429 |
"!!evs. [| evs : otway lost; B ~: lost |] \ |
|
2064 | 430 |
\ ==> EX NA' A'. ALL NA A. \ |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
431 |
\ Crypt (shrK B) {|NA, NB, Agent A, Agent B|} : parts(sees lost Spy evs) \ |
2048 | 432 |
\ --> NA = NA' & A = A'"; |
2064 | 433 |
by (parts_induct_tac 1); |
434 |
by (simp_tac (!simpset addsimps [all_conj_distrib]) 1); |
|
2048 | 435 |
(*OR2: creation of new Nonce. Move assertion into global context*) |
2064 | 436 |
by (expand_case_tac "NB = ?y" 1); |
3102 | 437 |
by (blast_tac (!claset addSEs sees_Spy_partsEs) 1); |
2048 | 438 |
val lemma = result(); |
439 |
||
440 |
goal thy |
|
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
441 |
"!!evs.[| Crypt (shrK B) {|NA, NB, Agent A, Agent B|} \ |
2048 | 442 |
\ : parts(sees lost Spy evs); \ |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
443 |
\ Crypt (shrK B) {|NC, NB, Agent C, Agent B|} \ |
2048 | 444 |
\ : parts(sees lost Spy evs); \ |
445 |
\ evs : otway lost; B ~: lost |] \ |
|
446 |
\ ==> NC = NA & C = A"; |
|
2417 | 447 |
by (prove_unique_tac lemma 1); |
2048 | 448 |
qed "unique_NB"; |
449 |
||
450 |
||
451 |
(*If the encrypted message appears, and B has used Nonce NB, |
|
452 |
then it originated with the Server!*) |
|
453 |
goal thy |
|
454 |
"!!evs. [| B ~: lost; B ~= Spy; evs : otway lost |] \ |
|
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
455 |
\ ==> Crypt (shrK B) {|NB, Key K|} : parts (sees lost Spy evs) \ |
2048 | 456 |
\ --> (ALL X'. Says B Server \ |
457 |
\ {|NA, Agent A, Agent B, X', \ |
|
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
458 |
\ Crypt (shrK B) {|NA, NB, Agent A, Agent B|}|} \ |
2048 | 459 |
\ : set_of_list evs \ |
460 |
\ --> Says Server B \ |
|
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
461 |
\ {|NA, Crypt (shrK A) {|NA, Key K|}, \ |
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
462 |
\ Crypt (shrK B) {|NB, Key K|}|} \ |
2048 | 463 |
\ : set_of_list evs)"; |
2064 | 464 |
by (parts_induct_tac 1); |
2048 | 465 |
(*OR1: it cannot be a new Nonce, contradiction.*) |
3102 | 466 |
by (blast_tac (!claset addSIs [parts_insertI] addSEs sees_Spy_partsEs) 1); |
2048 | 467 |
(*OR4*) |
3102 | 468 |
by (blast_tac (!claset addSEs [MPair_parts, Crypt_imp_OR2]) 2); |
2194
63a68a3a8a76
Removal of an obsolete result, and authentication of
paulson
parents:
2171
diff
changeset
|
469 |
(*OR3*) |
2048 | 470 |
by (step_tac (!claset delrules [disjCI, impCE]) 1); |
3102 | 471 |
by (blast_tac (!claset delrules [conjI] (*stop split-up*)) 3); |
472 |
by (blast_tac (!claset addSDs [Says_imp_sees_Spy' RS parts.Inj] |
|
473 |
addSEs [MPair_parts] |
|
474 |
addDs [unique_NB]) 2); |
|
475 |
by (blast_tac (!claset addSEs [MPair_parts, no_nonce_OR1_OR2 RSN (2, rev_notE)] |
|
476 |
addSDs [Says_imp_sees_Spy' RS parts.Inj] |
|
477 |
delrules [conjI, impCE] (*stop split-up*)) 1); |
|
2048 | 478 |
qed_spec_mp "NB_Crypt_imp_Server_msg"; |
479 |
||
480 |
||
481 |
(*Guarantee for B: if it gets a message with matching NB then the Server |
|
482 |
has sent the correct message.*) |
|
483 |
goal thy |
|
484 |
"!!evs. [| B ~: lost; B ~= Spy; evs : otway lost; \ |
|
2837
dee1c7f1f576
Trivial renamings (for consistency with CSFW papers)
paulson
parents:
2637
diff
changeset
|
485 |
\ Says S' B {|NA, X, Crypt (shrK B) {|NB, Key K|}|} \ |
2048 | 486 |
\ : set_of_list evs; \ |
487 |
\ Says B Server {|NA, Agent A, Agent B, X', \ |
|
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
488 |
\ Crypt (shrK B) {|NA, NB, Agent A, Agent B|} |} \ |
2048 | 489 |
\ : set_of_list evs |] \ |
490 |
\ ==> Says Server B \ |
|
491 |
\ {|NA, \ |
|
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
492 |
\ Crypt (shrK A) {|NA, Key K|}, \ |
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
493 |
\ Crypt (shrK B) {|NB, Key K|}|} \ |
2048 | 494 |
\ : set_of_list evs"; |
3102 | 495 |
by (blast_tac (!claset addSIs [NB_Crypt_imp_Server_msg] |
496 |
addSEs sees_Spy_partsEs) 1); |
|
2328 | 497 |
qed "B_trusts_OR3"; |
2048 | 498 |
|
499 |
||
2328 | 500 |
B_trusts_OR3 RS Spy_not_see_encrypted_key; |
2048 | 501 |
|
502 |
||
1945 | 503 |
goal thy |
2214 | 504 |
"!!evs. [| B ~: lost; evs : otway lost |] \ |
505 |
\ ==> Says Server B \ |
|
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
506 |
\ {|NA, Crypt (shrK A) {|NA, Key K|}, \ |
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
507 |
\ Crypt (shrK B) {|NB, Key K|}|} : set_of_list evs --> \ |
2214 | 508 |
\ (EX X. Says B Server {|NA, Agent A, Agent B, X, \ |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
509 |
\ Crypt (shrK B) {|NA, NB, Agent A, Agent B|} |} \ |
2194
63a68a3a8a76
Removal of an obsolete result, and authentication of
paulson
parents:
2171
diff
changeset
|
510 |
\ : set_of_list evs)"; |
2032 | 511 |
by (etac otway.induct 1); |
3102 | 512 |
by (ALLGOALS Asm_simp_tac); |
513 |
by (blast_tac (!claset addDs [Says_imp_sees_Spy' RS parts.Inj] |
|
514 |
addSEs [MPair_parts, Crypt_imp_OR2]) 3); |
|
515 |
by (ALLGOALS Blast_tac); |
|
2194
63a68a3a8a76
Removal of an obsolete result, and authentication of
paulson
parents:
2171
diff
changeset
|
516 |
bind_thm ("OR3_imp_OR2", result() RSN (2,rev_mp) RS exE); |
63a68a3a8a76
Removal of an obsolete result, and authentication of
paulson
parents:
2171
diff
changeset
|
517 |
|
63a68a3a8a76
Removal of an obsolete result, and authentication of
paulson
parents:
2171
diff
changeset
|
518 |
|
63a68a3a8a76
Removal of an obsolete result, and authentication of
paulson
parents:
2171
diff
changeset
|
519 |
(*After getting and checking OR4, agent A can trust that B has been active. |
63a68a3a8a76
Removal of an obsolete result, and authentication of
paulson
parents:
2171
diff
changeset
|
520 |
We could probably prove that X has the expected form, but that is not |
63a68a3a8a76
Removal of an obsolete result, and authentication of
paulson
parents:
2171
diff
changeset
|
521 |
strictly necessary for authentication.*) |
63a68a3a8a76
Removal of an obsolete result, and authentication of
paulson
parents:
2171
diff
changeset
|
522 |
goal thy |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
523 |
"!!evs. [| Says B' A {|NA, Crypt (shrK A) {|NA, Key K|}|} \ |
2194
63a68a3a8a76
Removal of an obsolete result, and authentication of
paulson
parents:
2171
diff
changeset
|
524 |
\ : set_of_list evs; \ |
63a68a3a8a76
Removal of an obsolete result, and authentication of
paulson
parents:
2171
diff
changeset
|
525 |
\ Says A B {|NA, Agent A, Agent B, \ |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
526 |
\ Crypt (shrK A) {|NA, Agent A, Agent B|}|} \ |
2194
63a68a3a8a76
Removal of an obsolete result, and authentication of
paulson
parents:
2171
diff
changeset
|
527 |
\ : set_of_list evs; \ |
63a68a3a8a76
Removal of an obsolete result, and authentication of
paulson
parents:
2171
diff
changeset
|
528 |
\ A ~: lost; A ~= Spy; B ~: lost; evs : otway lost |] \ |
63a68a3a8a76
Removal of an obsolete result, and authentication of
paulson
parents:
2171
diff
changeset
|
529 |
\ ==> EX NB X. Says B Server {|NA, Agent A, Agent B, X, \ |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
530 |
\ Crypt (shrK B) {|NA, NB, Agent A, Agent B|} |}\ |
2194
63a68a3a8a76
Removal of an obsolete result, and authentication of
paulson
parents:
2171
diff
changeset
|
531 |
\ : set_of_list evs"; |
3102 | 532 |
by (blast_tac (!claset addSDs [A_trusts_OR4] |
533 |
addSEs [OR3_imp_OR2]) 1); |
|
2194
63a68a3a8a76
Removal of an obsolete result, and authentication of
paulson
parents:
2171
diff
changeset
|
534 |
qed "A_auths_B"; |