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