author | paulson |
Fri, 17 Jan 1997 12:49:31 +0100 | |
changeset 2516 | 4d68fbe6378b |
parent 2454 | 92f43ed48935 |
child 2637 | e9b203f854ae |
permissions | -rw-r--r-- |
1995 | 1 |
(* Title: HOL/Auth/Yahalom |
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
2 |
ID: $Id$ |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
4 |
Copyright 1996 University of Cambridge |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
5 |
|
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
6 |
Inductive relation "otway" for the Yahalom protocol. |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
7 |
|
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
8 |
From page 257 of |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
9 |
Burrows, Abadi and Needham. A Logic of Authentication. |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
10 |
Proc. Royal Soc. 426 (1989) |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
11 |
*) |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
12 |
|
1995 | 13 |
open Yahalom; |
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
14 |
|
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
15 |
proof_timing:=true; |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
16 |
HOL_quantifiers := false; |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
17 |
Pretty.setdepth 25; |
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
18 |
|
1995 | 19 |
|
2322 | 20 |
(*A "possibility property": there are traces that reach the end*) |
1995 | 21 |
goal thy |
22 |
"!!A B. [| A ~= B; A ~= Server; B ~= Server |] \ |
|
2032 | 23 |
\ ==> EX X NB K. EX evs: yahalom lost. \ |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2269
diff
changeset
|
24 |
\ Says A B {|X, Crypt K (Nonce NB)|} : set_of_list evs"; |
1995 | 25 |
by (REPEAT (resolve_tac [exI,bexI] 1)); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
26 |
by (rtac (yahalom.Nil RS yahalom.YM1 RS yahalom.YM2 RS yahalom.YM3 RS |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
27 |
yahalom.YM4) 2); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
28 |
by possibility_tac; |
2013 | 29 |
result(); |
1995 | 30 |
|
31 |
||
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
32 |
(**** Inductive proofs about yahalom ****) |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
33 |
|
2110 | 34 |
(*Monotonicity*) |
2045
ae1030e66745
Removed some dead wood. Transferred lemmas used to prove analz_image_newK
paulson
parents:
2032
diff
changeset
|
35 |
goal thy "!!evs. lost' <= lost ==> yahalom lost' <= yahalom lost"; |
ae1030e66745
Removed some dead wood. Transferred lemmas used to prove analz_image_newK
paulson
parents:
2032
diff
changeset
|
36 |
by (rtac subsetI 1); |
ae1030e66745
Removed some dead wood. Transferred lemmas used to prove analz_image_newK
paulson
parents:
2032
diff
changeset
|
37 |
by (etac yahalom.induct 1); |
ae1030e66745
Removed some dead wood. Transferred lemmas used to prove analz_image_newK
paulson
parents:
2032
diff
changeset
|
38 |
by (REPEAT_FIRST |
ae1030e66745
Removed some dead wood. Transferred lemmas used to prove analz_image_newK
paulson
parents:
2032
diff
changeset
|
39 |
(best_tac (!claset addIs (impOfSubs (sees_mono RS analz_mono RS synth_mono) |
ae1030e66745
Removed some dead wood. Transferred lemmas used to prove analz_image_newK
paulson
parents:
2032
diff
changeset
|
40 |
:: yahalom.intrs)))); |
ae1030e66745
Removed some dead wood. Transferred lemmas used to prove analz_image_newK
paulson
parents:
2032
diff
changeset
|
41 |
qed "yahalom_mono"; |
ae1030e66745
Removed some dead wood. Transferred lemmas used to prove analz_image_newK
paulson
parents:
2032
diff
changeset
|
42 |
|
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
43 |
|
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
44 |
(*Nobody sends themselves messages*) |
2051 | 45 |
goal thy "!!evs. evs: yahalom lost ==> ALL A X. Says A A X ~: set_of_list evs"; |
2032 | 46 |
by (etac yahalom.induct 1); |
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
47 |
by (Auto_tac()); |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
48 |
qed_spec_mp "not_Says_to_self"; |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
49 |
Addsimps [not_Says_to_self]; |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
50 |
AddSEs [not_Says_to_self RSN (2, rev_notE)]; |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
51 |
|
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
52 |
|
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
53 |
(** For reasoning about the encrypted portion of messages **) |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
54 |
|
1995 | 55 |
(*Lets us treat YM4 using a similar argument as for the Fake case.*) |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2269
diff
changeset
|
56 |
goal thy "!!evs. Says S A {|Crypt (shrK A) Y, X|} : set_of_list evs ==> \ |
2032 | 57 |
\ X : analz (sees lost Spy evs)"; |
58 |
by (fast_tac (!claset addSDs [Says_imp_sees_Spy RS analz.Inj]) 1); |
|
59 |
qed "YM4_analz_sees_Spy"; |
|
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
60 |
|
2110 | 61 |
bind_thm ("YM4_parts_sees_Spy", |
62 |
YM4_analz_sees_Spy RS (impOfSubs analz_subset_parts)); |
|
63 |
||
2133 | 64 |
(*Relates to both YM4 and Oops*) |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2269
diff
changeset
|
65 |
goal thy "!!evs. Says S A {|Crypt (shrK A) {|B, K, NA, NB|}, X|} \ |
1995 | 66 |
\ : set_of_list evs ==> \ |
2032 | 67 |
\ K : parts (sees lost Spy evs)"; |
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
68 |
by (fast_tac (!claset addSEs partsEs |
2032 | 69 |
addSDs [Says_imp_sees_Spy RS parts.Inj]) 1); |
2110 | 70 |
qed "YM4_Key_parts_sees_Spy"; |
71 |
||
72 |
(*We instantiate the variable to "lost". Leaving it as a Var makes proofs |
|
73 |
harder: the simplifier does less.*) |
|
74 |
val parts_Fake_tac = |
|
75 |
forw_inst_tac [("lost","lost")] YM4_parts_sees_Spy 6 THEN |
|
76 |
forw_inst_tac [("lost","lost")] YM4_Key_parts_sees_Spy 7; |
|
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
77 |
|
2110 | 78 |
(*For proving the easier theorems about X ~: parts (sees lost Spy evs) *) |
79 |
fun parts_induct_tac i = SELECT_GOAL |
|
80 |
(DETERM (etac yahalom.induct 1 THEN parts_Fake_tac THEN |
|
2170 | 81 |
(*Fake message*) |
82 |
TRY (best_tac (!claset addDs [impOfSubs analz_subset_parts, |
|
83 |
impOfSubs Fake_parts_insert] |
|
2110 | 84 |
addss (!simpset)) 2)) THEN |
85 |
(*Base case*) |
|
86 |
fast_tac (!claset addss (!simpset)) 1 THEN |
|
87 |
ALLGOALS Asm_simp_tac) i; |
|
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
88 |
|
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
89 |
|
2032 | 90 |
(** Theorems of the form X ~: parts (sees lost Spy evs) imply that NOBODY |
2013 | 91 |
sends messages containing X! **) |
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
92 |
|
2133 | 93 |
(*Spy never sees another agent's shared key! (unless it's lost at start)*) |
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
94 |
goal thy |
2133 | 95 |
"!!evs. evs : yahalom lost \ |
96 |
\ ==> (Key (shrK A) : parts (sees lost Spy evs)) = (A : lost)"; |
|
2110 | 97 |
by (parts_induct_tac 1); |
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
98 |
by (Auto_tac()); |
2133 | 99 |
qed "Spy_see_shrK"; |
100 |
Addsimps [Spy_see_shrK]; |
|
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
101 |
|
2133 | 102 |
goal thy |
103 |
"!!evs. evs : yahalom lost \ |
|
104 |
\ ==> (Key (shrK A) : analz (sees lost Spy evs)) = (A : lost)"; |
|
105 |
by (auto_tac(!claset addDs [impOfSubs analz_subset_parts], !simpset)); |
|
106 |
qed "Spy_analz_shrK"; |
|
107 |
Addsimps [Spy_analz_shrK]; |
|
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
108 |
|
2133 | 109 |
goal thy "!!A. [| Key (shrK A) : parts (sees lost Spy evs); \ |
110 |
\ evs : yahalom lost |] ==> A:lost"; |
|
111 |
by (fast_tac (!claset addDs [Spy_see_shrK]) 1); |
|
112 |
qed "Spy_see_shrK_D"; |
|
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
113 |
|
2133 | 114 |
bind_thm ("Spy_analz_shrK_D", analz_subset_parts RS subsetD RS Spy_see_shrK_D); |
115 |
AddSDs [Spy_see_shrK_D, Spy_analz_shrK_D]; |
|
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
116 |
|
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
117 |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
118 |
(*Nobody can have used non-existent keys!*) |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
119 |
goal thy "!!evs. evs : yahalom lost ==> \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
120 |
\ Key K ~: used evs --> K ~: keysFor (parts (sees lost Spy evs))"; |
2110 | 121 |
by (parts_induct_tac 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
122 |
(*YM4: Key K is not fresh!*) |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
123 |
by (fast_tac (!claset addSEs sees_Spy_partsEs) 3); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
124 |
(*YM3*) |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
125 |
by (fast_tac (!claset addss (!simpset)) 2); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
126 |
(*Fake*) |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
127 |
by (best_tac |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
128 |
(!claset addIs [impOfSubs analz_subset_parts] |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
129 |
addDs [impOfSubs (analz_subset_parts RS keysFor_mono), |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
130 |
impOfSubs (parts_insert_subset_Un RS keysFor_mono)] |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
131 |
addss (!simpset)) 1); |
2160 | 132 |
qed_spec_mp "new_keys_not_used"; |
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
133 |
|
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
134 |
bind_thm ("new_keys_not_analzd", |
2032 | 135 |
[analz_subset_parts RS keysFor_mono, |
136 |
new_keys_not_used] MRS contra_subsetD); |
|
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
137 |
|
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
138 |
Addsimps [new_keys_not_used, new_keys_not_analzd]; |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
139 |
|
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
140 |
|
2133 | 141 |
(*Describes the form of K when the Server sends this message. Useful for |
142 |
Oops as well as main secrecy property.*) |
|
2110 | 143 |
goal thy |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
144 |
"!!evs. [| Says Server A {|Crypt (shrK A) {|Agent B, Key K, NA, NB|}, X|} \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
145 |
\ : set_of_list evs; \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
146 |
\ evs : yahalom lost |] \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
147 |
\ ==> K ~: range shrK"; |
2133 | 148 |
by (etac rev_mp 1); |
149 |
by (etac yahalom.induct 1); |
|
150 |
by (ALLGOALS (fast_tac (!claset addss (!simpset)))); |
|
151 |
qed "Says_Server_message_form"; |
|
2110 | 152 |
|
153 |
||
154 |
(*For proofs involving analz. We again instantiate the variable to "lost".*) |
|
155 |
val analz_Fake_tac = |
|
2133 | 156 |
forw_inst_tac [("lost","lost")] YM4_analz_sees_Spy 6 THEN |
157 |
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:
2454
diff
changeset
|
158 |
assume_tac 7 THEN REPEAT ((etac exE ORELSE' hyp_subst_tac) 7); |
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
159 |
|
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
160 |
|
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
161 |
(**** |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
162 |
The following is to prove theorems of the form |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
163 |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
164 |
Key K : analz (insert (Key KAB) (sees lost Spy evs)) ==> |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2377
diff
changeset
|
165 |
Key K : analz (sees lost Spy evs) |
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
166 |
|
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
167 |
A more general formula must be proved inductively. |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
168 |
****) |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
169 |
|
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
170 |
(** Session keys are not used to encrypt other session keys **) |
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
171 |
|
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
172 |
goal thy |
2032 | 173 |
"!!evs. evs : yahalom lost ==> \ |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
174 |
\ ALL K KK. KK <= Compl (range shrK) --> \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
175 |
\ (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:
2454
diff
changeset
|
176 |
\ (K : KK | Key K : analz (sees lost Spy evs))"; |
2032 | 177 |
by (etac yahalom.induct 1); |
2110 | 178 |
by analz_Fake_tac; |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
179 |
by (REPEAT_FIRST (resolve_tac [allI, impI])); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
180 |
by (REPEAT_FIRST (rtac analz_image_freshK_lemma )); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
181 |
by (ALLGOALS (asm_simp_tac analz_image_freshK_ss)); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
182 |
(*Base*) |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
183 |
by (fast_tac (!claset addIs [image_eqI] addss (!simpset)) 1); |
2133 | 184 |
(*YM4, Fake*) |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
185 |
by (REPEAT (spy_analz_tac 1)); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
186 |
qed_spec_mp "analz_image_freshK"; |
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
187 |
|
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
188 |
goal thy |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
189 |
"!!evs. [| evs : yahalom lost; KAB ~: range shrK |] ==> \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
190 |
\ 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:
2454
diff
changeset
|
191 |
\ (K = KAB | Key K : analz (sees lost Spy evs))"; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
192 |
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:
2454
diff
changeset
|
193 |
qed "analz_insert_freshK"; |
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
194 |
|
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
195 |
|
2110 | 196 |
(*** The Key K uniquely identifies the Server's message. **) |
197 |
||
198 |
goal thy |
|
199 |
"!!evs. evs : yahalom lost ==> \ |
|
2133 | 200 |
\ EX A' B' NA' NB' X'. ALL A B NA NB X. \ |
2110 | 201 |
\ Says Server A \ |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2269
diff
changeset
|
202 |
\ {|Crypt (shrK A) {|Agent B, Key K, NA, NB|}, X|} \ |
2133 | 203 |
\ : set_of_list evs --> A=A' & B=B' & NA=NA' & NB=NB' & X=X'"; |
2110 | 204 |
by (etac yahalom.induct 1); |
205 |
by (ALLGOALS (asm_simp_tac (!simpset addsimps [all_conj_distrib]))); |
|
206 |
by (Step_tac 1); |
|
2133 | 207 |
by (ex_strip_tac 2); |
208 |
by (Fast_tac 2); |
|
2110 | 209 |
(*Remaining case: YM3*) |
210 |
by (expand_case_tac "K = ?y" 1); |
|
211 |
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:
2454
diff
changeset
|
212 |
(*...we assume X is a recent message and handle this case by contradiction*) |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
213 |
by (fast_tac (!claset addSEs sees_Spy_partsEs |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
214 |
delrules [conjI] (*prevent split-up into 4 subgoals*) |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
215 |
addss (!simpset addsimps [parts_insertI])) 1); |
2110 | 216 |
val lemma = result(); |
217 |
||
218 |
goal thy |
|
219 |
"!!evs. [| Says Server A \ |
|
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2269
diff
changeset
|
220 |
\ {|Crypt (shrK A) {|Agent B, Key K, NA, NB|}, X|} \ |
2110 | 221 |
\ : set_of_list evs; \ |
222 |
\ Says Server A' \ |
|
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2269
diff
changeset
|
223 |
\ {|Crypt (shrK A') {|Agent B', Key K, NA', NB'|}, X'|} \ |
2110 | 224 |
\ : set_of_list evs; \ |
225 |
\ evs : yahalom lost |] \ |
|
226 |
\ ==> A=A' & B=B' & NA=NA' & NB=NB'"; |
|
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2377
diff
changeset
|
227 |
by (prove_unique_tac lemma 1); |
2110 | 228 |
qed "unique_session_keys"; |
229 |
||
230 |
||
231 |
(*If the encrypted message appears then it originated with the Server*) |
|
232 |
goal thy |
|
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2269
diff
changeset
|
233 |
"!!evs. [| Crypt (shrK A) {|Agent B, Key K, NA, NB|} \ |
2110 | 234 |
\ : parts (sees lost Spy evs); \ |
235 |
\ A ~: lost; evs : yahalom lost |] \ |
|
236 |
\ ==> Says Server A \ |
|
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2269
diff
changeset
|
237 |
\ {|Crypt (shrK A) {|Agent B, Key K, NA, NB|}, \ |
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2269
diff
changeset
|
238 |
\ Crypt (shrK B) {|Agent A, Key K|}|} \ |
2110 | 239 |
\ : set_of_list evs"; |
240 |
by (etac rev_mp 1); |
|
241 |
by (parts_induct_tac 1); |
|
2322 | 242 |
qed "A_trusts_YM3"; |
2110 | 243 |
|
244 |
||
245 |
(** Crucial secrecy property: Spy does not see the keys sent in msg YM3 **) |
|
2013 | 246 |
|
247 |
goal thy |
|
2133 | 248 |
"!!evs. [| A ~: lost; B ~: lost; evs : yahalom lost |] \ |
2051 | 249 |
\ ==> Says Server A \ |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2269
diff
changeset
|
250 |
\ {|Crypt (shrK A) {|Agent B, Key K, NA, NB|}, \ |
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2269
diff
changeset
|
251 |
\ Crypt (shrK B) {|Agent A, Key K|}|} \ |
2110 | 252 |
\ : set_of_list evs --> \ |
253 |
\ Says A Spy {|NA, NB, Key K|} ~: set_of_list evs --> \ |
|
2051 | 254 |
\ Key K ~: analz (sees lost Spy evs)"; |
2032 | 255 |
by (etac yahalom.induct 1); |
2110 | 256 |
by analz_Fake_tac; |
2013 | 257 |
by (ALLGOALS |
258 |
(asm_simp_tac |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
259 |
(!simpset addsimps [not_parts_not_analz, analz_insert_freshK] |
2013 | 260 |
setloop split_tac [expand_if]))); |
261 |
(*YM3*) |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
262 |
by (fast_tac (!claset delrules [impCE] |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
263 |
addSEs sees_Spy_partsEs |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
264 |
addIs [impOfSubs analz_subset_parts] |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
265 |
addss (!simpset addsimps [parts_insert2])) 2); |
2133 | 266 |
(*OR4, Fake*) |
2377 | 267 |
by (REPEAT_FIRST spy_analz_tac); |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2377
diff
changeset
|
268 |
(*Oops*) |
2110 | 269 |
by (fast_tac (!claset delrules [disjE] |
2170 | 270 |
addDs [unique_session_keys] |
271 |
addss (!simpset)) 1); |
|
2110 | 272 |
val lemma = result() RS mp RS mp RSN(2,rev_notE); |
2013 | 273 |
|
274 |
||
275 |
(*Final version: Server's message in the most abstract form*) |
|
1985
84cf16192e03
Tidied many proofs, using AddIffs to let equivalences take
paulson
parents:
diff
changeset
|
276 |
goal thy |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
277 |
"!!evs. [| Says Server A \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
278 |
\ {|Crypt (shrK A) {|Agent B, Key K, NA, NB|}, \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
279 |
\ Crypt (shrK B) {|Agent A, Key K|}|} \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
280 |
\ : set_of_list evs; \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
281 |
\ Says A Spy {|NA, NB, Key K|} ~: set_of_list evs; \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
282 |
\ A ~: lost; B ~: lost; evs : yahalom lost |] \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
283 |
\ ==> Key K ~: analz (sees lost Spy evs)"; |
2013 | 284 |
by (forward_tac [Says_Server_message_form] 1 THEN assume_tac 1); |
285 |
by (fast_tac (!claset addSEs [lemma]) 1); |
|
2032 | 286 |
qed "Spy_not_see_encrypted_key"; |
2001 | 287 |
|
288 |
||
2045
ae1030e66745
Removed some dead wood. Transferred lemmas used to prove analz_image_newK
paulson
parents:
2032
diff
changeset
|
289 |
goal thy |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
290 |
"!!evs. [| C ~: {A,B,Server}; \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
291 |
\ Says Server A \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
292 |
\ {|Crypt (shrK A) {|Agent B, Key K, NA, NB|}, \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
293 |
\ Crypt (shrK B) {|Agent A, Key K|}|} \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
294 |
\ : set_of_list evs; \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
295 |
\ Says A Spy {|NA, NB, Key K|} ~: set_of_list evs; \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
296 |
\ A ~: lost; B ~: lost; evs : yahalom lost |] \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
297 |
\ ==> Key K ~: analz (sees lost C evs)"; |
2045
ae1030e66745
Removed some dead wood. Transferred lemmas used to prove analz_image_newK
paulson
parents:
2032
diff
changeset
|
298 |
by (rtac (subset_insertI RS sees_mono RS analz_mono RS contra_subsetD) 1); |
ae1030e66745
Removed some dead wood. Transferred lemmas used to prove analz_image_newK
paulson
parents:
2032
diff
changeset
|
299 |
by (rtac (sees_lost_agent_subset_sees_Spy RS analz_mono RS contra_subsetD) 1); |
ae1030e66745
Removed some dead wood. Transferred lemmas used to prove analz_image_newK
paulson
parents:
2032
diff
changeset
|
300 |
by (FIRSTGOAL (rtac Spy_not_see_encrypted_key)); |
ae1030e66745
Removed some dead wood. Transferred lemmas used to prove analz_image_newK
paulson
parents:
2032
diff
changeset
|
301 |
by (REPEAT_FIRST (fast_tac (!claset addIs [yahalom_mono RS subsetD]))); |
ae1030e66745
Removed some dead wood. Transferred lemmas used to prove analz_image_newK
paulson
parents:
2032
diff
changeset
|
302 |
qed "Agent_not_see_encrypted_key"; |
ae1030e66745
Removed some dead wood. Transferred lemmas used to prove analz_image_newK
paulson
parents:
2032
diff
changeset
|
303 |
|
ae1030e66745
Removed some dead wood. Transferred lemmas used to prove analz_image_newK
paulson
parents:
2032
diff
changeset
|
304 |
|
2110 | 305 |
(*** Security Guarantee for B upon receiving YM4 ***) |
2013 | 306 |
|
2110 | 307 |
(*B knows, by the first part of A's message, that the Server distributed |
308 |
the key for A and B. But this part says nothing about nonces.*) |
|
2001 | 309 |
goal thy |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2269
diff
changeset
|
310 |
"!!evs. [| Crypt (shrK B) {|Agent A, Key K|} : parts (sees lost Spy evs); \ |
2051 | 311 |
\ B ~: lost; evs : yahalom lost |] \ |
2001 | 312 |
\ ==> EX NA NB. Says Server A \ |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2377
diff
changeset
|
313 |
\ {|Crypt (shrK A) {|Agent B, Key K, \ |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
314 |
\ Nonce NA, Nonce NB|}, \ |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2269
diff
changeset
|
315 |
\ Crypt (shrK B) {|Agent A, Key K|}|} \ |
2013 | 316 |
\ : set_of_list evs"; |
2032 | 317 |
by (etac rev_mp 1); |
2110 | 318 |
by (parts_induct_tac 1); |
319 |
(*YM3*) |
|
320 |
by (Fast_tac 1); |
|
321 |
qed "B_trusts_YM4_shrK"; |
|
322 |
||
2133 | 323 |
|
324 |
(** The Nonce NB uniquely identifies B's message. **) |
|
325 |
||
326 |
goal thy |
|
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2377
diff
changeset
|
327 |
"!!evs. evs : yahalom lost ==> \ |
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2377
diff
changeset
|
328 |
\ EX NA' A' B'. ALL NA A B. \ |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2269
diff
changeset
|
329 |
\ Crypt (shrK B) {|Agent A, Nonce NA, NB|} : parts(sees lost Spy evs) \ |
2133 | 330 |
\ --> B ~: lost --> NA = NA' & A = A' & B = B'"; |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2377
diff
changeset
|
331 |
by (etac yahalom.induct 1 THEN parts_Fake_tac); |
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2377
diff
changeset
|
332 |
(*Fake: the tactic in parts_induct_tac works, but takes 4 times longer*) |
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2377
diff
changeset
|
333 |
by (REPEAT (etac exE 2) THEN |
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2377
diff
changeset
|
334 |
best_tac (!claset addSIs [exI] |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
335 |
addDs [impOfSubs Fake_parts_insert] |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
336 |
addss (!simpset)) 2); |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2377
diff
changeset
|
337 |
(*Base case*) |
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2377
diff
changeset
|
338 |
by (fast_tac (!claset addss (!simpset)) 1); |
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2377
diff
changeset
|
339 |
by (ALLGOALS (asm_simp_tac (!simpset addsimps [all_conj_distrib]))); |
2133 | 340 |
(*YM2: creation of new Nonce. Move assertion into global context*) |
341 |
by (expand_case_tac "NB = ?y" 1); |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
342 |
by (REPEAT (resolve_tac [exI, conjI, impI, refl] 1)); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
343 |
by (fast_tac (!claset addSEs sees_Spy_partsEs) 1); |
2133 | 344 |
val lemma = result(); |
345 |
||
2110 | 346 |
goal thy |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2269
diff
changeset
|
347 |
"!!evs.[| Crypt (shrK B) {|Agent A, Nonce NA, NB|} \ |
2133 | 348 |
\ : parts (sees lost Spy evs); \ |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2269
diff
changeset
|
349 |
\ Crypt (shrK B') {|Agent A', Nonce NA', NB|} \ |
2133 | 350 |
\ : parts (sees lost Spy evs); \ |
351 |
\ evs : yahalom lost; B ~: lost; B' ~: lost |] \ |
|
352 |
\ ==> NA' = NA & A' = A & B' = B"; |
|
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2377
diff
changeset
|
353 |
by (prove_unique_tac lemma 1); |
2133 | 354 |
qed "unique_NB"; |
355 |
||
356 |
fun lost_tac s = |
|
357 |
case_tac ("(" ^ s ^ ") : lost") THEN' |
|
358 |
SELECT_GOAL |
|
359 |
(REPEAT_DETERM (dtac (Says_imp_sees_Spy RS analz.Inj) 1) THEN |
|
360 |
REPEAT_DETERM (etac MPair_analz 1) THEN |
|
361 |
THEN_BEST_FIRST |
|
362 |
(dres_inst_tac [("A", s)] Crypt_Spy_analz_lost 1 THEN assume_tac 1) |
|
2170 | 363 |
(has_fewer_prems 1, size_of_thm) |
364 |
(Step_tac 1)); |
|
2133 | 365 |
|
366 |
||
367 |
(*Variant useful for proving secrecy of NB*) |
|
368 |
goal thy |
|
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2269
diff
changeset
|
369 |
"!!evs.[| Says C D {|X, Crypt (shrK B) {|Agent A, Nonce NA, NB|}|} \ |
2133 | 370 |
\ : set_of_list evs; B ~: lost; \ |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2269
diff
changeset
|
371 |
\ Says C' D' {|X', Crypt (shrK B') {|Agent A', Nonce NA', NB|}|} \ |
2133 | 372 |
\ : set_of_list evs; \ |
373 |
\ NB ~: analz (sees lost Spy evs); \ |
|
374 |
\ evs : yahalom lost |] \ |
|
375 |
\ ==> NA' = NA & A' = A & B' = B"; |
|
376 |
by (lost_tac "B'" 1); |
|
377 |
by (fast_tac (!claset addSDs [Says_imp_sees_Spy RS parts.Inj] |
|
378 |
addSEs [MPair_parts] |
|
379 |
addDs [unique_NB]) 1); |
|
380 |
qed "Says_unique_NB"; |
|
381 |
||
382 |
goal thy |
|
383 |
"!!evs. [| B ~: lost; evs : yahalom lost |] \ |
|
384 |
\ ==> Nonce NB ~: analz (sees lost Spy evs) --> \ |
|
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2269
diff
changeset
|
385 |
\ Crypt (shrK B) {|Agent A, Nonce NA, Nonce NB|} : parts (sees lost Spy evs) \ |
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2269
diff
changeset
|
386 |
\ --> Crypt (shrK B') {|Agent A', Nonce NB, NB'|} ~: parts (sees lost Spy evs)"; |
2133 | 387 |
by (etac yahalom.induct 1); |
388 |
by parts_Fake_tac; |
|
389 |
by (REPEAT_FIRST |
|
390 |
(rtac impI THEN' |
|
391 |
dtac (sees_subset_sees_Says RS analz_mono RS contra_subsetD) THEN' |
|
392 |
mp_tac)); |
|
393 |
by (best_tac (!claset addDs [impOfSubs analz_subset_parts, |
|
2170 | 394 |
impOfSubs Fake_parts_insert] |
395 |
addss (!simpset)) 2); |
|
2133 | 396 |
by (ALLGOALS Asm_simp_tac); |
397 |
by (fast_tac (!claset addss (!simpset)) 1); |
|
398 |
by (fast_tac (!claset addDs [Says_imp_sees_Spy RS analz.Inj] |
|
2170 | 399 |
addSIs [parts_insertI] |
2133 | 400 |
addSEs partsEs |
401 |
addss (!simpset)) 1); |
|
402 |
val no_nonce_YM1_YM2 = standard (result() RS mp RSN (2, rev_mp) RS notE); |
|
403 |
||
404 |
||
405 |
||
406 |
(**** Towards proving secrecy of Nonce NB ****) |
|
407 |
||
408 |
(*B knows, by the second part of A's message, that the Server distributed |
|
409 |
the key quoting nonce NB. This part says nothing about agent names. |
|
410 |
Secrecy of NB is crucial.*) |
|
411 |
goal thy |
|
412 |
"!!evs. evs : yahalom lost \ |
|
413 |
\ ==> Nonce NB ~: analz (sees lost Spy evs) --> \ |
|
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2269
diff
changeset
|
414 |
\ Crypt K (Nonce NB) : parts (sees lost Spy evs) --> \ |
2133 | 415 |
\ (EX A B NA. Says Server A \ |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
416 |
\ {|Crypt (shrK A) {|Agent B, Key K, \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
417 |
\ Nonce NA, Nonce NB|}, \ |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2269
diff
changeset
|
418 |
\ Crypt (shrK B) {|Agent A, Key K|}|} \ |
2133 | 419 |
\ : set_of_list evs)"; |
420 |
by (etac yahalom.induct 1); |
|
421 |
by parts_Fake_tac; |
|
422 |
by (fast_tac (!claset addss (!simpset)) 1); |
|
423 |
by (REPEAT_FIRST |
|
424 |
(rtac impI THEN' |
|
425 |
dtac (sees_subset_sees_Says RS analz_mono RS contra_subsetD))); |
|
426 |
by (ALLGOALS Asm_simp_tac); |
|
427 |
(*Fake, YM3, YM4*) |
|
428 |
by (Fast_tac 2); |
|
429 |
by (fast_tac (!claset addSDs [impOfSubs Fake_parts_insert] |
|
430 |
addDs [impOfSubs analz_subset_parts] |
|
431 |
addss (!simpset)) 1); |
|
432 |
(*YM4*) |
|
433 |
by (Step_tac 1); |
|
434 |
by (lost_tac "A" 1); |
|
435 |
by (fast_tac (!claset addDs [Says_imp_sees_Spy RS parts.Inj RS parts.Fst RS |
|
2322 | 436 |
A_trusts_YM3]) 1); |
2133 | 437 |
val B_trusts_YM4_newK = result() RS mp RSN (2, rev_mp); |
438 |
||
439 |
||
440 |
(*This is the original version of the result above. But it is of little |
|
441 |
value because it assumes secrecy of K, which we cannot be assured of |
|
442 |
until we know that K is fresh -- which we do not know at the point this |
|
443 |
result is applied.*) |
|
444 |
goal thy |
|
445 |
"!!evs. evs : yahalom lost \ |
|
446 |
\ ==> Key K ~: analz (sees lost Spy evs) --> \ |
|
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2269
diff
changeset
|
447 |
\ Crypt K (Nonce NB) : parts (sees lost Spy evs) --> \ |
2110 | 448 |
\ (EX A B NA. Says Server A \ |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2269
diff
changeset
|
449 |
\ {|Crypt (shrK A) {|Agent B, Key K, \ |
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2269
diff
changeset
|
450 |
\ Nonce NA, Nonce NB|}, \ |
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2269
diff
changeset
|
451 |
\ Crypt (shrK B) {|Agent A, Key K|}|} \ |
2110 | 452 |
\ : set_of_list evs)"; |
2032 | 453 |
by (etac yahalom.induct 1); |
2110 | 454 |
by parts_Fake_tac; |
2001 | 455 |
by (fast_tac (!claset addss (!simpset)) 1); |
2110 | 456 |
by (TRYALL (rtac impI)); |
457 |
by (REPEAT_FIRST |
|
458 |
(dtac (sees_subset_sees_Says RS analz_mono RS contra_subsetD))); |
|
459 |
by (ALLGOALS Asm_simp_tac); |
|
460 |
(*Fake, YM3, YM4*) |
|
461 |
by (fast_tac (!claset addSDs [Crypt_Fake_parts_insert] |
|
2133 | 462 |
addDs [impOfSubs analz_subset_parts]) 1); |
2110 | 463 |
by (Fast_tac 1); |
464 |
(*YM4*) |
|
465 |
by (Step_tac 1); |
|
2133 | 466 |
by (lost_tac "A" 1); |
2110 | 467 |
by (fast_tac (!claset addDs [Says_imp_sees_Spy RS parts.Inj RS parts.Fst RS |
2322 | 468 |
A_trusts_YM3]) 1); |
2133 | 469 |
result() RS mp RSN (2, rev_mp); |
470 |
||
471 |
||
472 |
(*YM3 can only be triggered by YM2*) |
|
473 |
goal thy |
|
474 |
"!!evs. [| Says Server A \ |
|
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2269
diff
changeset
|
475 |
\ {|Crypt (shrK A) {|Agent B, k, na, nb|}, X|} : set_of_list evs; \ |
2133 | 476 |
\ evs : yahalom lost |] \ |
477 |
\ ==> EX B'. Says B' Server \ |
|
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2269
diff
changeset
|
478 |
\ {| Agent B, Crypt (shrK B) {|Agent A, na, nb|} |} \ |
2133 | 479 |
\ : set_of_list evs"; |
480 |
by (etac rev_mp 1); |
|
481 |
by (etac yahalom.induct 1); |
|
482 |
by (ALLGOALS Asm_simp_tac); |
|
483 |
by (ALLGOALS Fast_tac); |
|
484 |
qed "Says_Server_imp_YM2"; |
|
485 |
||
486 |
||
487 |
(** Dedicated tactics for the nonce secrecy proofs **) |
|
488 |
||
489 |
val no_nonce_tac = SELECT_GOAL |
|
490 |
(REPEAT (resolve_tac [impI, notI] 1) THEN |
|
491 |
REPEAT (hyp_subst_tac 1) THEN |
|
492 |
etac (Says_imp_sees_Spy RS parts.Inj RS parts.Snd RS no_nonce_YM1_YM2) 1 |
|
493 |
THEN |
|
494 |
etac (Says_imp_sees_Spy RS parts.Inj RS parts.Snd) 4 |
|
495 |
THEN |
|
496 |
REPEAT_FIRST assume_tac); |
|
497 |
||
498 |
val not_analz_insert = subset_insertI RS analz_mono RS contra_subsetD; |
|
499 |
||
500 |
||
501 |
(*The only nonces that can be found with the help of session keys are |
|
502 |
those distributed as nonce NB by the Server. The form of the theorem |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
503 |
recalls analz_image_freshK, but it is much more complicated.*) |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
504 |
|
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
505 |
(*As with analz_image_freshK, we take some pains to express the property |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
506 |
as a logical equivalence so that the simplifier can apply it.*) |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
507 |
goal thy |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
508 |
"!!evs. P --> (X : analz (G Un H)) --> (X : analz H) ==> \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
509 |
\ P --> (X : analz (G Un H)) = (X : analz H)"; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
510 |
by (fast_tac (!claset addSEs [impOfSubs analz_mono]) 1); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
511 |
qed "Nonce_secrecy_lemma"; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
512 |
|
2133 | 513 |
goal thy |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
514 |
"!!evs. evs : yahalom lost ==> \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
515 |
\ (ALL KK. KK <= Compl (range shrK) --> \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
516 |
\ (ALL K: KK. ALL A B na X. \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
517 |
\ Says Server A \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
518 |
\ {|Crypt (shrK A) {|Agent B, Key K, na, Nonce NB|}, X|} \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
519 |
\ ~: set_of_list evs) --> \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
520 |
\ (Nonce NB : analz (Key``KK Un (sees lost Spy evs))) = \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
521 |
\ (Nonce NB : analz (sees lost Spy evs)))"; |
2133 | 522 |
by (etac yahalom.induct 1); |
523 |
by analz_Fake_tac; |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
524 |
by (REPEAT_FIRST (resolve_tac [impI RS allI])); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
525 |
by (REPEAT_FIRST (rtac Nonce_secrecy_lemma )); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
526 |
by (rtac ccontr 7); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
527 |
by (subgoal_tac "ALL A B na X. \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
528 |
\ Says Server A \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
529 |
\ {|Crypt (shrK A) {|Agent B, Key K, na, Nonce NB|}, X|} \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
530 |
\ ~: set_of_list evsa" 7); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
531 |
by (eres_inst_tac [("P","?PP-->?QQ")] notE 7); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
532 |
by (subgoal_tac "ALL A B na X. \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
533 |
\ Says Server A \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
534 |
\ {|Crypt (shrK A) {|Agent B, Key KAB, na, Nonce NB|}, X|} \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
535 |
\ ~: set_of_list evsa" 5); |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2377
diff
changeset
|
536 |
by (ALLGOALS (*22 seconds*) |
2133 | 537 |
(asm_simp_tac |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
538 |
(analz_image_freshK_ss addsimps |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
539 |
([all_conj_distrib, |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
540 |
not_parts_not_analz, analz_image_freshK] |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
541 |
@ pushes @ ball_simps)))); |
2133 | 542 |
(*Base*) |
543 |
by (fast_tac (!claset addss (!simpset)) 1); |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
544 |
(*Fake*) (** LEVEL 10 **) |
2133 | 545 |
by (spy_analz_tac 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
546 |
(*YM3*) |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
547 |
by (fast_tac (!claset addSEs sees_Spy_partsEs) 1); |
2133 | 548 |
(*Oops*) |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
549 |
(*20 secs*) |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
550 |
by (fast_tac (!claset delrules [ballE] addDs [unique_session_keys] |
2170 | 551 |
addss (!simpset)) 2); |
2133 | 552 |
(*YM4*) |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
553 |
(** LEVEL 13 **) |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
554 |
by (REPEAT (resolve_tac [impI, allI] 1)); |
2377 | 555 |
by (dtac (impOfSubs Fake_analz_insert) 1 THEN etac synth.Inj 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
556 |
by (stac insert_commute 1); |
2133 | 557 |
by (eres_inst_tac [("P","Nonce NB : ?HH")] rev_mp 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
558 |
by (asm_simp_tac (analz_image_freshK_ss |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
559 |
addsimps [analz_insertI, analz_image_freshK]) 1); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
560 |
by (step_tac (!claset addSDs [not_analz_insert]) 1); |
2133 | 561 |
by (lost_tac "A" 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
562 |
(** LEVEL 20 **) |
2322 | 563 |
by (dtac (Says_imp_sees_Spy RS parts.Inj RS parts.Fst RS A_trusts_YM3) 1 |
2133 | 564 |
THEN REPEAT (assume_tac 1)); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
565 |
by (thin_tac "All ?PP" 1); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
566 |
by (Fast_tac 1); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
567 |
qed_spec_mp "Nonce_secrecy"; |
2133 | 568 |
|
569 |
||
570 |
(*Version required below: if NB can be decrypted using a session key then it |
|
571 |
was distributed with that key. The more general form above is required |
|
572 |
for the induction to carry through.*) |
|
573 |
goal thy |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
574 |
"!!evs. [| Says Server A \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
575 |
\ {|Crypt (shrK A) {|Agent B, Key KAB, na, Nonce NB'|}, X|} \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
576 |
\ : set_of_list evs; \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
577 |
\ Nonce NB : analz (insert (Key KAB) (sees lost Spy evs)); \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
578 |
\ Nonce NB ~: analz (sees lost Spy evs); \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
579 |
\ KAB ~: range shrK; evs : yahalom lost |] \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
580 |
\ ==> NB = NB'"; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
581 |
by (rtac ccontr 1); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
582 |
by (subgoal_tac "ALL A B na X. \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
583 |
\ Says Server A \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
584 |
\ {|Crypt (shrK A) {|Agent B, Key KAB, na, Nonce NB|}, X|} \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
585 |
\ ~: set_of_list evs" 1); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
586 |
by (eres_inst_tac [("P","Nonce NB : ?HH")] rev_mp 1); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
587 |
by (asm_simp_tac (analz_image_freshK_ss |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
588 |
addsimps ([Nonce_secrecy] @ ball_simps)) 1); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
589 |
by (auto_tac (!claset addDs [unique_session_keys], (!simpset))); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
590 |
qed "single_Nonce_secrecy"; |
2133 | 591 |
|
592 |
||
593 |
goal thy |
|
594 |
"!!evs. [| A ~: lost; B ~: lost; Spy: lost; evs : yahalom lost |] \ |
|
595 |
\ ==> Says B Server \ |
|
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2269
diff
changeset
|
596 |
\ {|Agent B, Crypt (shrK B) {|Agent A, Nonce NA, Nonce NB|}|} \ |
2133 | 597 |
\ : set_of_list evs --> \ |
598 |
\ (ALL k. Says A Spy {|Nonce NA, Nonce NB, k|} ~: set_of_list evs) --> \ |
|
599 |
\ Nonce NB ~: analz (sees lost Spy evs)"; |
|
600 |
by (etac yahalom.induct 1); |
|
601 |
by analz_Fake_tac; |
|
602 |
by (ALLGOALS |
|
603 |
(asm_simp_tac |
|
2377 | 604 |
(!simpset addsimps ([not_parts_not_analz, |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
605 |
analz_insert_freshK] @ pushes) |
2133 | 606 |
setloop split_tac [expand_if]))); |
607 |
by (fast_tac (!claset addSIs [parts_insertI] |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
608 |
addSEs sees_Spy_partsEs |
2133 | 609 |
addss (!simpset)) 2); |
2377 | 610 |
(*Proof of YM2*) (** LEVEL 4 **) |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
611 |
by (deepen_tac (!claset addDs [Says_imp_sees_Spy RS analz.Inj, |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
612 |
impOfSubs analz_subset_parts] |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
613 |
addSEs partsEs) 3 2); |
2133 | 614 |
(*Prove YM3 by showing that no NB can also be an NA*) |
615 |
by (REPEAT (Safe_step_tac 2 ORELSE no_nonce_tac 2)); |
|
616 |
by (deepen_tac (!claset addDs [Says_unique_NB]) 1 2); |
|
2377 | 617 |
(*Fake*) |
618 |
by (spy_analz_tac 1); |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
619 |
(*YM4*) (** LEVEL 8 **) |
2133 | 620 |
by (res_inst_tac [("x1","X")] (insert_commute RS ssubst) 1); |
621 |
by (simp_tac (!simpset setloop split_tac [expand_if]) 1); |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
622 |
(*43 secs??*) |
2377 | 623 |
by (SELECT_GOAL (REPEAT_FIRST (spy_analz_tac ORELSE' Safe_step_tac)) 1); |
2133 | 624 |
by (lost_tac "Aa" 1); |
2322 | 625 |
by (dtac (Says_imp_sees_Spy RS parts.Inj RS parts.Fst RS A_trusts_YM3) 1); |
2133 | 626 |
by (forward_tac [Says_Server_message_form] 3); |
627 |
by (forward_tac [Says_Server_imp_YM2] 4); |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
628 |
(** LEVEL 15 **) |
2133 | 629 |
by (REPEAT_FIRST ((eresolve_tac [asm_rl, bexE, exE, disjE]))); |
630 |
by (lost_tac "Ba" 1); |
|
2170 | 631 |
by (dtac (Says_imp_sees_Spy RS parts.Inj RS parts.Snd RS unique_NB) 1); |
2133 | 632 |
by (fast_tac (!claset addSDs [Says_imp_sees_Spy RS parts.Inj] |
633 |
addSEs [MPair_parts]) 1); |
|
634 |
by (REPEAT (assume_tac 1 ORELSE Safe_step_tac 1)); |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
635 |
(** LEVEL 20 **) |
2170 | 636 |
by (dtac Spy_not_see_encrypted_key 1); |
2133 | 637 |
by (REPEAT (assume_tac 1 ORELSE Fast_tac 1)); |
638 |
by (spy_analz_tac 1); |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
639 |
(*Oops case*) (** LEVEL 23 **) |
2133 | 640 |
by (full_simp_tac (!simpset addsimps [all_conj_distrib]) 1); |
641 |
by (step_tac (!claset delrules [disjE, conjI]) 1); |
|
642 |
by (forward_tac [Says_Server_imp_YM2] 1 THEN assume_tac 1 THEN etac exE 1); |
|
643 |
by (expand_case_tac "NB = NBa" 1); |
|
644 |
by (deepen_tac (!claset addDs [Says_unique_NB]) 1 1); |
|
2170 | 645 |
by (rtac conjI 1); |
2133 | 646 |
by (no_nonce_tac 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
647 |
(** LEVEL 30 **) |
2133 | 648 |
by (thin_tac "?PP|?QQ" 1); (*subsumption!*) |
649 |
by (fast_tac (!claset addSDs [single_Nonce_secrecy]) 1); |
|
650 |
val Spy_not_see_NB = result() RSN(2,rev_mp) RSN(2,rev_mp) |> standard; |
|
651 |
||
2001 | 652 |
|
2110 | 653 |
(*What can B deduce from receipt of YM4? Note how the two components of |
654 |
the message contribute to a single conclusion about the Server's message. |
|
655 |
It's annoying that the "Says A Spy" assumption must quantify over |
|
2133 | 656 |
ALL POSSIBLE keys instead of our particular K (though at least the |
657 |
nonces are forced to agree with NA and NB). *) |
|
2001 | 658 |
goal thy |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
659 |
"!!evs. [| Says B Server \ |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2269
diff
changeset
|
660 |
\ {|Agent B, Crypt (shrK B) {|Agent A, Nonce NA, Nonce NB|}|} \ |
2133 | 661 |
\ : set_of_list evs; \ |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2269
diff
changeset
|
662 |
\ Says A' B {|Crypt (shrK B) {|Agent A, Key K|}, \ |
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2269
diff
changeset
|
663 |
\ Crypt K (Nonce NB)|} : set_of_list evs; \ |
2133 | 664 |
\ ALL k. Says A Spy {|Nonce NA, Nonce NB, k|} ~: set_of_list evs; \ |
665 |
\ A ~: lost; B ~: lost; Spy: lost; evs : yahalom lost |] \ |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
666 |
\ ==> Says Server A \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
667 |
\ {|Crypt (shrK A) {|Agent B, Key K, \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2454
diff
changeset
|
668 |
\ Nonce NA, Nonce NB|}, \ |
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2269
diff
changeset
|
669 |
\ Crypt (shrK B) {|Agent A, Key K|}|} \ |
2001 | 670 |
\ : set_of_list evs"; |
2133 | 671 |
by (forward_tac [Spy_not_see_NB] 1 THEN REPEAT (assume_tac 1)); |
672 |
by (etac (Says_imp_sees_Spy RS parts.Inj RS MPair_parts) 1 THEN |
|
673 |
dtac B_trusts_YM4_shrK 1); |
|
2170 | 674 |
by (dtac B_trusts_YM4_newK 3); |
2110 | 675 |
by (REPEAT_FIRST (eresolve_tac [asm_rl, exE])); |
2133 | 676 |
by (forward_tac [Says_Server_imp_YM2] 1 THEN assume_tac 1); |
2170 | 677 |
by (dtac unique_session_keys 1 THEN REPEAT (assume_tac 1)); |
2133 | 678 |
by (deepen_tac (!claset addDs [Says_unique_NB] addss (!simpset)) 0 1); |
2322 | 679 |
qed "B_trusts_YM4"; |