author | paulson |
Wed, 05 Aug 1998 10:57:25 +0200 | |
changeset 5253 | 82a5ca6290aa |
parent 5223 | 4cb05273f764 |
child 5359 | bd539b72d484 |
permissions | -rw-r--r-- |
3474 | 1 |
(* Title: HOL/Auth/TLS |
2 |
ID: $Id$ |
|
3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
|
4 |
Copyright 1997 University of Cambridge |
|
5 |
||
3480
d59bbf053258
More realistic model: the Spy can compute clientK and serverK
paulson
parents:
3474
diff
changeset
|
6 |
Protocol goals: |
d59bbf053258
More realistic model: the Spy can compute clientK and serverK
paulson
parents:
3474
diff
changeset
|
7 |
* M, serverK(NA,NB,M) and clientK(NA,NB,M) will be known only to the two |
d59bbf053258
More realistic model: the Spy can compute clientK and serverK
paulson
parents:
3474
diff
changeset
|
8 |
parties (though A is not necessarily authenticated). |
d59bbf053258
More realistic model: the Spy can compute clientK and serverK
paulson
parents:
3474
diff
changeset
|
9 |
|
3685
5b8c0c8f576e
Full version of TLS including session resumption, but no Oops
paulson
parents:
3683
diff
changeset
|
10 |
* B upon receiving CertVerify knows that A is present (But this |
3480
d59bbf053258
More realistic model: the Spy can compute clientK and serverK
paulson
parents:
3474
diff
changeset
|
11 |
message is optional!) |
3474 | 12 |
|
3685
5b8c0c8f576e
Full version of TLS including session resumption, but no Oops
paulson
parents:
3683
diff
changeset
|
13 |
* A upon receiving ServerFinished knows that B is present |
3480
d59bbf053258
More realistic model: the Spy can compute clientK and serverK
paulson
parents:
3474
diff
changeset
|
14 |
|
d59bbf053258
More realistic model: the Spy can compute clientK and serverK
paulson
parents:
3474
diff
changeset
|
15 |
* Each party who has received a FINISHED message can trust that the other |
3729
6be7cf5086ab
Renamed XA, XB to PA, PB and removed the certificate from Client Verify
paulson
parents:
3711
diff
changeset
|
16 |
party agrees on all message components, including PA and PB (thus foiling |
3480
d59bbf053258
More realistic model: the Spy can compute clientK and serverK
paulson
parents:
3474
diff
changeset
|
17 |
rollback attacks). |
3474 | 18 |
*) |
19 |
||
3772 | 20 |
(*Automatically unfold the definition of "certificate"*) |
21 |
Addsimps [certificate_def]; |
|
3480
d59bbf053258
More realistic model: the Spy can compute clientK and serverK
paulson
parents:
3474
diff
changeset
|
22 |
|
3474 | 23 |
(*Injectiveness of key-generating functions*) |
3677
f2569416d18b
Now with the sessionK constant and new events ClientAccepts and ServerAccepts
paulson
parents:
3676
diff
changeset
|
24 |
AddIffs [inj_PRF RS inj_eq, inj_sessionK RS inj_eq]; |
3474 | 25 |
|
3677
f2569416d18b
Now with the sessionK constant and new events ClientAccepts and ServerAccepts
paulson
parents:
3676
diff
changeset
|
26 |
(* invKey(sessionK x) = sessionK x*) |
f2569416d18b
Now with the sessionK constant and new events ClientAccepts and ServerAccepts
paulson
parents:
3676
diff
changeset
|
27 |
Addsimps [isSym_sessionK, rewrite_rule [isSymKey_def] isSym_sessionK]; |
3480
d59bbf053258
More realistic model: the Spy can compute clientK and serverK
paulson
parents:
3474
diff
changeset
|
28 |
|
3474 | 29 |
|
30 |
(*** clientK and serverK make symmetric keys; no clashes with pubK or priK ***) |
|
31 |
||
5076 | 32 |
Goal "pubK A ~= sessionK arg"; |
4423 | 33 |
by (rtac notI 1); |
3474 | 34 |
by (dres_inst_tac [("f","isSymKey")] arg_cong 1); |
35 |
by (Full_simp_tac 1); |
|
3677
f2569416d18b
Now with the sessionK constant and new events ClientAccepts and ServerAccepts
paulson
parents:
3676
diff
changeset
|
36 |
qed "pubK_neq_sessionK"; |
3474 | 37 |
|
5076 | 38 |
Goal "priK A ~= sessionK arg"; |
4423 | 39 |
by (rtac notI 1); |
3474 | 40 |
by (dres_inst_tac [("f","isSymKey")] arg_cong 1); |
41 |
by (Full_simp_tac 1); |
|
3677
f2569416d18b
Now with the sessionK constant and new events ClientAccepts and ServerAccepts
paulson
parents:
3676
diff
changeset
|
42 |
qed "priK_neq_sessionK"; |
3474 | 43 |
|
3677
f2569416d18b
Now with the sessionK constant and new events ClientAccepts and ServerAccepts
paulson
parents:
3676
diff
changeset
|
44 |
val keys_distinct = [pubK_neq_sessionK, priK_neq_sessionK]; |
3515
d8a71f6eaf40
Now uses the Notes constructor to distinguish the Client (who has chosen M)
paulson
parents:
3506
diff
changeset
|
45 |
AddIffs (keys_distinct @ (keys_distinct RL [not_sym])); |
3474 | 46 |
|
47 |
||
48 |
(**** Protocol Proofs ****) |
|
49 |
||
3772 | 50 |
(*Possibility properties state that some traces run the protocol to the end. |
51 |
Four paths and 12 rules are considered.*) |
|
3474 | 52 |
|
3672
56e4365a0c99
TLS now with a distinction between premaster secret and master secret
paulson
parents:
3519
diff
changeset
|
53 |
|
3772 | 54 |
(** These proofs assume that the Nonce_supply nonces |
3672
56e4365a0c99
TLS now with a distinction between premaster secret and master secret
paulson
parents:
3519
diff
changeset
|
55 |
(which have the form @ N. Nonce N ~: used evs) |
3772 | 56 |
lie outside the range of PRF. It seems reasonable, but as it is needed |
57 |
only for the possibility theorems, it is not taken as an axiom. |
|
3672
56e4365a0c99
TLS now with a distinction between premaster secret and master secret
paulson
parents:
3519
diff
changeset
|
58 |
**) |
56e4365a0c99
TLS now with a distinction between premaster secret and master secret
paulson
parents:
3519
diff
changeset
|
59 |
|
56e4365a0c99
TLS now with a distinction between premaster secret and master secret
paulson
parents:
3519
diff
changeset
|
60 |
|
3685
5b8c0c8f576e
Full version of TLS including session resumption, but no Oops
paulson
parents:
3683
diff
changeset
|
61 |
(*Possibility property ending with ClientAccepts.*) |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
62 |
Goal "[| ALL evs. (@ N. Nonce N ~: used evs) ~: range PRF; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
63 |
\ A ~= B |] \ |
3760
77f71f650433
Strengthened the possibility property for resumption so that it could have
paulson
parents:
3758
diff
changeset
|
64 |
\ ==> EX SID M. EX evs: tls. \ |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
65 |
\ Notes A {|Number SID, Agent A, Agent B, Nonce M|} : set evs"; |
3474 | 66 |
by (REPEAT (resolve_tac [exI,bexI] 1)); |
3745
4c5d3b1ddc75
Client, Server certificates now sent using the separate Certificate rule,
paulson
parents:
3729
diff
changeset
|
67 |
by (rtac (tls.Nil RS tls.ClientHello RS tls.ServerHello RS tls.Certificate RS |
4c5d3b1ddc75
Client, Server certificates now sent using the separate Certificate rule,
paulson
parents:
3729
diff
changeset
|
68 |
tls.ClientKeyExch RS tls.ClientFinished RS tls.ServerFinished RS |
4c5d3b1ddc75
Client, Server certificates now sent using the separate Certificate rule,
paulson
parents:
3729
diff
changeset
|
69 |
tls.ClientAccepts) 2); |
3474 | 70 |
by possibility_tac; |
3672
56e4365a0c99
TLS now with a distinction between premaster secret and master secret
paulson
parents:
3519
diff
changeset
|
71 |
by (REPEAT (Blast_tac 1)); |
3474 | 72 |
result(); |
73 |
||
3685
5b8c0c8f576e
Full version of TLS including session resumption, but no Oops
paulson
parents:
3683
diff
changeset
|
74 |
(*And one for ServerAccepts. Either FINISHED message may come first.*) |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
75 |
Goal "[| ALL evs. (@ N. Nonce N ~: used evs) ~: range PRF; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
76 |
\ A ~= B |] \ |
3760
77f71f650433
Strengthened the possibility property for resumption so that it could have
paulson
parents:
3758
diff
changeset
|
77 |
\ ==> EX SID NA PA NB PB M. EX evs: tls. \ |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
78 |
\ Notes B {|Number SID, Agent A, Agent B, Nonce M|} : set evs"; |
3474 | 79 |
by (REPEAT (resolve_tac [exI,bexI] 1)); |
3745
4c5d3b1ddc75
Client, Server certificates now sent using the separate Certificate rule,
paulson
parents:
3729
diff
changeset
|
80 |
by (rtac (tls.Nil RS tls.ClientHello RS tls.ServerHello RS tls.Certificate RS |
4c5d3b1ddc75
Client, Server certificates now sent using the separate Certificate rule,
paulson
parents:
3729
diff
changeset
|
81 |
tls.ClientKeyExch RS tls.ServerFinished RS tls.ClientFinished RS |
4c5d3b1ddc75
Client, Server certificates now sent using the separate Certificate rule,
paulson
parents:
3729
diff
changeset
|
82 |
tls.ServerAccepts) 2); |
3474 | 83 |
by possibility_tac; |
3672
56e4365a0c99
TLS now with a distinction between premaster secret and master secret
paulson
parents:
3519
diff
changeset
|
84 |
by (REPEAT (Blast_tac 1)); |
3474 | 85 |
result(); |
86 |
||
87 |
(*Another one, for CertVerify (which is optional)*) |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
88 |
Goal "[| ALL evs. (@ N. Nonce N ~: used evs) ~: range PRF; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
89 |
\ A ~= B |] \ |
3760
77f71f650433
Strengthened the possibility property for resumption so that it could have
paulson
parents:
3758
diff
changeset
|
90 |
\ ==> EX NB PMS. EX evs: tls. \ |
3729
6be7cf5086ab
Renamed XA, XB to PA, PB and removed the certificate from Client Verify
paulson
parents:
3711
diff
changeset
|
91 |
\ Says A B (Crypt (priK A) (Hash{|Nonce NB, Agent B, Nonce PMS|})) : set evs"; |
3474 | 92 |
by (REPEAT (resolve_tac [exI,bexI] 1)); |
3745
4c5d3b1ddc75
Client, Server certificates now sent using the separate Certificate rule,
paulson
parents:
3729
diff
changeset
|
93 |
by (rtac (tls.Nil RS tls.ClientHello RS tls.ServerHello RS tls.Certificate RS |
4c5d3b1ddc75
Client, Server certificates now sent using the separate Certificate rule,
paulson
parents:
3729
diff
changeset
|
94 |
tls.ClientKeyExch RS tls.CertVerify) 2); |
3474 | 95 |
by possibility_tac; |
3672
56e4365a0c99
TLS now with a distinction between premaster secret and master secret
paulson
parents:
3519
diff
changeset
|
96 |
by (REPEAT (Blast_tac 1)); |
3474 | 97 |
result(); |
98 |
||
3685
5b8c0c8f576e
Full version of TLS including session resumption, but no Oops
paulson
parents:
3683
diff
changeset
|
99 |
(*Another one, for session resumption (both ServerResume and ClientResume) *) |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
100 |
Goal "[| evs0 : tls; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
101 |
\ Notes A {|Number SID, Agent A, Agent B, Nonce M|} : set evs0; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
102 |
\ Notes B {|Number SID, Agent A, Agent B, Nonce M|} : set evs0; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
103 |
\ ALL evs. (@ N. Nonce N ~: used evs) ~: range PRF; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
104 |
\ A ~= B |] ==> EX NA PA NB PB X. EX evs: tls. \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
105 |
\ X = Hash{|Number SID, Nonce M, \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
106 |
\ Nonce NA, Number PA, Agent A, \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
107 |
\ Nonce NB, Number PB, Agent B|} & \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
108 |
\ Says A B (Crypt (clientK(NA,NB,M)) X) : set evs & \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
109 |
\ Says B A (Crypt (serverK(NA,NB,M)) X) : set evs"; |
3685
5b8c0c8f576e
Full version of TLS including session resumption, but no Oops
paulson
parents:
3683
diff
changeset
|
110 |
by (REPEAT (resolve_tac [exI,bexI] 1)); |
3745
4c5d3b1ddc75
Client, Server certificates now sent using the separate Certificate rule,
paulson
parents:
3729
diff
changeset
|
111 |
by (etac (tls.ClientHello RS tls.ServerHello RS tls.ServerResume RS |
4c5d3b1ddc75
Client, Server certificates now sent using the separate Certificate rule,
paulson
parents:
3729
diff
changeset
|
112 |
tls.ClientResume) 2); |
3685
5b8c0c8f576e
Full version of TLS including session resumption, but no Oops
paulson
parents:
3683
diff
changeset
|
113 |
by possibility_tac; |
5b8c0c8f576e
Full version of TLS including session resumption, but no Oops
paulson
parents:
3683
diff
changeset
|
114 |
by (REPEAT (Blast_tac 1)); |
5b8c0c8f576e
Full version of TLS including session resumption, but no Oops
paulson
parents:
3683
diff
changeset
|
115 |
result(); |
5b8c0c8f576e
Full version of TLS including session resumption, but no Oops
paulson
parents:
3683
diff
changeset
|
116 |
|
5b8c0c8f576e
Full version of TLS including session resumption, but no Oops
paulson
parents:
3683
diff
changeset
|
117 |
|
3474 | 118 |
|
119 |
(**** Inductive proofs about tls ****) |
|
120 |
||
121 |
(*Nobody sends themselves messages*) |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
122 |
Goal "evs : tls ==> ALL A X. Says A A X ~: set evs"; |
3474 | 123 |
by (etac tls.induct 1); |
4477
b3e5857d8d99
New Auto_tac (by Oheimb), and new syntax (without parens), and expandshort
paulson
parents:
4472
diff
changeset
|
124 |
by Auto_tac; |
3474 | 125 |
qed_spec_mp "not_Says_to_self"; |
126 |
Addsimps [not_Says_to_self]; |
|
127 |
AddSEs [not_Says_to_self RSN (2, rev_notE)]; |
|
128 |
||
129 |
||
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3515
diff
changeset
|
130 |
(*Induction for regularity theorems. If induction formula has the form |
3683 | 131 |
X ~: analz (spies evs) --> ... then it shortens the proof by discarding |
132 |
needless information about analz (insert X (spies evs)) *) |
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3515
diff
changeset
|
133 |
fun parts_induct_tac i = |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3515
diff
changeset
|
134 |
etac tls.induct i |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3515
diff
changeset
|
135 |
THEN |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3515
diff
changeset
|
136 |
REPEAT (FIRSTGOAL analz_mono_contra_tac) |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3515
diff
changeset
|
137 |
THEN |
4091 | 138 |
fast_tac (claset() addss (simpset())) i THEN |
4686 | 139 |
ALLGOALS Asm_simp_tac; |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3515
diff
changeset
|
140 |
|
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3515
diff
changeset
|
141 |
|
3683 | 142 |
(** Theorems of the form X ~: parts (spies evs) imply that NOBODY |
3474 | 143 |
sends messages containing X! **) |
144 |
||
3683 | 145 |
(*Spy never sees another agent's private key! (unless it's bad at start)*) |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
146 |
Goal "evs : tls ==> (Key (priK A) : parts (spies evs)) = (A : bad)"; |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3515
diff
changeset
|
147 |
by (parts_induct_tac 1); |
3474 | 148 |
by (Fake_parts_insert_tac 1); |
149 |
qed "Spy_see_priK"; |
|
150 |
Addsimps [Spy_see_priK]; |
|
151 |
||
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
152 |
Goal "evs : tls ==> (Key (priK A) : analz (spies evs)) = (A : bad)"; |
4091 | 153 |
by (auto_tac(claset() addDs [impOfSubs analz_subset_parts], simpset())); |
3474 | 154 |
qed "Spy_analz_priK"; |
155 |
Addsimps [Spy_analz_priK]; |
|
156 |
||
4472 | 157 |
AddSDs [Spy_see_priK RSN (2, rev_iffD1), |
158 |
Spy_analz_priK RSN (2, rev_iffD1)]; |
|
3474 | 159 |
|
160 |
||
3515
d8a71f6eaf40
Now uses the Notes constructor to distinguish the Client (who has chosen M)
paulson
parents:
3506
diff
changeset
|
161 |
(*This lemma says that no false certificates exist. One might extend the |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3515
diff
changeset
|
162 |
model to include bogus certificates for the agents, but there seems |
3515
d8a71f6eaf40
Now uses the Notes constructor to distinguish the Client (who has chosen M)
paulson
parents:
3506
diff
changeset
|
163 |
little point in doing so: the loss of their private keys is a worse |
d8a71f6eaf40
Now uses the Notes constructor to distinguish the Client (who has chosen M)
paulson
parents:
3506
diff
changeset
|
164 |
breach of security.*) |
5076 | 165 |
Goalw [certificate_def] |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
166 |
"[| certificate B KB : parts (spies evs); evs : tls |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
167 |
\ ==> pubK B = KB"; |
3772 | 168 |
by (etac rev_mp 1); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3515
diff
changeset
|
169 |
by (parts_induct_tac 1); |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3515
diff
changeset
|
170 |
by (Fake_parts_insert_tac 1); |
3772 | 171 |
qed "certificate_valid"; |
3515
d8a71f6eaf40
Now uses the Notes constructor to distinguish the Client (who has chosen M)
paulson
parents:
3506
diff
changeset
|
172 |
|
d8a71f6eaf40
Now uses the Notes constructor to distinguish the Client (who has chosen M)
paulson
parents:
3506
diff
changeset
|
173 |
|
3745
4c5d3b1ddc75
Client, Server certificates now sent using the separate Certificate rule,
paulson
parents:
3729
diff
changeset
|
174 |
(*Replace key KB in ClientKeyExch by (pubK B) *) |
4c5d3b1ddc75
Client, Server certificates now sent using the separate Certificate rule,
paulson
parents:
3729
diff
changeset
|
175 |
val ClientKeyExch_tac = |
3772 | 176 |
forward_tac [Says_imp_spies RS parts.Inj RS certificate_valid] |
3515
d8a71f6eaf40
Now uses the Notes constructor to distinguish the Client (who has chosen M)
paulson
parents:
3506
diff
changeset
|
177 |
THEN' assume_tac |
d8a71f6eaf40
Now uses the Notes constructor to distinguish the Client (who has chosen M)
paulson
parents:
3506
diff
changeset
|
178 |
THEN' hyp_subst_tac; |
d8a71f6eaf40
Now uses the Notes constructor to distinguish the Client (who has chosen M)
paulson
parents:
3506
diff
changeset
|
179 |
|
d8a71f6eaf40
Now uses the Notes constructor to distinguish the Client (who has chosen M)
paulson
parents:
3506
diff
changeset
|
180 |
fun analz_induct_tac i = |
d8a71f6eaf40
Now uses the Notes constructor to distinguish the Client (who has chosen M)
paulson
parents:
3506
diff
changeset
|
181 |
etac tls.induct i THEN |
3745
4c5d3b1ddc75
Client, Server certificates now sent using the separate Certificate rule,
paulson
parents:
3729
diff
changeset
|
182 |
ClientKeyExch_tac (i+6) THEN (*ClientKeyExch*) |
3515
d8a71f6eaf40
Now uses the Notes constructor to distinguish the Client (who has chosen M)
paulson
parents:
3506
diff
changeset
|
183 |
ALLGOALS (asm_simp_tac |
4091 | 184 |
(simpset() addcongs [if_weak_cong] |
4831 | 185 |
addsimps (split_ifs@pushes))) THEN |
3515
d8a71f6eaf40
Now uses the Notes constructor to distinguish the Client (who has chosen M)
paulson
parents:
3506
diff
changeset
|
186 |
(*Remove instances of pubK B: the Spy already knows all public keys. |
d8a71f6eaf40
Now uses the Notes constructor to distinguish the Client (who has chosen M)
paulson
parents:
3506
diff
changeset
|
187 |
Combining the two simplifier calls makes them run extremely slowly.*) |
d8a71f6eaf40
Now uses the Notes constructor to distinguish the Client (who has chosen M)
paulson
parents:
3506
diff
changeset
|
188 |
ALLGOALS (asm_simp_tac |
4091 | 189 |
(simpset() addcongs [if_weak_cong] |
4686 | 190 |
addsimps [insert_absorb])); |
3515
d8a71f6eaf40
Now uses the Notes constructor to distinguish the Client (who has chosen M)
paulson
parents:
3506
diff
changeset
|
191 |
|
d8a71f6eaf40
Now uses the Notes constructor to distinguish the Client (who has chosen M)
paulson
parents:
3506
diff
changeset
|
192 |
|
3758
188a4fbfaf55
Exchanged the M and SID fields of the FINISHED messages to simplify proofs;
paulson
parents:
3745
diff
changeset
|
193 |
(*** Properties of items found in Notes ***) |
3515
d8a71f6eaf40
Now uses the Notes constructor to distinguish the Client (who has chosen M)
paulson
parents:
3506
diff
changeset
|
194 |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
195 |
Goal "[| Notes A {|Agent B, X|} : set evs; evs : tls |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
196 |
\ ==> Crypt (pubK B) X : parts (spies evs)"; |
3515
d8a71f6eaf40
Now uses the Notes constructor to distinguish the Client (who has chosen M)
paulson
parents:
3506
diff
changeset
|
197 |
by (etac rev_mp 1); |
d8a71f6eaf40
Now uses the Notes constructor to distinguish the Client (who has chosen M)
paulson
parents:
3506
diff
changeset
|
198 |
by (analz_induct_tac 1); |
4091 | 199 |
by (blast_tac (claset() addIs [parts_insertI]) 1); |
3683 | 200 |
qed "Notes_Crypt_parts_spies"; |
3515
d8a71f6eaf40
Now uses the Notes constructor to distinguish the Client (who has chosen M)
paulson
parents:
3506
diff
changeset
|
201 |
|
3758
188a4fbfaf55
Exchanged the M and SID fields of the FINISHED messages to simplify proofs;
paulson
parents:
3745
diff
changeset
|
202 |
(*C may be either A or B*) |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
203 |
Goal "[| Notes C {|s, Agent A, Agent B, Nonce(PRF(PMS,NA,NB))|} : set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
204 |
\ evs : tls \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
205 |
\ |] ==> Crypt (pubK B) (Nonce PMS) : parts (spies evs)"; |
3685
5b8c0c8f576e
Full version of TLS including session resumption, but no Oops
paulson
parents:
3683
diff
changeset
|
206 |
by (etac rev_mp 1); |
5b8c0c8f576e
Full version of TLS including session resumption, but no Oops
paulson
parents:
3683
diff
changeset
|
207 |
by (parts_induct_tac 1); |
3711 | 208 |
by (ALLGOALS Clarify_tac); |
3685
5b8c0c8f576e
Full version of TLS including session resumption, but no Oops
paulson
parents:
3683
diff
changeset
|
209 |
(*Fake*) |
4091 | 210 |
by (blast_tac (claset() addIs [parts_insertI]) 1); |
3685
5b8c0c8f576e
Full version of TLS including session resumption, but no Oops
paulson
parents:
3683
diff
changeset
|
211 |
(*Client, Server Accept*) |
4091 | 212 |
by (REPEAT (blast_tac (claset() addSEs spies_partsEs |
4422
21238c9d363e
Simplified proofs using rewrites for f``A where f is injective
paulson
parents:
4201
diff
changeset
|
213 |
addSDs [Notes_Crypt_parts_spies]) 1)); |
3685
5b8c0c8f576e
Full version of TLS including session resumption, but no Oops
paulson
parents:
3683
diff
changeset
|
214 |
qed "Notes_master_imp_Crypt_PMS"; |
5b8c0c8f576e
Full version of TLS including session resumption, but no Oops
paulson
parents:
3683
diff
changeset
|
215 |
|
5b8c0c8f576e
Full version of TLS including session resumption, but no Oops
paulson
parents:
3683
diff
changeset
|
216 |
(*Compared with the theorem above, both premise and conclusion are stronger*) |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
217 |
Goal "[| Notes A {|s, Agent A, Agent B, Nonce(PRF(PMS,NA,NB))|} : set evs;\ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
218 |
\ evs : tls \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
219 |
\ |] ==> Notes A {|Agent B, Nonce PMS|} : set evs"; |
3685
5b8c0c8f576e
Full version of TLS including session resumption, but no Oops
paulson
parents:
3683
diff
changeset
|
220 |
by (etac rev_mp 1); |
5b8c0c8f576e
Full version of TLS including session resumption, but no Oops
paulson
parents:
3683
diff
changeset
|
221 |
by (parts_induct_tac 1); |
5b8c0c8f576e
Full version of TLS including session resumption, but no Oops
paulson
parents:
3683
diff
changeset
|
222 |
(*ServerAccepts*) |
5b8c0c8f576e
Full version of TLS including session resumption, but no Oops
paulson
parents:
3683
diff
changeset
|
223 |
by (Fast_tac 1); (*Blast_tac's very slow here*) |
5b8c0c8f576e
Full version of TLS including session resumption, but no Oops
paulson
parents:
3683
diff
changeset
|
224 |
qed "Notes_master_imp_Notes_PMS"; |
5b8c0c8f576e
Full version of TLS including session resumption, but no Oops
paulson
parents:
3683
diff
changeset
|
225 |
|
5b8c0c8f576e
Full version of TLS including session resumption, but no Oops
paulson
parents:
3683
diff
changeset
|
226 |
|
5b8c0c8f576e
Full version of TLS including session resumption, but no Oops
paulson
parents:
3683
diff
changeset
|
227 |
(*** Protocol goal: if B receives CertVerify, then A sent it ***) |
3474 | 228 |
|
3745
4c5d3b1ddc75
Client, Server certificates now sent using the separate Certificate rule,
paulson
parents:
3729
diff
changeset
|
229 |
(*B can check A's signature if he has received A's certificate.*) |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
230 |
Goal "[| X : parts (spies evs); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
231 |
\ X = Crypt (priK A) (Hash{|nb, Agent B, pms|}); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
232 |
\ evs : tls; A ~: bad |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
233 |
\ ==> Says A B X : set evs"; |
3745
4c5d3b1ddc75
Client, Server certificates now sent using the separate Certificate rule,
paulson
parents:
3729
diff
changeset
|
234 |
by (etac rev_mp 1); |
3480
d59bbf053258
More realistic model: the Spy can compute clientK and serverK
paulson
parents:
3474
diff
changeset
|
235 |
by (hyp_subst_tac 1); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3515
diff
changeset
|
236 |
by (parts_induct_tac 1); |
3474 | 237 |
by (Fake_parts_insert_tac 1); |
3745
4c5d3b1ddc75
Client, Server certificates now sent using the separate Certificate rule,
paulson
parents:
3729
diff
changeset
|
238 |
val lemma = result(); |
4c5d3b1ddc75
Client, Server certificates now sent using the separate Certificate rule,
paulson
parents:
3729
diff
changeset
|
239 |
|
4c5d3b1ddc75
Client, Server certificates now sent using the separate Certificate rule,
paulson
parents:
3729
diff
changeset
|
240 |
(*Final version: B checks X using the distributed KA instead of priK A*) |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
241 |
Goal "[| X : parts (spies evs); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
242 |
\ X = Crypt (invKey KA) (Hash{|nb, Agent B, pms|}); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
243 |
\ certificate A KA : parts (spies evs); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
244 |
\ evs : tls; A ~: bad |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
245 |
\ ==> Says A B X : set evs"; |
4091 | 246 |
by (blast_tac (claset() addSDs [certificate_valid] addSIs [lemma]) 1); |
3745
4c5d3b1ddc75
Client, Server certificates now sent using the separate Certificate rule,
paulson
parents:
3729
diff
changeset
|
247 |
qed "TrustCertVerify"; |
3474 | 248 |
|
249 |
||
3685
5b8c0c8f576e
Full version of TLS including session resumption, but no Oops
paulson
parents:
3683
diff
changeset
|
250 |
(*If CertVerify is present then A has chosen PMS.*) |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
251 |
Goal "[| Crypt (priK A) (Hash{|nb, Agent B, Nonce PMS|}) \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
252 |
\ : parts (spies evs); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
253 |
\ evs : tls; A ~: bad |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
254 |
\ ==> Notes A {|Agent B, Nonce PMS|} : set evs"; |
4423 | 255 |
by (etac rev_mp 1); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3515
diff
changeset
|
256 |
by (parts_induct_tac 1); |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3515
diff
changeset
|
257 |
by (Fake_parts_insert_tac 1); |
3745
4c5d3b1ddc75
Client, Server certificates now sent using the separate Certificate rule,
paulson
parents:
3729
diff
changeset
|
258 |
val lemma = result(); |
4c5d3b1ddc75
Client, Server certificates now sent using the separate Certificate rule,
paulson
parents:
3729
diff
changeset
|
259 |
|
4c5d3b1ddc75
Client, Server certificates now sent using the separate Certificate rule,
paulson
parents:
3729
diff
changeset
|
260 |
(*Final version using the distributed KA instead of priK A*) |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
261 |
Goal "[| Crypt (invKey KA) (Hash{|nb, Agent B, Nonce PMS|}) \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
262 |
\ : parts (spies evs); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
263 |
\ certificate A KA : parts (spies evs); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
264 |
\ evs : tls; A ~: bad |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
265 |
\ ==> Notes A {|Agent B, Nonce PMS|} : set evs"; |
4091 | 266 |
by (blast_tac (claset() addSDs [certificate_valid] addSIs [lemma]) 1); |
3515
d8a71f6eaf40
Now uses the Notes constructor to distinguish the Client (who has chosen M)
paulson
parents:
3506
diff
changeset
|
267 |
qed "UseCertVerify"; |
3474 | 268 |
|
3480
d59bbf053258
More realistic model: the Spy can compute clientK and serverK
paulson
parents:
3474
diff
changeset
|
269 |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
270 |
Goal "evs : tls ==> Notes A {|Agent B, Nonce (PRF x)|} ~: set evs"; |
3672
56e4365a0c99
TLS now with a distinction between premaster secret and master secret
paulson
parents:
3519
diff
changeset
|
271 |
by (parts_induct_tac 1); |
3745
4c5d3b1ddc75
Client, Server certificates now sent using the separate Certificate rule,
paulson
parents:
3729
diff
changeset
|
272 |
(*ClientKeyExch: PMS is assumed to differ from any PRF.*) |
3672
56e4365a0c99
TLS now with a distinction between premaster secret and master secret
paulson
parents:
3519
diff
changeset
|
273 |
by (Blast_tac 1); |
56e4365a0c99
TLS now with a distinction between premaster secret and master secret
paulson
parents:
3519
diff
changeset
|
274 |
qed "no_Notes_A_PRF"; |
56e4365a0c99
TLS now with a distinction between premaster secret and master secret
paulson
parents:
3519
diff
changeset
|
275 |
Addsimps [no_Notes_A_PRF]; |
56e4365a0c99
TLS now with a distinction between premaster secret and master secret
paulson
parents:
3519
diff
changeset
|
276 |
|
56e4365a0c99
TLS now with a distinction between premaster secret and master secret
paulson
parents:
3519
diff
changeset
|
277 |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
278 |
Goal "[| Nonce (PRF (PMS,NA,NB)) : parts (spies evs); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
279 |
\ evs : tls |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
280 |
\ ==> Nonce PMS : parts (spies evs)"; |
3672
56e4365a0c99
TLS now with a distinction between premaster secret and master secret
paulson
parents:
3519
diff
changeset
|
281 |
by (etac rev_mp 1); |
56e4365a0c99
TLS now with a distinction between premaster secret and master secret
paulson
parents:
3519
diff
changeset
|
282 |
by (parts_induct_tac 1); |
56e4365a0c99
TLS now with a distinction between premaster secret and master secret
paulson
parents:
3519
diff
changeset
|
283 |
by (Fake_parts_insert_tac 1); |
3677
f2569416d18b
Now with the sessionK constant and new events ClientAccepts and ServerAccepts
paulson
parents:
3676
diff
changeset
|
284 |
(*Six others, all trivial or by freshness*) |
4091 | 285 |
by (REPEAT (blast_tac (claset() addSDs [Notes_Crypt_parts_spies] |
4201 | 286 |
addSEs spies_partsEs) 1)); |
3672
56e4365a0c99
TLS now with a distinction between premaster secret and master secret
paulson
parents:
3519
diff
changeset
|
287 |
qed "MS_imp_PMS"; |
56e4365a0c99
TLS now with a distinction between premaster secret and master secret
paulson
parents:
3519
diff
changeset
|
288 |
AddSDs [MS_imp_PMS]; |
56e4365a0c99
TLS now with a distinction between premaster secret and master secret
paulson
parents:
3519
diff
changeset
|
289 |
|
56e4365a0c99
TLS now with a distinction between premaster secret and master secret
paulson
parents:
3519
diff
changeset
|
290 |
|
3474 | 291 |
|
3672
56e4365a0c99
TLS now with a distinction between premaster secret and master secret
paulson
parents:
3519
diff
changeset
|
292 |
(*** Unicity results for PMS, the pre-master-secret ***) |
3515
d8a71f6eaf40
Now uses the Notes constructor to distinguish the Client (who has chosen M)
paulson
parents:
3506
diff
changeset
|
293 |
|
3672
56e4365a0c99
TLS now with a distinction between premaster secret and master secret
paulson
parents:
3519
diff
changeset
|
294 |
(*PMS determines B. Proof borrowed from NS_Public/unique_NA and from Yahalom*) |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
295 |
Goal "[| Nonce PMS ~: analz (spies evs); evs : tls |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
296 |
\ ==> EX B'. ALL B. \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
297 |
\ Crypt (pubK B) (Nonce PMS) : parts (spies evs) --> B=B'"; |
3515
d8a71f6eaf40
Now uses the Notes constructor to distinguish the Client (who has chosen M)
paulson
parents:
3506
diff
changeset
|
298 |
by (etac rev_mp 1); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3515
diff
changeset
|
299 |
by (parts_induct_tac 1); |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3515
diff
changeset
|
300 |
by (Fake_parts_insert_tac 1); |
3745
4c5d3b1ddc75
Client, Server certificates now sent using the separate Certificate rule,
paulson
parents:
3729
diff
changeset
|
301 |
(*ClientKeyExch*) |
4c5d3b1ddc75
Client, Server certificates now sent using the separate Certificate rule,
paulson
parents:
3729
diff
changeset
|
302 |
by (ClientKeyExch_tac 1); |
4091 | 303 |
by (asm_simp_tac (simpset() addsimps [all_conj_distrib]) 1); |
3672
56e4365a0c99
TLS now with a distinction between premaster secret and master secret
paulson
parents:
3519
diff
changeset
|
304 |
by (expand_case_tac "PMS = ?y" 1 THEN |
4091 | 305 |
blast_tac (claset() addSEs partsEs) 1); |
3515
d8a71f6eaf40
Now uses the Notes constructor to distinguish the Client (who has chosen M)
paulson
parents:
3506
diff
changeset
|
306 |
val lemma = result(); |
d8a71f6eaf40
Now uses the Notes constructor to distinguish the Client (who has chosen M)
paulson
parents:
3506
diff
changeset
|
307 |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
308 |
Goal "[| Crypt(pubK B) (Nonce PMS) : parts (spies evs); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
309 |
\ Crypt(pubK B') (Nonce PMS) : parts (spies evs); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
310 |
\ Nonce PMS ~: analz (spies evs); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
311 |
\ evs : tls |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
312 |
\ ==> B=B'"; |
3515
d8a71f6eaf40
Now uses the Notes constructor to distinguish the Client (who has chosen M)
paulson
parents:
3506
diff
changeset
|
313 |
by (prove_unique_tac lemma 1); |
3704 | 314 |
qed "Crypt_unique_PMS"; |
315 |
||
3515
d8a71f6eaf40
Now uses the Notes constructor to distinguish the Client (who has chosen M)
paulson
parents:
3506
diff
changeset
|
316 |
|
3685
5b8c0c8f576e
Full version of TLS including session resumption, but no Oops
paulson
parents:
3683
diff
changeset
|
317 |
(** It is frustrating that we need two versions of the unicity results. |
3704 | 318 |
But Notes A {|Agent B, Nonce PMS|} determines both A and B. Sometimes |
319 |
we have only the weaker assertion Crypt(pubK B) (Nonce PMS), which |
|
320 |
determines B alone, and only if PMS is secret. |
|
3685
5b8c0c8f576e
Full version of TLS including session resumption, but no Oops
paulson
parents:
3683
diff
changeset
|
321 |
**) |
3515
d8a71f6eaf40
Now uses the Notes constructor to distinguish the Client (who has chosen M)
paulson
parents:
3506
diff
changeset
|
322 |
|
3677
f2569416d18b
Now with the sessionK constant and new events ClientAccepts and ServerAccepts
paulson
parents:
3676
diff
changeset
|
323 |
(*In A's internal Note, PMS determines A and B.*) |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
324 |
Goal "evs : tls \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
325 |
\ ==> EX A' B'. ALL A B. \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
326 |
\ Notes A {|Agent B, Nonce PMS|} : set evs --> A=A' & B=B'"; |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3515
diff
changeset
|
327 |
by (parts_induct_tac 1); |
4091 | 328 |
by (asm_simp_tac (simpset() addsimps [all_conj_distrib]) 1); |
3745
4c5d3b1ddc75
Client, Server certificates now sent using the separate Certificate rule,
paulson
parents:
3729
diff
changeset
|
329 |
(*ClientKeyExch: if PMS is fresh, then it can't appear in Notes A X.*) |
3672
56e4365a0c99
TLS now with a distinction between premaster secret and master secret
paulson
parents:
3519
diff
changeset
|
330 |
by (expand_case_tac "PMS = ?y" 1 THEN |
4091 | 331 |
blast_tac (claset() addSDs [Notes_Crypt_parts_spies] addSEs partsEs) 1); |
3515
d8a71f6eaf40
Now uses the Notes constructor to distinguish the Client (who has chosen M)
paulson
parents:
3506
diff
changeset
|
332 |
val lemma = result(); |
d8a71f6eaf40
Now uses the Notes constructor to distinguish the Client (who has chosen M)
paulson
parents:
3506
diff
changeset
|
333 |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
334 |
Goal "[| Notes A {|Agent B, Nonce PMS|} : set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
335 |
\ Notes A' {|Agent B', Nonce PMS|} : set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
336 |
\ evs : tls |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
337 |
\ ==> A=A' & B=B'"; |
3515
d8a71f6eaf40
Now uses the Notes constructor to distinguish the Client (who has chosen M)
paulson
parents:
3506
diff
changeset
|
338 |
by (prove_unique_tac lemma 1); |
3672
56e4365a0c99
TLS now with a distinction between premaster secret and master secret
paulson
parents:
3519
diff
changeset
|
339 |
qed "Notes_unique_PMS"; |
3515
d8a71f6eaf40
Now uses the Notes constructor to distinguish the Client (who has chosen M)
paulson
parents:
3506
diff
changeset
|
340 |
|
d8a71f6eaf40
Now uses the Notes constructor to distinguish the Client (who has chosen M)
paulson
parents:
3506
diff
changeset
|
341 |
|
3474 | 342 |
|
3772 | 343 |
(**** Secrecy Theorems ****) |
344 |
||
345 |
(*Key compromise lemma needed to prove analz_image_keys. |
|
346 |
No collection of keys can help the spy get new private keys.*) |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
347 |
Goal "evs : tls ==> \ |
3772 | 348 |
\ ALL KK. (Key(priK B) : analz (Key``KK Un (spies evs))) = \ |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
349 |
\ (priK B : KK | B : bad)"; |
3772 | 350 |
by (etac tls.induct 1); |
351 |
by (ALLGOALS |
|
352 |
(asm_simp_tac (analz_image_keys_ss |
|
353 |
addsimps (certificate_def::keys_distinct)))); |
|
354 |
(*Fake*) |
|
4422
21238c9d363e
Simplified proofs using rewrites for f``A where f is injective
paulson
parents:
4201
diff
changeset
|
355 |
by (spy_analz_tac 1); |
3772 | 356 |
qed_spec_mp "analz_image_priK"; |
357 |
||
358 |
||
359 |
(*slightly speeds up the big simplification below*) |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
360 |
Goal "KK <= range sessionK ==> priK B ~: KK"; |
3772 | 361 |
by (Blast_tac 1); |
362 |
val range_sessionkeys_not_priK = result(); |
|
363 |
||
364 |
(*Lemma for the trivial direction of the if-and-only-if*) |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
365 |
Goal "(X : analz (G Un H)) --> (X : analz H) ==> \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
366 |
\ (X : analz (G Un H)) = (X : analz H)"; |
4091 | 367 |
by (blast_tac (claset() addIs [impOfSubs analz_mono]) 1); |
3961 | 368 |
val analz_image_keys_lemma = result(); |
3772 | 369 |
|
370 |
(** Strangely, the following version doesn't work: |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
371 |
\ ALL Z. (Nonce N : analz (Key``(sessionK``Z) Un (spies evs))) = \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
372 |
\ (Nonce N : analz (spies evs))"; |
3772 | 373 |
**) |
374 |
||
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
375 |
Goal "evs : tls ==> \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
376 |
\ ALL KK. KK <= range sessionK --> \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
377 |
\ (Nonce N : analz (Key``KK Un (spies evs))) = \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
378 |
\ (Nonce N : analz (spies evs))"; |
3772 | 379 |
by (etac tls.induct 1); |
380 |
by (ClientKeyExch_tac 7); |
|
381 |
by (REPEAT_FIRST (resolve_tac [allI, impI])); |
|
3961 | 382 |
by (REPEAT_FIRST (rtac analz_image_keys_lemma)); |
5076 | 383 |
by (ALLGOALS (*4.5 seconds*) |
3772 | 384 |
(asm_simp_tac (analz_image_keys_ss |
4831 | 385 |
addsimps (split_ifs@pushes) |
3772 | 386 |
addsimps [range_sessionkeys_not_priK, |
387 |
analz_image_priK, certificate_def]))); |
|
4091 | 388 |
by (ALLGOALS (asm_simp_tac (simpset() addsimps [insert_absorb]))); |
3772 | 389 |
(*Fake*) |
4422
21238c9d363e
Simplified proofs using rewrites for f``A where f is injective
paulson
parents:
4201
diff
changeset
|
390 |
by (spy_analz_tac 1); |
3772 | 391 |
qed_spec_mp "analz_image_keys"; |
392 |
||
393 |
(*Knowing some session keys is no help in getting new nonces*) |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
394 |
Goal "evs : tls ==> \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
395 |
\ Nonce N : analz (insert (Key (sessionK z)) (spies evs)) = \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
396 |
\ (Nonce N : analz (spies evs))"; |
3772 | 397 |
by (asm_simp_tac (analz_image_keys_ss addsimps [analz_image_keys]) 1); |
398 |
qed "analz_insert_key"; |
|
399 |
Addsimps [analz_insert_key]; |
|
400 |
||
401 |
||
402 |
(*** Protocol goal: serverK(Na,Nb,M) and clientK(Na,Nb,M) remain secure ***) |
|
403 |
||
404 |
(** Some lemmas about session keys, comprising clientK and serverK **) |
|
405 |
||
406 |
||
407 |
(*Lemma: session keys are never used if PMS is fresh. |
|
408 |
Nonces don't have to agree, allowing session resumption. |
|
409 |
Converse doesn't hold; revealing PMS doesn't force the keys to be sent. |
|
410 |
THEY ARE NOT SUITABLE AS SAFE ELIM RULES.*) |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
411 |
Goal "[| Nonce PMS ~: parts (spies evs); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
412 |
\ K = sessionK((Na, Nb, PRF(PMS,NA,NB)), b); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
413 |
\ evs : tls |] \ |
3772 | 414 |
\ ==> Key K ~: parts (spies evs) & (ALL Y. Crypt K Y ~: parts (spies evs))"; |
415 |
by (etac rev_mp 1); |
|
416 |
by (hyp_subst_tac 1); |
|
417 |
by (analz_induct_tac 1); |
|
418 |
(*SpyKeys*) |
|
4091 | 419 |
by (blast_tac (claset() addSEs spies_partsEs) 3); |
3772 | 420 |
(*Fake*) |
421 |
by (Fake_parts_insert_tac 2); |
|
422 |
(** LEVEL 6 **) |
|
423 |
(*Oops*) |
|
4091 | 424 |
by (fast_tac (claset() addSEs [MPair_parts] |
3772 | 425 |
addDs [Says_imp_spies RS parts.Inj] |
4091 | 426 |
addss (simpset())) 6); |
3772 | 427 |
by (REPEAT |
4091 | 428 |
(blast_tac (claset() addSDs [Notes_Crypt_parts_spies, |
4201 | 429 |
Notes_master_imp_Crypt_PMS] |
430 |
addSEs spies_partsEs) 1)); |
|
3772 | 431 |
val lemma = result(); |
432 |
||
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
433 |
Goal "[| Key (sessionK((Na, Nb, PRF(PMS,NA,NB)), b)) : parts (spies evs); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
434 |
\ evs : tls |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
435 |
\ ==> Nonce PMS : parts (spies evs)"; |
4091 | 436 |
by (blast_tac (claset() addDs [lemma]) 1); |
3772 | 437 |
qed "PMS_sessionK_not_spied"; |
438 |
||
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
439 |
Goal "[| Crypt (sessionK((Na, Nb, PRF(PMS,NA,NB)), b)) Y \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
440 |
\ : parts (spies evs); evs : tls |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
441 |
\ ==> Nonce PMS : parts (spies evs)"; |
4091 | 442 |
by (blast_tac (claset() addDs [lemma]) 1); |
3772 | 443 |
qed "PMS_Crypt_sessionK_not_spied"; |
444 |
||
445 |
(*Lemma: write keys are never sent if M (MASTER SECRET) is secure. |
|
446 |
Converse doesn't hold; betraying M doesn't force the keys to be sent! |
|
447 |
The strong Oops condition can be weakened later by unicity reasoning, |
|
448 |
with some effort.*) |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
449 |
Goal "[| ALL A. Says A Spy (Key (sessionK((NA,NB,M),b))) ~: set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
450 |
\ Nonce M ~: analz (spies evs); evs : tls |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
451 |
\ ==> Key (sessionK((NA,NB,M),b)) ~: parts (spies evs)"; |
3772 | 452 |
by (etac rev_mp 1); |
453 |
by (etac rev_mp 1); |
|
454 |
by (analz_induct_tac 1); (*17 seconds*) |
|
455 |
(*SpyKeys*) |
|
4091 | 456 |
by (blast_tac (claset() addDs [Says_imp_spies RS analz.Inj]) 3); |
3772 | 457 |
(*Fake*) |
458 |
by (spy_analz_tac 2); |
|
459 |
(*Base*) |
|
460 |
by (Blast_tac 1); |
|
461 |
qed "sessionK_not_spied"; |
|
462 |
Addsimps [sessionK_not_spied]; |
|
463 |
||
464 |
||
3745
4c5d3b1ddc75
Client, Server certificates now sent using the separate Certificate rule,
paulson
parents:
3729
diff
changeset
|
465 |
(*If A sends ClientKeyExch to an honest B, then the PMS will stay secret.*) |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
466 |
Goal "[| evs : tls; A ~: bad; B ~: bad |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
467 |
\ ==> Notes A {|Agent B, Nonce PMS|} : set evs --> \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
468 |
\ Nonce PMS ~: analz (spies evs)"; |
3745
4c5d3b1ddc75
Client, Server certificates now sent using the separate Certificate rule,
paulson
parents:
3729
diff
changeset
|
469 |
by (analz_induct_tac 1); (*11 seconds*) |
3677
f2569416d18b
Now with the sessionK constant and new events ClientAccepts and ServerAccepts
paulson
parents:
3676
diff
changeset
|
470 |
(*ClientAccepts and ServerAccepts: because PMS ~: range PRF*) |
4091 | 471 |
by (REPEAT (fast_tac (claset() addss (simpset())) 6)); |
3745
4c5d3b1ddc75
Client, Server certificates now sent using the separate Certificate rule,
paulson
parents:
3729
diff
changeset
|
472 |
(*ClientHello, ServerHello, ClientKeyExch, ServerResume: |
3687
fb7d096d7884
Simplified SpyKeys to use sessionK instead of clientK and serverK
paulson
parents:
3686
diff
changeset
|
473 |
mostly freshness reasoning*) |
4091 | 474 |
by (REPEAT (blast_tac (claset() addSEs partsEs |
4201 | 475 |
addDs [Notes_Crypt_parts_spies, |
476 |
impOfSubs analz_subset_parts, |
|
477 |
Says_imp_spies RS analz.Inj]) 3)); |
|
3677
f2569416d18b
Now with the sessionK constant and new events ClientAccepts and ServerAccepts
paulson
parents:
3676
diff
changeset
|
478 |
(*SpyKeys*) |
4091 | 479 |
by (fast_tac (claset() addss (simpset())) 2); |
3677
f2569416d18b
Now with the sessionK constant and new events ClientAccepts and ServerAccepts
paulson
parents:
3676
diff
changeset
|
480 |
(*Fake*) |
f2569416d18b
Now with the sessionK constant and new events ClientAccepts and ServerAccepts
paulson
parents:
3676
diff
changeset
|
481 |
by (spy_analz_tac 1); |
f2569416d18b
Now with the sessionK constant and new events ClientAccepts and ServerAccepts
paulson
parents:
3676
diff
changeset
|
482 |
bind_thm ("Spy_not_see_PMS", result() RSN (2, rev_mp)); |
f2569416d18b
Now with the sessionK constant and new events ClientAccepts and ServerAccepts
paulson
parents:
3676
diff
changeset
|
483 |
|
f2569416d18b
Now with the sessionK constant and new events ClientAccepts and ServerAccepts
paulson
parents:
3676
diff
changeset
|
484 |
|
3745
4c5d3b1ddc75
Client, Server certificates now sent using the separate Certificate rule,
paulson
parents:
3729
diff
changeset
|
485 |
(*If A sends ClientKeyExch to an honest B, then the MASTER SECRET |
3677
f2569416d18b
Now with the sessionK constant and new events ClientAccepts and ServerAccepts
paulson
parents:
3676
diff
changeset
|
486 |
will stay secret.*) |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
487 |
Goal "[| evs : tls; A ~: bad; B ~: bad |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
488 |
\ ==> Notes A {|Agent B, Nonce PMS|} : set evs --> \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
489 |
\ Nonce (PRF(PMS,NA,NB)) ~: analz (spies evs)"; |
3745
4c5d3b1ddc75
Client, Server certificates now sent using the separate Certificate rule,
paulson
parents:
3729
diff
changeset
|
490 |
by (analz_induct_tac 1); (*13 seconds*) |
3677
f2569416d18b
Now with the sessionK constant and new events ClientAccepts and ServerAccepts
paulson
parents:
3676
diff
changeset
|
491 |
(*ClientAccepts and ServerAccepts: because PMS was already visible*) |
4091 | 492 |
by (REPEAT (blast_tac (claset() addDs [Spy_not_see_PMS, |
4201 | 493 |
Says_imp_spies RS analz.Inj, |
494 |
Notes_imp_spies RS analz.Inj]) 6)); |
|
3677
f2569416d18b
Now with the sessionK constant and new events ClientAccepts and ServerAccepts
paulson
parents:
3676
diff
changeset
|
495 |
(*ClientHello*) |
f2569416d18b
Now with the sessionK constant and new events ClientAccepts and ServerAccepts
paulson
parents:
3676
diff
changeset
|
496 |
by (Blast_tac 3); |
f2569416d18b
Now with the sessionK constant and new events ClientAccepts and ServerAccepts
paulson
parents:
3676
diff
changeset
|
497 |
(*SpyKeys: by secrecy of the PMS, Spy cannot make the MS*) |
4091 | 498 |
by (blast_tac (claset() addSDs [Spy_not_see_PMS, |
4422
21238c9d363e
Simplified proofs using rewrites for f``A where f is injective
paulson
parents:
4201
diff
changeset
|
499 |
Says_imp_spies RS analz.Inj]) 2); |
3677
f2569416d18b
Now with the sessionK constant and new events ClientAccepts and ServerAccepts
paulson
parents:
3676
diff
changeset
|
500 |
(*Fake*) |
f2569416d18b
Now with the sessionK constant and new events ClientAccepts and ServerAccepts
paulson
parents:
3676
diff
changeset
|
501 |
by (spy_analz_tac 1); |
3745
4c5d3b1ddc75
Client, Server certificates now sent using the separate Certificate rule,
paulson
parents:
3729
diff
changeset
|
502 |
(*ServerHello and ClientKeyExch: mostly freshness reasoning*) |
4091 | 503 |
by (REPEAT (blast_tac (claset() addSEs partsEs |
4201 | 504 |
addDs [Notes_Crypt_parts_spies, |
505 |
impOfSubs analz_subset_parts, |
|
506 |
Says_imp_spies RS analz.Inj]) 1)); |
|
3677
f2569416d18b
Now with the sessionK constant and new events ClientAccepts and ServerAccepts
paulson
parents:
3676
diff
changeset
|
507 |
bind_thm ("Spy_not_see_MS", result() RSN (2, rev_mp)); |
f2569416d18b
Now with the sessionK constant and new events ClientAccepts and ServerAccepts
paulson
parents:
3676
diff
changeset
|
508 |
|
f2569416d18b
Now with the sessionK constant and new events ClientAccepts and ServerAccepts
paulson
parents:
3676
diff
changeset
|
509 |
|
3704 | 510 |
(*** Weakening the Oops conditions for leakage of clientK ***) |
511 |
||
512 |
(*If A created PMS then nobody other than the Spy would send a message |
|
513 |
using a clientK generated from that PMS.*) |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
514 |
Goal "[| evs : tls; A' ~= Spy |] \ |
3704 | 515 |
\ ==> Notes A {|Agent B, Nonce PMS|} : set evs --> \ |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
516 |
\ Says A' B' (Crypt (clientK(Na,Nb,PRF(PMS,NA,NB))) Y) : set evs --> \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
517 |
\ A = A'"; |
3745
4c5d3b1ddc75
Client, Server certificates now sent using the separate Certificate rule,
paulson
parents:
3729
diff
changeset
|
518 |
by (analz_induct_tac 1); (*8 seconds*) |
3711 | 519 |
by (ALLGOALS Clarify_tac); |
3704 | 520 |
(*ClientFinished, ClientResume: by unicity of PMS*) |
521 |
by (REPEAT |
|
4091 | 522 |
(blast_tac (claset() addSDs [Notes_master_imp_Notes_PMS] |
4201 | 523 |
addIs [Notes_unique_PMS RS conjunct1]) 2)); |
3745
4c5d3b1ddc75
Client, Server certificates now sent using the separate Certificate rule,
paulson
parents:
3729
diff
changeset
|
524 |
(*ClientKeyExch*) |
4472 | 525 |
by (blast_tac (claset() addSDs [PMS_Crypt_sessionK_not_spied, |
526 |
Says_imp_spies RS parts.Inj]) 1); |
|
3704 | 527 |
bind_thm ("Says_clientK_unique", |
528 |
result() RSN(2,rev_mp) RSN(2,rev_mp)); |
|
529 |
||
530 |
||
531 |
(*If A created PMS and has not leaked her clientK to the Spy, |
|
532 |
then nobody has.*) |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
533 |
Goal "evs : tls \ |
3704 | 534 |
\ ==> Says A Spy (Key(clientK(Na,Nb,PRF(PMS,NA,NB)))) ~: set evs --> \ |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
535 |
\ Notes A {|Agent B, Nonce PMS|} : set evs --> \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
536 |
\ (ALL A. Says A Spy (Key(clientK(Na,Nb,PRF(PMS,NA,NB)))) ~: set evs) "; |
3704 | 537 |
by (etac tls.induct 1); |
538 |
(*This roundabout proof sequence avoids looping in simplification*) |
|
539 |
by (ALLGOALS Simp_tac); |
|
3711 | 540 |
by (ALLGOALS Clarify_tac); |
3704 | 541 |
by (Fake_parts_insert_tac 1); |
542 |
by (ALLGOALS Asm_simp_tac); |
|
543 |
(*Oops*) |
|
4091 | 544 |
by (blast_tac (claset() addIs [Says_clientK_unique]) 2); |
3745
4c5d3b1ddc75
Client, Server certificates now sent using the separate Certificate rule,
paulson
parents:
3729
diff
changeset
|
545 |
(*ClientKeyExch*) |
4472 | 546 |
by (blast_tac (claset() addSDs [PMS_sessionK_not_spied] |
547 |
addSEs spies_partsEs) 1); |
|
3704 | 548 |
qed_spec_mp "clientK_Oops_ALL"; |
549 |
||
550 |
||
551 |
||
552 |
(*** Weakening the Oops conditions for leakage of serverK ***) |
|
553 |
||
554 |
(*If A created PMS for B, then nobody other than B or the Spy would |
|
555 |
send a message using a serverK generated from that PMS.*) |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
556 |
Goal "[| evs : tls; A ~: bad; B ~: bad; B' ~= Spy |] \ |
3704 | 557 |
\ ==> Notes A {|Agent B, Nonce PMS|} : set evs --> \ |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
558 |
\ Says B' A' (Crypt (serverK(Na,Nb,PRF(PMS,NA,NB))) Y) : set evs --> \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
559 |
\ B = B'"; |
3745
4c5d3b1ddc75
Client, Server certificates now sent using the separate Certificate rule,
paulson
parents:
3729
diff
changeset
|
560 |
by (analz_induct_tac 1); (*9 seconds*) |
3711 | 561 |
by (ALLGOALS Clarify_tac); |
3704 | 562 |
(*ServerResume, ServerFinished: by unicity of PMS*) |
563 |
by (REPEAT |
|
4091 | 564 |
(blast_tac (claset() addSEs [MPair_parts] |
4201 | 565 |
addSDs [Notes_master_imp_Crypt_PMS, |
566 |
Says_imp_spies RS parts.Inj] |
|
567 |
addDs [Spy_not_see_PMS, |
|
568 |
Notes_Crypt_parts_spies, |
|
569 |
Crypt_unique_PMS]) 2)); |
|
3745
4c5d3b1ddc75
Client, Server certificates now sent using the separate Certificate rule,
paulson
parents:
3729
diff
changeset
|
570 |
(*ClientKeyExch*) |
4472 | 571 |
by (blast_tac (claset() addSDs [PMS_Crypt_sessionK_not_spied, |
572 |
Says_imp_spies RS parts.Inj]) 1); |
|
3704 | 573 |
bind_thm ("Says_serverK_unique", |
574 |
result() RSN(2,rev_mp) RSN(2,rev_mp)); |
|
575 |
||
576 |
(*If A created PMS for B, and B has not leaked his serverK to the Spy, |
|
577 |
then nobody has.*) |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
578 |
Goal "[| evs : tls; A ~: bad; B ~: bad |] \ |
3704 | 579 |
\ ==> Says B Spy (Key(serverK(Na,Nb,PRF(PMS,NA,NB)))) ~: set evs --> \ |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
580 |
\ Notes A {|Agent B, Nonce PMS|} : set evs --> \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
581 |
\ (ALL A. Says A Spy (Key(serverK(Na,Nb,PRF(PMS,NA,NB)))) ~: set evs) "; |
3704 | 582 |
by (etac tls.induct 1); |
583 |
(*This roundabout proof sequence avoids looping in simplification*) |
|
584 |
by (ALLGOALS Simp_tac); |
|
3711 | 585 |
by (ALLGOALS Clarify_tac); |
3704 | 586 |
by (Fake_parts_insert_tac 1); |
587 |
by (ALLGOALS Asm_simp_tac); |
|
588 |
(*Oops*) |
|
4091 | 589 |
by (blast_tac (claset() addIs [Says_serverK_unique]) 2); |
3745
4c5d3b1ddc75
Client, Server certificates now sent using the separate Certificate rule,
paulson
parents:
3729
diff
changeset
|
590 |
(*ClientKeyExch*) |
4472 | 591 |
by (blast_tac (claset() addSDs [PMS_sessionK_not_spied] |
592 |
addSEs spies_partsEs) 1); |
|
3704 | 593 |
qed_spec_mp "serverK_Oops_ALL"; |
594 |
||
595 |
||
596 |
||
3685
5b8c0c8f576e
Full version of TLS including session resumption, but no Oops
paulson
parents:
3683
diff
changeset
|
597 |
(*** Protocol goals: if A receives ServerFinished, then B is present |
3729
6be7cf5086ab
Renamed XA, XB to PA, PB and removed the certificate from Client Verify
paulson
parents:
3711
diff
changeset
|
598 |
and has used the quoted values PA, PB, etc. Note that it is up to A |
6be7cf5086ab
Renamed XA, XB to PA, PB and removed the certificate from Client Verify
paulson
parents:
3711
diff
changeset
|
599 |
to compare PA with what she originally sent. |
3474 | 600 |
***) |
601 |
||
3685
5b8c0c8f576e
Full version of TLS including session resumption, but no Oops
paulson
parents:
3683
diff
changeset
|
602 |
(*The mention of her name (A) in X assures A that B knows who she is.*) |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
603 |
Goal "[| X = Crypt (serverK(Na,Nb,M)) \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
604 |
\ (Hash{|Number SID, Nonce M, \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
605 |
\ Nonce Na, Number PA, Agent A, \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
606 |
\ Nonce Nb, Number PB, Agent B|}); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
607 |
\ M = PRF(PMS,NA,NB); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
608 |
\ evs : tls; A ~: bad; B ~: bad |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
609 |
\ ==> (ALL A. Says A Spy (Key(serverK(Na,Nb,M))) ~: set evs) --> \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
610 |
\ Notes A {|Agent B, Nonce PMS|} : set evs --> \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
611 |
\ X : parts (spies evs) --> Says B A X : set evs"; |
3480
d59bbf053258
More realistic model: the Spy can compute clientK and serverK
paulson
parents:
3474
diff
changeset
|
612 |
by (hyp_subst_tac 1); |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
613 |
by (analz_induct_tac 1); (*10 seconds*) |
4091 | 614 |
by (ALLGOALS (asm_simp_tac (simpset() addsimps [all_conj_distrib]))); |
3711 | 615 |
by (ALLGOALS Clarify_tac); |
4472 | 616 |
(*ClientKeyExch*) |
617 |
by (blast_tac (claset() addSDs [PMS_Crypt_sessionK_not_spied]) 2); |
|
3480
d59bbf053258
More realistic model: the Spy can compute clientK and serverK
paulson
parents:
3474
diff
changeset
|
618 |
(*Fake: the Spy doesn't have the critical session key!*) |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
619 |
by (subgoal_tac "Key (serverK(Na,Nb,PRF(PMS,NA,NB))) ~: analz(spies evs)" 1); |
4091 | 620 |
by (asm_simp_tac (simpset() addsimps [Spy_not_see_MS, |
4422
21238c9d363e
Simplified proofs using rewrites for f``A where f is injective
paulson
parents:
4201
diff
changeset
|
621 |
not_parts_not_analz]) 2); |
3474 | 622 |
by (Fake_parts_insert_tac 1); |
3772 | 623 |
val lemma = normalize_thm [RSmp] (result()); |
3704 | 624 |
|
625 |
(*Final version*) |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
626 |
Goal "[| X = Crypt (serverK(Na,Nb,M)) \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
627 |
\ (Hash{|Number SID, Nonce M, \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
628 |
\ Nonce Na, Number PA, Agent A, \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
629 |
\ Nonce Nb, Number PB, Agent B|}); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
630 |
\ M = PRF(PMS,NA,NB); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
631 |
\ X : parts (spies evs); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
632 |
\ Notes A {|Agent B, Nonce PMS|} : set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
633 |
\ Says B Spy (Key (serverK(Na,Nb,M))) ~: set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
634 |
\ evs : tls; A ~: bad; B ~: bad |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
635 |
\ ==> Says B A X : set evs"; |
4091 | 636 |
by (blast_tac (claset() addIs [lemma] |
4201 | 637 |
addEs [serverK_Oops_ALL RSN(2, rev_notE)]) 1); |
3474 | 638 |
qed_spec_mp "TrustServerFinished"; |
639 |
||
640 |
||
3704 | 641 |
|
3685
5b8c0c8f576e
Full version of TLS including session resumption, but no Oops
paulson
parents:
3683
diff
changeset
|
642 |
(*This version refers not to ServerFinished but to any message from B. |
5b8c0c8f576e
Full version of TLS including session resumption, but no Oops
paulson
parents:
3683
diff
changeset
|
643 |
We don't assume B has received CertVerify, and an intruder could |
3515
d8a71f6eaf40
Now uses the Notes constructor to distinguish the Client (who has chosen M)
paulson
parents:
3506
diff
changeset
|
644 |
have changed A's identity in all other messages, so we can't be sure |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3515
diff
changeset
|
645 |
that B sends his message to A. If CLIENT KEY EXCHANGE were augmented |
3704 | 646 |
to bind A's identity with PMS, then we could replace A' by A below.*) |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
647 |
Goal "[| M = PRF(PMS,NA,NB); evs : tls; A ~: bad; B ~: bad |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
648 |
\ ==> (ALL A. Says A Spy (Key(serverK(Na,Nb,M))) ~: set evs) --> \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
649 |
\ Notes A {|Agent B, Nonce PMS|} : set evs --> \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
650 |
\ Crypt (serverK(Na,Nb,M)) Y : parts (spies evs) --> \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
651 |
\ (EX A'. Says B A' (Crypt (serverK(Na,Nb,M)) Y) : set evs)"; |
3672
56e4365a0c99
TLS now with a distinction between premaster secret and master secret
paulson
parents:
3519
diff
changeset
|
652 |
by (hyp_subst_tac 1); |
3686
4b484805b4c4
First working version with Oops event for session keys
paulson
parents:
3685
diff
changeset
|
653 |
by (analz_induct_tac 1); (*20 seconds*) |
4091 | 654 |
by (ALLGOALS (asm_simp_tac (simpset() addsimps [ex_disj_distrib]))); |
3711 | 655 |
by (ALLGOALS Clarify_tac); |
3704 | 656 |
(*ServerResume, ServerFinished: by unicity of PMS*) |
657 |
by (REPEAT |
|
4091 | 658 |
(blast_tac (claset() addSEs [MPair_parts] |
4201 | 659 |
addSDs [Notes_master_imp_Crypt_PMS, |
660 |
Says_imp_spies RS parts.Inj] |
|
661 |
addDs [Spy_not_see_PMS, |
|
662 |
Notes_Crypt_parts_spies, |
|
663 |
Crypt_unique_PMS]) 3)); |
|
3745
4c5d3b1ddc75
Client, Server certificates now sent using the separate Certificate rule,
paulson
parents:
3729
diff
changeset
|
664 |
(*ClientKeyExch*) |
4472 | 665 |
by (blast_tac (claset() addSDs [PMS_Crypt_sessionK_not_spied]) 2); |
3515
d8a71f6eaf40
Now uses the Notes constructor to distinguish the Client (who has chosen M)
paulson
parents:
3506
diff
changeset
|
666 |
(*Fake: the Spy doesn't have the critical session key!*) |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
667 |
by (subgoal_tac "Key (serverK(Na,Nb,PRF(PMS,NA,NB))) ~: analz(spies evs)" 1); |
4091 | 668 |
by (asm_simp_tac (simpset() addsimps [Spy_not_see_MS, |
4201 | 669 |
not_parts_not_analz]) 2); |
3515
d8a71f6eaf40
Now uses the Notes constructor to distinguish the Client (who has chosen M)
paulson
parents:
3506
diff
changeset
|
670 |
by (Fake_parts_insert_tac 1); |
3772 | 671 |
val lemma = normalize_thm [RSmp] (result()); |
3704 | 672 |
|
673 |
(*Final version*) |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
674 |
Goal "[| M = PRF(PMS,NA,NB); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
675 |
\ Crypt (serverK(Na,Nb,M)) Y : parts (spies evs); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
676 |
\ Notes A {|Agent B, Nonce PMS|} : set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
677 |
\ Says B Spy (Key (serverK(Na,Nb,M))) ~: set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
678 |
\ evs : tls; A ~: bad; B ~: bad |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
679 |
\ ==> EX A'. Says B A' (Crypt (serverK(Na,Nb,M)) Y) : set evs"; |
4091 | 680 |
by (blast_tac (claset() addIs [lemma] |
4422
21238c9d363e
Simplified proofs using rewrites for f``A where f is injective
paulson
parents:
4201
diff
changeset
|
681 |
addEs [serverK_Oops_ALL RSN(2, rev_notE)]) 1); |
3515
d8a71f6eaf40
Now uses the Notes constructor to distinguish the Client (who has chosen M)
paulson
parents:
3506
diff
changeset
|
682 |
qed_spec_mp "TrustServerMsg"; |
d8a71f6eaf40
Now uses the Notes constructor to distinguish the Client (who has chosen M)
paulson
parents:
3506
diff
changeset
|
683 |
|
d8a71f6eaf40
Now uses the Notes constructor to distinguish the Client (who has chosen M)
paulson
parents:
3506
diff
changeset
|
684 |
|
3704 | 685 |
|
3515
d8a71f6eaf40
Now uses the Notes constructor to distinguish the Client (who has chosen M)
paulson
parents:
3506
diff
changeset
|
686 |
(*** Protocol goal: if B receives any message encrypted with clientK |
3672
56e4365a0c99
TLS now with a distinction between premaster secret and master secret
paulson
parents:
3519
diff
changeset
|
687 |
then A has sent it, ASSUMING that A chose PMS. Authentication is |
3515
d8a71f6eaf40
Now uses the Notes constructor to distinguish the Client (who has chosen M)
paulson
parents:
3506
diff
changeset
|
688 |
assumed here; B cannot verify it. But if the message is |
3729
6be7cf5086ab
Renamed XA, XB to PA, PB and removed the certificate from Client Verify
paulson
parents:
3711
diff
changeset
|
689 |
ClientFinished, then B can then check the quoted values PA, PB, etc. |
3506 | 690 |
***) |
3704 | 691 |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
692 |
Goal "[| M = PRF(PMS,NA,NB); evs : tls; A ~: bad; B ~: bad |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
693 |
\ ==> (ALL A. Says A Spy (Key(clientK(Na,Nb,M))) ~: set evs) --> \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
694 |
\ Notes A {|Agent B, Nonce PMS|} : set evs --> \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
695 |
\ Crypt (clientK(Na,Nb,M)) Y : parts (spies evs) --> \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
696 |
\ Says A B (Crypt (clientK(Na,Nb,M)) Y) : set evs"; |
3772 | 697 |
by (hyp_subst_tac 1); |
3745
4c5d3b1ddc75
Client, Server certificates now sent using the separate Certificate rule,
paulson
parents:
3729
diff
changeset
|
698 |
by (analz_induct_tac 1); (*15 seconds*) |
3711 | 699 |
by (ALLGOALS Clarify_tac); |
3704 | 700 |
(*ClientFinished, ClientResume: by unicity of PMS*) |
4091 | 701 |
by (REPEAT (blast_tac (claset() delrules [conjI] |
4201 | 702 |
addSDs [Notes_master_imp_Notes_PMS] |
703 |
addDs [Notes_unique_PMS]) 3)); |
|
4472 | 704 |
(*ClientKeyExch*) |
705 |
by (blast_tac (claset() addSDs [PMS_Crypt_sessionK_not_spied]) 2); |
|
3480
d59bbf053258
More realistic model: the Spy can compute clientK and serverK
paulson
parents:
3474
diff
changeset
|
706 |
(*Fake: the Spy doesn't have the critical session key!*) |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
707 |
by (subgoal_tac "Key (clientK(Na,Nb,PRF(PMS,NA,NB))) ~: analz(spies evs)" 1); |
4091 | 708 |
by (asm_simp_tac (simpset() addsimps [Spy_not_see_MS, |
4422
21238c9d363e
Simplified proofs using rewrites for f``A where f is injective
paulson
parents:
4201
diff
changeset
|
709 |
not_parts_not_analz]) 2); |
3474 | 710 |
by (Fake_parts_insert_tac 1); |
3772 | 711 |
val lemma = normalize_thm [RSmp] (result()); |
3704 | 712 |
|
713 |
(*Final version*) |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
714 |
Goal "[| M = PRF(PMS,NA,NB); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
715 |
\ Crypt (clientK(Na,Nb,M)) Y : parts (spies evs); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
716 |
\ Notes A {|Agent B, Nonce PMS|} : set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
717 |
\ Says A Spy (Key(clientK(Na,Nb,M))) ~: set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
718 |
\ evs : tls; A ~: bad; B ~: bad |] \ |
3772 | 719 |
\ ==> Says A B (Crypt (clientK(Na,Nb,M)) Y) : set evs"; |
4091 | 720 |
by (blast_tac (claset() addIs [lemma] |
4201 | 721 |
addEs [clientK_Oops_ALL RSN(2, rev_notE)]) 1); |
3772 | 722 |
qed "TrustClientMsg"; |
3506 | 723 |
|
724 |
||
3685
5b8c0c8f576e
Full version of TLS including session resumption, but no Oops
paulson
parents:
3683
diff
changeset
|
725 |
|
5b8c0c8f576e
Full version of TLS including session resumption, but no Oops
paulson
parents:
3683
diff
changeset
|
726 |
(*** Protocol goal: if B receives ClientFinished, and if B is able to |
5b8c0c8f576e
Full version of TLS including session resumption, but no Oops
paulson
parents:
3683
diff
changeset
|
727 |
check a CertVerify from A, then A has used the quoted |
3729
6be7cf5086ab
Renamed XA, XB to PA, PB and removed the certificate from Client Verify
paulson
parents:
3711
diff
changeset
|
728 |
values PA, PB, etc. Even this one requires A to be uncompromised. |
3506 | 729 |
***) |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
730 |
Goal "[| M = PRF(PMS,NA,NB); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
731 |
\ Says A Spy (Key(clientK(Na,Nb,M))) ~: set evs;\ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
732 |
\ Says A' B (Crypt (clientK(Na,Nb,M)) Y) : set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
733 |
\ certificate A KA : parts (spies evs); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
734 |
\ Says A'' B (Crypt (invKey KA) (Hash{|nb, Agent B, Nonce PMS|}))\ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
735 |
\ : set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
736 |
\ evs : tls; A ~: bad; B ~: bad |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
737 |
\ ==> Says A B (Crypt (clientK(Na,Nb,M)) Y) : set evs"; |
4091 | 738 |
by (blast_tac (claset() addSIs [TrustClientMsg, UseCertVerify] |
4201 | 739 |
addDs [Says_imp_spies RS parts.Inj]) 1); |
3515
d8a71f6eaf40
Now uses the Notes constructor to distinguish the Client (who has chosen M)
paulson
parents:
3506
diff
changeset
|
740 |
qed "AuthClientFinished"; |
3687
fb7d096d7884
Simplified SpyKeys to use sessionK instead of clientK and serverK
paulson
parents:
3686
diff
changeset
|
741 |
|
fb7d096d7884
Simplified SpyKeys to use sessionK instead of clientK and serverK
paulson
parents:
3686
diff
changeset
|
742 |
(*22/9/97: loads in 622s, which is 10 minutes 22 seconds*) |
3711 | 743 |
(*24/9/97: loads in 672s, which is 11 minutes 12 seconds [stronger theorems]*) |
3745
4c5d3b1ddc75
Client, Server certificates now sent using the separate Certificate rule,
paulson
parents:
3729
diff
changeset
|
744 |
(*29/9/97: loads in 481s, after removing Certificate from ClientKeyExch*) |
3758
188a4fbfaf55
Exchanged the M and SID fields of the FINISHED messages to simplify proofs;
paulson
parents:
3745
diff
changeset
|
745 |
(*30/9/97: loads in 476s, after removing unused theorems*) |
3760
77f71f650433
Strengthened the possibility property for resumption so that it could have
paulson
parents:
3758
diff
changeset
|
746 |
(*30/9/97: loads in 448s, after fixing ServerResume*) |