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