| author | wenzelm |
| Thu, 27 Aug 1998 16:54:55 +0200 | |
| changeset 5393 | 7299e531d481 |
| parent 5359 | bd539b72d484 |
| child 5421 | 01fc8d6a40f2 |
| permissions | -rw-r--r-- |
| 1934 | 1 |
(* Title: HOL/Auth/NS_Shared |
2 |
ID: $Id$ |
|
3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
|
4 |
Copyright 1996 University of Cambridge |
|
5 |
||
6 |
Inductive relation "ns_shared" for Needham-Schroeder Shared-Key protocol. |
|
7 |
||
8 |
From page 247 of |
|
9 |
Burrows, Abadi and Needham. A Logic of Authentication. |
|
10 |
Proc. Royal Soc. 426 (1989) |
|
11 |
*) |
|
12 |
||
| 4470 | 13 |
AddEs spies_partsEs; |
14 |
AddDs [impOfSubs analz_subset_parts]; |
|
15 |
AddDs [impOfSubs Fake_parts_insert]; |
|
16 |
||
| 1997 | 17 |
|
| 2323 | 18 |
(*A "possibility property": there are traces that reach the end*) |
| 5278 | 19 |
Goal "[| A ~= B; A ~= Server; B ~= Server |] \ |
|
4237
fb01353e363b
The dtac was discarding information, though apparently no proofs were hurt
paulson
parents:
4091
diff
changeset
|
20 |
\ ==> EX N K. EX evs: ns_shared. \ |
| 3465 | 21 |
\ Says A B (Crypt K {|Nonce N, Nonce N|}) : set evs";
|
| 1997 | 22 |
by (REPEAT (resolve_tac [exI,bexI] 1)); |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
23 |
by (rtac (ns_shared.Nil RS ns_shared.NS1 RS ns_shared.NS2 RS |
|
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
24 |
ns_shared.NS3 RS ns_shared.NS4 RS ns_shared.NS5) 2); |
|
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
25 |
by possibility_tac; |
| 2015 | 26 |
result(); |
27 |
||
| 5278 | 28 |
Goal "[| A ~= B; A ~= Server; B ~= Server |] \ |
|
3675
70dd312b70b2
Deleted the redundant simprule not_parts_not_analz
paulson
parents:
3651
diff
changeset
|
29 |
\ ==> EX evs: ns_shared. \ |
|
70dd312b70b2
Deleted the redundant simprule not_parts_not_analz
paulson
parents:
3651
diff
changeset
|
30 |
\ Says A B (Crypt ?K {|Nonce ?N, Nonce ?N|}) : set evs";
|
|
70dd312b70b2
Deleted the redundant simprule not_parts_not_analz
paulson
parents:
3651
diff
changeset
|
31 |
by (REPEAT (resolve_tac [exI,bexI] 1)); |
|
70dd312b70b2
Deleted the redundant simprule not_parts_not_analz
paulson
parents:
3651
diff
changeset
|
32 |
by (rtac (ns_shared.Nil RS ns_shared.NS1 RS ns_shared.NS2 RS |
|
70dd312b70b2
Deleted the redundant simprule not_parts_not_analz
paulson
parents:
3651
diff
changeset
|
33 |
ns_shared.NS3 RS ns_shared.NS4 RS ns_shared.NS5) 2); |
|
70dd312b70b2
Deleted the redundant simprule not_parts_not_analz
paulson
parents:
3651
diff
changeset
|
34 |
by possibility_tac; |
| 1943 | 35 |
|
| 1934 | 36 |
(**** Inductive proofs about ns_shared ****) |
37 |
||
38 |
(*Nobody sends themselves messages*) |
|
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
39 |
Goal "evs : ns_shared ==> ALL A X. Says A A X ~: set evs"; |
| 2032 | 40 |
by (etac ns_shared.induct 1); |
|
4477
b3e5857d8d99
New Auto_tac (by Oheimb), and new syntax (without parens), and expandshort
paulson
parents:
4470
diff
changeset
|
41 |
by Auto_tac; |
| 1934 | 42 |
qed_spec_mp "not_Says_to_self"; |
43 |
Addsimps [not_Says_to_self]; |
|
44 |
AddSEs [not_Says_to_self RSN (2, rev_notE)]; |
|
45 |
||
| 1943 | 46 |
(*For reasoning about the encrypted portion of message NS3*) |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
47 |
Goal "Says S A (Crypt KA {|N, B, K, X|}) : set evs \
|
| 3683 | 48 |
\ ==> X : parts (spies evs)"; |
| 4470 | 49 |
by (Blast_tac 1); |
| 3683 | 50 |
qed "NS3_msg_in_parts_spies"; |
| 2032 | 51 |
|
| 5278 | 52 |
Goal "Says Server A (Crypt (shrK A) {|NA, B, K, X|}) : set evs \
|
| 3683 | 53 |
\ ==> K : parts (spies evs)"; |
| 4470 | 54 |
by (Blast_tac 1); |
| 3683 | 55 |
qed "Oops_parts_spies"; |
| 2070 | 56 |
|
| 3683 | 57 |
(*For proving the easier theorems about X ~: parts (spies evs).*) |
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
58 |
fun parts_induct_tac i = |
| 4331 | 59 |
EVERY [etac ns_shared.induct i, |
60 |
REPEAT (FIRSTGOAL analz_mono_contra_tac), |
|
61 |
forward_tac [Oops_parts_spies] (i+7), |
|
62 |
forward_tac [NS3_msg_in_parts_spies] (i+4), |
|
63 |
prove_simple_subgoals_tac i]; |
|
| 2070 | 64 |
|
| 1934 | 65 |
|
| 3683 | 66 |
(** Theorems of the form X ~: parts (spies evs) imply that NOBODY |
| 2015 | 67 |
sends messages containing X! **) |
| 1934 | 68 |
|
| 3683 | 69 |
(*Spy never sees another agent's shared key! (unless it's bad at start)*) |
| 5278 | 70 |
Goal "evs : ns_shared ==> (Key (shrK A) : parts (spies evs)) = (A : bad)"; |
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
71 |
by (parts_induct_tac 1); |
| 3961 | 72 |
by (ALLGOALS Blast_tac); |
| 2131 | 73 |
qed "Spy_see_shrK"; |
74 |
Addsimps [Spy_see_shrK]; |
|
| 1934 | 75 |
|
| 5278 | 76 |
Goal "evs : ns_shared ==> (Key (shrK A) : analz (spies evs)) = (A : bad)"; |
|
4477
b3e5857d8d99
New Auto_tac (by Oheimb), and new syntax (without parens), and expandshort
paulson
parents:
4470
diff
changeset
|
77 |
by Auto_tac; |
| 2131 | 78 |
qed "Spy_analz_shrK"; |
79 |
Addsimps [Spy_analz_shrK]; |
|
| 1934 | 80 |
|
| 4470 | 81 |
AddSDs [Spy_see_shrK RSN (2, rev_iffD1), |
82 |
Spy_analz_shrK RSN (2, rev_iffD1)]; |
|
| 1934 | 83 |
|
| 2070 | 84 |
|
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
85 |
(*Nobody can have used non-existent keys!*) |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
86 |
Goal "evs : ns_shared ==> \ |
| 3683 | 87 |
\ Key K ~: used evs --> K ~: keysFor (parts (spies evs))"; |
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
88 |
by (parts_induct_tac 1); |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
89 |
(*Fake*) |
|
4509
828148415197
Making proofs faster, especially using keysFor_parts_insert
paulson
parents:
4477
diff
changeset
|
90 |
by (blast_tac (claset() addSDs [keysFor_parts_insert]) 1); |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
91 |
(*NS2, NS4, NS5*) |
| 5054 | 92 |
by (ALLGOALS Blast_tac); |
| 2160 | 93 |
qed_spec_mp "new_keys_not_used"; |
| 1934 | 94 |
|
95 |
bind_thm ("new_keys_not_analzd",
|
|
| 2032 | 96 |
[analz_subset_parts RS keysFor_mono, |
97 |
new_keys_not_used] MRS contra_subsetD); |
|
| 1934 | 98 |
|
99 |
Addsimps [new_keys_not_used, new_keys_not_analzd]; |
|
100 |
||
101 |
||
102 |
(** Lemmas concerning the form of items passed in messages **) |
|
103 |
||
| 2015 | 104 |
(*Describes the form of K, X and K' when the Server sends this message.*) |
| 5278 | 105 |
Goal "[| Says Server A (Crypt K' {|N, Agent B, Key K, X|}) : set evs; \
|
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
106 |
\ evs : ns_shared |] \ |
| 4267 | 107 |
\ ==> K ~: range shrK & \ |
108 |
\ X = (Crypt (shrK B) {|Key K, Agent A|}) & \
|
|
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
109 |
\ K' = shrK A"; |
| 2032 | 110 |
by (etac rev_mp 1); |
111 |
by (etac ns_shared.induct 1); |
|
|
4477
b3e5857d8d99
New Auto_tac (by Oheimb), and new syntax (without parens), and expandshort
paulson
parents:
4470
diff
changeset
|
112 |
by Auto_tac; |
| 1934 | 113 |
qed "Says_Server_message_form"; |
114 |
||
115 |
||
| 2070 | 116 |
(*If the encrypted message appears then it originated with the Server*) |
| 5278 | 117 |
Goal "[| Crypt (shrK A) {|NA, Agent B, Key K, X|} : parts (spies evs); \
|
| 4267 | 118 |
\ A ~: bad; evs : ns_shared |] \ |
119 |
\ ==> Says Server A (Crypt (shrK A) {|NA, Agent B, Key K, X|}) \
|
|
| 3651 | 120 |
\ : set evs"; |
| 2070 | 121 |
by (etac rev_mp 1); |
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
122 |
by (parts_induct_tac 1); |
| 4470 | 123 |
by (Blast_tac 1); |
| 2323 | 124 |
qed "A_trusts_NS2"; |
| 1934 | 125 |
|
| 1965 | 126 |
|
| 5278 | 127 |
Goal "[| Crypt (shrK A) {|NA, Agent B, Key K, X|} : parts (spies evs); \
|
| 4331 | 128 |
\ A ~: bad; evs : ns_shared |] \ |
129 |
\ ==> K ~: range shrK & X = (Crypt (shrK B) {|Key K, Agent A|})";
|
|
130 |
by (blast_tac (claset() addSDs [A_trusts_NS2, Says_Server_message_form]) 1); |
|
131 |
qed "cert_A_form"; |
|
132 |
||
133 |
||
| 1965 | 134 |
(*EITHER describes the form of X when the following message is sent, |
135 |
OR reduces it to the Fake case. |
|
136 |
Use Says_Server_message_form if applicable.*) |
|
| 5278 | 137 |
Goal "[| Says S A (Crypt (shrK A) {|Nonce NA, Agent B, Key K, X|}) \
|
| 3651 | 138 |
\ : set evs; \ |
139 |
\ evs : ns_shared |] \ |
|
|
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
140 |
\ ==> (K ~: range shrK & X = (Crypt (shrK B) {|Key K, Agent A|})) \
|
| 3683 | 141 |
\ | X : analz (spies evs)"; |
142 |
by (case_tac "A : bad" 1); |
|
| 4091 | 143 |
by (fast_tac (claset() addSDs [Says_imp_spies RS analz.Inj] |
|
4237
fb01353e363b
The dtac was discarding information, though apparently no proofs were hurt
paulson
parents:
4091
diff
changeset
|
144 |
addss (simpset())) 1); |
| 4470 | 145 |
by (blast_tac (claset() addSDs [cert_A_form]) 1); |
| 1934 | 146 |
qed "Says_S_message_form"; |
147 |
||
148 |
||
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
149 |
(*For proofs involving analz.*) |
| 3683 | 150 |
val analz_spies_tac = |
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
151 |
forward_tac [Says_Server_message_form] 8 THEN |
|
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
152 |
forward_tac [Says_S_message_form] 5 THEN |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
153 |
REPEAT_FIRST (eresolve_tac [asm_rl, conjE, disjE] ORELSE' hyp_subst_tac); |
| 2131 | 154 |
|
| 1934 | 155 |
|
156 |
(**** |
|
157 |
The following is to prove theorems of the form |
|
158 |
||
| 3683 | 159 |
Key K : analz (insert (Key KAB) (spies evs)) ==> |
160 |
Key K : analz (spies evs) |
|
| 1934 | 161 |
|
162 |
A more general formula must be proved inductively. |
|
163 |
****) |
|
164 |
||
165 |
||
166 |
(*NOT useful in this form, but it says that session keys are not used |
|
167 |
to encrypt messages containing other keys, in the actual protocol. |
|
168 |
We require that agents should behave like this subsequently also.*) |
|
| 5278 | 169 |
Goal "[| evs : ns_shared; Kab ~: range shrK |] ==> \ |
|
4237
fb01353e363b
The dtac was discarding information, though apparently no proofs were hurt
paulson
parents:
4091
diff
changeset
|
170 |
\ (Crypt KAB X) : parts (spies evs) & \ |
| 3683 | 171 |
\ Key K : parts {X} --> Key K : parts (spies evs)";
|
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
172 |
by (parts_induct_tac 1); |
| 4470 | 173 |
(*Fake*) |
| 4091 | 174 |
by (blast_tac (claset() addSEs partsEs |
|
4237
fb01353e363b
The dtac was discarding information, though apparently no proofs were hurt
paulson
parents:
4091
diff
changeset
|
175 |
addDs [impOfSubs parts_insert_subset_Un]) 1); |
| 1965 | 176 |
(*Base, NS4 and NS5*) |
|
4477
b3e5857d8d99
New Auto_tac (by Oheimb), and new syntax (without parens), and expandshort
paulson
parents:
4470
diff
changeset
|
177 |
by Auto_tac; |
| 1934 | 178 |
result(); |
179 |
||
180 |
||
181 |
(** Session keys are not used to encrypt other session keys **) |
|
182 |
||
| 2015 | 183 |
(*The equality makes the induction hypothesis easier to apply*) |
| 5278 | 184 |
Goal "evs : ns_shared ==> \ |
|
4237
fb01353e363b
The dtac was discarding information, though apparently no proofs were hurt
paulson
parents:
4091
diff
changeset
|
185 |
\ ALL K KK. KK <= Compl (range shrK) --> \ |
| 3683 | 186 |
\ (Key K : analz (Key``KK Un (spies evs))) = \ |
187 |
\ (K : KK | Key K : analz (spies evs))"; |
|
| 2032 | 188 |
by (etac ns_shared.induct 1); |
| 3683 | 189 |
by analz_spies_tac; |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
190 |
by (REPEAT_FIRST (resolve_tac [allI, impI])); |
| 3961 | 191 |
by (REPEAT_FIRST (rtac analz_image_freshK_lemma)); |
192 |
(*Takes 9 secs*) |
|
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
193 |
by (ALLGOALS (asm_simp_tac analz_image_freshK_ss)); |
|
3451
d10f100676d8
Made proofs more concise by replacing calls to spy_analz_tac by uses of
paulson
parents:
3441
diff
changeset
|
194 |
(*Fake*) |
|
4422
21238c9d363e
Simplified proofs using rewrites for f``A where f is injective
paulson
parents:
4331
diff
changeset
|
195 |
by (spy_analz_tac 1); |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
196 |
qed_spec_mp "analz_image_freshK"; |
| 1934 | 197 |
|
198 |
||
| 5278 | 199 |
Goal "[| evs : ns_shared; KAB ~: range shrK |] ==> \ |
| 3683 | 200 |
\ Key K : analz (insert (Key KAB) (spies evs)) = \ |
201 |
\ (K = KAB | Key K : analz (spies evs))"; |
|
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
202 |
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
|
203 |
qed "analz_insert_freshK"; |
| 1934 | 204 |
|
205 |
||
| 2558 | 206 |
(** The session key K uniquely identifies the message **) |
| 1965 | 207 |
|
| 5278 | 208 |
Goal "evs : ns_shared ==> \ |
|
4237
fb01353e363b
The dtac was discarding information, though apparently no proofs were hurt
paulson
parents:
4091
diff
changeset
|
209 |
\ EX A' NA' B' X'. ALL A NA B X. \ |
| 3683 | 210 |
\ Says Server A (Crypt (shrK A) {|NA, Agent B, Key K, X|}) : set evs \
|
211 |
\ --> A=A' & NA=NA' & B=B' & X=X'"; |
|
| 2032 | 212 |
by (etac ns_shared.induct 1); |
| 4091 | 213 |
by (ALLGOALS (asm_simp_tac (simpset() addsimps [all_conj_distrib]))); |
| 3730 | 214 |
by Safe_tac; |
| 2070 | 215 |
(*NS3*) |
216 |
by (ex_strip_tac 2); |
|
|
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
217 |
by (Blast_tac 2); |
| 2070 | 218 |
(*NS2: it can't be a new key*) |
219 |
by (expand_case_tac "K = ?y" 1); |
|
220 |
by (REPEAT (ares_tac [refl,exI,impI,conjI] 2)); |
|
| 4470 | 221 |
by (Blast_tac 1); |
| 1934 | 222 |
val lemma = result(); |
223 |
||
224 |
(*In messages of this form, the session key uniquely identifies the rest*) |
|
| 5278 | 225 |
Goal "[| Says Server A \ |
|
4237
fb01353e363b
The dtac was discarding information, though apparently no proofs were hurt
paulson
parents:
4091
diff
changeset
|
226 |
\ (Crypt (shrK A) {|NA, Agent B, Key K, X|}) : set evs; \
|
|
fb01353e363b
The dtac was discarding information, though apparently no proofs were hurt
paulson
parents:
4091
diff
changeset
|
227 |
\ Says Server A' \ |
| 3683 | 228 |
\ (Crypt (shrK A') {|NA', Agent B', Key K, X'|}) : set evs; \
|
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
229 |
\ evs : ns_shared |] ==> A=A' & NA=NA' & B=B' & X = X'"; |
|
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2374
diff
changeset
|
230 |
by (prove_unique_tac lemma 1); |
| 1934 | 231 |
qed "unique_session_keys"; |
232 |
||
233 |
||
| 2032 | 234 |
(** Crucial secrecy property: Spy does not see the keys sent in msg NS2 **) |
| 2015 | 235 |
|
| 5278 | 236 |
Goal "[| A ~: bad; B ~: bad; evs : ns_shared |] \ |
| 2015 | 237 |
\ ==> Says Server A \ |
|
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
238 |
\ (Crypt (shrK A) {|NA, Agent B, Key K, \
|
|
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
239 |
\ Crypt (shrK B) {|Key K, Agent A|}|}) \
|
|
3466
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
240 |
\ : set evs --> \ |
|
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
241 |
\ (ALL NB. Notes Spy {|NA, NB, Key K|} ~: set evs) --> \
|
| 3683 | 242 |
\ Key K ~: analz (spies evs)"; |
| 2032 | 243 |
by (etac ns_shared.induct 1); |
| 3683 | 244 |
by analz_spies_tac; |
| 1934 | 245 |
by (ALLGOALS |
| 2015 | 246 |
(asm_simp_tac |
| 4091 | 247 |
(simpset() addsimps ([analz_insert_eq, analz_insert_freshK] @ |
| 4831 | 248 |
pushes @ split_ifs)))); |
|
3451
d10f100676d8
Made proofs more concise by replacing calls to spy_analz_tac by uses of
paulson
parents:
3441
diff
changeset
|
249 |
(*Oops*) |
|
4509
828148415197
Making proofs faster, especially using keysFor_parts_insert
paulson
parents:
4477
diff
changeset
|
250 |
by (blast_tac (claset() addSDs [unique_session_keys]) 5); |
| 3679 | 251 |
(*NS3, replay sub-case*) |
|
3451
d10f100676d8
Made proofs more concise by replacing calls to spy_analz_tac by uses of
paulson
parents:
3441
diff
changeset
|
252 |
by (Blast_tac 4); |
| 1934 | 253 |
(*NS2*) |
| 4470 | 254 |
by (Blast_tac 2); |
|
3451
d10f100676d8
Made proofs more concise by replacing calls to spy_analz_tac by uses of
paulson
parents:
3441
diff
changeset
|
255 |
(*Fake*) |
|
d10f100676d8
Made proofs more concise by replacing calls to spy_analz_tac by uses of
paulson
parents:
3441
diff
changeset
|
256 |
by (spy_analz_tac 1); |
| 3679 | 257 |
(*NS3, Server sub-case*) (**LEVEL 6 **) |
| 4091 | 258 |
by (clarify_tac (claset() delrules [impCE]) 1); |
| 3683 | 259 |
by (forward_tac [Says_imp_spies RS parts.Inj RS A_trusts_NS2] 1); |
| 2170 | 260 |
by (assume_tac 2); |
| 4091 | 261 |
by (blast_tac (claset() addDs [Says_imp_spies RS analz.Inj RS |
| 4470 | 262 |
Crypt_Spy_analz_bad]) 1); |
| 4091 | 263 |
by (blast_tac (claset() addDs [unique_session_keys]) 1); |
| 2070 | 264 |
val lemma = result() RS mp RS mp RSN(2,rev_notE); |
| 2015 | 265 |
|
266 |
||
267 |
(*Final version: Server's message in the most abstract form*) |
|
| 5278 | 268 |
Goal "[| Says Server A \ |
| 4331 | 269 |
\ (Crypt K' {|NA, Agent B, Key K, X|}) : set evs; \
|
|
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
270 |
\ ALL NB. Notes Spy {|NA, NB, Key K|} ~: set evs; \
|
| 3683 | 271 |
\ A ~: bad; B ~: bad; evs : ns_shared \ |
272 |
\ |] ==> Key K ~: analz (spies evs)"; |
|
| 2015 | 273 |
by (forward_tac [Says_Server_message_form] 1 THEN assume_tac 1); |
| 4091 | 274 |
by (blast_tac (claset() addSDs [lemma]) 1); |
| 2032 | 275 |
qed "Spy_not_see_encrypted_key"; |
276 |
||
277 |
||
| 2070 | 278 |
(**** Guarantees available at various stages of protocol ***) |
279 |
||
| 3651 | 280 |
A_trusts_NS2 RS Spy_not_see_encrypted_key; |
| 2070 | 281 |
|
282 |
||
283 |
(*If the encrypted message appears then it originated with the Server*) |
|
| 5278 | 284 |
Goal "[| Crypt (shrK B) {|Key K, Agent A|} : parts (spies evs); \
|
|
4237
fb01353e363b
The dtac was discarding information, though apparently no proofs were hurt
paulson
parents:
4091
diff
changeset
|
285 |
\ B ~: bad; evs : ns_shared |] \ |
| 2070 | 286 |
\ ==> EX NA. Says Server A \ |
|
2284
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
287 |
\ (Crypt (shrK A) {|NA, Agent B, Key K, \
|
|
80ebd1a213fd
Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents:
2264
diff
changeset
|
288 |
\ Crypt (shrK B) {|Key K, Agent A|}|}) \
|
| 3465 | 289 |
\ : set evs"; |
| 2070 | 290 |
by (etac rev_mp 1); |
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
291 |
by (parts_induct_tac 1); |
|
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
292 |
by (ALLGOALS Blast_tac); |
| 2323 | 293 |
qed "B_trusts_NS3"; |
| 2070 | 294 |
|
295 |
||
| 5278 | 296 |
Goal "[| Crypt K (Nonce NB) : parts (spies evs); \ |
| 4331 | 297 |
\ Says Server A (Crypt (shrK A) {|NA, Agent B, Key K, X|}) \
|
298 |
\ : set evs; \ |
|
299 |
\ Key K ~: analz (spies evs); \ |
|
300 |
\ evs : ns_shared |] \ |
|
301 |
\ ==> Says B A (Crypt K (Nonce NB)) : set evs"; |
|
302 |
by (etac rev_mp 1); |
|
303 |
by (etac rev_mp 1); |
|
304 |
by (etac rev_mp 1); |
|
305 |
by (parts_induct_tac 1); |
|
| 4267 | 306 |
(*NS3*) |
307 |
by (Blast_tac 3); |
|
| 4470 | 308 |
by (Blast_tac 1); |
| 4267 | 309 |
(*NS2: contradiction from the assumptions |
| 4331 | 310 |
Key K ~: used evs2 and Crypt K (Nonce NB) : parts (spies evs2) *) |
311 |
by (blast_tac (claset() addSEs [new_keys_not_used RSN (2,rev_notE)] |
|
312 |
addSDs [Crypt_imp_keysFor]) 1); |
|
313 |
(**LEVEL 7**) |
|
314 |
(*NS4*) |
|
315 |
by (Clarify_tac 1); |
|
316 |
by (not_bad_tac "Ba" 1); |
|
| 4470 | 317 |
by (blast_tac (claset() addDs [B_trusts_NS3, unique_session_keys]) 1); |
| 4331 | 318 |
qed "A_trusts_NS4_lemma"; |
| 2103 | 319 |
|
| 4331 | 320 |
|
321 |
(*This version no longer assumes that K is secure*) |
|
| 5278 | 322 |
Goal "[| Crypt K (Nonce NB) : parts (spies evs); \ |
| 4331 | 323 |
\ Crypt (shrK A) {|NA, Agent B, Key K, X|} : parts (spies evs); \
|
|
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
324 |
\ ALL NB. Notes Spy {|NA, NB, Key K|} ~: set evs; \
|
| 4267 | 325 |
\ A ~: bad; B ~: bad; evs : ns_shared |] \ |
| 3465 | 326 |
\ ==> Says B A (Crypt K (Nonce NB)) : set evs"; |
| 4331 | 327 |
by (blast_tac (claset() addSIs [A_trusts_NS2, A_trusts_NS4_lemma] |
| 4267 | 328 |
addSEs [Spy_not_see_encrypted_key RSN (2,rev_notE)]) 1); |
| 2323 | 329 |
qed "A_trusts_NS4"; |
| 4331 | 330 |
|
331 |
||
332 |
(*If the session key has been used in NS4 then somebody has forwarded |
|
333 |
component X in some instance of NS4. Perhaps an interesting property, |
|
334 |
but not needed (after all) for the proofs below.*) |
|
| 5278 | 335 |
Goal "[| Crypt K (Nonce NB) : parts (spies evs); \ |
| 4331 | 336 |
\ Says Server A (Crypt (shrK A) {|NA, Agent B, Key K, X|}) \
|
337 |
\ : set evs; \ |
|
338 |
\ Key K ~: analz (spies evs); \ |
|
339 |
\ evs : ns_shared |] \ |
|
340 |
\ ==> EX A'. Says A' B X : set evs"; |
|
341 |
by (etac rev_mp 1); |
|
342 |
by (etac rev_mp 1); |
|
343 |
by (etac rev_mp 1); |
|
344 |
by (parts_induct_tac 1); |
|
345 |
by (ALLGOALS (asm_simp_tac (simpset() addsimps [ex_disj_distrib]))); |
|
346 |
by (ALLGOALS Clarify_tac); |
|
| 4470 | 347 |
by (Blast_tac 1); |
| 4331 | 348 |
(**LEVEL 7**) |
349 |
(*NS2*) |
|
350 |
by (blast_tac (claset() addSEs [new_keys_not_used RSN (2,rev_notE)] |
|
351 |
addSDs [Crypt_imp_keysFor]) 1); |
|
352 |
(*NS4*) |
|
353 |
by (not_bad_tac "Ba" 1); |
|
354 |
by (Asm_full_simp_tac 1); |
|
355 |
by (forward_tac [Says_imp_spies RS parts.Inj RS B_trusts_NS3] 1); |
|
356 |
by (ALLGOALS Clarify_tac); |
|
357 |
by (blast_tac (claset() addDs [unique_session_keys]) 1); |
|
358 |
qed "NS4_implies_NS3"; |
|
359 |
||
360 |
||
| 5278 | 361 |
Goal "[| B ~: bad; evs : ns_shared |] \ |
| 4331 | 362 |
\ ==> Key K ~: analz (spies evs) --> \ |
| 5054 | 363 |
\ Says Server A \ |
| 4331 | 364 |
\ (Crypt (shrK A) {|NA, Agent B, Key K, \
|
365 |
\ Crypt (shrK B) {|Key K, Agent A|}|}) \
|
|
| 5054 | 366 |
\ : set evs --> \ |
367 |
\ Says B A (Crypt K (Nonce NB)) : set evs --> \ |
|
368 |
\ Crypt K {|Nonce NB, Nonce NB|} : parts (spies evs) --> \
|
|
| 4331 | 369 |
\ Says A B (Crypt K {|Nonce NB, Nonce NB|}) : set evs";
|
370 |
by (parts_induct_tac 1); |
|
371 |
(*NS4*) |
|
| 4470 | 372 |
by (Blast_tac 4); |
| 4331 | 373 |
(*NS3*) |
| 4470 | 374 |
by (blast_tac (claset() addSDs [cert_A_form]) 3); |
| 4331 | 375 |
(*NS2*) |
376 |
by (blast_tac (claset() addSEs [new_keys_not_used RSN (2,rev_notE)] |
|
377 |
addSDs [Crypt_imp_keysFor]) 2); |
|
| 4470 | 378 |
by (Blast_tac 1); |
| 4331 | 379 |
(**LEVEL 5**) |
380 |
(*NS5*) |
|
381 |
by (Clarify_tac 1); |
|
382 |
by (not_bad_tac "Aa" 1); |
|
| 4470 | 383 |
by (blast_tac (claset() addDs [A_trusts_NS2, unique_session_keys]) 1); |
| 5054 | 384 |
qed_spec_mp "B_trusts_NS5_lemma"; |
| 4331 | 385 |
|
386 |
||
387 |
(*Very strong Oops condition reveals protocol's weakness*) |
|
| 5278 | 388 |
Goal "[| Crypt K {|Nonce NB, Nonce NB|} : parts (spies evs); \
|
| 4331 | 389 |
\ Says B A (Crypt K (Nonce NB)) : set evs; \ |
390 |
\ Crypt (shrK B) {|Key K, Agent A|} : parts (spies evs); \
|
|
|
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
391 |
\ ALL NA NB. Notes Spy {|NA, NB, Key K|} ~: set evs; \
|
| 4331 | 392 |
\ A ~: bad; B ~: bad; evs : ns_shared |] \ |
393 |
\ ==> Says A B (Crypt K {|Nonce NB, Nonce NB|}) : set evs";
|
|
394 |
by (dtac B_trusts_NS3 1); |
|
395 |
by (ALLGOALS Clarify_tac); |
|
| 5054 | 396 |
by (blast_tac (claset() addSIs [B_trusts_NS5_lemma] |
| 4331 | 397 |
addSEs [Spy_not_see_encrypted_key RSN (2,rev_notE)]) 1); |
398 |
qed "B_trusts_NS5"; |