| author | wenzelm | 
| Fri, 15 Sep 2006 22:56:17 +0200 | |
| changeset 20549 | c643984eb94b | 
| parent 18886 | 9f27383426db | 
| child 20768 | 1d478c2d621f | 
| permissions | -rw-r--r-- | 
| 6452 | 1 | (* Title: HOL/Auth/KerberosIV | 
| 2 | ID: $Id$ | |
| 3 | Author: Giampaolo Bella, Cambridge University Computer Laboratory | |
| 4 | Copyright 1998 University of Cambridge | |
| 5 | *) | |
| 6 | ||
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 7 | header{*The Kerberos Protocol, Version IV*}
 | 
| 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 8 | |
| 16417 | 9 | theory KerberosIV imports Public begin | 
| 6452 | 10 | |
| 18886 | 11 | text{*The "u" prefix indicates theorems referring to an updated version of the protocol. The "r" suffix indicates theorems where the confidentiality assumptions are relaxed by the corresponding arguments.*}
 | 
| 12 | ||
| 6452 | 13 | syntax | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 14 | Kas :: agent | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 15 |   Tgs :: agent  --{*the two servers are translations...*}
 | 
| 6452 | 16 | |
| 17 | ||
| 18 | translations | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 19 | "Kas" == "Server " | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 20 | "Tgs" == "Friend 0" | 
| 6452 | 21 | |
| 22 | ||
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 23 | axioms | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 24 | Tgs_not_bad [iff]: "Tgs \<notin> bad" | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 25 |    --{*Tgs is secure --- we already know that Kas is secure*}
 | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 26 | |
| 18886 | 27 | (*The current time is the length of the trace*) | 
| 6452 | 28 | syntax | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 29 | CT :: "event list=>nat" | 
| 6452 | 30 | |
| 18886 | 31 | expiredAK :: "[nat, event list] => bool" | 
| 6452 | 32 | |
| 18886 | 33 | expiredSK :: "[nat, event list] => bool" | 
| 6452 | 34 | |
| 18886 | 35 | expiredA :: "[nat, event list] => bool" | 
| 6452 | 36 | |
| 18886 | 37 |     valid :: "[nat, nat] => bool" ("valid _ wrt _")
 | 
| 6452 | 38 | |
| 39 | ||
| 40 | constdefs | |
| 18886 | 41 | (* authKeys are those contained in an authTicket *) | 
| 42 | authKeys :: "event list => key set" | |
| 43 |     "authKeys evs == {authK. \<exists>A Peer Ta. Says Kas A
 | |
| 44 | (Crypt (shrK A) \<lbrace>Key authK, Agent Peer, Number Ta, | |
| 45 | (Crypt (shrK Peer) \<lbrace>Agent A, Agent Peer, Key authK, Number Ta\<rbrace>) | |
| 46 | \<rbrace>) \<in> set evs}" | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 47 | |
| 6452 | 48 | (* A is the true creator of X if she has sent X and X never appeared on | 
| 49 | the trace before this event. Recall that traces grow from head. *) | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 50 | Issues :: "[agent, agent, msg, event list] => bool" | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 51 |              ("_ Issues _ with _ on _")
 | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 52 | "A Issues B with X on evs == | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 53 |       \<exists>Y. Says A B Y \<in> set evs & X \<in> parts {Y} &
 | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 54 | X \<notin> parts (spies (takeWhile (% z. z \<noteq> Says A B Y) (rev evs)))" | 
| 6452 | 55 | |
| 18886 | 56 | (* Yields the subtrace of a given trace from its beginning to a given event *) | 
| 57 |   before :: "[event, event list] => event list" ("before _ on _")
 | |
| 58 | "before ev on evs == takeWhile (% z. z ~= ev) (rev evs)" | |
| 59 | ||
| 60 | (* States than an event really appears only once on a trace *) | |
| 61 |   Unique :: "[event, event list] => bool" ("Unique _ on _")
 | |
| 62 | "Unique ev on evs == | |
| 63 | ev \<notin> set (tl (dropWhile (% z. z \<noteq> ev) evs))" | |
| 64 | ||
| 6452 | 65 | |
| 66 | consts | |
| 67 | (*Duration of the authentication key*) | |
| 18886 | 68 | authKlife :: nat | 
| 6452 | 69 | |
| 70 | (*Duration of the service key*) | |
| 18886 | 71 | servKlife :: nat | 
| 6452 | 72 | |
| 73 | (*Duration of an authenticator*) | |
| 18886 | 74 | authlife :: nat | 
| 6452 | 75 | |
| 76 | (*Upper bound on the time of reaction of a server*) | |
| 18886 | 77 | replylife :: nat | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 78 | |
| 18886 | 79 | specification (authKlife) | 
| 80 | authKlife_LB [iff]: "2 \<le> authKlife" | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 81 | by blast | 
| 6452 | 82 | |
| 18886 | 83 | specification (servKlife) | 
| 84 | servKlife_LB [iff]: "2 + authKlife \<le> servKlife" | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 85 | by blast | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 86 | |
| 18886 | 87 | specification (authlife) | 
| 88 | authlife_LB [iff]: "Suc 0 \<le> authlife" | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 89 | by blast | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 90 | |
| 18886 | 91 | specification (replylife) | 
| 92 | replylife_LB [iff]: "Suc 0 \<le> replylife" | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 93 | by blast | 
| 6452 | 94 | |
| 95 | translations | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 96 | "CT" == "length " | 
| 6452 | 97 | |
| 18886 | 98 | "expiredAK Ta evs" == "authKlife + Ta < CT evs" | 
| 6452 | 99 | |
| 18886 | 100 | "expiredSK Ts evs" == "servKlife + Ts < CT evs" | 
| 6452 | 101 | |
| 18886 | 102 | "expiredA T evs" == "authlife + T < CT evs" | 
| 6452 | 103 | |
| 18886 | 104 | "valid T1 wrt T2" == "T1 <= replylife + T2" | 
| 6452 | 105 | |
| 106 | (*---------------------------------------------------------------------*) | |
| 107 | ||
| 108 | ||
| 18886 | 109 | (* Predicate formalising the association between authKeys and servKeys *) | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 110 | constdefs | 
| 18886 | 111 | AKcryptSK :: "[key, key, event list] => bool" | 
| 112 | "AKcryptSK authK servK evs == | |
| 113 | \<exists>A B Ts. | |
| 114 | Says Tgs A (Crypt authK | |
| 115 | \<lbrace>Key servK, Agent B, Number Ts, | |
| 116 | Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace> \<rbrace>) | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 117 | \<in> set evs" | 
| 6452 | 118 | |
| 119 | consts | |
| 120 | ||
| 18886 | 121 | kerbIV :: "event list set" | 
| 122 | inductive "kerbIV" | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 123 | intros | 
| 6452 | 124 | |
| 18886 | 125 | Nil: "[] \<in> kerbIV" | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 126 | |
| 18886 | 127 | Fake: "\<lbrakk> evsf \<in> kerbIV; X \<in> synth (analz (spies evsf)) \<rbrakk> | 
| 128 | \<Longrightarrow> Says Spy B X # evsf \<in> kerbIV" | |
| 6452 | 129 | |
| 130 | (* FROM the initiator *) | |
| 18886 | 131 | K1: "\<lbrakk> evs1 \<in> kerbIV \<rbrakk> | 
| 132 | \<Longrightarrow> Says A Kas \<lbrace>Agent A, Agent Tgs, Number (CT evs1)\<rbrace> # evs1 | |
| 133 | \<in> kerbIV" | |
| 6452 | 134 | |
| 135 | (* Adding the timestamp serves to A in K3 to check that | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 136 | she doesn't get a reply too late. This kind of timeouts are ordinary. | 
| 6452 | 137 | If a server's reply is late, then it is likely to be fake. *) | 
| 138 | ||
| 139 | (*---------------------------------------------------------------------*) | |
| 140 | ||
| 141 | (*FROM Kas *) | |
| 18886 | 142 | K2: "\<lbrakk> evs2 \<in> kerbIV; Key authK \<notin> used evs2; authK \<in> symKeys; | 
| 143 | Says A' Kas \<lbrace>Agent A, Agent Tgs, Number T1\<rbrace> \<in> set evs2 \<rbrakk> | |
| 144 | \<Longrightarrow> Says Kas A | |
| 145 | (Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number (CT evs2), | |
| 146 | (Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, | |
| 147 | Number (CT evs2)\<rbrace>)\<rbrace>) # evs2 \<in> kerbIV" | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 148 | (* | 
| 18886 | 149 | The internal encryption builds the authTicket. | 
| 6452 | 150 | The timestamp doesn't change inside the two encryptions: the external copy | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 151 | will be used by the initiator in K3; the one inside the | 
| 18886 | 152 | authTicket by Tgs in K4. | 
| 6452 | 153 | *) | 
| 154 | ||
| 155 | (*---------------------------------------------------------------------*) | |
| 156 | ||
| 157 | (* FROM the initiator *) | |
| 18886 | 158 | K3: "\<lbrakk> evs3 \<in> kerbIV; | 
| 159 | Says A Kas \<lbrace>Agent A, Agent Tgs, Number T1\<rbrace> \<in> set evs3; | |
| 160 | Says Kas' A (Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta, | |
| 161 | authTicket\<rbrace>) \<in> set evs3; | |
| 162 | valid Ta wrt T1 | |
| 163 | \<rbrakk> | |
| 164 | \<Longrightarrow> Says A Tgs \<lbrace>authTicket, | |
| 165 | (Crypt authK \<lbrace>Agent A, Number (CT evs3)\<rbrace>), | |
| 166 | Agent B\<rbrace> # evs3 \<in> kerbIV" | |
| 167 | (*The two events amongst the premises allow A to accept only those authKeys | |
| 6452 | 168 | that are not issued late. *) | 
| 169 | ||
| 170 | (*---------------------------------------------------------------------*) | |
| 171 | ||
| 172 | (* FROM Tgs *) | |
| 173 | (* Note that the last temporal check is not mentioned in the original MIT | |
| 18886 | 174 | specification. Adding it makes many goals "available" to the peers. | 
| 175 | Theorems that exploit it have the suffix `_u', which stands for updated | |
| 176 | protocol. | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 177 | *) | 
| 18886 | 178 | K4: "\<lbrakk> evs4 \<in> kerbIV; Key servK \<notin> used evs4; servK \<in> symKeys; | 
| 179 | B \<noteq> Tgs; authK \<in> symKeys; | |
| 180 | Says A' Tgs \<lbrace> | |
| 181 | (Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, | |
| 182 | Number Ta\<rbrace>), | |
| 183 | (Crypt authK \<lbrace>Agent A, Number T2\<rbrace>), Agent B\<rbrace> | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 184 | \<in> set evs4; | 
| 18886 | 185 | \<not> expiredAK Ta evs4; | 
| 186 | \<not> expiredA T2 evs4; | |
| 187 | servKlife + (CT evs4) <= authKlife + Ta | |
| 188 | \<rbrakk> | |
| 189 | \<Longrightarrow> Says Tgs A | |
| 190 | (Crypt authK \<lbrace>Key servK, Agent B, Number (CT evs4), | |
| 191 | Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, | |
| 192 | Number (CT evs4)\<rbrace> \<rbrace>) | |
| 193 | # evs4 \<in> kerbIV" | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 194 | (* Tgs creates a new session key per each request for a service, without | 
| 6452 | 195 | checking if there is still a fresh one for that service. | 
| 18886 | 196 | The cipher under Tgs' key is the authTicket, the cipher under B's key | 
| 197 | is the servTicket, which is built now. | |
| 6452 | 198 | NOTE that the last temporal check is not present in the MIT specification. | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 199 | |
| 6452 | 200 | *) | 
| 201 | ||
| 202 | (*---------------------------------------------------------------------*) | |
| 203 | ||
| 204 | (* FROM the initiator *) | |
| 18886 | 205 | K5: "\<lbrakk> evs5 \<in> kerbIV; authK \<in> symKeys; servK \<in> symKeys; | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 206 | Says A Tgs | 
| 18886 | 207 | \<lbrace>authTicket, Crypt authK \<lbrace>Agent A, Number T2\<rbrace>, | 
| 208 | Agent B\<rbrace> | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 209 | \<in> set evs5; | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 210 | Says Tgs' A | 
| 18886 | 211 | (Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace>) | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 212 | \<in> set evs5; | 
| 18886 | 213 | valid Ts wrt T2 \<rbrakk> | 
| 214 | \<Longrightarrow> Says A B \<lbrace>servTicket, | |
| 215 | Crypt servK \<lbrace>Agent A, Number (CT evs5)\<rbrace> \<rbrace> | |
| 216 | # evs5 \<in> kerbIV" | |
| 6452 | 217 | (* Checks similar to those in K3. *) | 
| 218 | ||
| 219 | (*---------------------------------------------------------------------*) | |
| 220 | ||
| 221 | (* FROM the responder*) | |
| 18886 | 222 | K6: "\<lbrakk> evs6 \<in> kerbIV; | 
| 223 | Says A' B \<lbrace> | |
| 224 | (Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace>), | |
| 225 | (Crypt servK \<lbrace>Agent A, Number T3\<rbrace>)\<rbrace> | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 226 | \<in> set evs6; | 
| 18886 | 227 | \<not> expiredSK Ts evs6; | 
| 228 | \<not> expiredA T3 evs6 | |
| 229 | \<rbrakk> | |
| 230 | \<Longrightarrow> Says B A (Crypt servK (Number T3)) | |
| 231 | # evs6 \<in> kerbIV" | |
| 6452 | 232 | (* Checks similar to those in K4. *) | 
| 233 | ||
| 234 | (*---------------------------------------------------------------------*) | |
| 235 | ||
| 18886 | 236 | (* Leaking an authK... *) | 
| 237 | Oops1: "\<lbrakk> evsO1 \<in> kerbIV; A \<noteq> Spy; | |
| 6452 | 238 | Says Kas A | 
| 18886 | 239 | (Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta, | 
| 240 | authTicket\<rbrace>) \<in> set evsO1; | |
| 241 | expiredAK Ta evsO1 \<rbrakk> | |
| 242 | \<Longrightarrow> Says A Spy \<lbrace>Agent A, Agent Tgs, Number Ta, Key authK\<rbrace> | |
| 243 | # evsO1 \<in> kerbIV" | |
| 6452 | 244 | |
| 245 | (*---------------------------------------------------------------------*) | |
| 246 | ||
| 18886 | 247 | (*Leaking a servK... *) | 
| 248 | Oops2: "\<lbrakk> evsO2 \<in> kerbIV; A \<noteq> Spy; | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 249 | Says Tgs A | 
| 18886 | 250 | (Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace>) | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 251 | \<in> set evsO2; | 
| 18886 | 252 | expiredSK Ts evsO2 \<rbrakk> | 
| 253 | \<Longrightarrow> Says A Spy \<lbrace>Agent A, Agent B, Number Ts, Key servK\<rbrace> | |
| 254 | # evsO2 \<in> kerbIV" | |
| 6452 | 255 | |
| 256 | (*---------------------------------------------------------------------*) | |
| 257 | ||
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 258 | declare Says_imp_knows_Spy [THEN parts.Inj, dest] | 
| 14200 
d8598e24f8fa
Removal of the Key_supply axiom (affects many possbility proofs) and minor
 paulson parents: 
14182diff
changeset | 259 | declare parts.Body [dest] | 
| 
d8598e24f8fa
Removal of the Key_supply axiom (affects many possbility proofs) and minor
 paulson parents: 
14182diff
changeset | 260 | declare analz_into_parts [dest] | 
| 
d8598e24f8fa
Removal of the Key_supply axiom (affects many possbility proofs) and minor
 paulson parents: 
14182diff
changeset | 261 | declare Fake_parts_insert_in_Un [dest] | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 262 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 263 | |
| 18886 | 264 | subsection{*Lemmas about lists, for reasoning about  Issues*}
 | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 265 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 266 | lemma spies_Says_rev: "spies (evs @ [Says A B X]) = insert X (spies evs)" | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 267 | apply (induct_tac "evs") | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 268 | apply (induct_tac [2] "a", auto) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 269 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 270 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 271 | lemma spies_Gets_rev: "spies (evs @ [Gets A X]) = spies evs" | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 272 | apply (induct_tac "evs") | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 273 | apply (induct_tac [2] "a", auto) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 274 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 275 | |
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 276 | lemma spies_Notes_rev: "spies (evs @ [Notes A X]) = | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 277 | (if A:bad then insert X (spies evs) else spies evs)" | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 278 | apply (induct_tac "evs") | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 279 | apply (induct_tac [2] "a", auto) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 280 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 281 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 282 | lemma spies_evs_rev: "spies evs = spies (rev evs)" | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 283 | apply (induct_tac "evs") | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 284 | apply (induct_tac [2] "a") | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 285 | apply (simp_all (no_asm_simp) add: spies_Says_rev spies_Gets_rev spies_Notes_rev) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 286 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 287 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 288 | lemmas parts_spies_evs_revD2 = spies_evs_rev [THEN equalityD2, THEN parts_mono] | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 289 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 290 | lemma spies_takeWhile: "spies (takeWhile P evs) <= spies evs" | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 291 | apply (induct_tac "evs") | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 292 | apply (induct_tac [2] "a", auto) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 293 | txt{* Resembles @{text"used_subset_append"} in theory Event.*}
 | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 294 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 295 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 296 | lemmas parts_spies_takeWhile_mono = spies_takeWhile [THEN parts_mono] | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 297 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 298 | |
| 18886 | 299 | subsection{*Lemmas about @{term authKeys}*}
 | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 300 | |
| 18886 | 301 | lemma authKeys_empty: "authKeys [] = {}"
 | 
| 302 | apply (unfold authKeys_def) | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 303 | apply (simp (no_asm)) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 304 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 305 | |
| 18886 | 306 | lemma authKeys_not_insert: | 
| 307 | "(\<forall>A Ta akey Peer. | |
| 308 | ev \<noteq> Says Kas A (Crypt (shrK A) \<lbrace>akey, Agent Peer, Ta, | |
| 309 | (Crypt (shrK Peer) \<lbrace>Agent A, Agent Peer, akey, Ta\<rbrace>)\<rbrace>)) | |
| 310 | \<Longrightarrow> authKeys (ev # evs) = authKeys evs" | |
| 311 | by (unfold authKeys_def, auto) | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 312 | |
| 18886 | 313 | lemma authKeys_insert: | 
| 314 | "authKeys | |
| 315 | (Says Kas A (Crypt (shrK A) \<lbrace>Key K, Agent Peer, Number Ta, | |
| 316 | (Crypt (shrK Peer) \<lbrace>Agent A, Agent Peer, Key K, Number Ta\<rbrace>)\<rbrace>) # evs) | |
| 317 | = insert K (authKeys evs)" | |
| 318 | by (unfold authKeys_def, auto) | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 319 | |
| 18886 | 320 | lemma authKeys_simp: | 
| 321 | "K \<in> authKeys | |
| 322 | (Says Kas A (Crypt (shrK A) \<lbrace>Key K', Agent Peer, Number Ta, | |
| 323 | (Crypt (shrK Peer) \<lbrace>Agent A, Agent Peer, Key K', Number Ta\<rbrace>)\<rbrace>) # evs) | |
| 324 | \<Longrightarrow> K = K' | K \<in> authKeys evs" | |
| 325 | by (unfold authKeys_def, auto) | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 326 | |
| 18886 | 327 | lemma authKeysI: | 
| 328 | "Says Kas A (Crypt (shrK A) \<lbrace>Key K, Agent Tgs, Number Ta, | |
| 329 | (Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key K, Number Ta\<rbrace>)\<rbrace>) \<in> set evs | |
| 330 | \<Longrightarrow> K \<in> authKeys evs" | |
| 331 | by (unfold authKeys_def, auto) | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 332 | |
| 18886 | 333 | lemma authKeys_used: "K \<in> authKeys evs \<Longrightarrow> Key K \<in> used evs" | 
| 334 | by (simp add: authKeys_def, blast) | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 335 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 336 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 337 | subsection{*Forwarding Lemmas*}
 | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 338 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 339 | text{*--For reasoning about the encrypted portion of message K3--*}
 | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 340 | lemma K3_msg_in_parts_spies: | 
| 18886 | 341 | "Says Kas' A (Crypt KeyA \<lbrace>authK, Peer, Ta, authTicket\<rbrace>) | 
| 342 | \<in> set evs \<Longrightarrow> authTicket \<in> parts (spies evs)" | |
| 343 | apply blast | |
| 344 | done | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 345 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 346 | lemma Oops_range_spies1: | 
| 18886 | 347 | "\<lbrakk> Says Kas A (Crypt KeyA \<lbrace>Key authK, Peer, Ta, authTicket\<rbrace>) | 
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 348 | \<in> set evs ; | 
| 18886 | 349 | evs \<in> kerbIV \<rbrakk> \<Longrightarrow> authK \<notin> range shrK & authK \<in> symKeys" | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 350 | apply (erule rev_mp) | 
| 18886 | 351 | apply (erule kerbIV.induct, auto) | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 352 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 353 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 354 | text{*--For reasoning about the encrypted portion of message K5--*}
 | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 355 | lemma K5_msg_in_parts_spies: | 
| 18886 | 356 | "Says Tgs' A (Crypt authK \<lbrace>servK, Agent B, Ts, servTicket\<rbrace>) | 
| 357 | \<in> set evs \<Longrightarrow> servTicket \<in> parts (spies evs)" | |
| 358 | apply blast | |
| 359 | done | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 360 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 361 | lemma Oops_range_spies2: | 
| 18886 | 362 | "\<lbrakk> Says Tgs A (Crypt authK \<lbrace>Key servK, Agent B, Ts, servTicket\<rbrace>) | 
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 363 | \<in> set evs ; | 
| 18886 | 364 | evs \<in> kerbIV \<rbrakk> \<Longrightarrow> servK \<notin> range shrK & servK \<in> symKeys" | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 365 | apply (erule rev_mp) | 
| 18886 | 366 | apply (erule kerbIV.induct, auto) | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 367 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 368 | |
| 18886 | 369 | lemma Says_ticket_parts: | 
| 370 | "Says S A (Crypt K \<lbrace>SesKey, B, TimeStamp, Ticket\<rbrace>) \<in> set evs | |
| 371 | \<Longrightarrow> Ticket \<in> parts (spies evs)" | |
| 372 | apply blast | |
| 373 | done | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 374 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 375 | (*Spy never sees another agent's shared key! (unless it's lost at start)*) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 376 | lemma Spy_see_shrK [simp]: | 
| 18886 | 377 | "evs \<in> kerbIV \<Longrightarrow> (Key (shrK A) \<in> parts (spies evs)) = (A \<in> bad)" | 
| 378 | apply (erule kerbIV.induct) | |
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 379 | apply (frule_tac [7] K5_msg_in_parts_spies) | 
| 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 380 | apply (frule_tac [5] K3_msg_in_parts_spies, simp_all) | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 381 | apply (blast+) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 382 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 383 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 384 | lemma Spy_analz_shrK [simp]: | 
| 18886 | 385 | "evs \<in> kerbIV \<Longrightarrow> (Key (shrK A) \<in> analz (spies evs)) = (A \<in> bad)" | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 386 | by auto | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 387 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 388 | lemma Spy_see_shrK_D [dest!]: | 
| 18886 | 389 | "\<lbrakk> Key (shrK A) \<in> parts (spies evs); evs \<in> kerbIV \<rbrakk> \<Longrightarrow> A:bad" | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 390 | by (blast dest: Spy_see_shrK) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 391 | lemmas Spy_analz_shrK_D = analz_subset_parts [THEN subsetD, THEN Spy_see_shrK_D, dest!] | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 392 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 393 | text{*Nobody can have used non-existent keys!*}
 | 
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 394 | lemma new_keys_not_used [simp]: | 
| 18886 | 395 | "\<lbrakk>Key K \<notin> used evs; K \<in> symKeys; evs \<in> kerbIV\<rbrakk> | 
| 396 | \<Longrightarrow> K \<notin> keysFor (parts (spies evs))" | |
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 397 | apply (erule rev_mp) | 
| 18886 | 398 | apply (erule kerbIV.induct) | 
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 399 | apply (frule_tac [7] K5_msg_in_parts_spies) | 
| 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 400 | apply (frule_tac [5] K3_msg_in_parts_spies, simp_all) | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 401 | txt{*Fake*}
 | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 402 | apply (force dest!: keysFor_parts_insert) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 403 | txt{*Others*}
 | 
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 404 | apply (force dest!: analz_shrK_Decrypt)+ | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 405 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 406 | |
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 407 | (*Earlier, all protocol proofs declared this theorem. | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 408 | But few of them actually need it! (Another is Yahalom) *) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 409 | lemma new_keys_not_analzd: | 
| 18886 | 410 | "\<lbrakk>evs \<in> kerbIV; K \<in> symKeys; Key K \<notin> used evs\<rbrakk> | 
| 411 | \<Longrightarrow> K \<notin> keysFor (analz (spies evs))" | |
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 412 | by (blast dest: new_keys_not_used intro: keysFor_mono [THEN subsetD]) | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 413 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 414 | |
| 18886 | 415 | |
| 416 | subsection{*Lemmas for reasoning about predicate "before"*}
 | |
| 417 | ||
| 418 | lemma used_Says_rev: "used (evs @ [Says A B X]) = parts {X} \<union> (used evs)";
 | |
| 419 | apply (induct_tac "evs") | |
| 420 | apply simp | |
| 421 | apply (induct_tac "a") | |
| 422 | apply auto | |
| 423 | done | |
| 424 | ||
| 425 | lemma used_Notes_rev: "used (evs @ [Notes A X]) = parts {X} \<union> (used evs)";
 | |
| 426 | apply (induct_tac "evs") | |
| 427 | apply simp | |
| 428 | apply (induct_tac "a") | |
| 429 | apply auto | |
| 430 | done | |
| 431 | ||
| 432 | lemma used_Gets_rev: "used (evs @ [Gets B X]) = used evs"; | |
| 433 | apply (induct_tac "evs") | |
| 434 | apply simp | |
| 435 | apply (induct_tac "a") | |
| 436 | apply auto | |
| 437 | done | |
| 438 | ||
| 439 | lemma used_evs_rev: "used evs = used (rev evs)" | |
| 440 | apply (induct_tac "evs") | |
| 441 | apply simp | |
| 442 | apply (induct_tac "a") | |
| 443 | apply (simp add: used_Says_rev) | |
| 444 | apply (simp add: used_Gets_rev) | |
| 445 | apply (simp add: used_Notes_rev) | |
| 446 | done | |
| 447 | ||
| 448 | lemma used_takeWhile_used [rule_format]: | |
| 449 | "x : used (takeWhile P X) --> x : used X" | |
| 450 | apply (induct_tac "X") | |
| 451 | apply simp | |
| 452 | apply (induct_tac "a") | |
| 453 | apply (simp_all add: used_Nil) | |
| 454 | apply (blast dest!: initState_into_used)+ | |
| 455 | done | |
| 456 | ||
| 457 | lemma set_evs_rev: "set evs = set (rev evs)" | |
| 458 | apply auto | |
| 459 | done | |
| 460 | ||
| 461 | lemma takeWhile_void [rule_format]: | |
| 462 | "x \<notin> set evs \<longrightarrow> takeWhile (\<lambda>z. z \<noteq> x) evs = evs" | |
| 463 | apply auto | |
| 464 | done | |
| 465 | ||
| 466 | ||
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 467 | subsection{*Regularity Lemmas*}
 | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 468 | text{*These concern the form of items passed in messages*}
 | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 469 | |
| 18886 | 470 | text{*Describes the form of all components sent by Kas*}
 | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 471 | lemma Says_Kas_message_form: | 
| 18886 | 472 | "\<lbrakk> Says Kas A (Crypt K \<lbrace>Key authK, Agent Peer, Number Ta, authTicket\<rbrace>) | 
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 473 | \<in> set evs; | 
| 18886 | 474 | evs \<in> kerbIV \<rbrakk> \<Longrightarrow> | 
| 475 | K = shrK A & Peer = Tgs & | |
| 476 | authK \<notin> range shrK & authK \<in> authKeys evs & authK \<in> symKeys & | |
| 477 | authTicket = (Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Number Ta\<rbrace>) & | |
| 478 | Key authK \<notin> used(before | |
| 479 | Says Kas A (Crypt K \<lbrace>Key authK, Agent Peer, Number Ta, authTicket\<rbrace>) | |
| 480 | on evs) & | |
| 481 | Ta = CT (before | |
| 482 | Says Kas A (Crypt K \<lbrace>Key authK, Agent Peer, Number Ta, authTicket\<rbrace>) | |
| 483 | on evs)" | |
| 484 | apply (unfold before_def) | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 485 | apply (erule rev_mp) | 
| 18886 | 486 | apply (erule kerbIV.induct) | 
| 487 | apply (simp_all (no_asm) add: authKeys_def authKeys_insert, blast, blast) | |
| 488 | txt{*K2*}
 | |
| 489 | apply (simp (no_asm) add: takeWhile_tail) | |
| 490 | apply (rule conjI) | |
| 491 | apply clarify | |
| 492 | apply (rule conjI) | |
| 493 | apply clarify | |
| 494 | apply (rule conjI) | |
| 495 | apply blast | |
| 496 | apply (rule conjI) | |
| 497 | apply clarify | |
| 498 | apply (rule conjI) | |
| 499 | txt{*subcase: used before*}
 | |
| 500 | apply (blast dest: used_evs_rev [THEN equalityD2, THEN contra_subsetD] | |
| 501 | used_takeWhile_used) | |
| 502 | txt{*subcase: CT before*}
 | |
| 503 | apply (fastsimp dest!: set_evs_rev [THEN equalityD2, THEN contra_subsetD, THEN takeWhile_void]) | |
| 504 | apply blast | |
| 505 | txt{*rest*}
 | |
| 506 | apply blast+ | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 507 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 508 | |
| 18886 | 509 | |
| 510 | ||
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 511 | (*This lemma is essential for proving Says_Tgs_message_form: | 
| 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 512 | |
| 18886 | 513 | the session key authK | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 514 | supplied by Kas in the authentication ticket | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 515 | cannot be a long-term key! | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 516 | |
| 18886 | 517 | Generalised to any session keys (both authK and servK). | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 518 | *) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 519 | lemma SesKey_is_session_key: | 
| 18886 | 520 | "\<lbrakk> Crypt (shrK Tgs_B) \<lbrace>Agent A, Agent Tgs_B, Key SesKey, Number T\<rbrace> | 
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 521 | \<in> parts (spies evs); Tgs_B \<notin> bad; | 
| 18886 | 522 | evs \<in> kerbIV \<rbrakk> | 
| 523 | \<Longrightarrow> SesKey \<notin> range shrK" | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 524 | apply (erule rev_mp) | 
| 18886 | 525 | apply (erule kerbIV.induct) | 
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 526 | apply (frule_tac [7] K5_msg_in_parts_spies) | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 527 | apply (frule_tac [5] K3_msg_in_parts_spies, simp_all, blast) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 528 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 529 | |
| 18886 | 530 | lemma authTicket_authentic: | 
| 531 | "\<lbrakk> Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Number Ta\<rbrace> | |
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 532 | \<in> parts (spies evs); | 
| 18886 | 533 | evs \<in> kerbIV \<rbrakk> | 
| 534 | \<Longrightarrow> Says Kas A (Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta, | |
| 535 | Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Number Ta\<rbrace>\<rbrace>) | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 536 | \<in> set evs" | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 537 | apply (erule rev_mp) | 
| 18886 | 538 | apply (erule kerbIV.induct) | 
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 539 | apply (frule_tac [7] K5_msg_in_parts_spies) | 
| 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 540 | apply (frule_tac [5] K3_msg_in_parts_spies, simp_all) | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 541 | txt{*Fake, K4*}
 | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 542 | apply (blast+) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 543 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 544 | |
| 18886 | 545 | lemma authTicket_crypt_authK: | 
| 546 | "\<lbrakk> Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Number Ta\<rbrace> | |
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 547 | \<in> parts (spies evs); | 
| 18886 | 548 | evs \<in> kerbIV \<rbrakk> | 
| 549 | \<Longrightarrow> authK \<in> authKeys evs" | |
| 550 | apply (frule authTicket_authentic, assumption) | |
| 551 | apply (simp (no_asm) add: authKeys_def) | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 552 | apply blast | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 553 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 554 | |
| 18886 | 555 | text{*Describes the form of servK, servTicket and authK sent by Tgs*}
 | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 556 | lemma Says_Tgs_message_form: | 
| 18886 | 557 | "\<lbrakk> Says Tgs A (Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace>) | 
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 558 | \<in> set evs; | 
| 18886 | 559 | evs \<in> kerbIV \<rbrakk> | 
| 560 | \<Longrightarrow> B \<noteq> Tgs & | |
| 561 | authK \<notin> range shrK & authK \<in> authKeys evs & authK \<in> symKeys & | |
| 562 | servK \<notin> range shrK & servK \<notin> authKeys evs & servK \<in> symKeys & | |
| 563 | servTicket = (Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace>) & | |
| 564 | Key servK \<notin> used (before | |
| 565 | Says Tgs A (Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace>) | |
| 566 | on evs) & | |
| 567 | Ts = CT(before | |
| 568 | Says Tgs A (Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace>) | |
| 569 | on evs) " | |
| 570 | apply (unfold before_def) | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 571 | apply (erule rev_mp) | 
| 18886 | 572 | apply (erule kerbIV.induct) | 
| 573 | apply (simp_all add: authKeys_insert authKeys_not_insert authKeys_empty authKeys_simp, blast) | |
| 574 | txt{*We need this simplification only for Message 4*}
 | |
| 575 | apply (simp (no_asm) add: takeWhile_tail) | |
| 576 | apply auto | |
| 577 | txt{*Five subcases of Message 4*}
 | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 578 | apply (blast dest!: SesKey_is_session_key) | 
| 18886 | 579 | apply (blast dest: authTicket_crypt_authK) | 
| 580 | apply (blast dest!: authKeys_used Says_Kas_message_form) | |
| 581 | txt{*subcase: used before*}
 | |
| 582 | apply (blast dest: used_evs_rev [THEN equalityD2, THEN contra_subsetD] | |
| 583 | used_takeWhile_used) | |
| 584 | txt{*subcase: CT before*}
 | |
| 585 | apply (fastsimp dest!: set_evs_rev [THEN equalityD2, THEN contra_subsetD, THEN takeWhile_void]) | |
| 586 | done | |
| 587 | ||
| 588 | lemma authTicket_form: | |
| 589 | "\<lbrakk> Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Ta, authTicket\<rbrace> | |
| 590 | \<in> parts (spies evs); | |
| 591 | A \<notin> bad; | |
| 592 | evs \<in> kerbIV \<rbrakk> | |
| 593 | \<Longrightarrow> authK \<notin> range shrK & authK \<in> symKeys & | |
| 594 | authTicket = Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Ta\<rbrace>" | |
| 595 | apply (erule rev_mp) | |
| 596 | apply (erule kerbIV.induct) | |
| 597 | apply (frule_tac [7] K5_msg_in_parts_spies) | |
| 598 | apply (frule_tac [5] K3_msg_in_parts_spies, simp_all) | |
| 599 | apply (blast+) | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 600 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 601 | |
| 18886 | 602 | text{* This form holds also over an authTicket, but is not needed below.*}
 | 
| 603 | lemma servTicket_form: | |
| 604 | "\<lbrakk> Crypt authK \<lbrace>Key servK, Agent B, Ts, servTicket\<rbrace> | |
| 605 | \<in> parts (spies evs); | |
| 606 | Key authK \<notin> analz (spies evs); | |
| 607 | evs \<in> kerbIV \<rbrakk> | |
| 608 | \<Longrightarrow> servK \<notin> range shrK & servK \<in> symKeys & | |
| 609 | (\<exists>A. servTicket = Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Ts\<rbrace>)" | |
| 610 | apply (erule rev_mp) | |
| 611 | apply (erule rev_mp) | |
| 612 | apply (erule kerbIV.induct, analz_mono_contra) | |
| 613 | apply (frule_tac [7] K5_msg_in_parts_spies) | |
| 614 | apply (frule_tac [5] K3_msg_in_parts_spies, simp_all, blast) | |
| 615 | done | |
| 616 | ||
| 617 | text{* Essentially the same as @{text authTicket_form} *}
 | |
| 618 | lemma Says_kas_message_form: | |
| 619 | "\<lbrakk> Says Kas' A (Crypt (shrK A) | |
| 620 | \<lbrace>Key authK, Agent Tgs, Ta, authTicket\<rbrace>) \<in> set evs; | |
| 621 | evs \<in> kerbIV \<rbrakk> | |
| 622 | \<Longrightarrow> authK \<notin> range shrK & authK \<in> symKeys & | |
| 623 | authTicket = | |
| 624 | Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Ta\<rbrace> | |
| 625 | | authTicket \<in> analz (spies evs)" | |
| 626 | by (blast dest: analz_shrK_Decrypt authTicket_form | |
| 627 | Says_imp_spies [THEN analz.Inj]) | |
| 628 | ||
| 629 | lemma Says_tgs_message_form: | |
| 630 | "\<lbrakk> Says Tgs' A (Crypt authK \<lbrace>Key servK, Agent B, Ts, servTicket\<rbrace>) | |
| 631 | \<in> set evs; authK \<in> symKeys; | |
| 632 | evs \<in> kerbIV \<rbrakk> | |
| 633 | \<Longrightarrow> servK \<notin> range shrK & | |
| 634 | (\<exists>A. servTicket = | |
| 635 | Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Ts\<rbrace>) | |
| 636 | | servTicket \<in> analz (spies evs)" | |
| 637 | apply (frule Says_imp_spies [THEN analz.Inj], auto) | |
| 638 | apply (force dest!: servTicket_form) | |
| 639 | apply (frule analz_into_parts) | |
| 640 | apply (frule servTicket_form, auto) | |
| 641 | done | |
| 642 | ||
| 643 | ||
| 644 | subsection{*Authenticity theorems: confirm origin of sensitive messages*}
 | |
| 645 | ||
| 646 | lemma authK_authentic: | |
| 647 | "\<lbrakk> Crypt (shrK A) \<lbrace>Key authK, Peer, Ta, authTicket\<rbrace> | |
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 648 | \<in> parts (spies evs); | 
| 18886 | 649 | A \<notin> bad; evs \<in> kerbIV \<rbrakk> | 
| 650 | \<Longrightarrow> Says Kas A (Crypt (shrK A) \<lbrace>Key authK, Peer, Ta, authTicket\<rbrace>) | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 651 | \<in> set evs" | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 652 | apply (erule rev_mp) | 
| 18886 | 653 | apply (erule kerbIV.induct) | 
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 654 | apply (frule_tac [7] K5_msg_in_parts_spies) | 
| 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 655 | apply (frule_tac [5] K3_msg_in_parts_spies, simp_all) | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 656 | txt{*Fake*}
 | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 657 | apply blast | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 658 | txt{*K4*}
 | 
| 18886 | 659 | apply (blast dest!: authTicket_authentic [THEN Says_Kas_message_form]) | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 660 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 661 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 662 | text{*If a certain encrypted message appears then it originated with Tgs*}
 | 
| 18886 | 663 | lemma servK_authentic: | 
| 664 | "\<lbrakk> Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace> | |
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 665 | \<in> parts (spies evs); | 
| 18886 | 666 | Key authK \<notin> analz (spies evs); | 
| 667 | authK \<notin> range shrK; | |
| 668 | evs \<in> kerbIV \<rbrakk> | |
| 669 | \<Longrightarrow> \<exists>A. Says Tgs A (Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace>) | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 670 | \<in> set evs" | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 671 | apply (erule rev_mp) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 672 | apply (erule rev_mp) | 
| 18886 | 673 | apply (erule kerbIV.induct, analz_mono_contra) | 
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 674 | apply (frule_tac [7] K5_msg_in_parts_spies) | 
| 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 675 | apply (frule_tac [5] K3_msg_in_parts_spies, simp_all) | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 676 | txt{*Fake*}
 | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 677 | apply blast | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 678 | txt{*K2*}
 | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 679 | apply blast | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 680 | txt{*K4*}
 | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 681 | apply auto | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 682 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 683 | |
| 18886 | 684 | lemma servK_authentic_bis: | 
| 685 | "\<lbrakk> Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace> | |
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 686 | \<in> parts (spies evs); | 
| 18886 | 687 | Key authK \<notin> analz (spies evs); | 
| 688 | B \<noteq> Tgs; | |
| 689 | evs \<in> kerbIV \<rbrakk> | |
| 690 | \<Longrightarrow> \<exists>A. Says Tgs A (Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace>) | |
| 691 | \<in> set evs" | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 692 | apply (erule rev_mp) | 
| 18886 | 693 | apply (erule rev_mp) | 
| 694 | apply (erule kerbIV.induct, analz_mono_contra) | |
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 695 | apply (frule_tac [7] K5_msg_in_parts_spies) | 
| 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 696 | apply (frule_tac [5] K3_msg_in_parts_spies, simp_all) | 
| 18886 | 697 | txt{*Fake*}
 | 
| 698 | apply blast | |
| 699 | txt{*K4*}
 | |
| 700 | apply blast | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 701 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 702 | |
| 18886 | 703 | text{*Authenticity of servK for B*}
 | 
| 704 | lemma servTicket_authentic_Tgs: | |
| 705 | "\<lbrakk> Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace> | |
| 706 | \<in> parts (spies evs); B \<noteq> Tgs; B \<notin> bad; | |
| 707 | evs \<in> kerbIV \<rbrakk> | |
| 708 | \<Longrightarrow> \<exists>authK. | |
| 709 | Says Tgs A (Crypt authK \<lbrace>Key servK, Agent B, Number Ts, | |
| 710 | Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace>\<rbrace>) | |
| 711 | \<in> set evs" | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 712 | apply (erule rev_mp) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 713 | apply (erule rev_mp) | 
| 18886 | 714 | apply (erule kerbIV.induct) | 
| 715 | apply (frule_tac [7] K5_msg_in_parts_spies) | |
| 716 | apply (frule_tac [5] K3_msg_in_parts_spies, simp_all) | |
| 717 | apply blast+ | |
| 718 | done | |
| 719 | ||
| 720 | text{*Anticipated here from next subsection*}
 | |
| 721 | lemma K4_imp_K2: | |
| 722 | "\<lbrakk> Says Tgs A (Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace>) | |
| 723 | \<in> set evs; evs \<in> kerbIV\<rbrakk> | |
| 724 | \<Longrightarrow> \<exists>Ta. Says Kas A | |
| 725 | (Crypt (shrK A) | |
| 726 | \<lbrace>Key authK, Agent Tgs, Number Ta, | |
| 727 | Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Number Ta\<rbrace>\<rbrace>) | |
| 728 | \<in> set evs" | |
| 729 | apply (erule rev_mp) | |
| 730 | apply (erule kerbIV.induct) | |
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 731 | apply (frule_tac [7] K5_msg_in_parts_spies) | 
| 18886 | 732 | apply (frule_tac [5] K3_msg_in_parts_spies, simp_all, auto) | 
| 733 | apply (blast dest!: Says_imp_spies [THEN parts.Inj, THEN parts.Fst, THEN authTicket_authentic]) | |
| 734 | done | |
| 735 | ||
| 736 | text{*Anticipated here from next subsection*}
 | |
| 737 | lemma u_K4_imp_K2: | |
| 738 | "\<lbrakk> Says Tgs A (Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace>) | |
| 739 | \<in> set evs; evs \<in> kerbIV\<rbrakk> | |
| 740 | \<Longrightarrow> \<exists>Ta. (Says Kas A (Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta, | |
| 741 | Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Number Ta\<rbrace>\<rbrace>) | |
| 742 | \<in> set evs | |
| 743 | & servKlife + Ts <= authKlife + Ta)" | |
| 744 | apply (erule rev_mp) | |
| 745 | apply (erule kerbIV.induct) | |
| 746 | apply (frule_tac [7] K5_msg_in_parts_spies) | |
| 747 | apply (frule_tac [5] K3_msg_in_parts_spies, simp_all, auto) | |
| 748 | apply (blast dest!: Says_imp_spies [THEN parts.Inj, THEN parts.Fst, THEN authTicket_authentic]) | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 749 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 750 | |
| 18886 | 751 | lemma servTicket_authentic_Kas: | 
| 752 | "\<lbrakk> Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace> | |
| 753 | \<in> parts (spies evs); B \<noteq> Tgs; B \<notin> bad; | |
| 754 | evs \<in> kerbIV \<rbrakk> | |
| 755 | \<Longrightarrow> \<exists>authK Ta. | |
| 756 | Says Kas A | |
| 757 | (Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta, | |
| 758 | Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Number Ta\<rbrace>\<rbrace>) | |
| 759 | \<in> set evs" | |
| 760 | apply (blast dest!: servTicket_authentic_Tgs K4_imp_K2) | |
| 761 | done | |
| 762 | ||
| 763 | lemma u_servTicket_authentic_Kas: | |
| 764 | "\<lbrakk> Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace> | |
| 765 | \<in> parts (spies evs); B \<noteq> Tgs; B \<notin> bad; | |
| 766 | evs \<in> kerbIV \<rbrakk> | |
| 767 | \<Longrightarrow> \<exists>authK Ta. Says Kas A (Crypt(shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta, | |
| 768 | Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Number Ta\<rbrace>\<rbrace>) | |
| 769 | \<in> set evs | |
| 770 | & servKlife + Ts <= authKlife + Ta" | |
| 771 | apply (blast dest!: servTicket_authentic_Tgs u_K4_imp_K2) | |
| 772 | done | |
| 773 | ||
| 774 | lemma servTicket_authentic: | |
| 775 | "\<lbrakk> Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace> | |
| 776 | \<in> parts (spies evs); B \<noteq> Tgs; B \<notin> bad; | |
| 777 | evs \<in> kerbIV \<rbrakk> | |
| 778 | \<Longrightarrow> \<exists>Ta authK. | |
| 779 | Says Kas A (Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta, | |
| 780 | Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Number Ta\<rbrace>\<rbrace>) | |
| 781 | \<in> set evs | |
| 782 | & Says Tgs A (Crypt authK \<lbrace>Key servK, Agent B, Number Ts, | |
| 783 | Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace>\<rbrace>) | |
| 784 | \<in> set evs" | |
| 785 | apply (blast dest: servTicket_authentic_Tgs K4_imp_K2) | |
| 786 | done | |
| 787 | ||
| 788 | lemma u_servTicket_authentic: | |
| 789 | "\<lbrakk> Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace> | |
| 790 | \<in> parts (spies evs); B \<noteq> Tgs; B \<notin> bad; | |
| 791 | evs \<in> kerbIV \<rbrakk> | |
| 792 | \<Longrightarrow> \<exists>Ta authK. | |
| 793 | (Says Kas A (Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta, | |
| 794 | Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Number Ta\<rbrace>\<rbrace>) | |
| 795 | \<in> set evs | |
| 796 | & Says Tgs A (Crypt authK \<lbrace>Key servK, Agent B, Number Ts, | |
| 797 | Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace>\<rbrace>) | |
| 798 | \<in> set evs | |
| 799 | & servKlife + Ts <= authKlife + Ta)" | |
| 800 | apply (blast dest: servTicket_authentic_Tgs u_K4_imp_K2) | |
| 801 | done | |
| 802 | ||
| 803 | lemma u_NotexpiredSK_NotexpiredAK: | |
| 804 | "\<lbrakk> \<not> expiredSK Ts evs; servKlife + Ts <= authKlife + Ta \<rbrakk> | |
| 805 | \<Longrightarrow> \<not> expiredAK Ta evs" | |
| 806 | apply (blast dest: leI le_trans dest: leD) | |
| 807 | done | |
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 808 | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 809 | |
| 18886 | 810 | subsection{* Reliability: friendly agents send something if something else happened*}
 | 
| 811 | ||
| 812 | lemma K3_imp_K2: | |
| 813 | "\<lbrakk> Says A Tgs | |
| 814 | \<lbrace>authTicket, Crypt authK \<lbrace>Agent A, Number T2\<rbrace>, Agent B\<rbrace> | |
| 815 | \<in> set evs; | |
| 816 | A \<notin> bad; evs \<in> kerbIV \<rbrakk> | |
| 817 | \<Longrightarrow> \<exists>Ta. Says Kas A (Crypt (shrK A) | |
| 818 | \<lbrace>Key authK, Agent Tgs, Number Ta, authTicket\<rbrace>) | |
| 819 | \<in> set evs" | |
| 820 | apply (erule rev_mp) | |
| 821 | apply (erule kerbIV.induct) | |
| 822 | apply (frule_tac [7] K5_msg_in_parts_spies) | |
| 823 | apply (frule_tac [5] K3_msg_in_parts_spies, simp_all, blast, blast) | |
| 824 | apply (blast dest: Says_imp_spies [THEN parts.Inj, THEN authK_authentic]) | |
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 825 | done | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 826 | |
| 18886 | 827 | text{*Anticipated here from next subsection. An authK is encrypted by one and only one Shared key. A servK is encrypted by one and only one authK.*}
 | 
| 828 | lemma Key_unique_SesKey: | |
| 829 | "\<lbrakk> Crypt K \<lbrace>Key SesKey, Agent B, T, Ticket\<rbrace> | |
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 830 | \<in> parts (spies evs); | 
| 18886 | 831 | Crypt K' \<lbrace>Key SesKey, Agent B', T', Ticket'\<rbrace> | 
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 832 | \<in> parts (spies evs); Key SesKey \<notin> analz (spies evs); | 
| 18886 | 833 | evs \<in> kerbIV \<rbrakk> | 
| 834 | \<Longrightarrow> K=K' & B=B' & T=T' & Ticket=Ticket'" | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 835 | apply (erule rev_mp) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 836 | apply (erule rev_mp) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 837 | apply (erule rev_mp) | 
| 18886 | 838 | apply (erule kerbIV.induct, analz_mono_contra) | 
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 839 | apply (frule_tac [7] K5_msg_in_parts_spies) | 
| 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 840 | apply (frule_tac [5] K3_msg_in_parts_spies, simp_all) | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 841 | txt{*Fake, K2, K4*}
 | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 842 | apply (blast+) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 843 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 844 | |
| 18886 | 845 | lemma Tgs_authenticates_A: | 
| 846 | "\<lbrakk> Crypt authK \<lbrace>Agent A, Number T2\<rbrace> \<in> parts (spies evs); | |
| 847 | Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Number Ta\<rbrace> | |
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 848 | \<in> parts (spies evs); | 
| 18886 | 849 | Key authK \<notin> analz (spies evs); A \<notin> bad; evs \<in> kerbIV \<rbrakk> | 
| 850 | \<Longrightarrow> \<exists> B. Says A Tgs \<lbrace> | |
| 851 | Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Number Ta\<rbrace>, | |
| 852 | Crypt authK \<lbrace>Agent A, Number T2\<rbrace>, Agent B \<rbrace> \<in> set evs" | |
| 853 | apply (drule authTicket_authentic, assumption, rotate_tac 4) | |
| 854 | apply (erule rev_mp, erule rev_mp, erule rev_mp) | |
| 855 | apply (erule kerbIV.induct, analz_mono_contra) | |
| 856 | apply (frule_tac [5] Says_ticket_parts) | |
| 857 | apply (frule_tac [7] Says_ticket_parts) | |
| 858 | apply (simp_all (no_asm_simp) add: all_conj_distrib) | |
| 859 | txt{*Fake*}
 | |
| 860 | apply blast | |
| 861 | txt{*K2*}
 | |
| 862 | apply (force dest!: Crypt_imp_keysFor) | |
| 863 | txt{*K3*}
 | |
| 864 | apply (blast dest: Key_unique_SesKey) | |
| 865 | txt{*K5*}
 | |
| 866 | txt{*If authKa were compromised, so would be authK*}
 | |
| 867 | apply (case_tac "Key authKa \<in> analz (spies evs5)") | |
| 868 | apply (force dest!: Says_imp_spies [THEN analz.Inj, THEN analz.Decrypt, THEN analz.Fst]) | |
| 869 | txt{*Besides, since authKa originated with Kas anyway...*}
 | |
| 870 | apply (clarify, drule K3_imp_K2, assumption, assumption) | |
| 871 | apply (clarify, drule Says_Kas_message_form, assumption) | |
| 872 | txt{*...it cannot be a shared key*. Therefore @{text servK_authentic} applies. 
 | |
| 873 | Contradition: Tgs used authK as a servkey, | |
| 874 | while Kas used it as an authkey*} | |
| 875 | apply (blast dest: servK_authentic Says_Tgs_message_form) | |
| 876 | done | |
| 877 | ||
| 878 | lemma Says_K5: | |
| 879 | "\<lbrakk> Crypt servK \<lbrace>Agent A, Number T3\<rbrace> \<in> parts (spies evs); | |
| 880 | Says Tgs A (Crypt authK \<lbrace>Key servK, Agent B, Number Ts, | |
| 881 | servTicket\<rbrace>) \<in> set evs; | |
| 882 | Key servK \<notin> analz (spies evs); | |
| 883 | A \<notin> bad; B \<notin> bad; evs \<in> kerbIV \<rbrakk> | |
| 884 | \<Longrightarrow> Says A B \<lbrace>servTicket, Crypt servK \<lbrace>Agent A, Number T3\<rbrace>\<rbrace> \<in> set evs" | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 885 | apply (erule rev_mp) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 886 | apply (erule rev_mp) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 887 | apply (erule rev_mp) | 
| 18886 | 888 | apply (erule kerbIV.induct, analz_mono_contra) | 
| 889 | apply (frule_tac [5] Says_ticket_parts) | |
| 890 | apply (frule_tac [7] Says_ticket_parts) | |
| 891 | apply (simp_all (no_asm_simp) add: all_conj_distrib) | |
| 892 | apply blast | |
| 893 | txt{*K3*}
 | |
| 894 | apply (blast dest: authK_authentic Says_Kas_message_form Says_Tgs_message_form) | |
| 895 | txt{*K4*}
 | |
| 896 | apply (force dest!: Crypt_imp_keysFor) | |
| 897 | txt{*K5*}
 | |
| 898 | apply (blast dest: Key_unique_SesKey) | |
| 899 | done | |
| 900 | ||
| 901 | text{*Anticipated here from next subsection*}
 | |
| 902 | lemma unique_CryptKey: | |
| 903 | "\<lbrakk> Crypt (shrK B) \<lbrace>Agent A, Agent B, Key SesKey, T\<rbrace> | |
| 904 | \<in> parts (spies evs); | |
| 905 | Crypt (shrK B') \<lbrace>Agent A', Agent B', Key SesKey, T'\<rbrace> | |
| 906 | \<in> parts (spies evs); Key SesKey \<notin> analz (spies evs); | |
| 907 | evs \<in> kerbIV \<rbrakk> | |
| 908 | \<Longrightarrow> A=A' & B=B' & T=T'" | |
| 909 | apply (erule rev_mp) | |
| 910 | apply (erule rev_mp) | |
| 911 | apply (erule rev_mp) | |
| 912 | apply (erule kerbIV.induct, analz_mono_contra) | |
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 913 | apply (frule_tac [7] K5_msg_in_parts_spies) | 
| 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 914 | apply (frule_tac [5] K3_msg_in_parts_spies, simp_all) | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 915 | txt{*Fake, K2, K4*}
 | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 916 | apply (blast+) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 917 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 918 | |
| 18886 | 919 | lemma Says_K6: | 
| 920 | "\<lbrakk> Crypt servK (Number T3) \<in> parts (spies evs); | |
| 921 | Says Tgs A (Crypt authK \<lbrace>Key servK, Agent B, Number Ts, | |
| 922 | servTicket\<rbrace>) \<in> set evs; | |
| 923 | Key servK \<notin> analz (spies evs); | |
| 924 | A \<notin> bad; B \<notin> bad; evs \<in> kerbIV \<rbrakk> | |
| 925 | \<Longrightarrow> Says B A (Crypt servK (Number T3)) \<in> set evs" | |
| 926 | apply (erule rev_mp) | |
| 927 | apply (erule rev_mp) | |
| 928 | apply (erule rev_mp) | |
| 929 | apply (erule kerbIV.induct, analz_mono_contra) | |
| 930 | apply (frule_tac [5] Says_ticket_parts) | |
| 931 | apply (frule_tac [7] Says_ticket_parts) | |
| 932 | apply (simp_all (no_asm_simp)) | |
| 933 | apply blast | |
| 934 | apply (force dest!: Crypt_imp_keysFor, clarify) | |
| 935 | apply (frule Says_Tgs_message_form, assumption, clarify) (*PROOF FAILED if omitted*) | |
| 936 | apply (blast dest: unique_CryptKey) | |
| 937 | done | |
| 938 | ||
| 939 | text{*Needs a unicity theorem, hence moved here*}
 | |
| 940 | lemma servK_authentic_ter: | |
| 941 | "\<lbrakk> Says Kas A | |
| 942 | (Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta, authTicket\<rbrace>) \<in> set evs; | |
| 943 | Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace> | |
| 944 | \<in> parts (spies evs); | |
| 945 | Key authK \<notin> analz (spies evs); | |
| 946 | evs \<in> kerbIV \<rbrakk> | |
| 947 | \<Longrightarrow> Says Tgs A (Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace>) | |
| 948 | \<in> set evs" | |
| 949 | apply (frule Says_Kas_message_form, assumption) | |
| 950 | apply (erule rev_mp) | |
| 951 | apply (erule rev_mp) | |
| 952 | apply (erule rev_mp) | |
| 953 | apply (erule kerbIV.induct, analz_mono_contra) | |
| 954 | apply (frule_tac [7] K5_msg_in_parts_spies) | |
| 955 | apply (frule_tac [5] K3_msg_in_parts_spies, simp_all, blast) | |
| 956 | txt{*K2 and K4 remain*}
 | |
| 957 | prefer 2 apply (blast dest!: unique_CryptKey) | |
| 958 | apply (blast dest!: servK_authentic Says_Tgs_message_form authKeys_used) | |
| 959 | done | |
| 960 | ||
| 961 | ||
| 962 | subsection{*Unicity Theorems*}
 | |
| 963 | ||
| 964 | text{* The session key, if secure, uniquely identifies the Ticket
 | |
| 965 | whether authTicket or servTicket. As a matter of fact, one can read | |
| 966 | also Tgs in the place of B. *} | |
| 967 | ||
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 968 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 969 | (* | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 970 | At reception of any message mentioning A, Kas associates shrK A with | 
| 18886 | 971 | a new authK. Realistic, as the user gets a new authK at each login. | 
| 972 | Similarly, at reception of any message mentioning an authK | |
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 973 | (a legitimate user could make several requests to Tgs - by K3), Tgs | 
| 18886 | 974 | associates it with a new servK. | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 975 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 976 | Therefore, a goal like | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 977 | |
| 18886 | 978 | "evs \<in> kerbIV | 
| 979 | \<Longrightarrow> Key Kc \<notin> analz (spies evs) \<longrightarrow> | |
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 980 | (\<exists>K' B' T' Ticket'. \<forall>K B T Ticket. | 
| 18886 | 981 | Crypt Kc \<lbrace>Key K, Agent B, T, Ticket\<rbrace> | 
| 982 | \<in> parts (spies evs) \<longrightarrow> K=K' & B=B' & T=T' & Ticket=Ticket')" | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 983 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 984 | would fail on the K2 and K4 cases. | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 985 | *) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 986 | |
| 18886 | 987 | lemma unique_authKeys: | 
| 988 | "\<lbrakk> Says Kas A | |
| 989 | (Crypt Ka \<lbrace>Key authK, Agent Tgs, Ta, X\<rbrace>) \<in> set evs; | |
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 990 | Says Kas A' | 
| 18886 | 991 | (Crypt Ka' \<lbrace>Key authK, Agent Tgs, Ta', X'\<rbrace>) \<in> set evs; | 
| 992 | evs \<in> kerbIV \<rbrakk> \<Longrightarrow> A=A' & Ka=Ka' & Ta=Ta' & X=X'" | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 993 | apply (erule rev_mp) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 994 | apply (erule rev_mp) | 
| 18886 | 995 | apply (erule kerbIV.induct) | 
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 996 | apply (frule_tac [7] K5_msg_in_parts_spies) | 
| 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 997 | apply (frule_tac [5] K3_msg_in_parts_spies, simp_all) | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 998 | txt{*K2*}
 | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 999 | apply blast | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1000 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1001 | |
| 18886 | 1002 | text{* servK uniquely identifies the message from Tgs *}
 | 
| 1003 | lemma unique_servKeys: | |
| 1004 | "\<lbrakk> Says Tgs A | |
| 1005 | (Crypt K \<lbrace>Key servK, Agent B, Ts, X\<rbrace>) \<in> set evs; | |
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 1006 | Says Tgs A' | 
| 18886 | 1007 | (Crypt K' \<lbrace>Key servK, Agent B', Ts', X'\<rbrace>) \<in> set evs; | 
| 1008 | evs \<in> kerbIV \<rbrakk> \<Longrightarrow> A=A' & B=B' & K=K' & Ts=Ts' & X=X'" | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1009 | apply (erule rev_mp) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1010 | apply (erule rev_mp) | 
| 18886 | 1011 | apply (erule kerbIV.induct) | 
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 1012 | apply (frule_tac [7] K5_msg_in_parts_spies) | 
| 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 1013 | apply (frule_tac [5] K3_msg_in_parts_spies, simp_all) | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1014 | txt{*K4*}
 | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1015 | apply blast | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1016 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1017 | |
| 18886 | 1018 | text{* Revised unicity theorems *}
 | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1019 | |
| 18886 | 1020 | lemma Kas_Unique: | 
| 1021 | "\<lbrakk> Says Kas A | |
| 1022 | (Crypt Ka \<lbrace>Key authK, Agent Tgs, Ta, authTicket\<rbrace>) \<in> set evs; | |
| 1023 | evs \<in> kerbIV \<rbrakk> \<Longrightarrow> | |
| 1024 | Unique (Says Kas A (Crypt Ka \<lbrace>Key authK, Agent Tgs, Ta, authTicket\<rbrace>)) | |
| 1025 | on evs" | |
| 1026 | apply (erule rev_mp, erule kerbIV.induct, simp_all add: Unique_def) | |
| 1027 | apply blast | |
| 1028 | done | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1029 | |
| 18886 | 1030 | lemma Tgs_Unique: | 
| 1031 | "\<lbrakk> Says Tgs A | |
| 1032 | (Crypt authK \<lbrace>Key servK, Agent B, Ts, servTicket\<rbrace>) \<in> set evs; | |
| 1033 | evs \<in> kerbIV \<rbrakk> \<Longrightarrow> | |
| 1034 | Unique (Says Tgs A (Crypt authK \<lbrace>Key servK, Agent B, Ts, servTicket\<rbrace>)) | |
| 1035 | on evs" | |
| 1036 | apply (erule rev_mp, erule kerbIV.induct, simp_all add: Unique_def) | |
| 1037 | apply blast | |
| 1038 | done | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1039 | |
| 18886 | 1040 | |
| 1041 | subsection{*Lemmas About the Predicate @{term AKcryptSK}*}
 | |
| 1042 | ||
| 1043 | lemma not_AKcryptSK_Nil [iff]: "\<not> AKcryptSK authK servK []" | |
| 1044 | by (simp add: AKcryptSK_def) | |
| 1045 | ||
| 1046 | lemma AKcryptSKI: | |
| 1047 | "\<lbrakk> Says Tgs A (Crypt authK \<lbrace>Key servK, Agent B, Number Ts, X \<rbrace>) \<in> set evs; | |
| 1048 | evs \<in> kerbIV \<rbrakk> \<Longrightarrow> AKcryptSK authK servK evs" | |
| 1049 | apply (unfold AKcryptSK_def) | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1050 | apply (blast dest: Says_Tgs_message_form) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1051 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1052 | |
| 18886 | 1053 | lemma AKcryptSK_Says [simp]: | 
| 1054 | "AKcryptSK authK servK (Says S A X # evs) = | |
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 1055 | (Tgs = S & | 
| 18886 | 1056 | (\<exists>B Ts. X = Crypt authK | 
| 1057 | \<lbrace>Key servK, Agent B, Number Ts, | |
| 1058 | Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace> \<rbrace>) | |
| 1059 | | AKcryptSK authK servK evs)" | |
| 1060 | apply (unfold AKcryptSK_def) | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1061 | apply (simp (no_asm)) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1062 | apply blast | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1063 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1064 | |
| 18886 | 1065 | (*A fresh authK cannot be associated with any other | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1066 | (with respect to a given trace). *) | 
| 18886 | 1067 | lemma Auth_fresh_not_AKcryptSK: | 
| 1068 | "\<lbrakk> Key authK \<notin> used evs; evs \<in> kerbIV \<rbrakk> | |
| 1069 | \<Longrightarrow> \<not> AKcryptSK authK servK evs" | |
| 1070 | apply (unfold AKcryptSK_def) | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1071 | apply (erule rev_mp) | 
| 18886 | 1072 | apply (erule kerbIV.induct) | 
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 1073 | apply (frule_tac [7] K5_msg_in_parts_spies) | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1074 | apply (frule_tac [5] K3_msg_in_parts_spies, simp_all, blast) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1075 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1076 | |
| 18886 | 1077 | (*A fresh servK cannot be associated with any other | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1078 | (with respect to a given trace). *) | 
| 18886 | 1079 | lemma Serv_fresh_not_AKcryptSK: | 
| 1080 | "Key servK \<notin> used evs \<Longrightarrow> \<not> AKcryptSK authK servK evs" | |
| 1081 | apply (unfold AKcryptSK_def, blast) | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1082 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1083 | |
| 18886 | 1084 | lemma authK_not_AKcryptSK: | 
| 1085 | "\<lbrakk> Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, tk\<rbrace> | |
| 1086 | \<in> parts (spies evs); evs \<in> kerbIV \<rbrakk> | |
| 1087 | \<Longrightarrow> \<not> AKcryptSK K authK evs" | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1088 | apply (erule rev_mp) | 
| 18886 | 1089 | apply (erule kerbIV.induct) | 
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 1090 | apply (frule_tac [7] K5_msg_in_parts_spies) | 
| 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 1091 | apply (frule_tac [5] K3_msg_in_parts_spies, simp_all) | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1092 | txt{*Fake*}
 | 
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 1093 | apply blast | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1094 | txt{*K2: by freshness*}
 | 
| 18886 | 1095 | apply (simp add: AKcryptSK_def) | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1096 | txt{*K4*}
 | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1097 | apply (blast+) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1098 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1099 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1100 | text{*A secure serverkey cannot have been used to encrypt others*}
 | 
| 18886 | 1101 | lemma servK_not_AKcryptSK: | 
| 1102 | "\<lbrakk> Crypt (shrK B) \<lbrace>Agent A, Agent B, Key SK, Number Ts\<rbrace> \<in> parts (spies evs); | |
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 1103 | Key SK \<notin> analz (spies evs); SK \<in> symKeys; | 
| 18886 | 1104 | B \<noteq> Tgs; evs \<in> kerbIV \<rbrakk> | 
| 1105 | \<Longrightarrow> \<not> AKcryptSK SK K evs" | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1106 | apply (erule rev_mp) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1107 | apply (erule rev_mp) | 
| 18886 | 1108 | apply (erule kerbIV.induct, analz_mono_contra) | 
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 1109 | apply (frule_tac [7] K5_msg_in_parts_spies) | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1110 | apply (frule_tac [5] K3_msg_in_parts_spies, simp_all, blast) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1111 | txt{*K4 splits into distinct subcases*}
 | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1112 | apply auto | 
| 18886 | 1113 | txt{*servK can't have been enclosed in two certificates*}
 | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1114 | prefer 2 apply (blast dest: unique_CryptKey) | 
| 18886 | 1115 | txt{*servK is fresh and so could not have been used, by
 | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1116 |    @{text new_keys_not_used}*}
 | 
| 18886 | 1117 | apply (force dest!: Crypt_imp_invKey_keysFor simp add: AKcryptSK_def) | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1118 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1119 | |
| 18886 | 1120 | text{*Long term keys are not issued as servKeys*}
 | 
| 1121 | lemma shrK_not_AKcryptSK: | |
| 1122 | "evs \<in> kerbIV \<Longrightarrow> \<not> AKcryptSK K (shrK A) evs" | |
| 1123 | apply (unfold AKcryptSK_def) | |
| 1124 | apply (erule kerbIV.induct) | |
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 1125 | apply (frule_tac [7] K5_msg_in_parts_spies) | 
| 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 1126 | apply (frule_tac [5] K3_msg_in_parts_spies, auto) | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1127 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1128 | |
| 18886 | 1129 | text{*The Tgs message associates servK with authK and therefore not with any
 | 
| 1130 | other key authK.*} | |
| 1131 | lemma Says_Tgs_AKcryptSK: | |
| 1132 | "\<lbrakk> Says Tgs A (Crypt authK \<lbrace>Key servK, Agent B, Number Ts, X \<rbrace>) | |
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 1133 | \<in> set evs; | 
| 18886 | 1134 | authK' \<noteq> authK; evs \<in> kerbIV \<rbrakk> | 
| 1135 | \<Longrightarrow> \<not> AKcryptSK authK' servK evs" | |
| 1136 | apply (unfold AKcryptSK_def) | |
| 1137 | apply (blast dest: unique_servKeys) | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1138 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1139 | |
| 18886 | 1140 | text{*Equivalently*}
 | 
| 1141 | lemma not_different_AKcryptSK: | |
| 1142 | "\<lbrakk> AKcryptSK authK servK evs; | |
| 1143 | authK' \<noteq> authK; evs \<in> kerbIV \<rbrakk> | |
| 1144 | \<Longrightarrow> \<not> AKcryptSK authK' servK evs \<and> servK \<in> symKeys" | |
| 1145 | apply (simp add: AKcryptSK_def) | |
| 1146 | apply (blast dest: unique_servKeys Says_Tgs_message_form) | |
| 1147 | done | |
| 1148 | ||
| 1149 | lemma AKcryptSK_not_AKcryptSK: | |
| 1150 | "\<lbrakk> AKcryptSK authK servK evs; evs \<in> kerbIV \<rbrakk> | |
| 1151 | \<Longrightarrow> \<not> AKcryptSK servK K evs" | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1152 | apply (erule rev_mp) | 
| 18886 | 1153 | apply (erule kerbIV.induct) | 
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 1154 | apply (frule_tac [7] K5_msg_in_parts_spies) | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1155 | apply (frule_tac [5] K3_msg_in_parts_spies, simp_all, safe) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1156 | txt{*K4 splits into subcases*}
 | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1157 | apply simp_all | 
| 18886 | 1158 | prefer 4 apply (blast dest!: authK_not_AKcryptSK) | 
| 1159 | txt{*servK is fresh and so could not have been used, by
 | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1160 |    @{text new_keys_not_used}*}
 | 
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 1161 | prefer 2 | 
| 18886 | 1162 | apply (force dest!: Crypt_imp_invKey_keysFor simp add: AKcryptSK_def) | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1163 | txt{*Others by freshness*}
 | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1164 | apply (blast+) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1165 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1166 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1167 | text{*The only session keys that can be found with the help of session keys are
 | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1168 | those sent by Tgs in step K4. *} | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1169 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1170 | text{*We take some pains to express the property
 | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1171 | as a logical equivalence so that the simplifier can apply it.*} | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1172 | lemma Key_analz_image_Key_lemma: | 
| 18886 | 1173 | "P \<longrightarrow> (Key K \<in> analz (Key`KK Un H)) \<longrightarrow> (K:KK | Key K \<in> analz H) | 
| 1174 | \<Longrightarrow> | |
| 1175 | P \<longrightarrow> (Key K \<in> analz (Key`KK Un H)) = (K:KK | Key K \<in> analz H)" | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1176 | by (blast intro: analz_mono [THEN subsetD]) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1177 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1178 | |
| 18886 | 1179 | lemma AKcryptSK_analz_insert: | 
| 1180 | "\<lbrakk> AKcryptSK K K' evs; K \<in> symKeys; evs \<in> kerbIV \<rbrakk> | |
| 1181 | \<Longrightarrow> Key K' \<in> analz (insert (Key K) (spies evs))" | |
| 1182 | apply (simp add: AKcryptSK_def, clarify) | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1183 | apply (drule Says_imp_spies [THEN analz.Inj, THEN analz_insertI], auto) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1184 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1185 | |
| 18886 | 1186 | lemma authKeys_are_not_AKcryptSK: | 
| 1187 | "\<lbrakk> K \<in> authKeys evs Un range shrK; evs \<in> kerbIV \<rbrakk> | |
| 1188 | \<Longrightarrow> \<forall>SK. \<not> AKcryptSK SK K evs \<and> K \<in> symKeys" | |
| 1189 | apply (simp add: authKeys_def AKcryptSK_def) | |
| 1190 | apply (blast dest: Says_Kas_message_form Says_Tgs_message_form) | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1191 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1192 | |
| 18886 | 1193 | lemma not_authKeys_not_AKcryptSK: | 
| 1194 | "\<lbrakk> K \<notin> authKeys evs; | |
| 1195 | K \<notin> range shrK; evs \<in> kerbIV \<rbrakk> | |
| 1196 | \<Longrightarrow> \<forall>SK. \<not> AKcryptSK K SK evs" | |
| 1197 | apply (simp add: AKcryptSK_def) | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1198 | apply (blast dest: Says_Tgs_message_form) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1199 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1200 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1201 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1202 | subsection{*Secrecy Theorems*}
 | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1203 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1204 | text{*For the Oops2 case of the next theorem*}
 | 
| 18886 | 1205 | lemma Oops2_not_AKcryptSK: | 
| 1206 | "\<lbrakk> evs \<in> kerbIV; | |
| 1207 | Says Tgs A (Crypt authK | |
| 1208 | \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace>) | |
| 1209 | \<in> set evs \<rbrakk> | |
| 1210 | \<Longrightarrow> \<not> AKcryptSK servK SK evs" | |
| 1211 | apply (blast dest: AKcryptSKI AKcryptSK_not_AKcryptSK) | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1212 | done | 
| 18886 | 1213 | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1214 | text{* Big simplification law for keys SK that are not crypted by keys in KK
 | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1215 | It helps prove three, otherwise hard, facts about keys. These facts are | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1216 | exploited as simplification laws for analz, and also "limit the damage" | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1217 | in case of loss of a key to the spy. See ESORICS98. | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1218 | [simplified by LCP] *} | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1219 | lemma Key_analz_image_Key [rule_format (no_asm)]: | 
| 18886 | 1220 | "evs \<in> kerbIV \<Longrightarrow> | 
| 1221 | (\<forall>SK KK. SK \<in> symKeys & KK <= -(range shrK) \<longrightarrow> | |
| 1222 | (\<forall>K \<in> KK. \<not> AKcryptSK K SK evs) \<longrightarrow> | |
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 1223 | (Key SK \<in> analz (Key`KK Un (spies evs))) = | 
| 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 1224 | (SK \<in> KK | Key SK \<in> analz (spies evs)))" | 
| 18886 | 1225 | apply (erule kerbIV.induct) | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1226 | apply (frule_tac [10] Oops_range_spies2) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1227 | apply (frule_tac [9] Oops_range_spies1) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1228 | apply (frule_tac [7] Says_tgs_message_form) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1229 | apply (frule_tac [5] Says_kas_message_form) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1230 | apply (safe del: impI intro!: Key_analz_image_Key_lemma [THEN impI]) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1231 | txt{*Case-splits for Oops1 and message 5: the negated case simplifies using
 | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1232 | the induction hypothesis*} | 
| 18886 | 1233 | apply (case_tac [11] "AKcryptSK authK SK evsO1") | 
| 1234 | apply (case_tac [8] "AKcryptSK servK SK evs5") | |
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 1235 | apply (simp_all del: image_insert | 
| 18886 | 1236 | add: analz_image_freshK_simps AKcryptSK_Says shrK_not_AKcryptSK | 
| 1237 | Oops2_not_AKcryptSK Auth_fresh_not_AKcryptSK | |
| 1238 | Serv_fresh_not_AKcryptSK Says_Tgs_AKcryptSK Spy_analz_shrK) | |
| 14945 | 1239 | txt{*Fake*} 
 | 
| 1240 | apply spy_analz | |
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 1241 | txt{*K2*}
 | 
| 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 1242 | apply blast | 
| 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 1243 | txt{*K3*}
 | 
| 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 1244 | apply blast | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1245 | txt{*K4*}
 | 
| 18886 | 1246 | apply (blast dest!: authK_not_AKcryptSK) | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1247 | txt{*K5*}
 | 
| 18886 | 1248 | apply (case_tac "Key servK \<in> analz (spies evs5) ") | 
| 1249 | txt{*If servK is compromised then the result follows directly...*}
 | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1250 | apply (simp (no_asm_simp) add: analz_insert_eq Un_upper2 [THEN analz_mono, THEN subsetD]) | 
| 18886 | 1251 | txt{*...therefore servK is uncompromised.*}
 | 
| 1252 | txt{*The AKcryptSK servK SK evs5 case leads to a contradiction.*}
 | |
| 1253 | apply (blast elim!: servK_not_AKcryptSK [THEN [2] rev_notE] del: allE ballE) | |
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 1254 | txt{*Another K5 case*}
 | 
| 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 1255 | apply blast | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1256 | txt{*Oops1*}
 | 
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 1257 | apply simp | 
| 18886 | 1258 | apply (blast dest!: AKcryptSK_analz_insert) | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1259 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1260 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1261 | text{* First simplification law for analz: no session keys encrypt
 | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1262 | authentication keys or shared keys. *} | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1263 | lemma analz_insert_freshK1: | 
| 18886 | 1264 | "\<lbrakk> evs \<in> kerbIV; K \<in> authKeys evs Un range shrK; | 
| 1265 | SesKey \<notin> range shrK \<rbrakk> | |
| 1266 | \<Longrightarrow> (Key K \<in> analz (insert (Key SesKey) (spies evs))) = | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1267 | (K = SesKey | Key K \<in> analz (spies evs))" | 
| 18886 | 1268 | apply (frule authKeys_are_not_AKcryptSK, assumption) | 
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 1269 | apply (simp del: image_insert | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1270 | add: analz_image_freshK_simps add: Key_analz_image_Key) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1271 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1272 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1273 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1274 | text{* Second simplification law for analz: no service keys encrypt any other keys.*}
 | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1275 | lemma analz_insert_freshK2: | 
| 18886 | 1276 | "\<lbrakk> evs \<in> kerbIV; servK \<notin> (authKeys evs); servK \<notin> range shrK; | 
| 1277 | K \<in> symKeys \<rbrakk> | |
| 1278 | \<Longrightarrow> (Key K \<in> analz (insert (Key servK) (spies evs))) = | |
| 1279 | (K = servK | Key K \<in> analz (spies evs))" | |
| 1280 | apply (frule not_authKeys_not_AKcryptSK, assumption, assumption) | |
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 1281 | apply (simp del: image_insert | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1282 | add: analz_image_freshK_simps add: Key_analz_image_Key) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1283 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1284 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1285 | |
| 18886 | 1286 | text{* Third simplification law for analz: only one authentication key encrypts a certain service key.*}
 | 
| 1287 | ||
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1288 | lemma analz_insert_freshK3: | 
| 18886 | 1289 | "\<lbrakk> AKcryptSK authK servK evs; | 
| 1290 | authK' \<noteq> authK; authK' \<notin> range shrK; evs \<in> kerbIV \<rbrakk> | |
| 1291 | \<Longrightarrow> (Key servK \<in> analz (insert (Key authK') (spies evs))) = | |
| 1292 | (servK = authK' | Key servK \<in> analz (spies evs))" | |
| 1293 | apply (drule_tac authK' = authK' in not_different_AKcryptSK, blast, assumption) | |
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 1294 | apply (simp del: image_insert | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1295 | add: analz_image_freshK_simps add: Key_analz_image_Key) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1296 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1297 | |
| 18886 | 1298 | lemma analz_insert_freshK3_bis: | 
| 1299 | "\<lbrakk> Says Tgs A | |
| 1300 | (Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace>) | |
| 1301 | \<in> set evs; | |
| 1302 | authK \<noteq> authK'; authK' \<notin> range shrK; evs \<in> kerbIV \<rbrakk> | |
| 1303 | \<Longrightarrow> (Key servK \<in> analz (insert (Key authK') (spies evs))) = | |
| 1304 | (servK = authK' | Key servK \<in> analz (spies evs))" | |
| 1305 | apply (frule AKcryptSKI, assumption) | |
| 1306 | apply (simp add: analz_insert_freshK3) | |
| 1307 | done | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1308 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1309 | text{*a weakness of the protocol*}
 | 
| 18886 | 1310 | lemma authK_compromises_servK: | 
| 1311 | "\<lbrakk> Says Tgs A | |
| 1312 | (Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace>) | |
| 1313 | \<in> set evs; authK \<in> symKeys; | |
| 1314 | Key authK \<in> analz (spies evs); evs \<in> kerbIV \<rbrakk> | |
| 1315 | \<Longrightarrow> Key servK \<in> analz (spies evs)" | |
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 1316 | by (force dest: Says_imp_spies [THEN analz.Inj, THEN analz.Decrypt, THEN analz.Fst]) | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1317 | |
| 18886 | 1318 | lemma servK_notin_authKeysD: | 
| 1319 | "\<lbrakk> Crypt authK \<lbrace>Key servK, Agent B, Ts, | |
| 1320 | Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Ts\<rbrace>\<rbrace> | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1321 | \<in> parts (spies evs); | 
| 18886 | 1322 | Key servK \<notin> analz (spies evs); | 
| 1323 | B \<noteq> Tgs; evs \<in> kerbIV \<rbrakk> | |
| 1324 | \<Longrightarrow> servK \<notin> authKeys evs" | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1325 | apply (erule rev_mp) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1326 | apply (erule rev_mp) | 
| 18886 | 1327 | apply (simp add: authKeys_def) | 
| 1328 | apply (erule kerbIV.induct, analz_mono_contra) | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1329 | apply (frule_tac [7] K5_msg_in_parts_spies) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1330 | apply (frule_tac [5] K3_msg_in_parts_spies, simp_all) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1331 | apply (blast+) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1332 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1333 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1334 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1335 | text{*If Spy sees the Authentication Key sent in msg K2, then
 | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1336 | the Key has expired.*} | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1337 | lemma Confidentiality_Kas_lemma [rule_format]: | 
| 18886 | 1338 | "\<lbrakk> authK \<in> symKeys; A \<notin> bad; evs \<in> kerbIV \<rbrakk> | 
| 1339 | \<Longrightarrow> Says Kas A | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1340 | (Crypt (shrK A) | 
| 18886 | 1341 | \<lbrace>Key authK, Agent Tgs, Number Ta, | 
| 1342 | Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Number Ta\<rbrace>\<rbrace>) | |
| 1343 | \<in> set evs \<longrightarrow> | |
| 1344 | Key authK \<in> analz (spies evs) \<longrightarrow> | |
| 1345 | expiredAK Ta evs" | |
| 1346 | apply (erule kerbIV.induct) | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1347 | apply (frule_tac [10] Oops_range_spies2) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1348 | apply (frule_tac [9] Oops_range_spies1) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1349 | apply (frule_tac [7] Says_tgs_message_form) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1350 | apply (frule_tac [5] Says_kas_message_form) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1351 | apply (safe del: impI conjI impCE) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1352 | apply (simp_all (no_asm_simp) add: Says_Kas_message_form less_SucI analz_insert_eq not_parts_not_analz analz_insert_freshK1 pushes) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1353 | txt{*Fake*}
 | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1354 | apply spy_analz | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1355 | txt{*K2*}
 | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1356 | apply blast | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1357 | txt{*K4*}
 | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1358 | apply blast | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1359 | txt{*Level 8: K5*}
 | 
| 18886 | 1360 | apply (blast dest: servK_notin_authKeysD Says_Kas_message_form intro: less_SucI) | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1361 | txt{*Oops1*}
 | 
| 18886 | 1362 | apply (blast dest!: unique_authKeys intro: less_SucI) | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1363 | txt{*Oops2*}
 | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1364 | apply (blast dest: Says_Tgs_message_form Says_Kas_message_form) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1365 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1366 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1367 | lemma Confidentiality_Kas: | 
| 18886 | 1368 | "\<lbrakk> Says Kas A | 
| 1369 | (Crypt Ka \<lbrace>Key authK, Agent Tgs, Number Ta, authTicket\<rbrace>) | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1370 | \<in> set evs; | 
| 18886 | 1371 | \<not> expiredAK Ta evs; | 
| 1372 | A \<notin> bad; evs \<in> kerbIV \<rbrakk> | |
| 1373 | \<Longrightarrow> Key authK \<notin> analz (spies evs)" | |
| 14200 
d8598e24f8fa
Removal of the Key_supply axiom (affects many possbility proofs) and minor
 paulson parents: 
14182diff
changeset | 1374 | by (blast dest: Says_Kas_message_form Confidentiality_Kas_lemma) | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1375 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1376 | text{*If Spy sees the Service Key sent in msg K4, then
 | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1377 | the Key has expired.*} | 
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 1378 | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1379 | lemma Confidentiality_lemma [rule_format]: | 
| 18886 | 1380 | "\<lbrakk> Says Tgs A | 
| 1381 | (Crypt authK | |
| 1382 | \<lbrace>Key servK, Agent B, Number Ts, | |
| 1383 | Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace>\<rbrace>) | |
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 1384 | \<in> set evs; | 
| 18886 | 1385 | Key authK \<notin> analz (spies evs); | 
| 1386 | servK \<in> symKeys; | |
| 1387 | A \<notin> bad; B \<notin> bad; evs \<in> kerbIV \<rbrakk> | |
| 1388 | \<Longrightarrow> Key servK \<in> analz (spies evs) \<longrightarrow> | |
| 1389 | expiredSK Ts evs" | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1390 | apply (erule rev_mp) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1391 | apply (erule rev_mp) | 
| 18886 | 1392 | apply (erule kerbIV.induct) | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1393 | apply (rule_tac [9] impI)+; | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1394 |   --{*The Oops1 case is unusual: must simplify
 | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1395 |     @{term "Authkey \<notin> analz (spies (ev#evs))"}, not letting
 | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1396 |    @{text analz_mono_contra} weaken it to
 | 
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 1397 |    @{term "Authkey \<notin> analz (spies evs)"},
 | 
| 18886 | 1398 |   for we then conclude @{term "authK \<noteq> authKa"}.*}
 | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1399 | apply analz_mono_contra | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1400 | apply (frule_tac [10] Oops_range_spies2) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1401 | apply (frule_tac [9] Oops_range_spies1) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1402 | apply (frule_tac [7] Says_tgs_message_form) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1403 | apply (frule_tac [5] Says_kas_message_form) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1404 | apply (safe del: impI conjI impCE) | 
| 18886 | 1405 | apply (simp_all add: less_SucI new_keys_not_analzd Says_Kas_message_form Says_Tgs_message_form analz_insert_eq not_parts_not_analz analz_insert_freshK1 analz_insert_freshK2 analz_insert_freshK3_bis pushes) | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1406 | txt{*Fake*}
 | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1407 | apply spy_analz | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1408 | txt{*K2*}
 | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1409 | apply (blast intro: parts_insertI less_SucI) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1410 | txt{*K4*}
 | 
| 18886 | 1411 | apply (blast dest: authTicket_authentic Confidentiality_Kas) | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1412 | txt{*Oops2*}
 | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1413 | prefer 3 | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1414 | apply (blast dest: Says_imp_spies [THEN parts.Inj] Key_unique_SesKey intro: less_SucI) | 
| 18886 | 1415 | txt{*Oops1*} 
 | 
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 1416 | prefer 2 | 
| 18886 | 1417 | apply (blast dest: Says_Kas_message_form Says_Tgs_message_form intro: less_SucI) | 
| 1418 | txt{*K5. Not obvious how this step could be integrated with the main
 | |
| 1419 | simplification step. Done in KerberosV.thy *} | |
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 1420 | apply clarify | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1421 | apply (erule_tac V = "Says Aa Tgs ?X \<in> set ?evs" in thin_rl) | 
| 18886 | 1422 | apply (frule Says_imp_spies [THEN parts.Inj, THEN servK_notin_authKeysD]) | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1423 | apply (assumption, blast, assumption) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1424 | apply (simp add: analz_insert_freshK2) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1425 | apply (blast dest: Says_imp_spies [THEN parts.Inj] Key_unique_SesKey intro: less_SucI) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1426 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1427 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1428 | |
| 18886 | 1429 | text{* In the real world Tgs can't check wheter authK is secure! *}
 | 
| 1430 | lemma Confidentiality_Tgs: | |
| 1431 | "\<lbrakk> Says Tgs A | |
| 1432 | (Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace>) | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1433 | \<in> set evs; | 
| 18886 | 1434 | Key authK \<notin> analz (spies evs); | 
| 1435 | \<not> expiredSK Ts evs; | |
| 1436 | A \<notin> bad; B \<notin> bad; evs \<in> kerbIV \<rbrakk> | |
| 1437 | \<Longrightarrow> Key servK \<notin> analz (spies evs)" | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1438 | apply (blast dest: Says_Tgs_message_form Confidentiality_lemma) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1439 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1440 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1441 | text{* In the real world Tgs CAN check what Kas sends! *}
 | 
| 18886 | 1442 | lemma Confidentiality_Tgs_bis: | 
| 1443 | "\<lbrakk> Says Kas A | |
| 1444 | (Crypt Ka \<lbrace>Key authK, Agent Tgs, Number Ta, authTicket\<rbrace>) | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1445 | \<in> set evs; | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1446 | Says Tgs A | 
| 18886 | 1447 | (Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace>) | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1448 | \<in> set evs; | 
| 18886 | 1449 | \<not> expiredAK Ta evs; \<not> expiredSK Ts evs; | 
| 1450 | A \<notin> bad; B \<notin> bad; evs \<in> kerbIV \<rbrakk> | |
| 1451 | \<Longrightarrow> Key servK \<notin> analz (spies evs)" | |
| 1452 | apply (blast dest!: Confidentiality_Kas Confidentiality_Tgs) | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1453 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1454 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1455 | text{*Most general form*}
 | 
| 18886 | 1456 | lemmas Confidentiality_Tgs_ter = authTicket_authentic [THEN Confidentiality_Tgs_bis] | 
| 1457 | ||
| 1458 | lemmas Confidentiality_Auth_A = authK_authentic [THEN Confidentiality_Kas] | |
| 1459 | ||
| 1460 | text{*Needs a confidentiality guarantee, hence moved here.
 | |
| 1461 | Authenticity of servK for A*} | |
| 1462 | lemma servK_authentic_bis_r: | |
| 1463 | "\<lbrakk> Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta, authTicket\<rbrace> | |
| 1464 | \<in> parts (spies evs); | |
| 1465 | Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace> | |
| 1466 | \<in> parts (spies evs); | |
| 1467 | \<not> expiredAK Ta evs; A \<notin> bad; evs \<in> kerbIV \<rbrakk> | |
| 1468 | \<Longrightarrow>Says Tgs A (Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace>) | |
| 1469 | \<in> set evs" | |
| 1470 | apply (blast dest: authK_authentic Confidentiality_Auth_A servK_authentic_ter) | |
| 1471 | done | |
| 1472 | ||
| 1473 | lemma Confidentiality_Serv_A: | |
| 1474 | "\<lbrakk> Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta, authTicket\<rbrace> | |
| 1475 | \<in> parts (spies evs); | |
| 1476 | Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace> | |
| 1477 | \<in> parts (spies evs); | |
| 1478 | \<not> expiredAK Ta evs; \<not> expiredSK Ts evs; | |
| 1479 | A \<notin> bad; B \<notin> bad; evs \<in> kerbIV \<rbrakk> | |
| 1480 | \<Longrightarrow> Key servK \<notin> analz (spies evs)" | |
| 1481 | apply (drule authK_authentic, assumption, assumption) | |
| 1482 | apply (blast dest: Confidentiality_Kas Says_Kas_message_form servK_authentic_ter Confidentiality_Tgs_bis) | |
| 1483 | done | |
| 1484 | ||
| 1485 | lemma Confidentiality_B: | |
| 1486 | "\<lbrakk> Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace> | |
| 1487 | \<in> parts (spies evs); | |
| 1488 | Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace> | |
| 1489 | \<in> parts (spies evs); | |
| 1490 | Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta, authTicket\<rbrace> | |
| 1491 | \<in> parts (spies evs); | |
| 1492 | \<not> expiredSK Ts evs; \<not> expiredAK Ta evs; | |
| 1493 | A \<notin> bad; B \<notin> bad; B \<noteq> Tgs; evs \<in> kerbIV \<rbrakk> | |
| 1494 | \<Longrightarrow> Key servK \<notin> analz (spies evs)" | |
| 1495 | apply (frule authK_authentic) | |
| 1496 | apply (frule_tac [3] Confidentiality_Kas) | |
| 1497 | apply (frule_tac [6] servTicket_authentic, auto) | |
| 1498 | apply (blast dest!: Confidentiality_Tgs_bis dest: Says_Kas_message_form servK_authentic unique_servKeys unique_authKeys) | |
| 1499 | done | |
| 1500 | (* | |
| 1501 | The proof above is fast. It can be done in one command in 17 secs: | |
| 1502 | apply (blast dest: authK_authentic servK_authentic | |
| 1503 | Says_Kas_message_form servTicket_authentic | |
| 1504 | unique_servKeys unique_authKeys | |
| 1505 | Confidentiality_Kas | |
| 1506 | Confidentiality_Tgs_bis) | |
| 1507 | It is very brittle: we can't use this command partway | |
| 1508 | through the script above. | |
| 1509 | *) | |
| 1510 | ||
| 1511 | lemma u_Confidentiality_B: | |
| 1512 | "\<lbrakk> Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace> | |
| 1513 | \<in> parts (spies evs); | |
| 1514 | \<not> expiredSK Ts evs; | |
| 1515 | A \<notin> bad; B \<notin> bad; B \<noteq> Tgs; evs \<in> kerbIV \<rbrakk> | |
| 1516 | \<Longrightarrow> Key servK \<notin> analz (spies evs)" | |
| 1517 | apply (blast dest: u_servTicket_authentic u_NotexpiredSK_NotexpiredAK Confidentiality_Tgs_bis) | |
| 1518 | done | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1519 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1520 | |
| 18886 | 1521 | |
| 1522 | subsection{*Parties authentication: each party verifies "the identity of
 | |
| 1523 | another party who generated some data" (quoted from Neuman and Ts'o).*} | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1524 | |
| 18886 | 1525 | text{*These guarantees don't assess whether two parties agree on
 | 
| 1526 | the same session key: sending a message containing a key | |
| 1527 | doesn't a priori state knowledge of the key.*} | |
| 1528 | ||
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1529 | |
| 18886 | 1530 | text{*@{text Tgs_authenticates_A} can be found above*}
 | 
| 1531 | ||
| 1532 | lemma A_authenticates_Tgs: | |
| 1533 | "\<lbrakk> Says Kas A | |
| 1534 | (Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta, authTicket\<rbrace>) \<in> set evs; | |
| 1535 | Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace> | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1536 | \<in> parts (spies evs); | 
| 18886 | 1537 | Key authK \<notin> analz (spies evs); | 
| 1538 | evs \<in> kerbIV \<rbrakk> | |
| 1539 | \<Longrightarrow> Says Tgs A (Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace>) | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1540 | \<in> set evs" | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1541 | apply (frule Says_Kas_message_form, assumption) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1542 | apply (erule rev_mp) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1543 | apply (erule rev_mp) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1544 | apply (erule rev_mp) | 
| 18886 | 1545 | apply (erule kerbIV.induct, analz_mono_contra) | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1546 | apply (frule_tac [7] K5_msg_in_parts_spies) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1547 | apply (frule_tac [5] K3_msg_in_parts_spies, simp_all, blast) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1548 | txt{*K2 and K4 remain*}
 | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1549 | prefer 2 apply (blast dest!: unique_CryptKey) | 
| 18886 | 1550 | apply (blast dest!: servK_authentic Says_Tgs_message_form authKeys_used) | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1551 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1552 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1553 | |
| 18886 | 1554 | lemma B_authenticates_A: | 
| 1555 | "\<lbrakk> Crypt servK \<lbrace>Agent A, Number T3\<rbrace> \<in> parts (spies evs); | |
| 1556 | Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace> | |
| 1557 | \<in> parts (spies evs); | |
| 1558 | Key servK \<notin> analz (spies evs); | |
| 1559 | A \<notin> bad; B \<notin> bad; B \<noteq> Tgs; evs \<in> kerbIV \<rbrakk> | |
| 1560 | \<Longrightarrow> Says A B \<lbrace>Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace>, | |
| 1561 | Crypt servK \<lbrace>Agent A, Number T3\<rbrace>\<rbrace> \<in> set evs" | |
| 1562 | apply (blast dest: servTicket_authentic_Tgs intro: Says_K5) | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1563 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1564 | |
| 18886 | 1565 | text{*The second assumption tells B what kind of key servK is.*}
 | 
| 1566 | lemma B_authenticates_A_r: | |
| 1567 | "\<lbrakk> Crypt servK \<lbrace>Agent A, Number T3\<rbrace> \<in> parts (spies evs); | |
| 1568 | Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace> | |
| 1569 | \<in> parts (spies evs); | |
| 1570 | Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace> | |
| 1571 | \<in> parts (spies evs); | |
| 1572 | Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta, authTicket\<rbrace> | |
| 1573 | \<in> parts (spies evs); | |
| 1574 | \<not> expiredSK Ts evs; \<not> expiredAK Ta evs; | |
| 1575 | B \<noteq> Tgs; A \<notin> bad; B \<notin> bad; evs \<in> kerbIV \<rbrakk> | |
| 1576 | \<Longrightarrow> Says A B \<lbrace>Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace>, | |
| 1577 | Crypt servK \<lbrace>Agent A, Number T3\<rbrace> \<rbrace> \<in> set evs" | |
| 1578 | apply (blast intro: Says_K5 dest: Confidentiality_B servTicket_authentic_Tgs) | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1579 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1580 | |
| 18886 | 1581 | text{* @{text u_B_authenticates_A} would be the same as @{text B_authenticates_A} because the servK confidentiality assumption is yet unrelaxed*}
 | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1582 | |
| 18886 | 1583 | lemma u_B_authenticates_A_r: | 
| 1584 | "\<lbrakk> Crypt servK \<lbrace>Agent A, Number T3\<rbrace> \<in> parts (spies evs); | |
| 1585 | Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace> | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1586 | \<in> parts (spies evs); | 
| 18886 | 1587 | \<not> expiredSK Ts evs; | 
| 1588 | B \<noteq> Tgs; A \<notin> bad; B \<notin> bad; evs \<in> kerbIV \<rbrakk> | |
| 1589 | \<Longrightarrow> Says A B \<lbrace>Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace>, | |
| 1590 | Crypt servK \<lbrace>Agent A, Number T3\<rbrace> \<rbrace> \<in> set evs" | |
| 1591 | apply (blast intro: Says_K5 dest: u_Confidentiality_B servTicket_authentic_Tgs) | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1592 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1593 | |
| 18886 | 1594 | lemma A_authenticates_B: | 
| 1595 | "\<lbrakk> Crypt servK (Number T3) \<in> parts (spies evs); | |
| 1596 | Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace> | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1597 | \<in> parts (spies evs); | 
| 18886 | 1598 | Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta, authTicket\<rbrace> | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1599 | \<in> parts (spies evs); | 
| 18886 | 1600 | Key authK \<notin> analz (spies evs); Key servK \<notin> analz (spies evs); | 
| 1601 | A \<notin> bad; B \<notin> bad; evs \<in> kerbIV \<rbrakk> | |
| 1602 | \<Longrightarrow> Says B A (Crypt servK (Number T3)) \<in> set evs" | |
| 1603 | apply (frule authK_authentic) | |
| 1604 | apply assumption+ | |
| 1605 | apply (frule servK_authentic) | |
| 1606 | prefer 2 apply (blast dest: authK_authentic Says_Kas_message_form) | |
| 1607 | apply assumption+ | |
| 1608 | apply (blast dest: K4_imp_K2 Key_unique_SesKey intro!: Says_K6) | |
| 1609 | (*Single command proof: slower! | |
| 1610 | apply (blast dest: authK_authentic servK_authentic Says_Kas_message_form Key_unique_SesKey K4_imp_K2 intro!: Says_K6) | |
| 1611 | *) | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1612 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1613 | |
| 18886 | 1614 | lemma A_authenticates_B_r: | 
| 1615 | "\<lbrakk> Crypt servK (Number T3) \<in> parts (spies evs); | |
| 1616 | Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace> | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1617 | \<in> parts (spies evs); | 
| 18886 | 1618 | Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta, authTicket\<rbrace> | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1619 | \<in> parts (spies evs); | 
| 18886 | 1620 | \<not> expiredAK Ta evs; \<not> expiredSK Ts evs; | 
| 1621 | A \<notin> bad; B \<notin> bad; evs \<in> kerbIV \<rbrakk> | |
| 1622 | \<Longrightarrow> Says B A (Crypt servK (Number T3)) \<in> set evs" | |
| 1623 | apply (frule authK_authentic) | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1624 | apply (frule_tac [3] Says_Kas_message_form) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1625 | apply (frule_tac [4] Confidentiality_Kas) | 
| 18886 | 1626 | apply (frule_tac [7] servK_authentic) | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1627 | prefer 8 apply blast | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1628 | apply (erule_tac [9] exE) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1629 | apply (frule_tac [9] K4_imp_K2) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1630 | apply assumption+ | 
| 18886 | 1631 | apply (blast dest: Key_unique_SesKey intro!: Says_K6 dest: Confidentiality_Tgs | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1632 | ) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1633 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1634 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1635 | |
| 18886 | 1636 | subsection{* Key distribution guarantees
 | 
| 1637 | An agent knows a session key if he used it to issue a cipher. | |
| 1638 | These guarantees also convey a stronger form of | |
| 1639 | authentication - non-injective agreement on the session key*} | |
| 1640 | ||
| 1641 | ||
| 1642 | lemma Kas_Issues_A: | |
| 1643 | "\<lbrakk> Says Kas A (Crypt (shrK A) \<lbrace>Key authK, Peer, Ta, authTicket\<rbrace>) \<in> set evs; | |
| 1644 | evs \<in> kerbIV \<rbrakk> | |
| 1645 | \<Longrightarrow> Kas Issues A with (Crypt (shrK A) \<lbrace>Key authK, Peer, Ta, authTicket\<rbrace>) | |
| 1646 | on evs" | |
| 1647 | apply (simp (no_asm) add: Issues_def) | |
| 1648 | apply (rule exI) | |
| 1649 | apply (rule conjI, assumption) | |
| 1650 | apply (simp (no_asm)) | |
| 1651 | apply (erule rev_mp) | |
| 1652 | apply (erule kerbIV.induct) | |
| 1653 | apply (frule_tac [5] Says_ticket_parts) | |
| 1654 | apply (frule_tac [7] Says_ticket_parts) | |
| 1655 | apply (simp_all (no_asm_simp) add: all_conj_distrib) | |
| 1656 | txt{*K2*}
 | |
| 1657 | apply (simp add: takeWhile_tail) | |
| 1658 | apply (blast dest: authK_authentic parts_spies_takeWhile_mono [THEN subsetD] parts_spies_evs_revD2 [THEN subsetD]) | |
| 1659 | done | |
| 1660 | ||
| 1661 | lemma A_authenticates_and_keydist_to_Kas: | |
| 1662 | "\<lbrakk> Crypt (shrK A) \<lbrace>Key authK, Peer, Ta, authTicket\<rbrace> \<in> parts (spies evs); | |
| 1663 | A \<notin> bad; evs \<in> kerbIV \<rbrakk> | |
| 1664 | \<Longrightarrow> Kas Issues A with (Crypt (shrK A) \<lbrace>Key authK, Peer, Ta, authTicket\<rbrace>) | |
| 1665 | on evs" | |
| 1666 | apply (blast dest: authK_authentic Kas_Issues_A) | |
| 1667 | done | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1668 | |
| 18886 | 1669 | lemma honest_never_says_newer_timestamp_in_auth: | 
| 1670 |      "\<lbrakk> (CT evs) \<le> T; A \<notin> bad; Number T \<in> parts {X}; evs \<in> kerbIV \<rbrakk> 
 | |
| 1671 | \<Longrightarrow> \<forall> B Y. Says A B \<lbrace>Y, X\<rbrace> \<notin> set evs" | |
| 1672 | apply (erule rev_mp) | |
| 1673 | apply (erule kerbIV.induct) | |
| 1674 | apply (simp_all) | |
| 1675 | apply force+ | |
| 1676 | done | |
| 1677 | ||
| 1678 | lemma honest_never_says_current_timestamp_in_auth: | |
| 1679 |      "\<lbrakk> (CT evs) = T; Number T \<in> parts {X}; evs \<in> kerbIV \<rbrakk> 
 | |
| 1680 | \<Longrightarrow> \<forall> A B Y. A \<notin> bad \<longrightarrow> Says A B \<lbrace>Y, X\<rbrace> \<notin> set evs" | |
| 1681 | apply (frule eq_imp_le) | |
| 1682 | apply (blast dest: honest_never_says_newer_timestamp_in_auth) | |
| 1683 | done | |
| 1684 | ||
| 1685 | lemma A_trusts_secure_authenticator: | |
| 1686 | "\<lbrakk> Crypt K \<lbrace>Agent A, Number T\<rbrace> \<in> parts (spies evs); | |
| 1687 | Key K \<notin> analz (spies evs); evs \<in> kerbIV \<rbrakk> | |
| 1688 | \<Longrightarrow> \<exists> B X. Says A Tgs \<lbrace>X, Crypt K \<lbrace>Agent A, Number T\<rbrace>, Agent B\<rbrace> \<in> set evs \<or> | |
| 1689 | Says A B \<lbrace>X, Crypt K \<lbrace>Agent A, Number T\<rbrace>\<rbrace> \<in> set evs"; | |
| 1690 | apply (erule rev_mp) | |
| 1691 | apply (erule rev_mp) | |
| 1692 | apply (erule kerbIV.induct, analz_mono_contra) | |
| 1693 | apply (frule_tac [5] Says_ticket_parts) | |
| 1694 | apply (frule_tac [7] Says_ticket_parts) | |
| 1695 | apply (simp_all add: all_conj_distrib) | |
| 1696 | apply blast+ | |
| 1697 | done | |
| 1698 | ||
| 1699 | lemma A_Issues_Tgs: | |
| 1700 | "\<lbrakk> Says A Tgs \<lbrace>authTicket, Crypt authK \<lbrace>Agent A, Number T2\<rbrace>, Agent B\<rbrace> | |
| 1701 | \<in> set evs; | |
| 1702 | Key authK \<notin> analz (spies evs); | |
| 1703 | A \<notin> bad; evs \<in> kerbIV \<rbrakk> | |
| 1704 | \<Longrightarrow> A Issues Tgs with (Crypt authK \<lbrace>Agent A, Number T2\<rbrace>) on evs" | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1705 | apply (simp (no_asm) add: Issues_def) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1706 | apply (rule exI) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1707 | apply (rule conjI, assumption) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1708 | apply (simp (no_asm)) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1709 | apply (erule rev_mp) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1710 | apply (erule rev_mp) | 
| 18886 | 1711 | apply (erule kerbIV.induct, analz_mono_contra) | 
| 1712 | apply (frule_tac [5] Says_ticket_parts) | |
| 1713 | apply (frule_tac [7] Says_ticket_parts) | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1714 | apply (simp_all (no_asm_simp) add: all_conj_distrib) | 
| 18886 | 1715 | txt{*fake*}
 | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1716 | apply blast | 
| 18886 | 1717 | txt{*K3*}
 | 
| 1718 | (* | |
| 1719 | apply clarify | |
| 1720 | apply (drule Says_imp_knows_Spy [THEN parts.Inj, THEN authK_authentic, THEN Says_Kas_message_form], assumption, assumption, assumption) | |
| 1721 | *) | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1722 | apply (simp add: takeWhile_tail) | 
| 18886 | 1723 | apply auto | 
| 1724 | apply (force dest!: authK_authentic Says_Kas_message_form) | |
| 1725 | apply (drule parts_spies_takeWhile_mono [THEN subsetD, THEN parts_spies_evs_revD2 [THEN subsetD]]) | |
| 1726 | apply (drule A_trusts_secure_authenticator, assumption, assumption) | |
| 1727 | apply (simp add: honest_never_says_current_timestamp_in_auth) | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1728 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1729 | |
| 18886 | 1730 | lemma Tgs_authenticates_and_keydist_to_A: | 
| 1731 | "\<lbrakk> Crypt authK \<lbrace>Agent A, Number T2\<rbrace> \<in> parts (spies evs); | |
| 1732 | Crypt (shrK Tgs) \<lbrace>Agent A, Agent Tgs, Key authK, Number Ta\<rbrace> | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1733 | \<in> parts (spies evs); | 
| 18886 | 1734 | Key authK \<notin> analz (spies evs); | 
| 1735 | A \<notin> bad; evs \<in> kerbIV \<rbrakk> | |
| 1736 | \<Longrightarrow> A Issues Tgs with (Crypt authK \<lbrace>Agent A, Number T2\<rbrace>) on evs" | |
| 1737 | apply (blast dest: A_Issues_Tgs Tgs_authenticates_A) | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1738 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1739 | |
| 18886 | 1740 | lemma Tgs_Issues_A: | 
| 1741 | "\<lbrakk> Says Tgs A (Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket \<rbrace>) | |
| 1742 | \<in> set evs; | |
| 1743 | Key authK \<notin> analz (spies evs); evs \<in> kerbIV \<rbrakk> | |
| 1744 | \<Longrightarrow> Tgs Issues A with | |
| 1745 | (Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket \<rbrace>) on evs" | |
| 1746 | apply (simp (no_asm) add: Issues_def) | |
| 1747 | apply (rule exI) | |
| 1748 | apply (rule conjI, assumption) | |
| 1749 | apply (simp (no_asm)) | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1750 | apply (erule rev_mp) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1751 | apply (erule rev_mp) | 
| 18886 | 1752 | apply (erule kerbIV.induct, analz_mono_contra) | 
| 1753 | apply (frule_tac [5] Says_ticket_parts) | |
| 1754 | apply (frule_tac [7] Says_ticket_parts) | |
| 1755 | apply (simp_all (no_asm_simp) add: all_conj_distrib) | |
| 1756 | txt{*K4*}
 | |
| 1757 | apply (simp add: takeWhile_tail) | |
| 1758 | (*Last two thms installed only to derive authK \<notin> range shrK*) | |
| 1759 | apply (blast dest: servK_authentic parts_spies_takeWhile_mono [THEN subsetD] parts_spies_evs_revD2 [THEN subsetD] authTicket_authentic Says_Kas_message_form) | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1760 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1761 | |
| 18886 | 1762 | lemma A_authenticates_and_keydist_to_Tgs: | 
| 1763 | "\<lbrakk>Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace> \<in> parts (spies evs); | |
| 1764 | Key authK \<notin> analz (spies evs); B \<noteq> Tgs; evs \<in> kerbIV \<rbrakk> | |
| 1765 | \<Longrightarrow> \<exists>A. Tgs Issues A with | |
| 1766 | (Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket \<rbrace>) on evs" | |
| 1767 | apply (blast dest: Tgs_Issues_A servK_authentic_bis) | |
| 1768 | done | |
| 1769 | ||
| 1770 | ||
| 1771 | ||
| 1772 | lemma B_Issues_A: | |
| 1773 | "\<lbrakk> Says B A (Crypt servK (Number T3)) \<in> set evs; | |
| 1774 | Key servK \<notin> analz (spies evs); | |
| 1775 | A \<notin> bad; B \<notin> bad; B \<noteq> Tgs; evs \<in> kerbIV \<rbrakk> | |
| 1776 | \<Longrightarrow> B Issues A with (Crypt servK (Number T3)) on evs" | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1777 | apply (simp (no_asm) add: Issues_def) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1778 | apply (rule exI) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1779 | apply (rule conjI, assumption) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1780 | apply (simp (no_asm)) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1781 | apply (erule rev_mp) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1782 | apply (erule rev_mp) | 
| 18886 | 1783 | apply (erule kerbIV.induct, analz_mono_contra) | 
| 1784 | apply (frule_tac [5] Says_ticket_parts) | |
| 1785 | apply (frule_tac [7] Says_ticket_parts) | |
| 1786 | apply (simp_all (no_asm_simp) add: all_conj_distrib) | |
| 1787 | apply blast | |
| 1788 | txt{*K6 requires numerous lemmas*}
 | |
| 1789 | apply (simp add: takeWhile_tail) | |
| 1790 | apply (blast dest: servTicket_authentic parts_spies_takeWhile_mono [THEN subsetD] parts_spies_evs_revD2 [THEN subsetD] intro: Says_K6) | |
| 1791 | done | |
| 1792 | ||
| 1793 | lemma B_Issues_A_r: | |
| 1794 | "\<lbrakk> Says B A (Crypt servK (Number T3)) \<in> set evs; | |
| 1795 | Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace> | |
| 1796 | \<in> parts (spies evs); | |
| 1797 | Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace> | |
| 1798 | \<in> parts (spies evs); | |
| 1799 | Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta, authTicket\<rbrace> | |
| 1800 | \<in> parts (spies evs); | |
| 1801 | \<not> expiredSK Ts evs; \<not> expiredAK Ta evs; | |
| 1802 | A \<notin> bad; B \<notin> bad; B \<noteq> Tgs; evs \<in> kerbIV \<rbrakk> | |
| 1803 | \<Longrightarrow> B Issues A with (Crypt servK (Number T3)) on evs" | |
| 1804 | apply (blast dest!: Confidentiality_B B_Issues_A) | |
| 1805 | done | |
| 1806 | ||
| 1807 | lemma u_B_Issues_A_r: | |
| 1808 | "\<lbrakk> Says B A (Crypt servK (Number T3)) \<in> set evs; | |
| 1809 | Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace> | |
| 1810 | \<in> parts (spies evs); | |
| 1811 | \<not> expiredSK Ts evs; | |
| 1812 | A \<notin> bad; B \<notin> bad; B \<noteq> Tgs; evs \<in> kerbIV \<rbrakk> | |
| 1813 | \<Longrightarrow> B Issues A with (Crypt servK (Number T3)) on evs" | |
| 1814 | apply (blast dest!: u_Confidentiality_B B_Issues_A) | |
| 1815 | done | |
| 1816 | ||
| 1817 | lemma A_authenticates_and_keydist_to_B: | |
| 1818 | "\<lbrakk> Crypt servK (Number T3) \<in> parts (spies evs); | |
| 1819 | Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace> | |
| 1820 | \<in> parts (spies evs); | |
| 1821 | Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta, authTicket\<rbrace> | |
| 1822 | \<in> parts (spies evs); | |
| 1823 | Key authK \<notin> analz (spies evs); Key servK \<notin> analz (spies evs); | |
| 1824 | A \<notin> bad; B \<notin> bad; B \<noteq> Tgs; evs \<in> kerbIV \<rbrakk> | |
| 1825 | \<Longrightarrow> B Issues A with (Crypt servK (Number T3)) on evs" | |
| 1826 | apply (blast dest!: A_authenticates_B B_Issues_A) | |
| 1827 | done | |
| 1828 | ||
| 1829 | lemma A_authenticates_and_keydist_to_B_r: | |
| 1830 | "\<lbrakk> Crypt servK (Number T3) \<in> parts (spies evs); | |
| 1831 | Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace> | |
| 1832 | \<in> parts (spies evs); | |
| 1833 | Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta, authTicket\<rbrace> | |
| 1834 | \<in> parts (spies evs); | |
| 1835 | \<not> expiredAK Ta evs; \<not> expiredSK Ts evs; | |
| 1836 | A \<notin> bad; B \<notin> bad; B \<noteq> Tgs; evs \<in> kerbIV \<rbrakk> | |
| 1837 | \<Longrightarrow> B Issues A with (Crypt servK (Number T3)) on evs" | |
| 1838 | apply (blast dest!: A_authenticates_B_r Confidentiality_Serv_A B_Issues_A) | |
| 1839 | done | |
| 1840 | ||
| 1841 | ||
| 1842 | lemma A_Issues_B: | |
| 1843 | "\<lbrakk> Says A B \<lbrace>servTicket, Crypt servK \<lbrace>Agent A, Number T3\<rbrace>\<rbrace> | |
| 1844 | \<in> set evs; | |
| 1845 | Key servK \<notin> analz (spies evs); | |
| 1846 | B \<noteq> Tgs; A \<notin> bad; B \<notin> bad; evs \<in> kerbIV \<rbrakk> | |
| 1847 | \<Longrightarrow> A Issues B with (Crypt servK \<lbrace>Agent A, Number T3\<rbrace>) on evs" | |
| 1848 | apply (simp (no_asm) add: Issues_def) | |
| 1849 | apply (rule exI) | |
| 1850 | apply (rule conjI, assumption) | |
| 1851 | apply (simp (no_asm)) | |
| 1852 | apply (erule rev_mp) | |
| 1853 | apply (erule rev_mp) | |
| 1854 | apply (erule kerbIV.induct, analz_mono_contra) | |
| 1855 | apply (frule_tac [5] Says_ticket_parts) | |
| 1856 | apply (frule_tac [7] Says_ticket_parts) | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1857 | apply (simp_all (no_asm_simp)) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1858 | apply clarify | 
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 1859 | txt{*K5*}
 | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1860 | apply auto | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1861 | apply (simp add: takeWhile_tail) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1862 | txt{*Level 15: case study necessary because the assumption doesn't state
 | 
| 18886 | 1863 | the form of servTicket. The guarantee becomes stronger.*} | 
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 1864 | apply (blast dest: Says_imp_spies [THEN analz.Inj, THEN analz_Decrypt'] | 
| 18886 | 1865 | K3_imp_K2 servK_authentic_ter | 
| 14207 
f20fbb141673
Conversion of all main protocols from "Shared" to "Public".
 paulson parents: 
14200diff
changeset | 1866 | parts_spies_takeWhile_mono [THEN subsetD] | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1867 | parts_spies_evs_revD2 [THEN subsetD] | 
| 18886 | 1868 | intro: Says_K5) | 
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1869 | apply (simp add: takeWhile_tail) | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1870 | done | 
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1871 | |
| 18886 | 1872 | lemma A_Issues_B_r: | 
| 1873 | "\<lbrakk> Says A B \<lbrace>servTicket, Crypt servK \<lbrace>Agent A, Number T3\<rbrace>\<rbrace> | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1874 | \<in> set evs; | 
| 18886 | 1875 | Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta, authTicket\<rbrace> | 
| 1876 | \<in> parts (spies evs); | |
| 1877 | Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace> | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1878 | \<in> parts (spies evs); | 
| 18886 | 1879 | \<not> expiredAK Ta evs; \<not> expiredSK Ts evs; | 
| 1880 | B \<noteq> Tgs; A \<notin> bad; B \<notin> bad; evs \<in> kerbIV \<rbrakk> | |
| 1881 | \<Longrightarrow> A Issues B with (Crypt servK \<lbrace>Agent A, Number T3\<rbrace>) on evs" | |
| 1882 | apply (blast dest!: Confidentiality_Serv_A A_Issues_B) | |
| 1883 | done | |
| 1884 | ||
| 1885 | lemma B_authenticates_and_keydist_to_A: | |
| 1886 | "\<lbrakk> Crypt servK \<lbrace>Agent A, Number T3\<rbrace> \<in> parts (spies evs); | |
| 1887 | Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace> | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1888 | \<in> parts (spies evs); | 
| 18886 | 1889 | Key servK \<notin> analz (spies evs); | 
| 1890 | B \<noteq> Tgs; A \<notin> bad; B \<notin> bad; evs \<in> kerbIV \<rbrakk> | |
| 1891 | \<Longrightarrow> A Issues B with (Crypt servK \<lbrace>Agent A, Number T3\<rbrace>) on evs" | |
| 1892 | apply (blast dest: B_authenticates_A A_Issues_B) | |
| 1893 | done | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1894 | |
| 18886 | 1895 | lemma B_authenticates_and_keydist_to_A_r: | 
| 1896 | "\<lbrakk> Crypt servK \<lbrace>Agent A, Number T3\<rbrace> \<in> parts (spies evs); | |
| 1897 | Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace> | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1898 | \<in> parts (spies evs); | 
| 18886 | 1899 | Crypt authK \<lbrace>Key servK, Agent B, Number Ts, servTicket\<rbrace> | 
| 1900 | \<in> parts (spies evs); | |
| 1901 | Crypt (shrK A) \<lbrace>Key authK, Agent Tgs, Number Ta, authTicket\<rbrace> | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1902 | \<in> parts (spies evs); | 
| 18886 | 1903 | \<not> expiredSK Ts evs; \<not> expiredAK Ta evs; | 
| 1904 | B \<noteq> Tgs; A \<notin> bad; B \<notin> bad; evs \<in> kerbIV \<rbrakk> | |
| 1905 | \<Longrightarrow> A Issues B with (Crypt servK \<lbrace>Agent A, Number T3\<rbrace>) on evs" | |
| 1906 | apply (blast dest: B_authenticates_A Confidentiality_B A_Issues_B) | |
| 1907 | done | |
| 1908 | ||
| 1909 | text{* @{text u_B_authenticates_and_keydist_to_A} would be the same as @{text B_authenticates_and_keydist_to_A} because the
 | |
| 1910 | servK confidentiality assumption is yet unrelaxed*} | |
| 1911 | ||
| 1912 | lemma u_B_authenticates_and_keydist_to_A_r: | |
| 1913 | "\<lbrakk> Crypt servK \<lbrace>Agent A, Number T3\<rbrace> \<in> parts (spies evs); | |
| 1914 | Crypt (shrK B) \<lbrace>Agent A, Agent B, Key servK, Number Ts\<rbrace> | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1915 | \<in> parts (spies evs); | 
| 18886 | 1916 | \<not> expiredSK Ts evs; | 
| 1917 | B \<noteq> Tgs; A \<notin> bad; B \<notin> bad; evs \<in> kerbIV \<rbrakk> | |
| 1918 | \<Longrightarrow> A Issues B with (Crypt servK \<lbrace>Agent A, Number T3\<rbrace>) on evs" | |
| 1919 | apply (blast dest: u_B_authenticates_A_r u_Confidentiality_B A_Issues_B) | |
| 1920 | done | |
| 14182 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1921 | |
| 
5f49f00fe084
conversion of HOL/Auth/KerberosIV to new-style theory
 paulson parents: 
13507diff
changeset | 1922 | |
| 18886 | 1923 | |
| 6452 | 1924 | |
| 1925 | end |