author | paulson |
Sat, 10 Jan 1998 17:59:32 +0100 | |
changeset 4552 | bb8ff763c93d |
parent 4509 | 828148415197 |
child 4556 | e7a4683c0026 |
permissions | -rw-r--r-- |
2449 | 1 |
(* Title: HOL/Auth/Recur |
2 |
ID: $Id$ |
|
3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
|
4 |
Copyright 1996 University of Cambridge |
|
5 |
||
6 |
Inductive relation "recur" for the Recursive Authentication protocol. |
|
7 |
*) |
|
8 |
||
9 |
open Recur; |
|
10 |
||
4449 | 11 |
set proof_timing; |
2449 | 12 |
HOL_quantifiers := false; |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
13 |
Pretty.setdepth 30; |
2449 | 14 |
|
15 |
||
16 |
(** Possibility properties: traces that reach the end |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
17 |
ONE theorem would be more elegant and faster! |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
18 |
By induction on a list of agents (no repetitions) |
2449 | 19 |
**) |
20 |
||
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
21 |
|
2449 | 22 |
(*Simplest case: Alice goes directly to the server*) |
2481 | 23 |
goal thy |
3483
6988394a6008
Tidying; also simplified the lemma Says_Server_not
paulson
parents:
3466
diff
changeset
|
24 |
"!!A. A ~= Server \ |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
25 |
\ ==> EX K NA. EX evs: recur. \ |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
26 |
\ Says Server A {|Crypt (shrK A) {|Key K, Agent Server, Nonce NA|}, \ |
3466
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
27 |
\ Agent Server|} : set evs"; |
2449 | 28 |
by (REPEAT (resolve_tac [exI,bexI] 1)); |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
29 |
by (rtac (recur.Nil RS recur.RA1 RS |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
30 |
(respond.One RSN (4,recur.RA3))) 2); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
31 |
by possibility_tac; |
2449 | 32 |
result(); |
33 |
||
34 |
||
35 |
(*Case two: Alice, Bob and the server*) |
|
2481 | 36 |
goal thy |
3483
6988394a6008
Tidying; also simplified the lemma Says_Server_not
paulson
parents:
3466
diff
changeset
|
37 |
"!!A B. [| A ~= B; A ~= Server; B ~= Server |] \ |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
38 |
\ ==> EX K. EX NA. EX evs: recur. \ |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
39 |
\ Says B A {|Crypt (shrK A) {|Key K, Agent B, Nonce NA|}, \ |
3466
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
40 |
\ Agent Server|} : set evs"; |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
41 |
by (cut_facts_tac [Nonce_supply2, Key_supply2] 1); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
42 |
by (REPEAT (eresolve_tac [exE, conjE] 1)); |
2449 | 43 |
by (REPEAT (resolve_tac [exI,bexI] 1)); |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
44 |
by (rtac (recur.Nil RS recur.RA1 RS recur.RA2 RS |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
45 |
(respond.One RS respond.Cons RSN (4,recur.RA3)) RS |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
46 |
recur.RA4) 2); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
47 |
by basic_possibility_tac; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
48 |
by (DEPTH_SOLVE (eresolve_tac [asm_rl, less_not_refl2, |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
49 |
less_not_refl2 RS not_sym] 1)); |
2449 | 50 |
result(); |
51 |
||
52 |
||
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
53 |
(*Case three: Alice, Bob, Charlie and the server |
2533 | 54 |
TOO SLOW to run every time! |
2481 | 55 |
goal thy |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
56 |
"!!A B. [| A ~= B; B ~= C; A ~= Server; B ~= Server; C ~= Server |] \ |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
57 |
\ ==> EX K. EX NA. EX evs: recur. \ |
3483
6988394a6008
Tidying; also simplified the lemma Says_Server_not
paulson
parents:
3466
diff
changeset
|
58 |
\ Says B A {|Crypt (shrK A) {|Key K, Agent B, Nonce NA|}, \ |
3466
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
59 |
\ Agent Server|} : set evs"; |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
60 |
by (cut_facts_tac [Nonce_supply3, Key_supply3] 1); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
61 |
by (REPEAT (eresolve_tac [exE, conjE] 1)); |
2449 | 62 |
by (REPEAT (resolve_tac [exI,bexI] 1)); |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
63 |
by (rtac (recur.Nil RS recur.RA1 RS recur.RA2 RS recur.RA2 RS |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
64 |
(respond.One RS respond.Cons RS respond.Cons RSN |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
65 |
(4,recur.RA3)) RS recur.RA4 RS recur.RA4) 2); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
66 |
(*SLOW: 70 seconds*) |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
67 |
by basic_possibility_tac; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
68 |
by (DEPTH_SOLVE (swap_res_tac [refl, conjI, disjCI] 1 |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
69 |
ORELSE |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
70 |
eresolve_tac [asm_rl, less_not_refl2, |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
71 |
less_not_refl2 RS not_sym] 1)); |
2449 | 72 |
result(); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
73 |
****************) |
2449 | 74 |
|
75 |
(**** Inductive proofs about recur ****) |
|
76 |
||
77 |
(*Nobody sends themselves messages*) |
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
78 |
goal thy "!!evs. evs : recur ==> ALL A X. Says A A X ~: set evs"; |
2449 | 79 |
by (etac recur.induct 1); |
4477
b3e5857d8d99
New Auto_tac (by Oheimb), and new syntax (without parens), and expandshort
paulson
parents:
4471
diff
changeset
|
80 |
by Auto_tac; |
2449 | 81 |
qed_spec_mp "not_Says_to_self"; |
82 |
Addsimps [not_Says_to_self]; |
|
83 |
AddSEs [not_Says_to_self RSN (2, rev_notE)]; |
|
84 |
||
85 |
||
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
86 |
|
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
87 |
goal thy "!!evs. (PA,RB,KAB) : respond evs ==> Key KAB : parts{RB}"; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
88 |
by (etac respond.induct 1); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
89 |
by (ALLGOALS Simp_tac); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
90 |
qed "respond_Key_in_parts"; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
91 |
|
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
92 |
goal thy "!!evs. (PA,RB,KAB) : respond evs ==> Key KAB ~: used evs"; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
93 |
by (etac respond.induct 1); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
94 |
by (REPEAT (assume_tac 1)); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
95 |
qed "respond_imp_not_used"; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
96 |
|
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
97 |
goal thy |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
98 |
"!!evs. [| Key K : parts {RB}; (PB,RB,K') : respond evs |] \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
99 |
\ ==> Key K ~: used evs"; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
100 |
by (etac rev_mp 1); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
101 |
by (etac respond.induct 1); |
4091 | 102 |
by (auto_tac(claset() addDs [Key_not_used, respond_imp_not_used], |
103 |
simpset())); |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
104 |
qed_spec_mp "Key_in_parts_respond"; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
105 |
|
2449 | 106 |
(*Simple inductive reasoning about responses*) |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
107 |
goal thy "!!evs. (PA,RB,KAB) : respond evs ==> RB : responses evs"; |
2449 | 108 |
by (etac respond.induct 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
109 |
by (REPEAT (ares_tac (respond_imp_not_used::responses.intrs) 1)); |
2449 | 110 |
qed "respond_imp_responses"; |
111 |
||
112 |
||
113 |
(** For reasoning about the encrypted portion of messages **) |
|
114 |
||
3683 | 115 |
val RA2_analz_spies = Says_imp_spies RS analz.Inj |> standard; |
2449 | 116 |
|
3465 | 117 |
goal thy "!!evs. Says C' B {|Crypt K X, X', RA|} : set evs \ |
3683 | 118 |
\ ==> RA : analz (spies evs)"; |
4091 | 119 |
by (blast_tac (claset() addSDs [Says_imp_spies RS analz.Inj]) 1); |
3683 | 120 |
qed "RA4_analz_spies"; |
2449 | 121 |
|
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
122 |
(*RA2_analz... and RA4_analz... let us treat those cases using the same |
2449 | 123 |
argument as for the Fake case. This is possible for most, but not all, |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
124 |
proofs: Fake does not invent new nonces (as in RA2), and of course Fake |
2449 | 125 |
messages originate from the Spy. *) |
126 |
||
3683 | 127 |
bind_thm ("RA2_parts_spies", |
128 |
RA2_analz_spies RS (impOfSubs analz_subset_parts)); |
|
129 |
bind_thm ("RA4_parts_spies", |
|
130 |
RA4_analz_spies RS (impOfSubs analz_subset_parts)); |
|
2449 | 131 |
|
3683 | 132 |
(*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
|
133 |
fun parts_induct_tac i = |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
134 |
etac recur.induct i THEN |
3683 | 135 |
forward_tac [RA2_parts_spies] (i+3) THEN |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
136 |
forward_tac [respond_imp_responses] (i+4) THEN |
3683 | 137 |
forward_tac [RA4_parts_spies] (i+5) THEN |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
138 |
prove_simple_subgoals_tac i; |
2449 | 139 |
|
140 |
||
3683 | 141 |
(** Theorems of the form X ~: parts (spies evs) imply that NOBODY |
2449 | 142 |
sends messages containing X! **) |
143 |
||
144 |
||
3683 | 145 |
(** Spy never sees another agent's shared key! (unless it's bad at start) **) |
2449 | 146 |
|
147 |
goal thy |
|
3683 | 148 |
"!!evs. evs : recur ==> (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
|
149 |
by (parts_induct_tac 1); |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
150 |
by (Fake_parts_insert_tac 1); |
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
151 |
by (ALLGOALS |
4091 | 152 |
(asm_simp_tac (simpset() addsimps [parts_insert2, parts_insert_spies]))); |
2550
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
153 |
(*RA3*) |
4552
bb8ff763c93d
Simplified proofs by omitting PA = {|XA, ...|} from RA2
paulson
parents:
4509
diff
changeset
|
154 |
by (blast_tac (claset() addDs [Key_in_parts_respond]) 1); |
2449 | 155 |
qed "Spy_see_shrK"; |
156 |
Addsimps [Spy_see_shrK]; |
|
157 |
||
158 |
goal thy |
|
3683 | 159 |
"!!evs. evs : recur ==> (Key (shrK A) : analz (spies evs)) = (A : bad)"; |
4091 | 160 |
by (auto_tac(claset() addDs [impOfSubs analz_subset_parts], simpset())); |
2449 | 161 |
qed "Spy_analz_shrK"; |
162 |
Addsimps [Spy_analz_shrK]; |
|
163 |
||
4471 | 164 |
AddSDs [Spy_see_shrK RSN (2, rev_iffD1), |
165 |
Spy_analz_shrK RSN (2, rev_iffD1)]; |
|
2449 | 166 |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
167 |
|
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
168 |
(** Nobody can have used non-existent keys! **) |
2449 | 169 |
|
4509
828148415197
Making proofs faster, especially using keysFor_parts_insert
paulson
parents:
4477
diff
changeset
|
170 |
(*The special case of H={} has the same proof*) |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
171 |
goal thy |
4509
828148415197
Making proofs faster, especially using keysFor_parts_insert
paulson
parents:
4477
diff
changeset
|
172 |
"!!evs. [| K : keysFor (parts (insert RB H)); (PB,RB,K') : respond evs |] \ |
828148415197
Making proofs faster, especially using keysFor_parts_insert
paulson
parents:
4477
diff
changeset
|
173 |
\ ==> K : range shrK | K : keysFor (parts H)"; |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
174 |
by (etac rev_mp 1); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
175 |
by (etac (respond_imp_responses RS responses.induct) 1); |
4477
b3e5857d8d99
New Auto_tac (by Oheimb), and new syntax (without parens), and expandshort
paulson
parents:
4471
diff
changeset
|
176 |
by Auto_tac; |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
177 |
qed_spec_mp "Key_in_keysFor_parts"; |
2449 | 178 |
|
179 |
||
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
180 |
goal thy "!!evs. evs : recur ==> \ |
3683 | 181 |
\ 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
|
182 |
by (parts_induct_tac 1); |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
183 |
(*RA3*) |
4509
828148415197
Making proofs faster, especially using keysFor_parts_insert
paulson
parents:
4477
diff
changeset
|
184 |
by (blast_tac (claset() addSDs [Key_in_keysFor_parts]) 2); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
185 |
(*Fake*) |
4509
828148415197
Making proofs faster, especially using keysFor_parts_insert
paulson
parents:
4477
diff
changeset
|
186 |
by (blast_tac (claset() addSDs [keysFor_parts_insert]) 1); |
2449 | 187 |
qed_spec_mp "new_keys_not_used"; |
188 |
||
189 |
||
190 |
bind_thm ("new_keys_not_analzd", |
|
191 |
[analz_subset_parts RS keysFor_mono, |
|
192 |
new_keys_not_used] MRS contra_subsetD); |
|
193 |
||
194 |
Addsimps [new_keys_not_used, new_keys_not_analzd]; |
|
195 |
||
196 |
||
197 |
||
198 |
(*** Proofs involving analz ***) |
|
199 |
||
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
200 |
(*For proofs involving analz.*) |
3683 | 201 |
val analz_spies_tac = |
202 |
dtac RA2_analz_spies 4 THEN |
|
2449 | 203 |
forward_tac [respond_imp_responses] 5 THEN |
3683 | 204 |
dtac RA4_analz_spies 6; |
2449 | 205 |
|
206 |
||
207 |
(** Session keys are not used to encrypt other session keys **) |
|
208 |
||
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
209 |
(*Version for "responses" relation. Handles case RA3 in the theorem below. |
3683 | 210 |
Note that it holds for *any* set H (not just "spies evs") |
2449 | 211 |
satisfying the inductive hypothesis.*) |
212 |
goal thy |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
213 |
"!!evs. [| RB : responses evs; \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
214 |
\ ALL K KK. KK <= Compl (range shrK) --> \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
215 |
\ (Key K : analz (Key``KK Un H)) = \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
216 |
\ (K : KK | Key K : analz H) |] \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
217 |
\ ==> ALL K KK. KK <= Compl (range shrK) --> \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
218 |
\ (Key K : analz (insert RB (Key``KK Un H))) = \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
219 |
\ (K : KK | Key K : analz (insert RB H))"; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
220 |
by (etac responses.induct 1); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
221 |
by (ALLGOALS (asm_simp_tac analz_image_freshK_ss)); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
222 |
qed "resp_analz_image_freshK_lemma"; |
2449 | 223 |
|
224 |
(*Version for the protocol. Proof is almost trivial, thanks to the lemma.*) |
|
225 |
goal thy |
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
226 |
"!!evs. evs : recur ==> \ |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
227 |
\ ALL K KK. KK <= Compl (range shrK) --> \ |
3683 | 228 |
\ (Key K : analz (Key``KK Un (spies evs))) = \ |
229 |
\ (K : KK | Key K : analz (spies evs))"; |
|
2449 | 230 |
by (etac recur.induct 1); |
3683 | 231 |
by analz_spies_tac; |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
232 |
by (REPEAT_FIRST (resolve_tac [allI, impI])); |
4552
bb8ff763c93d
Simplified proofs by omitting PA = {|XA, ...|} from RA2
paulson
parents:
4509
diff
changeset
|
233 |
by (REPEAT_FIRST (rtac analz_image_freshK_lemma)); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
234 |
by (ALLGOALS |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
235 |
(asm_simp_tac |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
236 |
(analz_image_freshK_ss addsimps [resp_analz_image_freshK_lemma]))); |
3451
d10f100676d8
Made proofs more concise by replacing calls to spy_analz_tac by uses of
paulson
parents:
3207
diff
changeset
|
237 |
(*Fake*) |
d10f100676d8
Made proofs more concise by replacing calls to spy_analz_tac by uses of
paulson
parents:
3207
diff
changeset
|
238 |
by (spy_analz_tac 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
239 |
val raw_analz_image_freshK = result(); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
240 |
qed_spec_mp "analz_image_freshK"; |
2449 | 241 |
|
242 |
||
3683 | 243 |
(*Instance of the lemma with H replaced by (spies evs): |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
244 |
[| RB : responses evs; evs : recur; |] |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
245 |
==> KK <= Compl (range shrK) --> |
3683 | 246 |
Key K : analz (insert RB (Key``KK Un spies evs)) = |
247 |
(K : KK | Key K : analz (insert RB (spies evs))) |
|
2449 | 248 |
*) |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
249 |
bind_thm ("resp_analz_image_freshK", |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
250 |
raw_analz_image_freshK RSN |
3961 | 251 |
(2, resp_analz_image_freshK_lemma) RS spec RS spec RS mp); |
2449 | 252 |
|
253 |
goal thy |
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
254 |
"!!evs. [| evs : recur; KAB ~: range shrK |] ==> \ |
3683 | 255 |
\ Key K : analz (insert (Key KAB) (spies evs)) = \ |
256 |
\ (K = KAB | Key K : analz (spies evs))"; |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
257 |
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:
2485
diff
changeset
|
258 |
qed "analz_insert_freshK"; |
2449 | 259 |
|
260 |
||
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
261 |
(*Everything that's hashed is already in past traffic. *) |
3683 | 262 |
goal thy "!!evs. [| Hash {|Key(shrK A), X|} : parts (spies evs); \ |
263 |
\ evs : recur; A ~: bad |] \ |
|
264 |
\ ==> X : parts (spies evs)"; |
|
2550
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
265 |
by (etac rev_mp 1); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
266 |
by (parts_induct_tac 1); |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
267 |
(*RA3 requires a further induction*) |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
268 |
by (etac responses.induct 2); |
2449 | 269 |
by (ALLGOALS Asm_simp_tac); |
270 |
(*Fake*) |
|
4091 | 271 |
by (simp_tac (simpset() addsimps [parts_insert_spies]) 1); |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
272 |
by (Fake_parts_insert_tac 1); |
2550
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
273 |
qed "Hash_imp_body"; |
2449 | 274 |
|
275 |
||
276 |
(** The Nonce NA uniquely identifies A's message. |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
277 |
This theorem applies to steps RA1 and RA2! |
2455
9c4444bfd44e
Simplification and generalization of the guarantees.
paulson
parents:
2451
diff
changeset
|
278 |
|
9c4444bfd44e
Simplification and generalization of the guarantees.
paulson
parents:
2451
diff
changeset
|
279 |
Unicity is not used in other proofs but is desirable in its own right. |
2449 | 280 |
**) |
281 |
||
282 |
goal thy |
|
3683 | 283 |
"!!evs. [| evs : recur; A ~: bad |] \ |
2560 | 284 |
\ ==> EX B' P'. ALL B P. \ |
3683 | 285 |
\ Hash {|Key(shrK A), Agent A, B, NA, P|} : parts (spies evs) \ |
2560 | 286 |
\ --> B=B' & P=P'"; |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
287 |
by (parts_induct_tac 1); |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
288 |
by (Fake_parts_insert_tac 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
289 |
by (etac responses.induct 3); |
4091 | 290 |
by (ALLGOALS (simp_tac (simpset() addsimps [all_conj_distrib]))); |
291 |
by (clarify_tac (claset() addSEs partsEs) 1); |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
292 |
(*RA1,2: creation of new Nonce. Move assertion into global context*) |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
293 |
by (ALLGOALS (expand_case_tac "NA = ?y")); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
294 |
by (REPEAT_FIRST (ares_tac [exI])); |
4091 | 295 |
by (REPEAT (blast_tac (claset() addSDs [Hash_imp_body] |
3683 | 296 |
addSEs spies_partsEs) 1)); |
2449 | 297 |
val lemma = result(); |
298 |
||
2481 | 299 |
goalw thy [HPair_def] |
3683 | 300 |
"!!A.[| Hash[Key(shrK A)] {|Agent A, B,NA,P|} : parts(spies evs); \ |
301 |
\ Hash[Key(shrK A)] {|Agent A, B',NA,P'|} : parts(spies evs); \ |
|
302 |
\ evs : recur; A ~: bad |] \ |
|
3483
6988394a6008
Tidying; also simplified the lemma Says_Server_not
paulson
parents:
3466
diff
changeset
|
303 |
\ ==> B=B' & P=P'"; |
2481 | 304 |
by (REPEAT (eresolve_tac partsEs 1)); |
2449 | 305 |
by (prove_unique_tac lemma 1); |
306 |
qed "unique_NA"; |
|
307 |
||
308 |
||
309 |
(*** Lemmas concerning the Server's response |
|
310 |
(relations "respond" and "responses") |
|
311 |
***) |
|
312 |
||
313 |
goal thy |
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
314 |
"!!evs. [| RB : responses evs; evs : recur |] \ |
3683 | 315 |
\ ==> (Key (shrK B) : analz (insert RB (spies evs))) = (B:bad)"; |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
316 |
by (etac responses.induct 1); |
2449 | 317 |
by (ALLGOALS |
318 |
(asm_simp_tac |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
319 |
(analz_image_freshK_ss addsimps [Spy_analz_shrK, |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
320 |
resp_analz_image_freshK]))); |
2449 | 321 |
qed "shrK_in_analz_respond"; |
322 |
Addsimps [shrK_in_analz_respond]; |
|
323 |
||
324 |
||
325 |
goal thy |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
326 |
"!!evs. [| RB : responses evs; \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
327 |
\ ALL K KK. KK <= Compl (range shrK) --> \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
328 |
\ (Key K : analz (Key``KK Un H)) = \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
329 |
\ (K : KK | Key K : analz H) |] \ |
3483
6988394a6008
Tidying; also simplified the lemma Says_Server_not
paulson
parents:
3466
diff
changeset
|
330 |
\ ==> (Key K : analz (insert RB H)) --> \ |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
331 |
\ (Key K : parts{RB} | Key K : analz H)"; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
332 |
by (etac responses.induct 1); |
2449 | 333 |
by (ALLGOALS |
334 |
(asm_simp_tac |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
335 |
(analz_image_freshK_ss addsimps [resp_analz_image_freshK_lemma]))); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
336 |
(*Simplification using two distinct treatments of "image"*) |
4091 | 337 |
by (simp_tac (simpset() addsimps [parts_insert2]) 1); |
338 |
by (blast_tac (claset() delrules [allE]) 1); |
|
2449 | 339 |
qed "resp_analz_insert_lemma"; |
340 |
||
341 |
bind_thm ("resp_analz_insert", |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
342 |
raw_analz_image_freshK RSN |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
343 |
(2, resp_analz_insert_lemma) RSN(2, rev_mp)); |
2449 | 344 |
|
345 |
||
346 |
(*The Server does not send such messages. This theorem lets us avoid |
|
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
347 |
assuming B~=Server in RA4.*) |
2449 | 348 |
goal thy |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
349 |
"!!evs. evs : recur \ |
3483
6988394a6008
Tidying; also simplified the lemma Says_Server_not
paulson
parents:
3466
diff
changeset
|
350 |
\ ==> ALL C X Y. Says Server C {|X, Agent Server, Y|} ~: set evs"; |
2449 | 351 |
by (etac recur.induct 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
352 |
by (etac (respond.induct) 5); |
4477
b3e5857d8d99
New Auto_tac (by Oheimb), and new syntax (without parens), and expandshort
paulson
parents:
4471
diff
changeset
|
353 |
by Auto_tac; |
2449 | 354 |
qed_spec_mp "Says_Server_not"; |
355 |
AddSEs [Says_Server_not RSN (2,rev_notE)]; |
|
356 |
||
357 |
||
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
358 |
(*The last key returned by respond indeed appears in a certificate*) |
2449 | 359 |
goal thy |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
360 |
"!!K. (Hash[Key(shrK A)] {|Agent A, B, NA, P|}, RA, K) : respond evs \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
361 |
\ ==> Crypt (shrK A) {|Key K, B, NA|} : parts {RA}"; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
362 |
by (etac respond.elim 1); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
363 |
by (ALLGOALS Asm_full_simp_tac); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
364 |
qed "respond_certificate"; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
365 |
|
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
366 |
|
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
367 |
goal thy |
2560 | 368 |
"!!K'. (PB,RB,KXY) : respond evs \ |
369 |
\ ==> EX A' B'. ALL A B N. \ |
|
2449 | 370 |
\ Crypt (shrK A) {|Key K, Agent B, N|} : parts {RB} \ |
371 |
\ --> (A'=A & B'=B) | (A'=B & B'=A)"; |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
372 |
by (etac respond.induct 1); |
4091 | 373 |
by (ALLGOALS (asm_full_simp_tac (simpset() addsimps [all_conj_distrib]))); |
2449 | 374 |
(*Base case*) |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
375 |
by (Blast_tac 1); |
3730 | 376 |
by Safe_tac; |
2550
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
377 |
by (expand_case_tac "K = KBC" 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
378 |
by (dtac respond_Key_in_parts 1); |
4091 | 379 |
by (blast_tac (claset() addSIs [exI] |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
380 |
addSEs partsEs |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
381 |
addDs [Key_in_parts_respond]) 1); |
2550
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
382 |
by (expand_case_tac "K = KAB" 1); |
2449 | 383 |
by (REPEAT (ares_tac [exI] 2)); |
384 |
by (ex_strip_tac 1); |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
385 |
by (dtac respond_certificate 1); |
2449 | 386 |
by (Fast_tac 1); |
387 |
val lemma = result(); |
|
388 |
||
389 |
goal thy |
|
2560 | 390 |
"!!RB. [| Crypt (shrK A) {|Key K, Agent B, N|} : parts {RB}; \ |
2449 | 391 |
\ Crypt (shrK A') {|Key K, Agent B', N'|} : parts {RB}; \ |
2560 | 392 |
\ (PB,RB,KXY) : respond evs |] \ |
2449 | 393 |
\ ==> (A'=A & B'=B) | (A'=B & B'=A)"; |
2560 | 394 |
by (prove_unique_tac lemma 1); |
2449 | 395 |
qed "unique_session_keys"; |
396 |
||
397 |
||
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
398 |
(** Crucial secrecy property: Spy does not see the keys sent in msg RA3 |
2449 | 399 |
Does not in itself guarantee security: an attack could violate |
400 |
the premises, e.g. by having A=Spy **) |
|
401 |
||
402 |
goal thy |
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
403 |
"!!evs. [| (PB,RB,KAB) : respond evs; evs : recur |] \ |
3683 | 404 |
\ ==> ALL A A' N. A ~: bad & A' ~: bad --> \ |
2449 | 405 |
\ Crypt (shrK A) {|Key K, Agent A', N|} : parts{RB} --> \ |
3683 | 406 |
\ Key K ~: analz (insert RB (spies evs))"; |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
407 |
by (etac respond.induct 1); |
2449 | 408 |
by (forward_tac [respond_imp_responses] 2); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
409 |
by (forward_tac [respond_imp_not_used] 2); |
3961 | 410 |
by (ALLGOALS (*6 seconds*) |
2449 | 411 |
(asm_simp_tac |
3961 | 412 |
(analz_image_freshK_ss |
413 |
addsimps expand_ifs |
|
414 |
addsimps |
|
415 |
[shrK_in_analz_respond, resp_analz_image_freshK, parts_insert2]))); |
|
4091 | 416 |
by (ALLGOALS (simp_tac (simpset() addsimps [ex_disj_distrib]))); |
3681 | 417 |
(** LEVEL 5 **) |
4091 | 418 |
by (blast_tac (claset() addIs [impOfSubs analz_subset_parts]) 1); |
3961 | 419 |
by (REPEAT_FIRST (resolve_tac [allI, conjI, impI])); |
420 |
by (ALLGOALS Clarify_tac); |
|
4091 | 421 |
by (blast_tac (claset() addSDs [resp_analz_insert] |
3961 | 422 |
addIs [impOfSubs analz_subset_parts]) 2); |
4091 | 423 |
by (blast_tac (claset() addSDs [respond_certificate]) 1); |
3961 | 424 |
by (Asm_full_simp_tac 1); |
425 |
(*by unicity, either B=Aa or B=A', a contradiction if B: bad*) |
|
426 |
by (blast_tac |
|
4091 | 427 |
(claset() addSEs [MPair_parts] |
3961 | 428 |
addDs [parts.Body, |
429 |
respond_certificate RSN (2, unique_session_keys)]) 1); |
|
2533 | 430 |
qed_spec_mp "respond_Spy_not_see_session_key"; |
2449 | 431 |
|
432 |
||
433 |
goal thy |
|
3683 | 434 |
"!!evs. [| Crypt (shrK A) {|Key K, Agent A', N|} : parts (spies evs); \ |
3730 | 435 |
\ A ~: bad; A' ~: bad; evs : recur |] \ |
3683 | 436 |
\ ==> Key K ~: analz (spies evs)"; |
2550
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
437 |
by (etac rev_mp 1); |
2449 | 438 |
by (etac recur.induct 1); |
3683 | 439 |
by analz_spies_tac; |
2449 | 440 |
by (ALLGOALS |
441 |
(asm_simp_tac |
|
4091 | 442 |
(simpset() addsimps (expand_ifs @ |
3961 | 443 |
[analz_insert_eq, parts_insert_spies, |
444 |
analz_insert_freshK])))); |
|
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
445 |
(*RA4*) |
2533 | 446 |
by (spy_analz_tac 5); |
447 |
(*RA2*) |
|
448 |
by (spy_analz_tac 3); |
|
2449 | 449 |
(*Fake*) |
2533 | 450 |
by (spy_analz_tac 2); |
451 |
(*Base*) |
|
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
452 |
by (Blast_tac 1); |
2533 | 453 |
(*RA3 remains*) |
4091 | 454 |
by (safe_tac (claset() delrules [impCE])); |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
455 |
(*RA3, case 2: K is an old key*) |
4091 | 456 |
by (blast_tac (claset() addSDs [resp_analz_insert] |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
457 |
addSEs partsEs |
3730 | 458 |
addDs [Key_in_parts_respond]) 2); |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
459 |
(*RA3, case 1: use lemma previously proved by induction*) |
4091 | 460 |
by (blast_tac (claset() addSEs [respond_Spy_not_see_session_key RSN |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
461 |
(2,rev_notE)]) 1); |
2550
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
462 |
qed "Spy_not_see_session_key"; |
2449 | 463 |
|
464 |
||
465 |
(**** Authenticity properties for Agents ****) |
|
466 |
||
2481 | 467 |
(*The response never contains Hashes*) |
468 |
goal thy |
|
2550
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
469 |
"!!evs. [| Hash {|Key (shrK B), M|} : parts (insert RB H); \ |
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
470 |
\ (PB,RB,K) : respond evs |] \ |
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
471 |
\ ==> Hash {|Key (shrK B), M|} : parts H"; |
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
472 |
by (etac rev_mp 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
473 |
by (etac (respond_imp_responses RS responses.induct) 1); |
4477
b3e5857d8d99
New Auto_tac (by Oheimb), and new syntax (without parens), and expandshort
paulson
parents:
4471
diff
changeset
|
474 |
by Auto_tac; |
2550
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
475 |
qed "Hash_in_parts_respond"; |
2481 | 476 |
|
2533 | 477 |
(*Only RA1 or RA2 can have caused such a part of a message to appear. |
478 |
This result is of no use to B, who cannot verify the Hash. Moreover, |
|
479 |
it can say nothing about how recent A's message is. It might later be |
|
480 |
used to prove B's presence to A at the run's conclusion.*) |
|
2481 | 481 |
goalw thy [HPair_def] |
3683 | 482 |
"!!evs. [| Hash {|Key(shrK A), Agent A, Agent B, NA, P|} : parts(spies evs); \ |
483 |
\ A ~: bad; evs : recur |] \ |
|
3466
30791e5a69c4
Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents:
3465
diff
changeset
|
484 |
\ ==> Says A B (Hash[Key(shrK A)] {|Agent A, Agent B, NA, P|}) : set evs"; |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
485 |
by (etac rev_mp 1); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
486 |
by (parts_induct_tac 1); |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
487 |
by (Fake_parts_insert_tac 1); |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
488 |
(*RA3*) |
4091 | 489 |
by (blast_tac (claset() addSDs [Hash_in_parts_respond]) 1); |
2449 | 490 |
qed_spec_mp "Hash_auth_sender"; |
491 |
||
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2485
diff
changeset
|
492 |
(** These two results subsume (for all agents) the guarantees proved |
2449 | 493 |
separately for A and B in the Otway-Rees protocol. |
494 |
**) |
|
495 |
||
496 |
||
2533 | 497 |
(*Certificates can only originate with the Server.*) |
2449 | 498 |
goal thy |
3683 | 499 |
"!!evs. [| Crypt (shrK A) Y : parts (spies evs); \ |
500 |
\ A ~: bad; A ~= Spy; evs : recur |] \ |
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
501 |
\ ==> EX C RC. Says Server C RC : set evs & \ |
2550
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
502 |
\ Crypt (shrK A) Y : parts {RC}"; |
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
503 |
by (etac rev_mp 1); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
504 |
by (parts_induct_tac 1); |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
505 |
by (Fake_parts_insert_tac 1); |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
506 |
(*RA4*) |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
507 |
by (Blast_tac 4); |
2455
9c4444bfd44e
Simplification and generalization of the guarantees.
paulson
parents:
2451
diff
changeset
|
508 |
(*RA3*) |
4091 | 509 |
by (full_simp_tac (simpset() addsimps [parts_insert_spies]) 3 |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
510 |
THEN Blast_tac 3); |
2455
9c4444bfd44e
Simplification and generalization of the guarantees.
paulson
parents:
2451
diff
changeset
|
511 |
(*RA1*) |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
512 |
by (Blast_tac 1); |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2449
diff
changeset
|
513 |
(*RA2: it cannot be a new Nonce, contradiction.*) |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
514 |
by (Blast_tac 1); |
2550
8d8344bcf98a
Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents:
2533
diff
changeset
|
515 |
qed "Cert_imp_Server_msg"; |