author | paulson |
Fri, 31 Jul 1998 10:48:42 +0200 | |
changeset 5223 | 4cb05273f764 |
parent 5114 | c729d4c299c1 |
child 5421 | 01fc8d6a40f2 |
permissions | -rw-r--r-- |
2274 | 1 |
(* Title: HOL/Auth/WooLam |
2 |
ID: $Id$ |
|
3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
|
4 |
Copyright 1996 University of Cambridge |
|
5 |
||
6 |
Inductive relation "woolam" for the Woo-Lam protocol. |
|
7 |
||
8 |
Simplified version from page 11 of |
|
9 |
Abadi and Needham. Prudent Engineering Practice for Cryptographic Protocols. |
|
10 |
IEEE Trans. S.E. 22(1), 1996, pages 6-15. |
|
11 |
*) |
|
12 |
||
4470 | 13 |
AddEs spies_partsEs; |
14 |
AddDs [impOfSubs analz_subset_parts]; |
|
15 |
AddDs [impOfSubs Fake_parts_insert]; |
|
16 |
||
2274 | 17 |
|
2321 | 18 |
(*A "possibility property": there are traces that reach the end*) |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
19 |
Goal "[| A ~= B; A ~= Server; B ~= Server |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
20 |
\ ==> EX NB. EX evs: woolam. \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
21 |
\ Says Server B (Crypt (shrK B) {|Agent A, Nonce NB|}) : set evs"; |
2274 | 22 |
by (REPEAT (resolve_tac [exI,bexI] 1)); |
23 |
by (rtac (woolam.Nil RS woolam.WL1 RS woolam.WL2 RS woolam.WL3 RS |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
24 |
woolam.WL4 RS woolam.WL5) 2); |
3471
cd37ec057028
Now the possibility proof calls the appropriate tactic
paulson
parents:
3466
diff
changeset
|
25 |
by possibility_tac; |
2274 | 26 |
result(); |
27 |
||
28 |
||
29 |
(**** Inductive proofs about woolam ****) |
|
30 |
||
31 |
(*Nobody sends themselves messages*) |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
32 |
Goal "evs : woolam ==> ALL A X. Says A A X ~: set evs"; |
2274 | 33 |
by (etac woolam.induct 1); |
4477
b3e5857d8d99
New Auto_tac (by Oheimb), and new syntax (without parens), and expandshort
paulson
parents:
4470
diff
changeset
|
34 |
by Auto_tac; |
2274 | 35 |
qed_spec_mp "not_Says_to_self"; |
36 |
Addsimps [not_Says_to_self]; |
|
37 |
AddSEs [not_Says_to_self RSN (2, rev_notE)]; |
|
38 |
||
39 |
||
40 |
(** For reasoning about the encrypted portion of messages **) |
|
41 |
||
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
42 |
Goal "Says A' B X : set evs ==> X : analz (spies evs)"; |
3683 | 43 |
by (etac (Says_imp_spies RS analz.Inj) 1); |
44 |
qed "WL4_analz_spies"; |
|
2274 | 45 |
|
3683 | 46 |
bind_thm ("WL4_parts_spies", |
47 |
WL4_analz_spies RS (impOfSubs analz_subset_parts)); |
|
2274 | 48 |
|
3683 | 49 |
(*For proving the easier theorems about X ~: parts (spies evs) *) |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3471
diff
changeset
|
50 |
fun parts_induct_tac i = |
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3471
diff
changeset
|
51 |
etac woolam.induct i THEN |
3683 | 52 |
forward_tac [WL4_parts_spies] (i+5) THEN |
3471
cd37ec057028
Now the possibility proof calls the appropriate tactic
paulson
parents:
3466
diff
changeset
|
53 |
prove_simple_subgoals_tac 1; |
2274 | 54 |
|
55 |
||
3683 | 56 |
(** Theorems of the form X ~: parts (spies evs) imply that NOBODY |
2274 | 57 |
sends messages containing X! **) |
58 |
||
3683 | 59 |
(*Spy never sees another agent's shared key! (unless it's bad at start)*) |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
60 |
Goal "evs : woolam ==> (Key (shrK A) : parts (spies evs)) = (A : bad)"; |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3471
diff
changeset
|
61 |
by (parts_induct_tac 1); |
4470 | 62 |
by (Blast_tac 1); |
2274 | 63 |
qed "Spy_see_shrK"; |
64 |
Addsimps [Spy_see_shrK]; |
|
65 |
||
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
66 |
Goal "evs : woolam ==> (Key (shrK A) : analz (spies evs)) = (A : bad)"; |
4477
b3e5857d8d99
New Auto_tac (by Oheimb), and new syntax (without parens), and expandshort
paulson
parents:
4470
diff
changeset
|
67 |
by Auto_tac; |
2274 | 68 |
qed "Spy_analz_shrK"; |
69 |
Addsimps [Spy_analz_shrK]; |
|
70 |
||
4470 | 71 |
AddSDs [Spy_see_shrK RSN (2, rev_iffD1), |
72 |
Spy_analz_shrK RSN (2, rev_iffD1)]; |
|
2274 | 73 |
|
74 |
||
75 |
(**** Autheticity properties for Woo-Lam ****) |
|
76 |
||
77 |
||
78 |
(*** WL4 ***) |
|
79 |
||
80 |
(*If the encrypted message appears then it originated with Alice*) |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
81 |
Goal "[| Crypt (shrK A) (Nonce NB) : parts (spies evs); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
82 |
\ A ~: bad; evs : woolam |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
83 |
\ ==> EX B. Says A B (Crypt (shrK A) (Nonce NB)) : set evs"; |
4470 | 84 |
by (etac rev_mp 1); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3471
diff
changeset
|
85 |
by (parts_induct_tac 1); |
4470 | 86 |
by (ALLGOALS Blast_tac); |
87 |
qed "NB_Crypt_imp_Alice_msg"; |
|
2274 | 88 |
|
89 |
(*Guarantee for Server: if it gets a message containing a certificate from |
|
90 |
Alice, then she originated that certificate. But we DO NOT know that B |
|
91 |
ever saw it: the Spy may have rerouted the message to the Server.*) |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
92 |
Goal "[| Says B' Server {|Agent A, Agent B, Crypt (shrK A) (Nonce NB)|} \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
93 |
\ : set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
94 |
\ A ~: bad; evs : woolam |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
95 |
\ ==> EX B. Says A B (Crypt (shrK A) (Nonce NB)) : set evs"; |
4470 | 96 |
by (blast_tac (claset() addSIs [NB_Crypt_imp_Alice_msg]) 1); |
2321 | 97 |
qed "Server_trusts_WL4"; |
2274 | 98 |
|
4470 | 99 |
AddDs [Server_trusts_WL4]; |
100 |
||
2274 | 101 |
|
102 |
(*** WL5 ***) |
|
103 |
||
104 |
(*Server sent WL5 only if it received the right sort of message*) |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
105 |
Goal "[| Says Server B (Crypt (shrK B) {|Agent A, NB|}) : set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
106 |
\ evs : woolam |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
107 |
\ ==> EX B'. Says B' Server {|Agent A, Agent B, Crypt (shrK A) NB|} \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
108 |
\ : set evs"; |
4470 | 109 |
by (etac rev_mp 1); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3471
diff
changeset
|
110 |
by (parts_induct_tac 1); |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
111 |
by (ALLGOALS Blast_tac); |
4470 | 112 |
qed "Server_sent_WL5"; |
2274 | 113 |
|
4470 | 114 |
AddDs [Server_sent_WL5]; |
2274 | 115 |
|
116 |
(*If the encrypted message appears then it originated with the Server!*) |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
117 |
Goal "[| Crypt (shrK B) {|Agent A, NB|} : parts (spies evs); \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
118 |
\ B ~: bad; evs : woolam |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
119 |
\ ==> Says Server B (Crypt (shrK B) {|Agent A, NB|}) : set evs"; |
4470 | 120 |
by (etac rev_mp 1); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3471
diff
changeset
|
121 |
by (parts_induct_tac 1); |
4470 | 122 |
by (Blast_tac 1); |
2274 | 123 |
qed_spec_mp "NB_Crypt_imp_Server_msg"; |
124 |
||
125 |
(*Guarantee for B. If B gets the Server's certificate then A has encrypted |
|
126 |
the nonce using her key. This event can be no older than the nonce itself. |
|
127 |
But A may have sent the nonce to some other agent and it could have reached |
|
128 |
the Server via the Spy.*) |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
129 |
Goal "[| Says S B (Crypt (shrK B) {|Agent A, Nonce NB|}): set evs; \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
130 |
\ A ~: bad; B ~: bad; evs : woolam |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
131 |
\ ==> EX B. Says A B (Crypt (shrK A) (Nonce NB)) : set evs"; |
4470 | 132 |
by (blast_tac (claset() addSDs [NB_Crypt_imp_Server_msg]) 1); |
2321 | 133 |
qed "B_trusts_WL5"; |
2274 | 134 |
|
135 |
||
4470 | 136 |
(*B only issues challenges in response to WL1. Not used.*) |
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
137 |
Goal "[| Says B A (Nonce NB) : set evs; B ~= Spy; evs : woolam |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
138 |
\ ==> EX A'. Says A' B (Agent A) : set evs"; |
4470 | 139 |
by (etac rev_mp 1); |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3471
diff
changeset
|
140 |
by (parts_induct_tac 1); |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2637
diff
changeset
|
141 |
by (ALLGOALS Blast_tac); |
4470 | 142 |
qed "B_said_WL2"; |
2274 | 143 |
|
144 |
||
145 |
(**CANNOT be proved because A doesn't know where challenges come from... |
|
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
146 |
Goal "[| A ~: bad; B ~= Spy; evs : woolam |] \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
147 |
\ ==> Crypt (shrK A) (Nonce NB) : parts (spies evs) & \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
148 |
\ Says B A (Nonce NB) : set evs \ |
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
149 |
\ --> Says A B (Crypt (shrK A) (Nonce NB)) : set evs"; |
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3471
diff
changeset
|
150 |
by (parts_induct_tac 1); |
4470 | 151 |
by (Blast_tac 1); |
3730 | 152 |
by Safe_tac; |
2274 | 153 |
**) |