author | paulson |
Tue, 13 Feb 2001 13:16:27 +0100 | |
changeset 11104 | f2024fed9f0c |
parent 10833 | c0844a30ea4e |
child 11150 | 67387142225e |
permissions | -rw-r--r-- |
2002 | 1 |
(* Title: HOL/Auth/OtwayRees_Bad |
2 |
ID: $Id$ |
|
3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
|
4 |
Copyright 1996 University of Cambridge |
|
5 |
||
6 |
Inductive relation "otway" for the Otway-Rees protocol. |
|
7 |
||
8 |
The FAULTY version omitting encryption of Nonce NB, as suggested on page 247 of |
|
9 |
Burrows, Abadi and Needham. A Logic of Authentication. |
|
10 |
Proc. Royal Soc. 426 (1989) |
|
11 |
||
12 |
This file illustrates the consequences of such errors. We can still prove |
|
2032 | 13 |
impressive-looking properties such as Spy_not_see_encrypted_key, yet the |
2002 | 14 |
protocol is open to a middleperson attack. Attempting to prove some key lemmas |
15 |
indicates the possibility of this attack. |
|
16 |
*) |
|
17 |
||
6308
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
18 |
AddEs knows_Spy_partsEs; |
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
19 |
AddDs [impOfSubs analz_subset_parts]; |
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
20 |
AddDs [impOfSubs Fake_parts_insert]; |
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
21 |
|
2002 | 22 |
|
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
3102
diff
changeset
|
23 |
(*A "possibility property": there are traces that reach the end*) |
5434
9b4bed3f394c
Got rid of not_Says_to_self and most uses of ~= in definitions and theorems
paulson
parents:
5421
diff
changeset
|
24 |
Goal "[| A ~= B; B ~= Server |] \ |
9b4bed3f394c
Got rid of not_Says_to_self and most uses of ~= in definitions and theorems
paulson
parents:
5421
diff
changeset
|
25 |
\ ==> EX K. EX NA. EX evs: otway. \ |
9b4bed3f394c
Got rid of not_Says_to_self and most uses of ~= in definitions and theorems
paulson
parents:
5421
diff
changeset
|
26 |
\ Says B A {|Nonce NA, Crypt (shrK A) {|Nonce NA, Key K|}|} \ |
9b4bed3f394c
Got rid of not_Says_to_self and most uses of ~= in definitions and theorems
paulson
parents:
5421
diff
changeset
|
27 |
\ : set evs"; |
2002 | 28 |
by (REPEAT (resolve_tac [exI,bexI] 1)); |
6308
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
29 |
by (rtac (otway.Nil RS |
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
30 |
otway.OR1 RS otway.Reception RS |
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
31 |
otway.OR2 RS otway.Reception RS |
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
32 |
otway.OR3 RS otway.Reception RS otway.OR4) 2); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
33 |
by possibility_tac; |
2002 | 34 |
result(); |
35 |
||
6308
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
36 |
Goal "[| Gets B X : set evs; evs : otway |] ==> EX A. Says A B X : set evs"; |
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
37 |
by (etac rev_mp 1); |
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
38 |
by (etac otway.induct 1); |
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
39 |
by Auto_tac; |
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
40 |
qed"Gets_imp_Says"; |
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
41 |
|
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
42 |
(*Must be proved separately for each protocol*) |
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
43 |
Goal "[| Gets B X : set evs; evs : otway |] ==> X : knows Spy evs"; |
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
44 |
by (blast_tac (claset() addSDs [Gets_imp_Says, Says_imp_knows_Spy]) 1); |
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
45 |
qed"Gets_imp_knows_Spy"; |
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
46 |
AddDs [Gets_imp_knows_Spy RS parts.Inj]; |
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
47 |
|
2002 | 48 |
|
49 |
(**** Inductive proofs about otway ****) |
|
50 |
||
51 |
||
52 |
(** For reasoning about the encrypted portion of messages **) |
|
53 |
||
6308
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
54 |
Goal "[| Gets B {|N, Agent A, Agent B, X|} : set evs; evs : otway |] \ |
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
55 |
\ ==> X : analz (knows Spy evs)"; |
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
56 |
by (blast_tac (claset() addSDs [Gets_imp_knows_Spy RS analz.Inj]) 1); |
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
57 |
qed "OR2_analz_knows_Spy"; |
2002 | 58 |
|
6308
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
59 |
Goal "[| Gets B {|N, X, Crypt (shrK B) X'|} : set evs; evs : otway |] \ |
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
60 |
\ ==> X : analz (knows Spy evs)"; |
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
61 |
by (blast_tac (claset() addSDs [Gets_imp_knows_Spy RS analz.Inj]) 1); |
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
62 |
qed "OR4_analz_knows_Spy"; |
2002 | 63 |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
64 |
Goal "Says Server B {|NA, X, Crypt K' {|NB,K|}|} : set evs \ |
6308
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
65 |
\ ==> K : parts (knows Spy evs)"; |
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
66 |
by (Blast_tac 1); |
6308
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
67 |
qed "Oops_parts_knows_Spy"; |
2002 | 68 |
|
6308
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
69 |
bind_thm ("OR2_parts_knows_Spy", |
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
70 |
OR2_analz_knows_Spy RS (impOfSubs analz_subset_parts)); |
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
71 |
bind_thm ("OR4_parts_knows_Spy", |
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
72 |
OR4_analz_knows_Spy RS (impOfSubs analz_subset_parts)); |
2052 | 73 |
|
6308
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
74 |
(*For proving the easier theorems about X ~: parts (knows Spy evs).*) |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
75 |
fun parts_induct_tac i = |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
76 |
etac otway.induct i THEN |
7499 | 77 |
ftac Oops_parts_knows_Spy (i+7) THEN |
78 |
ftac OR4_parts_knows_Spy (i+6) THEN |
|
79 |
ftac OR2_parts_knows_Spy (i+4) THEN |
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
80 |
prove_simple_subgoals_tac i; |
2002 | 81 |
|
82 |
||
6308
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
83 |
(** Theorems of the form X ~: parts (knows Spy evs) imply that NOBODY |
2002 | 84 |
sends messages containing X! **) |
85 |
||
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
86 |
(*Spy never sees a good agent's shared key!*) |
6308
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
87 |
Goal "evs : otway ==> (Key (shrK A) : parts (knows Spy evs)) = (A : bad)"; |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
88 |
by (parts_induct_tac 1); |
3961 | 89 |
by (ALLGOALS Blast_tac); |
2131 | 90 |
qed "Spy_see_shrK"; |
91 |
Addsimps [Spy_see_shrK]; |
|
2002 | 92 |
|
6308
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
93 |
Goal "evs : otway ==> (Key (shrK A) : analz (knows Spy evs)) = (A : bad)"; |
4091 | 94 |
by (auto_tac(claset() addDs [impOfSubs analz_subset_parts], simpset())); |
2131 | 95 |
qed "Spy_analz_shrK"; |
96 |
Addsimps [Spy_analz_shrK]; |
|
2002 | 97 |
|
4471 | 98 |
AddSDs [Spy_see_shrK RSN (2, rev_iffD1), |
99 |
Spy_analz_shrK RSN (2, rev_iffD1)]; |
|
2002 | 100 |
|
101 |
||
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
102 |
(*Nobody can have used non-existent keys!*) |
6308
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
103 |
Goal "evs : otway ==> Key K ~: used evs --> K ~: keysFor (parts (knows Spy evs))"; |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
104 |
by (parts_induct_tac 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
105 |
(*Fake*) |
4509
828148415197
Making proofs faster, especially using keysFor_parts_insert
paulson
parents:
4477
diff
changeset
|
106 |
by (blast_tac (claset() addSDs [keysFor_parts_insert]) 1); |
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
107 |
(*OR2, OR3*) |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
3102
diff
changeset
|
108 |
by (ALLGOALS Blast_tac); |
2160 | 109 |
qed_spec_mp "new_keys_not_used"; |
2002 | 110 |
|
111 |
bind_thm ("new_keys_not_analzd", |
|
2032 | 112 |
[analz_subset_parts RS keysFor_mono, |
113 |
new_keys_not_used] MRS contra_subsetD); |
|
2002 | 114 |
|
115 |
Addsimps [new_keys_not_used, new_keys_not_analzd]; |
|
116 |
||
117 |
||
2131 | 118 |
|
119 |
(*** Proofs involving analz ***) |
|
120 |
||
121 |
(*Describes the form of K and NA when the Server sends this message. Also |
|
122 |
for Oops case.*) |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
123 |
Goal "[| Says Server B {|NA, X, Crypt (shrK B) {|NB, Key K|}|} : set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
124 |
\ evs : otway |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
125 |
\ ==> K ~: range shrK & (EX i. NA = Nonce i) & (EX j. NB = Nonce j)"; |
2131 | 126 |
by (etac rev_mp 1); |
127 |
by (etac otway.induct 1); |
|
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
128 |
by (ALLGOALS Simp_tac); |
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
129 |
by (ALLGOALS Blast_tac); |
2131 | 130 |
qed "Says_Server_message_form"; |
131 |
||
132 |
||
133 |
(*For proofs involving analz.*) |
|
6308
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
134 |
val analz_knows_Spy_tac = |
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
135 |
dtac OR2_analz_knows_Spy 5 THEN assume_tac 5 THEN |
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
136 |
dtac OR4_analz_knows_Spy 7 THEN assume_tac 7 THEN |
7499 | 137 |
ftac Says_Server_message_form 8 THEN assume_tac 8 THEN |
6308
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
138 |
REPEAT ((eresolve_tac [exE, conjE] ORELSE' hyp_subst_tac) 8); |
2002 | 139 |
|
140 |
||
141 |
(**** |
|
142 |
The following is to prove theorems of the form |
|
143 |
||
6308
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
144 |
Key K : analz (insert (Key KAB) (knows Spy evs)) ==> |
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
145 |
Key K : analz (knows Spy evs) |
2002 | 146 |
|
147 |
A more general formula must be proved inductively. |
|
148 |
****) |
|
149 |
||
150 |
||
151 |
(** Session keys are not used to encrypt other session keys **) |
|
152 |
||
153 |
(*The equality makes the induction hypothesis easier to apply*) |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
154 |
Goal "evs : otway ==> \ |
5492 | 155 |
\ ALL K KK. KK <= - (range shrK) --> \ |
10833 | 156 |
\ (Key K : analz (Key`KK Un (knows Spy evs))) = \ |
6308
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
157 |
\ (K : KK | Key K : analz (knows Spy evs))"; |
2032 | 158 |
by (etac otway.induct 1); |
6308
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
159 |
by analz_knows_Spy_tac; |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
160 |
by (REPEAT_FIRST (resolve_tac [allI, impI])); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
161 |
by (REPEAT_FIRST (rtac analz_image_freshK_lemma )); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
162 |
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:
3207
diff
changeset
|
163 |
(*Fake*) |
4422
21238c9d363e
Simplified proofs using rewrites for f``A where f is injective
paulson
parents:
4091
diff
changeset
|
164 |
by (spy_analz_tac 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
165 |
qed_spec_mp "analz_image_freshK"; |
2002 | 166 |
|
167 |
||
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
168 |
Goal "[| evs : otway; KAB ~: range shrK |] ==> \ |
6308
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
169 |
\ Key K : analz (insert (Key KAB) (knows Spy evs)) = \ |
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
170 |
\ (K = KAB | Key K : analz (knows Spy evs))"; |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
171 |
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
|
172 |
qed "analz_insert_freshK"; |
2002 | 173 |
|
174 |
||
2131 | 175 |
(*** The Key K uniquely identifies the Server's message. **) |
2002 | 176 |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
177 |
Goal "[| Says Server B {|NA, X, Crypt (shrK B) {|NB, K|}|} : set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
178 |
\ Says Server B' {|NA',X',Crypt (shrK B') {|NB',K|}|} : set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
179 |
\ evs : otway |] ==> X=X' & B=B' & NA=NA' & NB=NB'"; |
11104 | 180 |
by (etac rev_mp 1); |
181 |
by (etac rev_mp 1); |
|
182 |
by (etac otway.induct 1); |
|
183 |
by (ALLGOALS Asm_simp_tac); |
|
184 |
(*Remaining cases: OR3 and OR4*) |
|
185 |
by (REPEAT (Blast_tac 1)); |
|
2002 | 186 |
qed "unique_session_keys"; |
187 |
||
188 |
||
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
189 |
(** Crucial secrecy property: Spy does not see the keys sent in msg OR3 |
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
190 |
Does not in itself guarantee security: an attack could violate |
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
191 |
the premises, e.g. by having A=Spy **) |
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
192 |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
193 |
Goal "[| A ~: bad; B ~: bad; evs : otway |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
194 |
\ ==> Says Server B \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
195 |
\ {|NA, Crypt (shrK A) {|NA, Key K|}, \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
196 |
\ Crypt (shrK B) {|NB, Key K|}|} : set evs --> \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
197 |
\ Notes Spy {|NA, NB, Key K|} ~: set evs --> \ |
6308
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
198 |
\ Key K ~: analz (knows Spy evs)"; |
2131 | 199 |
by (etac otway.induct 1); |
6308
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
200 |
by analz_knows_Spy_tac; |
2131 | 201 |
by (ALLGOALS |
4091 | 202 |
(asm_simp_tac (simpset() addcongs [conj_cong] |
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
203 |
addsimps [analz_insert_eq, analz_insert_freshK] |
5535 | 204 |
@ pushes @ split_ifs))); |
3451
d10f100676d8
Made proofs more concise by replacing calls to spy_analz_tac by uses of
paulson
parents:
3207
diff
changeset
|
205 |
(*Oops*) |
4091 | 206 |
by (blast_tac (claset() addSDs [unique_session_keys]) 4); |
3451
d10f100676d8
Made proofs more concise by replacing calls to spy_analz_tac by uses of
paulson
parents:
3207
diff
changeset
|
207 |
(*OR4*) |
d10f100676d8
Made proofs more concise by replacing calls to spy_analz_tac by uses of
paulson
parents:
3207
diff
changeset
|
208 |
by (Blast_tac 3); |
2131 | 209 |
(*OR3*) |
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
210 |
by (Blast_tac 2); |
3451
d10f100676d8
Made proofs more concise by replacing calls to spy_analz_tac by uses of
paulson
parents:
3207
diff
changeset
|
211 |
(*Fake*) |
d10f100676d8
Made proofs more concise by replacing calls to spy_analz_tac by uses of
paulson
parents:
3207
diff
changeset
|
212 |
by (spy_analz_tac 1); |
2131 | 213 |
val lemma = result() RS mp RS mp RSN(2,rev_notE); |
214 |
||
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
215 |
Goal "[| Says Server B \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
216 |
\ {|NA, Crypt (shrK A) {|NA, Key K|}, \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
217 |
\ Crypt (shrK B) {|NB, Key K|}|} : set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
218 |
\ Notes Spy {|NA, NB, Key K|} ~: set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
219 |
\ A ~: bad; B ~: bad; evs : otway |] \ |
6308
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
220 |
\ ==> Key K ~: analz (knows Spy evs)"; |
7499 | 221 |
by (ftac Says_Server_message_form 1 THEN assume_tac 1); |
4091 | 222 |
by (blast_tac (claset() addSEs [lemma]) 1); |
2131 | 223 |
qed "Spy_not_see_encrypted_key"; |
224 |
||
225 |
||
226 |
(*** Attempting to prove stronger properties ***) |
|
227 |
||
2052 | 228 |
(*Only OR1 can have caused such a part of a message to appear. |
5434
9b4bed3f394c
Got rid of not_Says_to_self and most uses of ~= in definitions and theorems
paulson
parents:
5421
diff
changeset
|
229 |
The premise A ~= B prevents OR2's similar-looking cryptogram from being |
9b4bed3f394c
Got rid of not_Says_to_self and most uses of ~= in definitions and theorems
paulson
parents:
5421
diff
changeset
|
230 |
picked up. Original Otway-Rees doesn't need it.*) |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
231 |
Goal "[| A ~: bad; A ~= B; evs : otway |] \ |
6308
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
232 |
\ ==> Crypt (shrK A) {|NA, Agent A, Agent B|} : parts (knows Spy evs) --> \ |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
233 |
\ Says A B {|NA, Agent A, Agent B, \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
234 |
\ Crypt (shrK A) {|NA, Agent A, Agent B|}|} : set evs"; |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
235 |
by (parts_induct_tac 1); |
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
236 |
by (ALLGOALS Blast_tac); |
2002 | 237 |
qed_spec_mp "Crypt_imp_OR1"; |
238 |
||
239 |
||
2131 | 240 |
(*Crucial property: If the encrypted message appears, and A has used NA |
6308
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
241 |
to start a run, then it originated with the Server! |
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
242 |
The premise A ~= B allows use of Crypt_imp_OR1*) |
2131 | 243 |
(*Only it is FALSE. Somebody could make a fake message to Server |
2002 | 244 |
substituting some other nonce NA' for NB.*) |
6308
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
245 |
Goal "[| A ~: bad; A ~= B; evs : otway |] \ |
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
246 |
\ ==> Crypt (shrK A) {|NA, Key K|} : parts (knows Spy evs) --> \ |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
247 |
\ Says A B {|NA, Agent A, Agent B, \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
248 |
\ Crypt (shrK A) {|NA, Agent A, Agent B|}|} \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
249 |
\ : set evs --> \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
250 |
\ (EX B NB. Says Server B \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
251 |
\ {|NA, \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
252 |
\ Crypt (shrK A) {|NA, Key K|}, \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
253 |
\ Crypt (shrK B) {|NB, Key K|}|} : set evs)"; |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3466
diff
changeset
|
254 |
by (parts_induct_tac 1); |
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
255 |
(*Fake*) |
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
256 |
by (Blast_tac 1); |
2002 | 257 |
(*OR1: it cannot be a new Nonce, contradiction.*) |
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
258 |
by (Blast_tac 1); |
3730 | 259 |
(*OR3 and OR4*) |
4091 | 260 |
by (ALLGOALS (asm_simp_tac (simpset() addsimps [ex_disj_distrib]))); |
3730 | 261 |
by (ALLGOALS Clarify_tac); |
2002 | 262 |
(*OR4*) |
4537
4e835bd9fada
Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents:
4509
diff
changeset
|
263 |
by (blast_tac (claset() addSIs [Crypt_imp_OR1]) 2); |
2131 | 264 |
(*OR3*) (** LEVEL 5 **) |
3730 | 265 |
(*The hypotheses at this point suggest an attack in which nonce NB is used |
2052 | 266 |
in two different roles: |
6308
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents:
5535
diff
changeset
|
267 |
Gets Server |
3730 | 268 |
{|Nonce NA, Agent Aa, Agent A, |
269 |
Crypt (shrK Aa) {|Nonce NA, Agent Aa, Agent A|}, Nonce NB, |
|
270 |
Crypt (shrK A) {|Nonce NA, Agent Aa, Agent A|}|} |
|
271 |
: set evs3; |
|
2052 | 272 |
Says A B |
3730 | 273 |
{|Nonce NB, Agent A, Agent B, |
274 |
Crypt (shrK A) {|Nonce NB, Agent A, Agent B|}|} |
|
275 |
: set evs3; |
|
2052 | 276 |
*) |
2131 | 277 |
writeln "GIVE UP! on NA_Crypt_imp_Server_msg"; |
2002 | 278 |
|
279 |
||
2052 | 280 |
(*Thus the key property A_can_trust probably fails too.*) |