src/HOL/Auth/OtwayRees_AN.ML
author paulson
Tue, 25 Mar 1997 10:43:01 +0100
changeset 2837 dee1c7f1f576
parent 2637 e9b203f854ae
child 2891 d8f254ad1ab9
permissions -rw-r--r--
Trivial renamings (for consistency with CSFW papers)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
     1
(*  Title:      HOL/Auth/OtwayRees
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
     2
    ID:         $Id$
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
     4
    Copyright   1996  University of Cambridge
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
     5
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
     6
Inductive relation "otway" for the Otway-Rees protocol.
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
     7
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
     8
Simplified version with minimal encryption but explicit messages
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
     9
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    10
From page 11 of
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    11
  Abadi and Needham.  Prudent Engineering Practice for Cryptographic Protocols.
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    12
  IEEE Trans. SE 22 (1), 1996
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    13
*)
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    14
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    15
open OtwayRees_AN;
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    16
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    17
proof_timing:=true;
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    18
HOL_quantifiers := false;
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    19
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    20
2331
d6a56ff0d94e Minor renamings
paulson
parents: 2284
diff changeset
    21
(*A "possibility property": there are traces that reach the end*)
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    22
goal thy 
2331
d6a56ff0d94e Minor renamings
paulson
parents: 2284
diff changeset
    23
 "!!A B. [| A ~= B; A ~= Server; B ~= Server |]                               \
d6a56ff0d94e Minor renamings
paulson
parents: 2284
diff changeset
    24
\        ==> EX K. EX NA. EX evs: otway lost.                                 \
2284
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2264
diff changeset
    25
\             Says B A (Crypt (shrK A) {|Nonce NA, Agent A, Agent B, Key K|}) \
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    26
\             : set_of_list evs";
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    27
by (REPEAT (resolve_tac [exI,bexI] 1));
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    28
by (rtac (otway.Nil RS otway.OR1 RS otway.OR2 RS otway.OR3 RS otway.OR4) 2);
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
    29
by possibility_tac;
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    30
result();
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    31
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    32
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    33
(**** Inductive proofs about otway ****)
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    34
2106
1a52e2c5897e Generaly tidying up
paulson
parents: 2090
diff changeset
    35
(*Monotonicity*)
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    36
goal thy "!!evs. lost' <= lost ==> otway lost' <= otway lost";
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    37
by (rtac subsetI 1);
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    38
by (etac otway.induct 1);
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    39
by (REPEAT_FIRST
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    40
    (best_tac (!claset addIs (impOfSubs (sees_mono RS analz_mono RS synth_mono)
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    41
                              :: otway.intrs))));
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    42
qed "otway_mono";
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    43
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    44
(*Nobody sends themselves messages*)
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    45
goal thy "!!evs. evs : otway lost ==> ALL A X. Says A A X ~: set_of_list evs";
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    46
by (etac otway.induct 1);
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    47
by (Auto_tac());
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    48
qed_spec_mp "not_Says_to_self";
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    49
Addsimps [not_Says_to_self];
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    50
AddSEs   [not_Says_to_self RSN (2, rev_notE)];
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    51
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    52
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    53
(** For reasoning about the encrypted portion of messages **)
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    54
2837
dee1c7f1f576 Trivial renamings (for consistency with CSFW papers)
paulson
parents: 2637
diff changeset
    55
goal thy "!!evs. Says S' B {|X, Crypt(shrK B) X'|} : set_of_list evs ==> \
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    56
\                X : analz (sees lost Spy evs)";
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    57
by (fast_tac (!claset addSDs [Says_imp_sees_Spy RS analz.Inj]) 1);
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    58
qed "OR4_analz_sees_Spy";
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    59
2284
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2264
diff changeset
    60
goal thy "!!evs. Says Server B {|X, Crypt K' {|NB, a, Agent B, K|}|} \
2131
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2106
diff changeset
    61
\                  : set_of_list evs ==> K : parts (sees lost Spy evs)";
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
    62
by (fast_tac (!claset addSEs sees_Spy_partsEs) 1);
2131
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2106
diff changeset
    63
qed "Oops_parts_sees_Spy";
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    64
2131
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2106
diff changeset
    65
(*OR4_analz_sees_Spy lets us treat those cases using the same 
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    66
  argument as for the Fake case.  This is possible for most, but not all,
2131
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2106
diff changeset
    67
  proofs, since Fake messages originate from the Spy. *)
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    68
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    69
bind_thm ("OR4_parts_sees_Spy",
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    70
          OR4_analz_sees_Spy RS (impOfSubs analz_subset_parts));
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    71
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    72
(*We instantiate the variable to "lost".  Leaving it as a Var makes proofs
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    73
  harder to complete, since simplification does less for us.*)
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    74
val parts_Fake_tac = 
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    75
    forw_inst_tac [("lost","lost")] OR4_parts_sees_Spy 6 THEN
2131
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2106
diff changeset
    76
    forw_inst_tac [("lost","lost")] Oops_parts_sees_Spy 7;
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    77
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    78
(*For proving the easier theorems about X ~: parts (sees lost Spy evs) *)
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    79
fun parts_induct_tac i = SELECT_GOAL
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    80
    (DETERM (etac otway.induct 1 THEN parts_Fake_tac THEN
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
    81
             (*Fake message*)
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
    82
             TRY (best_tac (!claset addDs [impOfSubs analz_subset_parts,
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
    83
                                           impOfSubs Fake_parts_insert]
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    84
                                    addss (!simpset)) 2)) THEN
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    85
     (*Base case*)
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    86
     fast_tac (!claset addss (!simpset)) 1 THEN
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    87
     ALLGOALS Asm_simp_tac) i;
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    88
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    89
(** Theorems of the form X ~: parts (sees lost Spy evs) imply that NOBODY
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    90
    sends messages containing X! **)
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    91
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    92
(*Spy never sees another agent's shared key! (unless it's lost at start)*)
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    93
goal thy 
2131
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2106
diff changeset
    94
 "!!evs. evs : otway lost \
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2106
diff changeset
    95
\        ==> (Key (shrK A) : parts (sees lost Spy evs)) = (A : lost)";
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    96
by (parts_induct_tac 1);
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    97
by (Auto_tac());
2131
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2106
diff changeset
    98
qed "Spy_see_shrK";
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2106
diff changeset
    99
Addsimps [Spy_see_shrK];
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   100
2131
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2106
diff changeset
   101
goal thy 
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2106
diff changeset
   102
 "!!evs. evs : otway lost \
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2106
diff changeset
   103
\        ==> (Key (shrK A) : analz (sees lost Spy evs)) = (A : lost)";
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2106
diff changeset
   104
by (auto_tac(!claset addDs [impOfSubs analz_subset_parts], !simpset));
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2106
diff changeset
   105
qed "Spy_analz_shrK";
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2106
diff changeset
   106
Addsimps [Spy_analz_shrK];
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   107
2131
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2106
diff changeset
   108
goal thy  "!!A. [| Key (shrK A) : parts (sees lost Spy evs);       \
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2106
diff changeset
   109
\                  evs : otway lost |] ==> A:lost";
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2106
diff changeset
   110
by (fast_tac (!claset addDs [Spy_see_shrK]) 1);
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2106
diff changeset
   111
qed "Spy_see_shrK_D";
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   112
2131
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2106
diff changeset
   113
bind_thm ("Spy_analz_shrK_D", analz_subset_parts RS subsetD RS Spy_see_shrK_D);
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2106
diff changeset
   114
AddSDs [Spy_see_shrK_D, Spy_analz_shrK_D];
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   115
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   116
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   117
(*Nobody can have used non-existent keys!*)
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   118
goal thy "!!evs. evs : otway lost ==>          \
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   119
\         Key K ~: used evs --> K ~: keysFor (parts (sees lost Spy evs))";
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   120
by (parts_induct_tac 1);
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   121
(*Fake*)
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   122
by (best_tac
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   123
      (!claset addIs [impOfSubs analz_subset_parts]
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   124
               addDs [impOfSubs (analz_subset_parts RS keysFor_mono),
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   125
                      impOfSubs (parts_insert_subset_Un RS keysFor_mono)]
2637
e9b203f854ae reflecting my recent changes of the simplifier and classical reasoner
oheimb
parents: 2516
diff changeset
   126
               unsafe_addss (!simpset)) 1);
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   127
(*OR3*)
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   128
by (fast_tac (!claset addss (!simpset)) 1);
2160
ad4382e546fc Simplified new_keys_not_seen, etc.: replaced the
paulson
parents: 2131
diff changeset
   129
qed_spec_mp "new_keys_not_used";
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   130
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   131
bind_thm ("new_keys_not_analzd",
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   132
          [analz_subset_parts RS keysFor_mono,
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   133
           new_keys_not_used] MRS contra_subsetD);
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   134
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   135
Addsimps [new_keys_not_used, new_keys_not_analzd];
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   136
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   137
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   138
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   139
(*** Proofs involving analz ***)
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   140
2131
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2106
diff changeset
   141
(*Describes the form of K and NA when the Server sends this message.*)
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   142
goal thy 
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   143
 "!!evs. [| Says Server B                                           \
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   144
\              {|Crypt (shrK A) {|NA, Agent A, Agent B, Key K|},    \
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   145
\                Crypt (shrK B) {|NB, Agent A, Agent B, Key K|}|}   \
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   146
\             : set_of_list evs;                                    \
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   147
\           evs : otway lost |]                                     \
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   148
\        ==> K ~: range shrK & (EX i. NA = Nonce i) & (EX j. NB = Nonce j)";
2131
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2106
diff changeset
   149
by (etac rev_mp 1);
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2106
diff changeset
   150
by (etac otway.induct 1);
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2106
diff changeset
   151
by (ALLGOALS (fast_tac (!claset addss (!simpset))));
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2106
diff changeset
   152
qed "Says_Server_message_form";
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   153
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   154
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   155
(*For proofs involving analz.  We again instantiate the variable to "lost".*)
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   156
val analz_Fake_tac = 
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   157
    dres_inst_tac [("lost","lost")] OR4_analz_sees_Spy 6 THEN
2131
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2106
diff changeset
   158
    forw_inst_tac [("lost","lost")] Says_Server_message_form 7 THEN
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   159
    assume_tac 7 THEN
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2417
diff changeset
   160
    REPEAT ((eresolve_tac [exE, conjE] ORELSE' hyp_subst_tac) 7);
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   161
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   162
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   163
(****
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   164
 The following is to prove theorems of the form
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   165
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   166
  Key K : analz (insert (Key KAB) (sees lost Spy evs)) ==>
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2417
diff changeset
   167
  Key K : analz (sees lost Spy evs)
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   168
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   169
 A more general formula must be proved inductively.
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   170
****)
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   171
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   172
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   173
(** Session keys are not used to encrypt other session keys **)
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   174
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   175
(*The equality makes the induction hypothesis easier to apply*)
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   176
goal thy  
2331
d6a56ff0d94e Minor renamings
paulson
parents: 2284
diff changeset
   177
 "!!evs. evs : otway lost ==>                                         \
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   178
\  ALL K KK. KK <= Compl (range shrK) -->                      \
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   179
\            (Key K : analz (Key``KK Un (sees lost Spy evs))) = \
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   180
\            (K : KK | Key K : analz (sees lost Spy evs))";
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   181
by (etac otway.induct 1);
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   182
by analz_Fake_tac;
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   183
by (REPEAT_FIRST (resolve_tac [allI, impI]));
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   184
by (REPEAT_FIRST (rtac analz_image_freshK_lemma ));
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   185
(*14 seconds*)
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   186
by (ALLGOALS (asm_simp_tac analz_image_freshK_ss));
2131
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2106
diff changeset
   187
(*OR4, Fake*) 
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   188
by (EVERY (map spy_analz_tac [3,2]));
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   189
(*Base*)
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   190
by (fast_tac (!claset addIs [image_eqI] addss (!simpset)) 1);
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   191
qed_spec_mp "analz_image_freshK";
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   192
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   193
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   194
goal thy
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   195
 "!!evs. [| evs : otway lost;  KAB ~: range shrK |] ==>             \
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   196
\        Key K : analz (insert (Key KAB) (sees lost Spy evs)) = \
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   197
\        (K = KAB | Key K : analz (sees lost Spy evs))";
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   198
by (asm_simp_tac (analz_image_freshK_ss addsimps [analz_image_freshK]) 1);
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   199
qed "analz_insert_freshK";
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   200
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   201
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   202
(*** The Key K uniquely identifies the Server's  message. **)
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   203
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   204
goal thy 
2331
d6a56ff0d94e Minor renamings
paulson
parents: 2284
diff changeset
   205
 "!!evs. evs : otway lost ==>                              \
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   206
\      EX A' B' NA' NB'. ALL A B NA NB.                    \
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   207
\       Says Server B \
2331
d6a56ff0d94e Minor renamings
paulson
parents: 2284
diff changeset
   208
\         {|Crypt (shrK A) {|NA, Agent A, Agent B, K|},                     \
2284
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2264
diff changeset
   209
\           Crypt (shrK B) {|NB, Agent A, Agent B, K|}|} : set_of_list evs  \
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   210
\       --> A=A' & B=B' & NA=NA' & NB=NB'";
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   211
by (etac otway.induct 1);
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   212
by (ALLGOALS (asm_simp_tac (!simpset addsimps [all_conj_distrib])));
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   213
by (Step_tac 1);
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   214
(*Remaining cases: OR3 and OR4*)
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   215
by (ex_strip_tac 2);
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   216
by (Fast_tac 2);
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   217
by (expand_case_tac "K = ?y" 1);
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   218
by (REPEAT (ares_tac [refl,exI,impI,conjI] 2));
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   219
(*...we assume X is a recent message and handle this case by contradiction*)
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   220
by (fast_tac (!claset addSEs sees_Spy_partsEs
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   221
                      delrules [conjI]    (*prevent split-up into 4 subgoals*)
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   222
                      addss (!simpset addsimps [parts_insertI])) 1);
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   223
val lemma = result();
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   224
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   225
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   226
goal thy 
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   227
"!!evs. [| Says Server B                                           \
2284
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2264
diff changeset
   228
\            {|Crypt (shrK A) {|NA, Agent A, Agent B, K|},         \
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2264
diff changeset
   229
\              Crypt (shrK B) {|NB, Agent A, Agent B, K|}|}        \
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   230
\           : set_of_list evs;                                     \
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   231
\          Says Server B'                                          \
2284
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2264
diff changeset
   232
\            {|Crypt (shrK A') {|NA', Agent A', Agent B', K|},     \
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2264
diff changeset
   233
\              Crypt (shrK B') {|NB', Agent A', Agent B', K|}|}    \
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   234
\           : set_of_list evs;                                     \
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   235
\          evs : otway lost |]                                     \
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   236
\       ==> A=A' & B=B' & NA=NA' & NB=NB'";
2417
95f275c8476e New tactic: prove_unique_tac
paulson
parents: 2375
diff changeset
   237
by (prove_unique_tac lemma 1);
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   238
qed "unique_session_keys";
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   239
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   240
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   241
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   242
(**** Authenticity properties relating to NA ****)
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   243
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   244
(*If the encrypted message appears then it originated with the Server!*)
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   245
goal thy 
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   246
 "!!evs. [| A ~: lost;  evs : otway lost |]                 \
2284
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2264
diff changeset
   247
\ ==> Crypt (shrK A) {|NA, Agent A, Agent B, Key K|}        \
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   248
\      : parts (sees lost Spy evs)                          \
2331
d6a56ff0d94e Minor renamings
paulson
parents: 2284
diff changeset
   249
\     --> (EX NB. Says Server B                                          \
2284
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2264
diff changeset
   250
\                  {|Crypt (shrK A) {|NA, Agent A, Agent B, Key K|},     \
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2264
diff changeset
   251
\                    Crypt (shrK B) {|NB, Agent A, Agent B, Key K|}|}    \
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   252
\                  : set_of_list evs)";
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   253
by (parts_induct_tac 1);
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   254
by (ALLGOALS (asm_simp_tac (!simpset addsimps [ex_disj_distrib])));
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   255
(*OR3*)
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   256
by (Fast_tac 1);
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   257
qed_spec_mp "NA_Crypt_imp_Server_msg";
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   258
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   259
2454
92f43ed48935 Corrected comments
paulson
parents: 2451
diff changeset
   260
(*Corollary: if A receives B's OR4 message then it originated with the Server.
92f43ed48935 Corrected comments
paulson
parents: 2451
diff changeset
   261
  Freshness may be inferred from nonce NA.*)
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   262
goal thy 
2284
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2264
diff changeset
   263
 "!!evs. [| Says B' A (Crypt (shrK A) {|NA, Agent A, Agent B, Key K|})  \
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   264
\            : set_of_list evs;                                         \
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   265
\           A ~: lost;  evs : otway lost |]                             \
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   266
\        ==> EX NB. Says Server B                                       \
2284
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2264
diff changeset
   267
\                    {|Crypt (shrK A) {|NA, Agent A, Agent B, Key K|},  \
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2264
diff changeset
   268
\                      Crypt (shrK B) {|NB, Agent A, Agent B, Key K|}|} \
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   269
\                   : set_of_list evs";
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   270
by (fast_tac (!claset addSIs [NA_Crypt_imp_Server_msg]
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   271
                      addEs  sees_Spy_partsEs) 1);
2331
d6a56ff0d94e Minor renamings
paulson
parents: 2284
diff changeset
   272
qed "A_trusts_OR4";
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   273
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   274
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   275
(** Crucial secrecy property: Spy does not see the keys sent in msg OR3
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   276
    Does not in itself guarantee security: an attack could violate 
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   277
    the premises, e.g. by having A=Spy **)
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   278
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   279
goal thy 
2166
d276a806cc10 Tidying up: removing redundant assumptions, etc.
paulson
parents: 2160
diff changeset
   280
 "!!evs. [| A ~: lost;  B ~: lost;  evs : otway lost |]                    \
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   281
\        ==> Says Server B                                                 \
2284
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2264
diff changeset
   282
\             {|Crypt (shrK A) {|NA, Agent A, Agent B, Key K|},            \
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2264
diff changeset
   283
\               Crypt (shrK B) {|NB, Agent A, Agent B, Key K|}|}           \
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   284
\            : set_of_list evs -->                                         \
2131
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2106
diff changeset
   285
\            Says B Spy {|NA, NB, Key K|} ~: set_of_list evs -->           \
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   286
\            Key K ~: analz (sees lost Spy evs)";
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   287
by (etac otway.induct 1);
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   288
by analz_Fake_tac;
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   289
by (ALLGOALS
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   290
    (asm_simp_tac (!simpset addcongs [conj_cong] 
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   291
                            addsimps [not_parts_not_analz,
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   292
                                      analz_insert_freshK]
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   293
                            setloop split_tac [expand_if])));
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   294
(*OR3*)
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   295
by (fast_tac (!claset delrules [impCE]
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   296
                      addSEs sees_Spy_partsEs
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   297
                      addIs [impOfSubs analz_subset_parts]
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   298
                      addss (!simpset addsimps [parts_insert2])) 2);
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   299
(*Oops*) 
2637
e9b203f854ae reflecting my recent changes of the simplifier and classical reasoner
oheimb
parents: 2516
diff changeset
   300
by (best_tac (!claset addDs [unique_session_keys] unsafe_addss (!simpset)) 3);
2131
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2106
diff changeset
   301
(*OR4, Fake*) 
2375
14539397fc04 Streamlined some proofs
paulson
parents: 2331
diff changeset
   302
by (REPEAT_FIRST spy_analz_tac);
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   303
val lemma = result() RS mp RS mp RSN(2,rev_notE);
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   304
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   305
goal thy 
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   306
 "!!evs. [| Says Server B                                           \
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   307
\              {|Crypt (shrK A) {|NA, Agent A, Agent B, Key K|},    \
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   308
\                Crypt (shrK B) {|NB, Agent A, Agent B, Key K|}|}   \
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   309
\             : set_of_list evs;                                    \
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   310
\           Says B Spy {|NA, NB, Key K|} ~: set_of_list evs;        \
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   311
\           A ~: lost;  B ~: lost;  evs : otway lost |]             \
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   312
\        ==> Key K ~: analz (sees lost Spy evs)";
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   313
by (forward_tac [Says_Server_message_form] 1 THEN assume_tac 1);
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   314
by (fast_tac (!claset addSEs [lemma]) 1);
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   315
qed "Spy_not_see_encrypted_key";
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   316
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   317
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   318
goal thy 
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   319
 "!!evs. [| C ~: {A,B,Server};                                      \
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   320
\           Says Server B                                           \
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   321
\              {|Crypt (shrK A) {|NA, Agent A, Agent B, Key K|},    \
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   322
\                Crypt (shrK B) {|NB, Agent A, Agent B, Key K|}|}   \
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   323
\             : set_of_list evs;                                    \
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   324
\           Says B Spy {|NA, NB, Key K|} ~: set_of_list evs;        \
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   325
\           A ~: lost;  B ~: lost;  evs : otway lost |]             \
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   326
\        ==> Key K ~: analz (sees lost C evs)";
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   327
by (rtac (subset_insertI RS sees_mono RS analz_mono RS contra_subsetD) 1);
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   328
by (rtac (sees_lost_agent_subset_sees_Spy RS analz_mono RS contra_subsetD) 1);
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   329
by (FIRSTGOAL (rtac Spy_not_see_encrypted_key));
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   330
by (REPEAT_FIRST (fast_tac (!claset addIs [otway_mono RS subsetD])));
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   331
qed "Agent_not_see_encrypted_key";
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   332
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   333
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   334
(**** Authenticity properties relating to NB ****)
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   335
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   336
(*If the encrypted message appears then it originated with the Server!*)
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   337
goal thy 
2106
1a52e2c5897e Generaly tidying up
paulson
parents: 2090
diff changeset
   338
 "!!evs. [| B ~: lost;  evs : otway lost |]                                 \
2284
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2264
diff changeset
   339
\    ==> Crypt (shrK B) {|NB, Agent A, Agent B, Key K|}                     \
2106
1a52e2c5897e Generaly tidying up
paulson
parents: 2090
diff changeset
   340
\         : parts (sees lost Spy evs)                                       \
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   341
\        --> (EX NA. Says Server B                                          \
2284
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2264
diff changeset
   342
\                     {|Crypt (shrK A) {|NA, Agent A, Agent B, Key K|},     \
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2264
diff changeset
   343
\                       Crypt (shrK B) {|NB, Agent A, Agent B, Key K|}|}    \
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   344
\                     : set_of_list evs)";
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   345
by (parts_induct_tac 1);
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   346
by (ALLGOALS (asm_simp_tac (!simpset addsimps [ex_disj_distrib])));
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   347
(*OR3*)
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   348
by (Fast_tac 1);
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   349
qed_spec_mp "NB_Crypt_imp_Server_msg";
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   350
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   351
2454
92f43ed48935 Corrected comments
paulson
parents: 2451
diff changeset
   352
(*Guarantee for B: if it gets a well-formed certificate then the Server
92f43ed48935 Corrected comments
paulson
parents: 2451
diff changeset
   353
  has sent the correct message in round 3.*)
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   354
goal thy 
2106
1a52e2c5897e Generaly tidying up
paulson
parents: 2090
diff changeset
   355
 "!!evs. [| B ~: lost;  evs : otway lost;                                   \
2837
dee1c7f1f576 Trivial renamings (for consistency with CSFW papers)
paulson
parents: 2637
diff changeset
   356
\           Says S' B {|X, Crypt (shrK B) {|NB, Agent A, Agent B, Key K|}|} \
2106
1a52e2c5897e Generaly tidying up
paulson
parents: 2090
diff changeset
   357
\            : set_of_list evs |]                                           \
1a52e2c5897e Generaly tidying up
paulson
parents: 2090
diff changeset
   358
\        ==> EX NA. Says Server B                                           \
2284
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2264
diff changeset
   359
\                     {|Crypt (shrK A) {|NA, Agent A, Agent B, Key K|},     \
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2264
diff changeset
   360
\                       Crypt (shrK B) {|NB, Agent A, Agent B, Key K|}|}    \
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   361
\                     : set_of_list evs";
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   362
by (fast_tac (!claset addSIs [NB_Crypt_imp_Server_msg]
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   363
                      addEs  sees_Spy_partsEs) 1);
2331
d6a56ff0d94e Minor renamings
paulson
parents: 2284
diff changeset
   364
qed "B_trusts_OR3";