author | nipkow |
Tue, 09 Jan 2001 15:29:17 +0100 | |
changeset 10833 | c0844a30ea4e |
parent 7499 | 23e090051cb8 |
child 11104 | f2024fed9f0c |
permissions | -rw-r--r-- |
2111
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
1 |
(* Title: HOL/Auth/Yahalom2 |
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
2 |
ID: $Id$ |
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
4 |
Copyright 1996 University of Cambridge |
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
5 |
|
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
6 |
Inductive relation "yahalom" for the Yahalom protocol, Variant 2. |
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
7 |
|
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
8 |
This version trades encryption of NB for additional explicitness in YM3. |
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
9 |
|
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
10 |
From page 259 of |
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
11 |
Burrows, Abadi and Needham. A Logic of Authentication. |
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
12 |
Proc. Royal Soc. 426 (1989) |
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
13 |
*) |
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
14 |
|
6335 | 15 |
AddEs knows_Spy_partsEs; |
5066
30271d90644f
Changed format of Bob's certificate from Nb,K,A to A,B,K,Nb.
paulson
parents:
4831
diff
changeset
|
16 |
AddDs [impOfSubs analz_subset_parts]; |
30271d90644f
Changed format of Bob's certificate from Nb,K,A to A,B,K,Nb.
paulson
parents:
4831
diff
changeset
|
17 |
AddDs [impOfSubs Fake_parts_insert]; |
30271d90644f
Changed format of Bob's certificate from Nb,K,A to A,B,K,Nb.
paulson
parents:
4831
diff
changeset
|
18 |
|
30271d90644f
Changed format of Bob's certificate from Nb,K,A to A,B,K,Nb.
paulson
parents:
4831
diff
changeset
|
19 |
|
2323 | 20 |
(*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
|
21 |
Goal "EX X NB K. EX evs: yahalom. \ |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
22 |
\ Says A B {|X, Crypt K (Nonce NB)|} : set evs"; |
2111
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
23 |
by (REPEAT (resolve_tac [exI,bexI] 1)); |
6335 | 24 |
by (rtac (yahalom.Nil RS |
25 |
yahalom.YM1 RS yahalom.Reception RS |
|
26 |
yahalom.YM2 RS yahalom.Reception RS |
|
27 |
yahalom.YM3 RS yahalom.Reception RS yahalom.YM4) 2); |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
28 |
by possibility_tac; |
2111
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
29 |
result(); |
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
30 |
|
6335 | 31 |
Goal "[| Gets B X : set evs; evs : yahalom |] ==> EX A. Says A B X : set evs"; |
32 |
by (etac rev_mp 1); |
|
33 |
by (etac yahalom.induct 1); |
|
34 |
by Auto_tac; |
|
35 |
qed "Gets_imp_Says"; |
|
36 |
||
37 |
(*Must be proved separately for each protocol*) |
|
38 |
Goal "[| Gets B X : set evs; evs : yahalom |] ==> X : knows Spy evs"; |
|
39 |
by (blast_tac (claset() addSDs [Gets_imp_Says, Says_imp_knows_Spy]) 1); |
|
40 |
qed"Gets_imp_knows_Spy"; |
|
41 |
AddDs [Gets_imp_knows_Spy RS parts.Inj]; |
|
42 |
||
2111
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
43 |
|
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
44 |
(**** Inductive proofs about yahalom ****) |
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
45 |
|
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
46 |
(** For reasoning about the encrypted portion of messages **) |
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
47 |
|
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
48 |
(*Lets us treat YM4 using a similar argument as for the Fake case.*) |
6335 | 49 |
Goal "[| Gets A {|NB, Crypt (shrK A) Y, X|} : set evs; evs : yahalom |] \ |
50 |
\ ==> X : analz (knows Spy evs)"; |
|
51 |
by (blast_tac (claset() addSDs [Gets_imp_knows_Spy RS analz.Inj]) 1); |
|
52 |
qed "YM4_analz_knows_Spy"; |
|
2111
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
53 |
|
6335 | 54 |
bind_thm ("YM4_parts_knows_Spy", |
55 |
YM4_analz_knows_Spy RS (impOfSubs analz_subset_parts)); |
|
2111
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
56 |
|
6335 | 57 |
(*For Oops*) |
58 |
Goal "Says Server A {|NB, Crypt (shrK A) {|B,K,NA|}, X|} : set evs \ |
|
59 |
\ ==> K : parts (knows Spy evs)"; |
|
60 |
by (blast_tac (claset() addSEs partsEs |
|
61 |
addSDs [Says_imp_knows_Spy RS parts.Inj]) 1); |
|
62 |
qed "YM4_Key_parts_knows_Spy"; |
|
2111
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
63 |
|
6335 | 64 |
(*For proving the easier theorems about X ~: parts (knows Spy evs).*) |
65 |
fun parts_knows_Spy_tac i = |
|
66 |
EVERY |
|
7499 | 67 |
[ftac YM4_Key_parts_knows_Spy (i+7), |
68 |
ftac YM4_parts_knows_Spy (i+6), assume_tac (i+6), |
|
6335 | 69 |
prove_simple_subgoals_tac i]; |
2111
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
70 |
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
71 |
(*Induction for regularity theorems. If induction formula has the form |
6335 | 72 |
X ~: analz (knows Spy evs) --> ... then it shortens the proof by discarding |
73 |
needless information about analz (insert X (knows Spy evs)) *) |
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
74 |
fun parts_induct_tac i = |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
75 |
etac yahalom.induct i |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
76 |
THEN |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
77 |
REPEAT (FIRSTGOAL analz_mono_contra_tac) |
6335 | 78 |
THEN parts_knows_Spy_tac i; |
3432 | 79 |
|
2111
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
80 |
|
6335 | 81 |
(** Theorems of the form X ~: parts (knows Spy evs) imply that NOBODY |
2111
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
82 |
sends messages containing X! **) |
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
83 |
|
3683 | 84 |
(*Spy never sees another agent's shared key! (unless it's bad at start)*) |
6335 | 85 |
Goal "evs : yahalom ==> (Key (shrK A) : parts (knows Spy evs)) = (A : bad)"; |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
86 |
by (parts_induct_tac 1); |
5066
30271d90644f
Changed format of Bob's certificate from Nb,K,A to A,B,K,Nb.
paulson
parents:
4831
diff
changeset
|
87 |
by (ALLGOALS Blast_tac); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
88 |
qed "Spy_see_shrK"; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
89 |
Addsimps [Spy_see_shrK]; |
2111
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
90 |
|
6335 | 91 |
Goal "evs : yahalom ==> (Key (shrK A) : analz (knows Spy evs)) = (A : bad)"; |
5066
30271d90644f
Changed format of Bob's certificate from Nb,K,A to A,B,K,Nb.
paulson
parents:
4831
diff
changeset
|
92 |
by Auto_tac; |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
93 |
qed "Spy_analz_shrK"; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
94 |
Addsimps [Spy_analz_shrK]; |
2111
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
95 |
|
4471 | 96 |
AddSDs [Spy_see_shrK RSN (2, rev_iffD1), |
97 |
Spy_analz_shrK RSN (2, rev_iffD1)]; |
|
2111
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
98 |
|
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
99 |
|
3432 | 100 |
(*Nobody can have used non-existent keys! Needed to apply analz_insert_Key*) |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
101 |
Goal "evs : yahalom ==> \ |
6335 | 102 |
\ 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:
3516
diff
changeset
|
103 |
by (parts_induct_tac 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
104 |
(*YM4: Key K is not fresh!*) |
5066
30271d90644f
Changed format of Bob's certificate from Nb,K,A to A,B,K,Nb.
paulson
parents:
4831
diff
changeset
|
105 |
by (Blast_tac 3); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
106 |
(*YM3*) |
4091 | 107 |
by (blast_tac (claset() addss (simpset())) 2); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
108 |
(*Fake*) |
4509
828148415197
Making proofs faster, especially using keysFor_parts_insert
paulson
parents:
4477
diff
changeset
|
109 |
by (blast_tac (claset() addSDs [keysFor_parts_insert]) 1); |
2160 | 110 |
qed_spec_mp "new_keys_not_used"; |
2111
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
111 |
|
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
112 |
bind_thm ("new_keys_not_analzd", |
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
113 |
[analz_subset_parts RS keysFor_mono, |
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
114 |
new_keys_not_used] MRS contra_subsetD); |
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
115 |
|
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
116 |
Addsimps [new_keys_not_used, new_keys_not_analzd]; |
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
117 |
|
2155 | 118 |
(*Describes the form of K when the Server sends this message. Useful for |
119 |
Oops as well as main secrecy property.*) |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
120 |
Goal "[| Says Server A {|nb', Crypt (shrK A) {|Agent B, Key K, na|}, X|} \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
121 |
\ : set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
122 |
\ evs : yahalom |] \ |
5434
9b4bed3f394c
Got rid of not_Says_to_self and most uses of ~= in definitions and theorems
paulson
parents:
5421
diff
changeset
|
123 |
\ ==> K ~: range shrK"; |
2155 | 124 |
by (etac rev_mp 1); |
125 |
by (etac yahalom.induct 1); |
|
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
126 |
by (ALLGOALS Asm_simp_tac); |
2155 | 127 |
qed "Says_Server_message_form"; |
2111
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
128 |
|
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
129 |
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
130 |
(*For proofs involving analz.*) |
6335 | 131 |
val analz_knows_Spy_tac = |
132 |
dtac YM4_analz_knows_Spy 7 THEN assume_tac 7 THEN |
|
7499 | 133 |
ftac Says_Server_message_form 8 THEN |
6335 | 134 |
assume_tac 8 THEN |
135 |
REPEAT ((etac conjE ORELSE' hyp_subst_tac) 8); |
|
2111
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
136 |
|
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
137 |
|
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
138 |
(**** |
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
139 |
The following is to prove theorems of the form |
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
140 |
|
6335 | 141 |
Key K : analz (insert (Key KAB) (knows Spy evs)) ==> |
142 |
Key K : analz (knows Spy evs) |
|
2111
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
143 |
|
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
144 |
A more general formula must be proved inductively. |
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
145 |
|
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
146 |
****) |
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
147 |
|
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
148 |
(** Session keys are not used to encrypt other session keys **) |
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
149 |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
150 |
Goal "evs : yahalom ==> \ |
5492 | 151 |
\ ALL K KK. KK <= - (range shrK) --> \ |
10833 | 152 |
\ (Key K : analz (Key`KK Un (knows Spy evs))) = \ |
6335 | 153 |
\ (K : KK | Key K : analz (knows Spy evs))"; |
2111
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
154 |
by (etac yahalom.induct 1); |
6335 | 155 |
by analz_knows_Spy_tac; |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
156 |
by (REPEAT_FIRST (resolve_tac [allI, impI])); |
3961 | 157 |
by (REPEAT_FIRST (rtac analz_image_freshK_lemma)); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
158 |
by (ALLGOALS (asm_simp_tac analz_image_freshK_ss)); |
3450
cd73bc206d87
Proof tidying and variable renaming (NA->na, NB->nb when of type msg)
paulson
parents:
3432
diff
changeset
|
159 |
(*Fake*) |
4422
21238c9d363e
Simplified proofs using rewrites for f``A where f is injective
paulson
parents:
4238
diff
changeset
|
160 |
by (spy_analz_tac 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
161 |
qed_spec_mp "analz_image_freshK"; |
2111
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
162 |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
163 |
Goal "[| evs : yahalom; KAB ~: range shrK |] ==> \ |
6335 | 164 |
\ Key K : analz (insert (Key KAB) (knows Spy evs)) = \ |
165 |
\ (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
|
166 |
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
|
167 |
qed "analz_insert_freshK"; |
2111
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
168 |
|
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
169 |
|
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
170 |
(*** The Key K uniquely identifies the Server's message. **) |
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
171 |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
172 |
Goal "evs : yahalom ==> \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
173 |
\ EX A' B' na' nb' X'. ALL A B na nb X. \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
174 |
\ Says Server A \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
175 |
\ {|nb, Crypt (shrK A) {|Agent B, Key K, na|}, X|} \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
176 |
\ : set evs --> A=A' & B=B' & na=na' & nb=nb' & X=X'"; |
2111
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
177 |
by (etac yahalom.induct 1); |
4091 | 178 |
by (ALLGOALS (asm_simp_tac (simpset() addsimps [all_conj_distrib]))); |
3730 | 179 |
by (Clarify_tac 1); |
2111
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
180 |
(*Remaining case: YM3*) |
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
181 |
by (expand_case_tac "K = ?y" 1); |
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
182 |
by (REPEAT (ares_tac [refl,exI,impI,conjI] 2)); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
183 |
(*...we assume X is a recent message and handle this case by contradiction*) |
5066
30271d90644f
Changed format of Bob's certificate from Nb,K,A to A,B,K,Nb.
paulson
parents:
4831
diff
changeset
|
184 |
by (blast_tac (claset() delrules [conjI] (*prevent splitup into 4 subgoals*) |
4199 | 185 |
addss (simpset() addsimps [parts_insertI])) 1); |
2111
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
186 |
val lemma = result(); |
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
187 |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
188 |
Goal "[| Says Server A \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
189 |
\ {|nb, Crypt (shrK A) {|Agent B, Key K, na|}, X|} : set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
190 |
\ Says Server A' \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
191 |
\ {|nb', Crypt (shrK A') {|Agent B', Key K, na'|}, X'|} : set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
192 |
\ evs : yahalom |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
193 |
\ ==> A=A' & B=B' & na=na' & nb=nb'"; |
2451
ce85a2aafc7a
Extensive tidying and simplification, largely stemming from
paulson
parents:
2377
diff
changeset
|
194 |
by (prove_unique_tac lemma 1); |
2111
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
195 |
qed "unique_session_keys"; |
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
196 |
|
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
197 |
|
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
198 |
(** Crucial secrecy property: Spy does not see the keys sent in msg YM3 **) |
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
199 |
|
5434
9b4bed3f394c
Got rid of not_Says_to_self and most uses of ~= in definitions and theorems
paulson
parents:
5421
diff
changeset
|
200 |
Goal "[| A ~: bad; B ~: bad; evs : yahalom |] \ |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
201 |
\ ==> Says Server A \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
202 |
\ {|nb, Crypt (shrK A) {|Agent B, Key K, na|}, \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
203 |
\ Crypt (shrK B) {|Agent A, Agent B, Key K, nb|}|} \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
204 |
\ : set evs --> \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
205 |
\ Notes Spy {|na, nb, Key K|} ~: set evs --> \ |
6335 | 206 |
\ Key K ~: analz (knows Spy evs)"; |
2111
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
207 |
by (etac yahalom.induct 1); |
6335 | 208 |
by analz_knows_Spy_tac; |
2111
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
209 |
by (ALLGOALS |
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
210 |
(asm_simp_tac |
4831 | 211 |
(simpset() addsimps split_ifs |
4686 | 212 |
addsimps [analz_insert_eq, analz_insert_freshK]))); |
3450
cd73bc206d87
Proof tidying and variable renaming (NA->na, NB->nb when of type msg)
paulson
parents:
3432
diff
changeset
|
213 |
(*Oops*) |
4091 | 214 |
by (blast_tac (claset() addDs [unique_session_keys]) 3); |
5932 | 215 |
(*YM3: delete a useless induction hypothesis*) |
216 |
by (thin_tac "?P-->?Q" 2); |
|
217 |
by (Blast_tac 2); |
|
3450
cd73bc206d87
Proof tidying and variable renaming (NA->na, NB->nb when of type msg)
paulson
parents:
3432
diff
changeset
|
218 |
(*Fake*) |
cd73bc206d87
Proof tidying and variable renaming (NA->na, NB->nb when of type msg)
paulson
parents:
3432
diff
changeset
|
219 |
by (spy_analz_tac 1); |
2111
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
220 |
val lemma = result() RS mp RS mp RSN(2,rev_notE); |
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
221 |
|
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
222 |
|
3432 | 223 |
(*Final version*) |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
224 |
Goal "[| Says Server A \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
225 |
\ {|nb, Crypt (shrK A) {|Agent B, Key K, na|}, \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
226 |
\ Crypt (shrK B) {|Agent A, Agent B, Key K, nb|}|} \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
227 |
\ : set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
228 |
\ Notes Spy {|na, nb, Key K|} ~: set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
229 |
\ A ~: bad; B ~: bad; evs : yahalom |] \ |
6335 | 230 |
\ ==> Key K ~: analz (knows Spy evs)"; |
7499 | 231 |
by (ftac Says_Server_message_form 1 THEN assume_tac 1); |
4091 | 232 |
by (blast_tac (claset() addSEs [lemma]) 1); |
2111
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
233 |
qed "Spy_not_see_encrypted_key"; |
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
234 |
|
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
235 |
|
3450
cd73bc206d87
Proof tidying and variable renaming (NA->na, NB->nb when of type msg)
paulson
parents:
3432
diff
changeset
|
236 |
(** Security Guarantee for A upon receiving YM3 **) |
2155 | 237 |
|
3432 | 238 |
(*If the encrypted message appears then it originated with the Server. |
239 |
May now apply Spy_not_see_encrypted_key, subject to its conditions.*) |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
240 |
Goal "[| Crypt (shrK A) {|Agent B, Key K, na|} \ |
6335 | 241 |
\ : parts (knows Spy evs); \ |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
242 |
\ A ~: bad; evs : yahalom |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
243 |
\ ==> EX nb. Says Server A \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
244 |
\ {|nb, Crypt (shrK A) {|Agent B, Key K, na|}, \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
245 |
\ Crypt (shrK B) {|Agent A, Agent B, Key K, nb|}|} \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
246 |
\ : set evs"; |
2155 | 247 |
by (etac rev_mp 1); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
248 |
by (parts_induct_tac 1); |
5066
30271d90644f
Changed format of Bob's certificate from Nb,K,A to A,B,K,Nb.
paulson
parents:
4831
diff
changeset
|
249 |
by (ALLGOALS Blast_tac); |
2323 | 250 |
qed "A_trusts_YM3"; |
2155 | 251 |
|
4598
649bf14debe7
Added some more explicit guarantees of key secrecy for agents
paulson
parents:
4537
diff
changeset
|
252 |
(*The obvious combination of A_trusts_YM3 with Spy_not_see_encrypted_key*) |
6335 | 253 |
Goal "[| Crypt (shrK A) {|Agent B, Key K, na|} : parts (knows Spy evs); \ |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
254 |
\ ALL nb. Notes Spy {|na, nb, Key K|} ~: set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
255 |
\ A ~: bad; B ~: bad; evs : yahalom |] \ |
6335 | 256 |
\ ==> Key K ~: analz (knows Spy evs)"; |
4598
649bf14debe7
Added some more explicit guarantees of key secrecy for agents
paulson
parents:
4537
diff
changeset
|
257 |
by (blast_tac (claset() addSDs [A_trusts_YM3, Spy_not_see_encrypted_key]) 1); |
649bf14debe7
Added some more explicit guarantees of key secrecy for agents
paulson
parents:
4537
diff
changeset
|
258 |
qed "A_gets_good_key"; |
649bf14debe7
Added some more explicit guarantees of key secrecy for agents
paulson
parents:
4537
diff
changeset
|
259 |
|
2111
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
260 |
|
3450
cd73bc206d87
Proof tidying and variable renaming (NA->na, NB->nb when of type msg)
paulson
parents:
3432
diff
changeset
|
261 |
(** Security Guarantee for B upon receiving YM4 **) |
cd73bc206d87
Proof tidying and variable renaming (NA->na, NB->nb when of type msg)
paulson
parents:
3432
diff
changeset
|
262 |
|
2111
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
263 |
(*B knows, by the first part of A's message, that the Server distributed |
5066
30271d90644f
Changed format of Bob's certificate from Nb,K,A to A,B,K,Nb.
paulson
parents:
4831
diff
changeset
|
264 |
the key for A and B, and has associated it with NB.*) |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
265 |
Goal "[| Crypt (shrK B) {|Agent A, Agent B, Key K, Nonce NB|} \ |
6335 | 266 |
\ : parts (knows Spy evs); \ |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
267 |
\ B ~: bad; evs : yahalom |] \ |
5066
30271d90644f
Changed format of Bob's certificate from Nb,K,A to A,B,K,Nb.
paulson
parents:
4831
diff
changeset
|
268 |
\ ==> EX NA. Says Server A \ |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
269 |
\ {|Nonce NB, \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
270 |
\ Crypt (shrK A) {|Agent B, Key K, Nonce NA|}, \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
271 |
\ Crypt (shrK B) {|Agent A, Agent B, Key K, Nonce NB|}|} \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
272 |
\ : set evs"; |
2111
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
273 |
by (etac rev_mp 1); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
274 |
by (parts_induct_tac 1); |
5066
30271d90644f
Changed format of Bob's certificate from Nb,K,A to A,B,K,Nb.
paulson
parents:
4831
diff
changeset
|
275 |
by (ALLGOALS Blast_tac); |
2111
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
276 |
qed "B_trusts_YM4_shrK"; |
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
277 |
|
3450
cd73bc206d87
Proof tidying and variable renaming (NA->na, NB->nb when of type msg)
paulson
parents:
3432
diff
changeset
|
278 |
|
cd73bc206d87
Proof tidying and variable renaming (NA->na, NB->nb when of type msg)
paulson
parents:
3432
diff
changeset
|
279 |
(*With this protocol variant, we don't need the 2nd part of YM4 at all: |
cd73bc206d87
Proof tidying and variable renaming (NA->na, NB->nb when of type msg)
paulson
parents:
3432
diff
changeset
|
280 |
Nonce NB is available in the first part.*) |
2111
81c8d46edfa3
New version of Yahalom, as recommended on p 259 of BAN paper
paulson
parents:
diff
changeset
|
281 |
|
2155 | 282 |
(*What can B deduce from receipt of YM4? Stronger and simpler than Yahalom |
283 |
because we do not have to show that NB is secret. *) |
|
6335 | 284 |
Goal "[| Gets B {|Crypt (shrK B) {|Agent A, Agent B, Key K, Nonce NB|}, \ |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
285 |
\ X|} \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
286 |
\ : set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
287 |
\ A ~: bad; B ~: bad; evs : yahalom |] \ |
5066
30271d90644f
Changed format of Bob's certificate from Nb,K,A to A,B,K,Nb.
paulson
parents:
4831
diff
changeset
|
288 |
\ ==> EX NA. Says Server A \ |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
289 |
\ {|Nonce NB, \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
290 |
\ Crypt (shrK A) {|Agent B, Key K, Nonce NA|}, \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
291 |
\ Crypt (shrK B) {|Agent A, Agent B, Key K, Nonce NB|}|} \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
292 |
\ : set evs"; |
4091 | 293 |
by (blast_tac (claset() addSDs [B_trusts_YM4_shrK]) 1); |
2323 | 294 |
qed "B_trusts_YM4"; |
3432 | 295 |
|
296 |
||
4598
649bf14debe7
Added some more explicit guarantees of key secrecy for agents
paulson
parents:
4537
diff
changeset
|
297 |
(*The obvious combination of B_trusts_YM4 with Spy_not_see_encrypted_key*) |
6335 | 298 |
Goal "[| Gets B {|Crypt (shrK B) {|Agent A, Agent B, Key K, Nonce NB|}, \ |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
299 |
\ X|} \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
300 |
\ : set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
301 |
\ ALL na. Notes Spy {|na, Nonce NB, Key K|} ~: set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
302 |
\ A ~: bad; B ~: bad; evs : yahalom |] \ |
6335 | 303 |
\ ==> Key K ~: analz (knows Spy evs)"; |
4598
649bf14debe7
Added some more explicit guarantees of key secrecy for agents
paulson
parents:
4537
diff
changeset
|
304 |
by (blast_tac (claset() addSDs [B_trusts_YM4, Spy_not_see_encrypted_key]) 1); |
649bf14debe7
Added some more explicit guarantees of key secrecy for agents
paulson
parents:
4537
diff
changeset
|
305 |
qed "B_gets_good_key"; |
649bf14debe7
Added some more explicit guarantees of key secrecy for agents
paulson
parents:
4537
diff
changeset
|
306 |
|
649bf14debe7
Added some more explicit guarantees of key secrecy for agents
paulson
parents:
4537
diff
changeset
|
307 |
|
3432 | 308 |
|
309 |
(*** Authenticating B to A ***) |
|
310 |
||
311 |
(*The encryption in message YM2 tells us it cannot be faked.*) |
|
6335 | 312 |
Goal "[| Crypt (shrK B) {|Agent A, Nonce NA|} : parts (knows Spy evs); \ |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
313 |
\ B ~: bad; evs : yahalom \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
314 |
\ |] ==> EX NB. Says B Server {|Agent B, Nonce NB, \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
315 |
\ Crypt (shrK B) {|Agent A, Nonce NA|}|} \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
316 |
\ : set evs"; |
5066
30271d90644f
Changed format of Bob's certificate from Nb,K,A to A,B,K,Nb.
paulson
parents:
4831
diff
changeset
|
317 |
by (etac rev_mp 1); |
30271d90644f
Changed format of Bob's certificate from Nb,K,A to A,B,K,Nb.
paulson
parents:
4831
diff
changeset
|
318 |
by (etac rev_mp 1); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
319 |
by (parts_induct_tac 1); |
5066
30271d90644f
Changed format of Bob's certificate from Nb,K,A to A,B,K,Nb.
paulson
parents:
4831
diff
changeset
|
320 |
by (ALLGOALS Blast_tac); |
30271d90644f
Changed format of Bob's certificate from Nb,K,A to A,B,K,Nb.
paulson
parents:
4831
diff
changeset
|
321 |
qed "B_Said_YM2"; |
3432 | 322 |
|
4598
649bf14debe7
Added some more explicit guarantees of key secrecy for agents
paulson
parents:
4537
diff
changeset
|
323 |
|
3432 | 324 |
(*If the server sends YM3 then B sent YM2, perhaps with a different NB*) |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
325 |
Goal "[| Says Server A \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
326 |
\ {|nb, Crypt (shrK A) {|Agent B, Key K, Nonce NA|}, X|} \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
327 |
\ : set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
328 |
\ B ~: bad; evs : yahalom \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
329 |
\ |] ==> EX nb'. Says B Server {|Agent B, nb', \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
330 |
\ Crypt (shrK B) {|Agent A, Nonce NA|}|} \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
331 |
\ : set evs"; |
5066
30271d90644f
Changed format of Bob's certificate from Nb,K,A to A,B,K,Nb.
paulson
parents:
4831
diff
changeset
|
332 |
by (etac rev_mp 1); |
30271d90644f
Changed format of Bob's certificate from Nb,K,A to A,B,K,Nb.
paulson
parents:
4831
diff
changeset
|
333 |
by (etac rev_mp 1); |
3432 | 334 |
by (etac yahalom.induct 1); |
335 |
by (ALLGOALS Asm_simp_tac); |
|
336 |
(*YM3*) |
|
5066
30271d90644f
Changed format of Bob's certificate from Nb,K,A to A,B,K,Nb.
paulson
parents:
4831
diff
changeset
|
337 |
by (blast_tac (claset() addSDs [B_Said_YM2]) 3); |
3432 | 338 |
(*Fake, YM2*) |
339 |
by (ALLGOALS Blast_tac); |
|
5066
30271d90644f
Changed format of Bob's certificate from Nb,K,A to A,B,K,Nb.
paulson
parents:
4831
diff
changeset
|
340 |
val lemma = result(); |
3432 | 341 |
|
342 |
(*If A receives YM3 then B has used nonce NA (and therefore is alive)*) |
|
6335 | 343 |
Goal "[| Gets A {|nb, Crypt (shrK A) {|Agent B, Key K, Nonce NA|}, X|} \ |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
344 |
\ : set evs; \ |
6335 | 345 |
\ A ~: bad; B ~: bad; evs : yahalom |] \ |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
346 |
\==> EX nb'. Says B Server \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
347 |
\ {|Agent B, nb', Crypt (shrK B) {|Agent A, Nonce NA|}|} \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
348 |
\ : set evs"; |
5066
30271d90644f
Changed format of Bob's certificate from Nb,K,A to A,B,K,Nb.
paulson
parents:
4831
diff
changeset
|
349 |
by (blast_tac (claset() addSDs [A_trusts_YM3, lemma]) 1); |
3432 | 350 |
qed "YM3_auth_B_to_A"; |
351 |
||
352 |
||
3450
cd73bc206d87
Proof tidying and variable renaming (NA->na, NB->nb when of type msg)
paulson
parents:
3432
diff
changeset
|
353 |
(*** Authenticating A to B using the certificate Crypt K (Nonce NB) ***) |
cd73bc206d87
Proof tidying and variable renaming (NA->na, NB->nb when of type msg)
paulson
parents:
3432
diff
changeset
|
354 |
|
cd73bc206d87
Proof tidying and variable renaming (NA->na, NB->nb when of type msg)
paulson
parents:
3432
diff
changeset
|
355 |
(*Assuming the session key is secure, if both certificates are present then |
3432 | 356 |
A has said NB. We can't be sure about the rest of A's message, but only |
6335 | 357 |
NB matters for freshness. Note that Key K ~: analz (knows Spy evs) must be |
5066
30271d90644f
Changed format of Bob's certificate from Nb,K,A to A,B,K,Nb.
paulson
parents:
4831
diff
changeset
|
358 |
the FIRST antecedent of the induction formula.*) |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
359 |
Goal "evs : yahalom \ |
6335 | 360 |
\ ==> Key K ~: analz (knows Spy evs) --> \ |
361 |
\ Crypt K (Nonce NB) : parts (knows Spy evs) --> \ |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
362 |
\ Crypt (shrK B) {|Agent A, Agent B, Key K, Nonce NB|} \ |
6335 | 363 |
\ : parts (knows Spy evs) --> \ |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
364 |
\ B ~: bad --> \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
365 |
\ (EX X. Says A B {|X, Crypt K (Nonce NB)|} : set evs)"; |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3516
diff
changeset
|
366 |
by (parts_induct_tac 1); |
3432 | 367 |
(*Fake*) |
5066
30271d90644f
Changed format of Bob's certificate from Nb,K,A to A,B,K,Nb.
paulson
parents:
4831
diff
changeset
|
368 |
by (Blast_tac 1); |
3432 | 369 |
(*YM3: by new_keys_not_used we note that Crypt K (Nonce NB) could not exist*) |
5932 | 370 |
by (force_tac (claset() addSDs [Crypt_imp_keysFor], simpset()) 1); |
3450
cd73bc206d87
Proof tidying and variable renaming (NA->na, NB->nb when of type msg)
paulson
parents:
3432
diff
changeset
|
371 |
(*YM4: was Crypt K (Nonce NB) the very last message? If not, use ind. hyp.*) |
4091 | 372 |
by (asm_simp_tac (simpset() addsimps [ex_disj_distrib]) 1); |
5932 | 373 |
(*yes: delete a useless induction hypothesis; apply unicity of session keys*) |
374 |
by (thin_tac "?P-->?Q" 1); |
|
7499 | 375 |
by (ftac Gets_imp_Says 1 THEN assume_tac 1); |
3683 | 376 |
by (not_bad_tac "Aa" 1); |
5066
30271d90644f
Changed format of Bob's certificate from Nb,K,A to A,B,K,Nb.
paulson
parents:
4831
diff
changeset
|
377 |
by (blast_tac (claset() addSDs [A_trusts_YM3, B_trusts_YM4_shrK] |
30271d90644f
Changed format of Bob's certificate from Nb,K,A to A,B,K,Nb.
paulson
parents:
4831
diff
changeset
|
378 |
addDs [unique_session_keys]) 1); |
30271d90644f
Changed format of Bob's certificate from Nb,K,A to A,B,K,Nb.
paulson
parents:
4831
diff
changeset
|
379 |
qed_spec_mp "Auth_A_to_B_lemma"; |
30271d90644f
Changed format of Bob's certificate from Nb,K,A to A,B,K,Nb.
paulson
parents:
4831
diff
changeset
|
380 |
|
3432 | 381 |
|
382 |
(*If B receives YM4 then A has used nonce NB (and therefore is alive). |
|
3450
cd73bc206d87
Proof tidying and variable renaming (NA->na, NB->nb when of type msg)
paulson
parents:
3432
diff
changeset
|
383 |
Moreover, A associates K with NB (thus is talking about the same run). |
3432 | 384 |
Other premises guarantee secrecy of K.*) |
6335 | 385 |
Goal "[| Gets B {|Crypt (shrK B) {|Agent A, Agent B, Key K, Nonce NB|}, \ |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
386 |
\ Crypt K (Nonce NB)|} : set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
387 |
\ (ALL NA. Notes Spy {|Nonce NA, Nonce NB, Key K|} ~: set evs); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
388 |
\ A ~: bad; B ~: bad; evs : yahalom |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
389 |
\ ==> EX X. Says A B {|X, Crypt K (Nonce NB)|} : set evs"; |
6335 | 390 |
by (subgoal_tac "Key K ~: analz (knows Spy evs)" 1); |
5066
30271d90644f
Changed format of Bob's certificate from Nb,K,A to A,B,K,Nb.
paulson
parents:
4831
diff
changeset
|
391 |
by (blast_tac (claset() addIs [Auth_A_to_B_lemma]) 1); |
30271d90644f
Changed format of Bob's certificate from Nb,K,A to A,B,K,Nb.
paulson
parents:
4831
diff
changeset
|
392 |
by (blast_tac (claset() addDs [Spy_not_see_encrypted_key, |
30271d90644f
Changed format of Bob's certificate from Nb,K,A to A,B,K,Nb.
paulson
parents:
4831
diff
changeset
|
393 |
B_trusts_YM4_shrK]) 1); |
3432 | 394 |
qed_spec_mp "YM4_imp_A_Said_YM3"; |