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