author | paulson |
Mon, 05 May 1997 12:15:53 +0200 | |
changeset 3102 | 4d01cdc119d2 |
parent 2837 | dee1c7f1f576 |
child 3121 | cbb6c0c1c58a |
permissions | -rw-r--r-- |
2002 | 1 |
(* Title: HOL/Auth/OtwayRees_Bad |
2 |
ID: $Id$ |
|
3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
|
4 |
Copyright 1996 University of Cambridge |
|
5 |
||
6 |
Inductive relation "otway" for the Otway-Rees protocol. |
|
7 |
||
8 |
The FAULTY version omitting encryption of Nonce NB, as suggested on page 247 of |
|
9 |
Burrows, Abadi and Needham. A Logic of Authentication. |
|
10 |
Proc. Royal Soc. 426 (1989) |
|
11 |
||
12 |
This file illustrates the consequences of such errors. We can still prove |
|
2032 | 13 |
impressive-looking properties such as Spy_not_see_encrypted_key, yet the |
2002 | 14 |
protocol is open to a middleperson attack. Attempting to prove some key lemmas |
15 |
indicates the possibility of this attack. |
|
16 |
*) |
|
17 |
||
18 |
open OtwayRees_Bad; |
|
19 |
||
20 |
proof_timing:=true; |
|
21 |
HOL_quantifiers := false; |
|
22 |
||
3102 | 23 |
(*No need to declare Says_imp_sees_Spy' because "lost" is a CONSTANT*) |
2002 | 24 |
|
25 |
(*Weak liveness: there are traces that reach the end*) |
|
26 |
goal thy |
|
27 |
"!!A B. [| A ~= B; A ~= Server; B ~= Server |] \ |
|
28 |
\ ==> EX K. EX NA. EX evs: otway. \ |
|
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|}|} \ |
2002 | 30 |
\ : set_of_list evs"; |
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; |
2002 | 34 |
result(); |
35 |
||
36 |
||
37 |
(**** Inductive proofs about otway ****) |
|
38 |
||
39 |
(*Nobody sends themselves messages*) |
|
40 |
goal thy "!!evs. evs : otway ==> ALL A X. Says A A X ~: set_of_list evs"; |
|
2032 | 41 |
by (etac otway.induct 1); |
2002 | 42 |
by (Auto_tac()); |
43 |
qed_spec_mp "not_Says_to_self"; |
|
44 |
Addsimps [not_Says_to_self]; |
|
45 |
AddSEs [not_Says_to_self RSN (2, rev_notE)]; |
|
46 |
||
47 |
||
48 |
(** For reasoning about the encrypted portion of messages **) |
|
49 |
||
50 |
goal thy "!!evs. Says A' B {|N, Agent A, Agent B, X|} : set_of_list evs ==> \ |
|
2052 | 51 |
\ X : analz (sees lost Spy evs)"; |
3102 | 52 |
by (blast_tac (!claset addSDs [Says_imp_sees_Spy RS analz.Inj]) 1); |
2032 | 53 |
qed "OR2_analz_sees_Spy"; |
2002 | 54 |
|
2837
dee1c7f1f576
Trivial renamings (for consistency with CSFW papers)
paulson
parents:
2637
diff
changeset
|
55 |
goal thy "!!evs. Says S' B {|N, X, Crypt (shrK B) X'|} : set_of_list evs ==> \ |
2052 | 56 |
\ X : analz (sees lost Spy evs)"; |
3102 | 57 |
by (blast_tac (!claset addSDs [Says_imp_sees_Spy RS analz.Inj]) 1); |
2032 | 58 |
qed "OR4_analz_sees_Spy"; |
2002 | 59 |
|
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
60 |
goal thy "!!evs. Says Server B {|NA, X, Crypt K' {|NB,K|}|} : set_of_list evs \ |
2131 | 61 |
\ ==> K : parts (sees lost Spy evs)"; |
3102 | 62 |
by (blast_tac (!claset addSEs sees_Spy_partsEs) 1); |
2131 | 63 |
qed "Oops_parts_sees_Spy"; |
2002 | 64 |
|
65 |
(*OR2_analz... and OR4_analz... let us treat those cases using the same |
|
66 |
argument as for the Fake case. This is possible for most, but not all, |
|
67 |
proofs: Fake does not invent new nonces (as in OR2), and of course Fake |
|
2032 | 68 |
messages originate from the Spy. *) |
2002 | 69 |
|
2052 | 70 |
bind_thm ("OR2_parts_sees_Spy", |
71 |
OR2_analz_sees_Spy RS (impOfSubs analz_subset_parts)); |
|
72 |
bind_thm ("OR4_parts_sees_Spy", |
|
73 |
OR4_analz_sees_Spy RS (impOfSubs analz_subset_parts)); |
|
74 |
||
2002 | 75 |
val parts_Fake_tac = |
2052 | 76 |
forward_tac [OR2_parts_sees_Spy] 4 THEN |
77 |
forward_tac [OR4_parts_sees_Spy] 6 THEN |
|
2131 | 78 |
forward_tac [Oops_parts_sees_Spy] 7; |
79 |
||
80 |
(*For proving the easier theorems about X ~: parts (sees lost Spy evs) *) |
|
81 |
fun parts_induct_tac i = SELECT_GOAL |
|
82 |
(DETERM (etac otway.induct 1 THEN parts_Fake_tac THEN |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
83 |
(*Fake message*) |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
84 |
TRY (best_tac (!claset addDs [impOfSubs analz_subset_parts, |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
85 |
impOfSubs Fake_parts_insert] |
2131 | 86 |
addss (!simpset)) 2)) THEN |
87 |
(*Base case*) |
|
88 |
fast_tac (!claset addss (!simpset)) 1 THEN |
|
89 |
ALLGOALS Asm_simp_tac) i; |
|
2002 | 90 |
|
91 |
||
2052 | 92 |
(** Theorems of the form X ~: parts (sees lost Spy evs) imply that NOBODY |
2002 | 93 |
sends messages containing X! **) |
94 |
||
2131 | 95 |
(*Spy never sees another agent's shared key! (unless it's lost at start)*) |
2002 | 96 |
goal thy |
2131 | 97 |
"!!evs. evs : otway \ |
98 |
\ ==> (Key (shrK A) : parts (sees lost Spy evs)) = (A : lost)"; |
|
99 |
by (parts_induct_tac 1); |
|
2002 | 100 |
by (Auto_tac()); |
2131 | 101 |
qed "Spy_see_shrK"; |
102 |
Addsimps [Spy_see_shrK]; |
|
2002 | 103 |
|
2131 | 104 |
goal thy |
105 |
"!!evs. evs : otway \ |
|
106 |
\ ==> (Key (shrK A) : analz (sees lost Spy evs)) = (A : lost)"; |
|
107 |
by (auto_tac(!claset addDs [impOfSubs analz_subset_parts], !simpset)); |
|
108 |
qed "Spy_analz_shrK"; |
|
109 |
Addsimps [Spy_analz_shrK]; |
|
2002 | 110 |
|
2131 | 111 |
goal thy "!!A. [| Key (shrK A) : parts (sees lost Spy evs); \ |
112 |
\ evs : otway |] ==> A:lost"; |
|
3102 | 113 |
by (blast_tac (!claset addDs [Spy_see_shrK]) 1); |
2131 | 114 |
qed "Spy_see_shrK_D"; |
2002 | 115 |
|
2131 | 116 |
bind_thm ("Spy_analz_shrK_D", analz_subset_parts RS subsetD RS Spy_see_shrK_D); |
117 |
AddSDs [Spy_see_shrK_D, Spy_analz_shrK_D]; |
|
2002 | 118 |
|
119 |
||
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
120 |
(*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
|
121 |
goal thy "!!evs. evs : otway ==> \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
122 |
\ Key K ~: used evs --> K ~: keysFor (parts (sees lost Spy evs))"; |
2160 | 123 |
by (parts_induct_tac 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
124 |
(*Fake*) |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
125 |
by (best_tac |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
126 |
(!claset addIs [impOfSubs analz_subset_parts] |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
127 |
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
|
128 |
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
|
129 |
unsafe_addss (!simpset)) 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
130 |
(*OR1-3*) |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
131 |
by (REPEAT (fast_tac (!claset addss (!simpset)) 1)); |
2160 | 132 |
qed_spec_mp "new_keys_not_used"; |
2002 | 133 |
|
134 |
bind_thm ("new_keys_not_analzd", |
|
2032 | 135 |
[analz_subset_parts RS keysFor_mono, |
136 |
new_keys_not_used] MRS contra_subsetD); |
|
2002 | 137 |
|
138 |
Addsimps [new_keys_not_used, new_keys_not_analzd]; |
|
139 |
||
140 |
||
2131 | 141 |
|
142 |
(*** Proofs involving analz ***) |
|
143 |
||
144 |
(*Describes the form of K and NA when the Server sends this message. Also |
|
145 |
for Oops case.*) |
|
146 |
goal thy |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
147 |
"!!evs. [| Says Server B \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
148 |
\ {|NA, X, 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
|
149 |
\ evs : otway |] \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
150 |
\ ==> K ~: range shrK & (EX i. NA = Nonce i) & (EX j. NB = Nonce j)"; |
2131 | 151 |
by (etac rev_mp 1); |
152 |
by (etac otway.induct 1); |
|
153 |
by (ALLGOALS (fast_tac (!claset addss (!simpset)))); |
|
154 |
qed "Says_Server_message_form"; |
|
155 |
||
156 |
||
157 |
(*For proofs involving analz.*) |
|
158 |
val analz_Fake_tac = |
|
159 |
dtac OR2_analz_sees_Spy 4 THEN |
|
160 |
dtac OR4_analz_sees_Spy 6 THEN |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
161 |
forward_tac [Says_Server_message_form] 7 THEN assume_tac 7 THEN |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2417
diff
changeset
|
162 |
REPEAT ((eresolve_tac [exE, conjE] ORELSE' hyp_subst_tac) 7); |
2002 | 163 |
|
164 |
||
165 |
(**** |
|
166 |
The following is to prove theorems of the form |
|
167 |
||
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
168 |
Key K : analz (insert (Key KAB) (sees lost Spy evs)) ==> |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2417
diff
changeset
|
169 |
Key K : analz (sees lost Spy evs) |
2002 | 170 |
|
171 |
A more general formula must be proved inductively. |
|
172 |
****) |
|
173 |
||
174 |
||
175 |
(** Session keys are not used to encrypt other session keys **) |
|
176 |
||
177 |
(*The equality makes the induction hypothesis easier to apply*) |
|
178 |
goal thy |
|
179 |
"!!evs. evs : otway ==> \ |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
180 |
\ 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
|
181 |
\ (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
|
182 |
\ (K : KK | Key K : analz (sees lost Spy evs))"; |
2032 | 183 |
by (etac otway.induct 1); |
2131 | 184 |
by analz_Fake_tac; |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
185 |
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
|
186 |
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
|
187 |
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
|
188 |
(*Base*) |
3102 | 189 |
by (blast_tac (!claset addIs [image_eqI] addss (!simpset)) 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
190 |
(*Fake, OR2, OR4*) |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
191 |
by (REPEAT (spy_analz_tac 1)); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
192 |
qed_spec_mp "analz_image_freshK"; |
2002 | 193 |
|
194 |
||
195 |
goal thy |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
196 |
"!!evs. [| evs : otway; KAB ~: range shrK |] ==> \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
197 |
\ 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
|
198 |
\ (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
|
199 |
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
|
200 |
qed "analz_insert_freshK"; |
2002 | 201 |
|
202 |
||
2131 | 203 |
(*** The Key K uniquely identifies the Server's message. **) |
2002 | 204 |
|
205 |
goal thy |
|
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2417
diff
changeset
|
206 |
"!!evs. evs : otway ==> \ |
2131 | 207 |
\ 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
|
208 |
\ Says Server B {|NA, X, Crypt (shrK B) {|NB, K|}|} : set_of_list evs --> \ |
2131 | 209 |
\ B=B' & NA=NA' & NB=NB' & X=X'"; |
2032 | 210 |
by (etac otway.induct 1); |
2002 | 211 |
by (ALLGOALS (asm_simp_tac (!simpset addsimps [all_conj_distrib]))); |
212 |
by (Step_tac 1); |
|
213 |
(*Remaining cases: OR3 and OR4*) |
|
214 |
by (ex_strip_tac 2); |
|
3102 | 215 |
by (Blast_tac 2); |
2107
23e8f15ec95f
The new proof of the lemma for new_nonces_not_seen is faster
paulson
parents:
2052
diff
changeset
|
216 |
by (expand_case_tac "K = ?y" 1); |
23e8f15ec95f
The new proof of the lemma for new_nonces_not_seen is faster
paulson
parents:
2052
diff
changeset
|
217 |
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
|
218 |
(*...we assume X is a recent message, and handle this case by contradiction*) |
3102 | 219 |
by (blast_tac (!claset addSEs sees_Spy_partsEs |
2032 | 220 |
delrules [conjI] (*prevent split-up into 4 subgoals*) |
221 |
addss (!simpset addsimps [parts_insertI])) 1); |
|
2002 | 222 |
val lemma = result(); |
223 |
||
224 |
goal thy |
|
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
225 |
"!!evs. [| Says Server B {|NA, X, Crypt (shrK B) {|NB, K|}|} \ |
2002 | 226 |
\ : set_of_list evs; \ |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
227 |
\ Says Server B' {|NA',X',Crypt (shrK B') {|NB',K|}|} \ |
2002 | 228 |
\ : set_of_list evs; \ |
2131 | 229 |
\ evs : otway |] ==> X=X' & B=B' & NA=NA' & NB=NB'"; |
2417 | 230 |
by (prove_unique_tac lemma 1); |
2002 | 231 |
qed "unique_session_keys"; |
232 |
||
233 |
||
2131 | 234 |
(*Crucial security property, but not itself enough to guarantee correctness!*) |
235 |
goal thy |
|
2166 | 236 |
"!!evs. [| A ~: lost; B ~: lost; evs : otway |] \ |
237 |
\ ==> Says Server B \ |
|
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
238 |
\ {|NA, Crypt (shrK A) {|NA, Key K|}, \ |
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
239 |
\ Crypt (shrK B) {|NB, Key K|}|} : set_of_list evs --> \ |
2166 | 240 |
\ Says B Spy {|NA, NB, Key K|} ~: set_of_list evs --> \ |
241 |
\ Key K ~: analz (sees lost Spy evs)"; |
|
2131 | 242 |
by (etac otway.induct 1); |
243 |
by analz_Fake_tac; |
|
244 |
by (ALLGOALS |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
245 |
(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
|
246 |
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
|
247 |
setloop split_tac [expand_if]))); |
2131 | 248 |
(*OR3*) |
3102 | 249 |
by (blast_tac (!claset delrules [impCE] |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
250 |
addSEs sees_Spy_partsEs |
3102 | 251 |
addIs [impOfSubs analz_subset_parts]) 3); |
2131 | 252 |
(*OR4, OR2, Fake*) |
2375 | 253 |
by (REPEAT_FIRST spy_analz_tac); |
2131 | 254 |
(*Oops*) (** LEVEL 5 **) |
3102 | 255 |
by (blast_tac (!claset addSDs [unique_session_keys]) 1); |
2131 | 256 |
val lemma = result() RS mp RS mp RSN(2,rev_notE); |
257 |
||
258 |
goal thy |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
259 |
"!!evs. [| Says Server B \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
260 |
\ {|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
|
261 |
\ 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
|
262 |
\ Says B Spy {|NA, NB, Key K|} ~: set_of_list evs; \ |
2131 | 263 |
\ A ~: lost; B ~: lost; evs : otway |] \ |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
264 |
\ ==> Key K ~: analz (sees lost Spy evs)"; |
2131 | 265 |
by (forward_tac [Says_Server_message_form] 1 THEN assume_tac 1); |
3102 | 266 |
by (blast_tac (!claset addSEs [lemma]) 1); |
2131 | 267 |
qed "Spy_not_see_encrypted_key"; |
268 |
||
269 |
||
270 |
(*** Attempting to prove stronger properties ***) |
|
271 |
||
2052 | 272 |
(*Only OR1 can have caused such a part of a message to appear. |
273 |
I'm not sure why A ~= B premise is needed: OtwayRees.ML doesn't need it. |
|
274 |
Perhaps it's because OR2 has two similar-looking encrypted messages in |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
275 |
this version.*) |
2002 | 276 |
goal thy |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
277 |
"!!evs. [| A ~: lost; A ~= B; evs : otway |] \ |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
278 |
\ ==> Crypt (shrK A) {|NA, Agent A, Agent B|} \ |
2052 | 279 |
\ : parts (sees lost Spy evs) --> \ |
2131 | 280 |
\ 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
|
281 |
\ Crypt (shrK A) {|NA, Agent A, Agent B|}|} \ |
2002 | 282 |
\ : set_of_list evs"; |
2131 | 283 |
by (parts_induct_tac 1); |
3102 | 284 |
by (Blast_tac 1); |
2002 | 285 |
qed_spec_mp "Crypt_imp_OR1"; |
286 |
||
287 |
||
2131 | 288 |
(*Crucial property: If the encrypted message appears, and A has used NA |
289 |
to start a run, then it originated with the Server!*) |
|
290 |
(*Only it is FALSE. Somebody could make a fake message to Server |
|
2002 | 291 |
substituting some other nonce NA' for NB.*) |
292 |
goal thy |
|
2052 | 293 |
"!!evs. [| A ~: lost; A ~= Spy; evs : otway |] \ |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
294 |
\ ==> Crypt (shrK A) {|NA, Key K|} : parts (sees lost Spy evs) --> \ |
2131 | 295 |
\ 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
|
296 |
\ Crypt (shrK A) {|NA, Agent A, Agent B|}|} \ |
2131 | 297 |
\ : set_of_list evs --> \ |
298 |
\ (EX B NB. Says Server B \ |
|
299 |
\ {|NA, \ |
|
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
300 |
\ Crypt (shrK A) {|NA, Key K|}, \ |
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
301 |
\ Crypt (shrK B) {|NB, Key K|}|} \ |
2002 | 302 |
\ : set_of_list evs)"; |
2131 | 303 |
by (parts_induct_tac 1); |
2002 | 304 |
(*OR1: it cannot be a new Nonce, contradiction.*) |
3102 | 305 |
by (blast_tac (!claset addSIs [parts_insertI] |
306 |
addSEs sees_Spy_partsEs) 1); |
|
2002 | 307 |
(*OR4*) |
308 |
by (REPEAT (Safe_step_tac 2)); |
|
3102 | 309 |
by (REPEAT (blast_tac (!claset addSDs [parts_cut]) 3)); |
310 |
by (blast_tac (!claset addSIs [Crypt_imp_OR1] |
|
311 |
addEs sees_Spy_partsEs) 2); |
|
2131 | 312 |
(*OR3*) (** LEVEL 5 **) |
2002 | 313 |
by (ALLGOALS (asm_simp_tac (!simpset addsimps [ex_disj_distrib]))); |
2052 | 314 |
by (step_tac (!claset delrules [disjCI, impCE]) 1); |
2002 | 315 |
(*The hypotheses at this point suggest an attack in which nonce NA is used |
2052 | 316 |
in two different roles: |
317 |
Says B' Server |
|
318 |
{|Nonce NAa, Agent Aa, Agent A, |
|
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
319 |
Crypt (shrK Aa) {|Nonce NAa, Agent Aa, Agent A|}, Nonce NA, |
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
320 |
Crypt (shrK A) {|Nonce NAa, Agent Aa, Agent A|}|} |
2052 | 321 |
: set_of_list evsa; |
322 |
Says A B |
|
323 |
{|Nonce NA, Agent A, Agent B, |
|
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
324 |
Crypt (shrK A) {|Nonce NA, Agent A, Agent B|}|} |
2052 | 325 |
: set_of_list evsa |
326 |
*) |
|
2131 | 327 |
writeln "GIVE UP! on NA_Crypt_imp_Server_msg"; |
2002 | 328 |
|
329 |
||
2052 | 330 |
(*Thus the key property A_can_trust probably fails too.*) |