author | paulson |
Fri, 21 Aug 1998 16:14:34 +0200 | |
changeset 5359 | bd539b72d484 |
parent 5223 | 4cb05273f764 |
child 5421 | 01fc8d6a40f2 |
permissions | -rw-r--r-- |
2318 | 1 |
(* Title: HOL/Auth/NS_Public |
2 |
ID: $Id$ |
|
3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
|
4 |
Copyright 1996 University of Cambridge |
|
5 |
||
6 |
Inductive relation "ns_public" for the Needham-Schroeder Public-Key protocol. |
|
7 |
Version incorporating Lowe's fix (inclusion of B's identify in round 2). |
|
8 |
*) |
|
9 |
||
4470 | 10 |
AddEs spies_partsEs; |
11 |
AddDs [impOfSubs analz_subset_parts]; |
|
12 |
AddDs [impOfSubs Fake_parts_insert]; |
|
13 |
||
3683 | 14 |
AddIffs [Spy_in_bad]; |
2318 | 15 |
|
16 |
(*A "possibility property": there are traces that reach the end*) |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
17 |
Goal "A ~= B ==> EX NB. EX evs: ns_public. \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
18 |
\ Says A B (Crypt (pubK B) (Nonce NB)) : set evs"; |
2318 | 19 |
by (REPEAT (resolve_tac [exI,bexI] 1)); |
20 |
by (rtac (ns_public.Nil RS ns_public.NS1 RS ns_public.NS2 RS ns_public.NS3) 2); |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2497
diff
changeset
|
21 |
by possibility_tac; |
2318 | 22 |
result(); |
23 |
||
24 |
||
25 |
(**** Inductive proofs about ns_public ****) |
|
26 |
||
27 |
(*Nobody sends themselves messages*) |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
28 |
Goal "evs : ns_public ==> ALL A X. Says A A X ~: set evs"; |
2318 | 29 |
by (etac ns_public.induct 1); |
4477
b3e5857d8d99
New Auto_tac (by Oheimb), and new syntax (without parens), and expandshort
paulson
parents:
4470
diff
changeset
|
30 |
by Auto_tac; |
2318 | 31 |
qed_spec_mp "not_Says_to_self"; |
32 |
Addsimps [not_Says_to_self]; |
|
33 |
AddSEs [not_Says_to_self RSN (2, rev_notE)]; |
|
34 |
||
35 |
||
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
36 |
(*Induction for regularity theorems. If induction formula has the form |
3683 | 37 |
X ~: analz (spies evs) --> ... then it shortens the proof by discarding |
38 |
needless information about analz (insert X (spies evs)) *) |
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
39 |
fun parts_induct_tac i = |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
40 |
etac ns_public.induct i |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
41 |
THEN |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
42 |
REPEAT (FIRSTGOAL analz_mono_contra_tac) |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
43 |
THEN |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
44 |
prove_simple_subgoals_tac i; |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
45 |
|
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
46 |
|
3683 | 47 |
(** Theorems of the form X ~: parts (spies evs) imply that NOBODY |
2318 | 48 |
sends messages containing X! **) |
49 |
||
3683 | 50 |
(*Spy never sees another agent's private key! (unless it's bad at start)*) |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
51 |
Goal "evs: ns_public ==> (Key (priK A) : parts (spies evs)) = (A : bad)"; |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
52 |
by (parts_induct_tac 1); |
4470 | 53 |
by (Blast_tac 1); |
2318 | 54 |
qed "Spy_see_priK"; |
55 |
Addsimps [Spy_see_priK]; |
|
56 |
||
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
57 |
Goal "evs: ns_public ==> (Key (priK 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
|
58 |
by Auto_tac; |
2318 | 59 |
qed "Spy_analz_priK"; |
60 |
Addsimps [Spy_analz_priK]; |
|
61 |
||
4470 | 62 |
AddSDs [Spy_see_priK RSN (2, rev_iffD1), |
63 |
Spy_analz_priK RSN (2, rev_iffD1)]; |
|
2318 | 64 |
|
65 |
||
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
66 |
(**** Authenticity properties obtained from NS2 ****) |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
67 |
|
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
68 |
(*It is impossible to re-use a nonce in both NS1 and NS2, provided the nonce |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
69 |
is secret. (Honest users generate fresh nonces.)*) |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
70 |
Goal "[| Crypt (pubK B) {|Nonce NA, Agent A|} : parts (spies evs); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
71 |
\ Nonce NA ~: analz (spies evs); evs : ns_public |] \ |
3683 | 72 |
\ ==> Crypt (pubK C) {|NA', Nonce NA, Agent D|} ~: parts (spies evs)"; |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
73 |
by (etac rev_mp 1); |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
74 |
by (etac rev_mp 1); |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
75 |
by (parts_induct_tac 1); |
4470 | 76 |
by (ALLGOALS Blast_tac); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
77 |
qed "no_nonce_NS1_NS2"; |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
78 |
|
4470 | 79 |
(*Adding it to the claset slows down proofs...*) |
80 |
val nonce_NS1_NS2_E = no_nonce_NS1_NS2 RSN (2, rev_notE); |
|
81 |
||
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
82 |
|
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
83 |
(*Unicity for NS1: nonce NA identifies agents A and B*) |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
84 |
Goal "[| Nonce NA ~: analz (spies evs); evs : ns_public |] \ |
3709 | 85 |
\ ==> EX A' B'. ALL A B. \ |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
86 |
\ Crypt (pubK B) {|Nonce NA, Agent A|} : parts (spies evs) --> \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
87 |
\ A=A' & B=B'"; |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
88 |
by (etac rev_mp 1); |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
89 |
by (parts_induct_tac 1); |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4477
diff
changeset
|
90 |
by (ALLGOALS (asm_simp_tac (simpset() addsimps [all_conj_distrib]))); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
91 |
(*NS1*) |
4470 | 92 |
by (expand_case_tac "NA = ?y" 2 THEN Blast_tac 2); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
93 |
(*Fake*) |
3709 | 94 |
by (Clarify_tac 1); |
4470 | 95 |
by (Blast_tac 1); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
96 |
val lemma = result(); |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
97 |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
98 |
Goal "[| Crypt(pubK B) {|Nonce NA, Agent A|} : parts(spies evs); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
99 |
\ Crypt(pubK B') {|Nonce NA, Agent A'|} : parts(spies evs); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
100 |
\ Nonce NA ~: analz (spies evs); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
101 |
\ evs : ns_public |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
102 |
\ ==> A=A' & B=B'"; |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
103 |
by (prove_unique_tac lemma 1); |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
104 |
qed "unique_NA"; |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
105 |
|
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
106 |
|
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
107 |
(*Tactic for proving secrecy theorems*) |
4686 | 108 |
fun analz_induct_tac i = |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
109 |
etac ns_public.induct i THEN |
4686 | 110 |
ALLGOALS Asm_simp_tac; |
2318 | 111 |
|
112 |
||
113 |
(*Secrecy: Spy does not see the nonce sent in msg NS1 if A and B are secure*) |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
114 |
Goal "[| Says A B (Crypt(pubK B) {|Nonce NA, Agent A|}) : set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
115 |
\ A ~: bad; B ~: bad; evs : ns_public |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
116 |
\ ==> Nonce NA ~: analz (spies evs)"; |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
117 |
by (etac rev_mp 1); |
2418
6b6a92d05fb2
New tactics: prove_unique_tac and analz_induct_tac
paulson
parents:
2374
diff
changeset
|
118 |
by (analz_induct_tac 1); |
2318 | 119 |
(*NS3*) |
4470 | 120 |
by (blast_tac (claset() addEs [nonce_NS1_NS2_E]) 4); |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
121 |
(*NS2*) |
4470 | 122 |
by (blast_tac (claset() addDs [unique_NA]) 3); |
2318 | 123 |
(*NS1*) |
4470 | 124 |
by (Blast_tac 2); |
2318 | 125 |
(*Fake*) |
2497 | 126 |
by (spy_analz_tac 1); |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
127 |
qed "Spy_not_see_NA"; |
2318 | 128 |
|
129 |
||
130 |
(*Authentication for A: if she receives message 2 and has used NA |
|
131 |
to start a run, then B has sent message 2.*) |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
132 |
Goal "[| Says A B (Crypt(pubK B) {|Nonce NA, Agent A|}) : set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
133 |
\ Says B' A (Crypt(pubK A) {|Nonce NA, Nonce NB, Agent B|}) \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
134 |
\ : set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
135 |
\ A ~: bad; B ~: bad; evs : ns_public |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
136 |
\ ==> Says B A (Crypt(pubK A) {|Nonce NA, Nonce NB, Agent B|}) \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
137 |
\ : set evs"; |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
138 |
by (etac rev_mp 1); |
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
139 |
(*prepare induction over Crypt (pubK A) {|NA,NB,B|} : parts H*) |
3683 | 140 |
by (etac (Says_imp_spies RS parts.Inj RS rev_mp) 1); |
2318 | 141 |
by (etac ns_public.induct 1); |
142 |
by (ALLGOALS Asm_simp_tac); |
|
143 |
(*NS1*) |
|
4470 | 144 |
by (Blast_tac 2); |
2318 | 145 |
(*Fake*) |
4422
21238c9d363e
Simplified proofs using rewrites for f``A where f is injective
paulson
parents:
4197
diff
changeset
|
146 |
by (blast_tac (claset() addDs [Spy_not_see_NA]) 1); |
2318 | 147 |
qed "A_trusts_NS2"; |
148 |
||
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4477
diff
changeset
|
149 |
|
2318 | 150 |
(*If the encrypted message appears then it originated with Alice in NS1*) |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
151 |
Goal "[| Crypt (pubK B) {|Nonce NA, Agent A|} : parts (spies evs); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
152 |
\ Nonce NA ~: analz (spies evs); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
153 |
\ evs : ns_public |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
154 |
\==> Says A B (Crypt (pubK B) {|Nonce NA, Agent A|}) : set evs"; |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
155 |
by (etac rev_mp 1); |
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
156 |
by (etac rev_mp 1); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
157 |
by (parts_induct_tac 1); |
4470 | 158 |
by (Blast_tac 1); |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
159 |
qed "B_trusts_NS1"; |
2318 | 160 |
|
161 |
||
162 |
||
163 |
(**** Authenticity properties obtained from NS2 ****) |
|
164 |
||
2480 | 165 |
(*Unicity for NS2: nonce NB identifies nonce NA and agents A, B |
2318 | 166 |
[unicity of B makes Lowe's fix work] |
167 |
[proof closely follows that for unique_NA] *) |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
168 |
Goal "[| Nonce NB ~: analz (spies evs); evs : ns_public |] \ |
3709 | 169 |
\ ==> EX A' NA' B'. ALL A NA B. \ |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
170 |
\ Crypt (pubK A) {|Nonce NA, Nonce NB, Agent B|} : parts (spies evs) \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
171 |
\ --> A=A' & NA=NA' & B=B'"; |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
172 |
by (etac rev_mp 1); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
173 |
by (parts_induct_tac 1); |
4556
e7a4683c0026
Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents:
4477
diff
changeset
|
174 |
by (ALLGOALS (asm_simp_tac (simpset() addsimps [all_conj_distrib]))); |
2318 | 175 |
(*NS2*) |
4470 | 176 |
by (expand_case_tac "NB = ?y" 2 THEN Blast_tac 2); |
2318 | 177 |
(*Fake*) |
3709 | 178 |
by (Clarify_tac 1); |
4470 | 179 |
by (Blast_tac 1); |
2318 | 180 |
val lemma = result(); |
181 |
||
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
182 |
Goal "[| Crypt(pubK A) {|Nonce NA, Nonce NB, Agent B|} \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
183 |
\ : parts(spies evs); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
184 |
\ Crypt(pubK A') {|Nonce NA', Nonce NB, Agent B'|} \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
185 |
\ : parts(spies evs); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
186 |
\ Nonce NB ~: analz (spies evs); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
187 |
\ evs : ns_public |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
188 |
\ ==> A=A' & NA=NA' & B=B'"; |
2418
6b6a92d05fb2
New tactics: prove_unique_tac and analz_induct_tac
paulson
parents:
2374
diff
changeset
|
189 |
by (prove_unique_tac lemma 1); |
2318 | 190 |
qed "unique_NB"; |
191 |
||
4470 | 192 |
AddDs [unique_NB]; |
193 |
||
2318 | 194 |
|
195 |
(*Secrecy: Spy does not see the nonce sent in msg NS2 if A and B are secure*) |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
196 |
Goal "[| Says B A (Crypt (pubK A) {|Nonce NA, Nonce NB, Agent B|}) \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
197 |
\ : set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
198 |
\ A ~: bad; B ~: bad; evs : ns_public |] \ |
3683 | 199 |
\ ==> Nonce NB ~: analz (spies evs)"; |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
200 |
by (etac rev_mp 1); |
2418
6b6a92d05fb2
New tactics: prove_unique_tac and analz_induct_tac
paulson
parents:
2374
diff
changeset
|
201 |
by (analz_induct_tac 1); |
2318 | 202 |
(*NS3*) |
4470 | 203 |
by (Blast_tac 4); |
3709 | 204 |
(*NS2: by freshness and unicity of NB*) |
4470 | 205 |
by (blast_tac (claset() addEs [nonce_NS1_NS2_E]) 3); |
2318 | 206 |
(*NS1*) |
4470 | 207 |
by (Blast_tac 2); |
2318 | 208 |
(*Fake*) |
2497 | 209 |
by (spy_analz_tac 1); |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
210 |
qed "Spy_not_see_NB"; |
2318 | 211 |
|
4422
21238c9d363e
Simplified proofs using rewrites for f``A where f is injective
paulson
parents:
4197
diff
changeset
|
212 |
AddDs [Spy_not_see_NB]; |
21238c9d363e
Simplified proofs using rewrites for f``A where f is injective
paulson
parents:
4197
diff
changeset
|
213 |
|
2318 | 214 |
|
215 |
(*Authentication for B: if he receives message 3 and has used NB |
|
216 |
in message 2, then A has sent message 3.*) |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
217 |
Goal "[| Says B A (Crypt (pubK A) {|Nonce NA, Nonce NB, Agent B|}) \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
218 |
\ : set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
219 |
\ Says A' B (Crypt (pubK B) (Nonce NB)): set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
220 |
\ A ~: bad; B ~: bad; evs : ns_public |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
221 |
\ ==> Says A B (Crypt (pubK B) (Nonce NB)) : set evs"; |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
222 |
by (etac rev_mp 1); |
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
223 |
(*prepare induction over Crypt (pubK B) NB : parts H*) |
3683 | 224 |
by (etac (Says_imp_spies RS parts.Inj RS rev_mp) 1); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
225 |
by (parts_induct_tac 1); |
3709 | 226 |
by (ALLGOALS Clarify_tac); |
4470 | 227 |
by (ALLGOALS Blast_tac); |
2318 | 228 |
qed "B_trusts_NS3"; |
229 |
||
230 |
||
231 |
(**** Overall guarantee for B*) |
|
232 |
||
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
233 |
(*Matches only NS2, not NS1 (or NS3)*) |
3683 | 234 |
val Says_imp_spies' = |
235 |
read_instantiate [("X","Crypt ?K {|?XX,?YY,?ZZ|}")] Says_imp_spies; |
|
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
236 |
|
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
237 |
|
2318 | 238 |
(*If B receives NS3 and the nonce NB agrees with the nonce he joined with |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
239 |
NA, then A initiated the run using NA. SAME proof as B_trusts_NS3!*) |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
240 |
Goal "[| Says B A (Crypt (pubK A) {|Nonce NA, Nonce NB, Agent B|}) \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
241 |
\ : set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
242 |
\ Says A' B (Crypt (pubK B) (Nonce NB)): set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
243 |
\ A ~: bad; B ~: bad; evs : ns_public |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
244 |
\ ==> Says A B (Crypt (pubK B) {|Nonce NA, Agent A|}) : set evs"; |
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
245 |
by (etac rev_mp 1); |
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
246 |
(*prepare induction over Crypt (pubK B) {|NB|} : parts H*) |
3683 | 247 |
by (etac (Says_imp_spies RS parts.Inj RS rev_mp) 1); |
2318 | 248 |
by (etac ns_public.induct 1); |
249 |
by (ALLGOALS Asm_simp_tac); |
|
3709 | 250 |
by (ALLGOALS Clarify_tac); |
4470 | 251 |
(*NS3 holds because NB determines A and NA*) |
252 |
by (ALLGOALS Blast_tac); |
|
2536
1e04eb7f7eb1
Tidied proofs by using "etac rev_mp" instead of applying rev_mp to result()
paulson
parents:
2516
diff
changeset
|
253 |
qed "B_trusts_protocol"; |
2318 | 254 |