src/HOL/Auth/OtwayRees_Bad.ML
author paulson
Fri, 18 Oct 1996 11:41:04 +0200
changeset 2107 23e8f15ec95f
parent 2052 d9f7f4b2613e
child 2131 3106a99d30a5
permissions -rw-r--r--
The new proof of the lemma for new_nonces_not_seen is faster
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
     1
(*  Title:      HOL/Auth/OtwayRees_Bad
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
     2
    ID:         $Id$
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
     4
    Copyright   1996  University of Cambridge
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
     5
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
     6
Inductive relation "otway" for the Otway-Rees protocol.
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
     7
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
     8
The FAULTY version omitting encryption of Nonce NB, as suggested on page 247 of
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
     9
  Burrows, Abadi and Needham.  A Logic of Authentication.
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    10
  Proc. Royal Soc. 426 (1989)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    11
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    12
This file illustrates the consequences of such errors.  We can still prove
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
    13
impressive-looking properties such as Spy_not_see_encrypted_key, yet the
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    14
protocol is open to a middleperson attack.  Attempting to prove some key lemmas
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    15
indicates the possibility of this attack.
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    16
*)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    17
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    18
open OtwayRees_Bad;
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    19
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    20
proof_timing:=true;
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    21
HOL_quantifiers := false;
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    22
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    23
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    24
(*Weak liveness: there are traces that reach the end*)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    25
goal thy 
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    26
 "!!A B. [| A ~= B; A ~= Server; B ~= Server |]   \
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    27
\        ==> EX K. EX NA. EX evs: otway.          \
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    28
\               Says B A {|Nonce NA, Crypt {|Nonce NA, Key K|} (shrK A)|} \
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    29
\                 : set_of_list evs";
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    30
by (REPEAT (resolve_tac [exI,bexI] 1));
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
    31
by (rtac (otway.Nil RS otway.OR1 RS otway.OR2 RS otway.OR3 RS otway.OR4) 2);
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    32
by (ALLGOALS (simp_tac (!simpset setsolver safe_solver)));
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    33
by (REPEAT_FIRST (resolve_tac [refl, conjI]));
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    34
by (ALLGOALS (fast_tac (!claset addss (!simpset setsolver safe_solver))));
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    35
result();
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    36
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    37
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    38
(**** Inductive proofs about otway ****)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    39
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
    40
(*The Spy can see more than anybody else, except for their initial state*)
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    41
goal thy 
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    42
 "!!evs. evs : otway ==> \
2052
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
    43
\     sees lost A evs <= initState lost A Un sees lost Spy evs";
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
    44
by (etac otway.induct 1);
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    45
by (ALLGOALS (fast_tac (!claset addDs [sees_Says_subset_insert RS subsetD] 
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
    46
                                addss (!simpset))));
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
    47
qed "sees_agent_subset_sees_Spy";
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    48
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    49
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    50
(*Nobody sends themselves messages*)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    51
goal thy "!!evs. evs : otway ==> ALL A X. Says A A X ~: set_of_list evs";
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
    52
by (etac otway.induct 1);
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    53
by (Auto_tac());
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    54
qed_spec_mp "not_Says_to_self";
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    55
Addsimps [not_Says_to_self];
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    56
AddSEs   [not_Says_to_self RSN (2, rev_notE)];
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    57
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    58
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    59
(** For reasoning about the encrypted portion of messages **)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    60
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    61
goal thy "!!evs. Says A' B {|N, Agent A, Agent B, X|} : set_of_list evs ==> \
2052
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
    62
\                X : analz (sees lost Spy evs)";
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
    63
by (fast_tac (!claset addSDs [Says_imp_sees_Spy RS analz.Inj]) 1);
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
    64
qed "OR2_analz_sees_Spy";
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    65
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    66
goal thy "!!evs. Says S B {|N, X, X'|} : set_of_list evs ==> \
2052
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
    67
\                X : analz (sees lost Spy evs)";
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
    68
by (fast_tac (!claset addSDs [Says_imp_sees_Spy RS analz.Inj]) 1);
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
    69
qed "OR4_analz_sees_Spy";
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    70
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    71
goal thy "!!evs. Says B' A {|N, Crypt {|N,K|} K'|} : set_of_list evs ==> \
2052
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
    72
\                K : parts (sees lost Spy evs)";
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    73
by (fast_tac (!claset addSEs partsEs
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
    74
                      addSDs [Says_imp_sees_Spy RS parts.Inj]) 1);
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
    75
qed "Reveal_parts_sees_Spy";
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    76
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    77
(*OR2_analz... and OR4_analz... let us treat those cases using the same 
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    78
  argument as for the Fake case.  This is possible for most, but not all,
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    79
  proofs: Fake does not invent new nonces (as in OR2), and of course Fake
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
    80
  messages originate from the Spy. *)
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    81
2052
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
    82
bind_thm ("OR2_parts_sees_Spy",
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
    83
          OR2_analz_sees_Spy RS (impOfSubs analz_subset_parts));
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
    84
bind_thm ("OR4_parts_sees_Spy",
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
    85
          OR4_analz_sees_Spy RS (impOfSubs analz_subset_parts));
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
    86
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    87
val parts_Fake_tac = 
2052
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
    88
    forward_tac [OR2_parts_sees_Spy] 4 THEN 
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
    89
    forward_tac [OR4_parts_sees_Spy] 6 THEN
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
    90
    forward_tac [Reveal_parts_sees_Spy] 7;
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    91
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    92
2052
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
    93
(** Theorems of the form X ~: parts (sees lost Spy evs) imply that NOBODY
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    94
    sends messages containing X! **)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    95
2107
23e8f15ec95f The new proof of the lemma for new_nonces_not_seen is faster
paulson
parents: 2052
diff changeset
    96
(*Spy never sees another agent's shared key! (unless it is leaked at start)*)
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    97
goal thy 
2052
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
    98
 "!!evs. [| evs : otway;  A ~: lost |]    \
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
    99
\        ==> Key (shrK A) ~: parts (sees lost Spy evs)";
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   100
by (etac otway.induct 1);
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   101
by parts_Fake_tac;
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   102
by (Auto_tac());
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   103
(*Deals with Fake message*)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   104
by (best_tac (!claset addDs [impOfSubs analz_subset_parts,
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   105
                             impOfSubs Fake_parts_insert]) 1);
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   106
qed "Spy_not_see_shrK";
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   107
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   108
bind_thm ("Spy_not_analz_shrK",
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   109
          [analz_subset_parts, Spy_not_see_shrK] MRS contra_subsetD);
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   110
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   111
Addsimps [Spy_not_see_shrK, Spy_not_analz_shrK];
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   112
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   113
(*We go to some trouble to preserve R in the 3rd and 4th subgoals
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   114
  As usual fast_tac cannot be used because it uses the equalities too soon*)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   115
val major::prems = 
2052
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   116
goal thy  "[| Key (shrK A) : parts (sees lost Spy evs);       \
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   117
\             evs : otway;                                 \
2052
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   118
\             A:lost ==> R                                  \
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   119
\           |] ==> R";
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   120
by (rtac ccontr 1);
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   121
by (rtac ([major, Spy_not_see_shrK] MRS rev_notE) 1);
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   122
by (swap_res_tac prems 2);
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   123
by (ALLGOALS (fast_tac (!claset addIs prems)));
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   124
qed "Spy_see_shrK_E";
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   125
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   126
bind_thm ("Spy_analz_shrK_E", 
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   127
          analz_subset_parts RS subsetD RS Spy_see_shrK_E);
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   128
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   129
AddSEs [Spy_see_shrK_E, Spy_analz_shrK_E];
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   130
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   131
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   132
(*** Future keys can't be seen or used! ***)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   133
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   134
(*Nobody can have SEEN keys that will be generated in the future.
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   135
  This has to be proved anew for each protocol description,
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   136
  but should go by similar reasoning every time.  Hardest case is the
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   137
  standard Fake rule.  
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   138
      The Union over C is essential for the induction! *)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   139
goal thy "!!evs. evs : otway ==> \
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   140
\                length evs <= length evs' --> \
2052
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   141
\                          Key (newK evs') ~: (UN C. parts (sees lost C evs))";
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   142
by (etac otway.induct 1);
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   143
by parts_Fake_tac;
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   144
(*auto_tac does not work here, as it performs safe_tac first*)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   145
by (ALLGOALS Asm_simp_tac);
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   146
by (REPEAT_FIRST (best_tac (!claset addDs [impOfSubs analz_subset_parts,
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   147
                                       impOfSubs parts_insert_subset_Un,
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   148
                                       Suc_leD]
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   149
                                addss (!simpset))));
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   150
val lemma = result();
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   151
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   152
(*Variant needed for the main theorem below*)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   153
goal thy 
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   154
 "!!evs. [| evs : otway;  length evs <= length evs' |]    \
2052
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   155
\        ==> Key (newK evs') ~: parts (sees lost C evs)";
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   156
by (fast_tac (!claset addDs [lemma]) 1);
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   157
qed "new_keys_not_seen";
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   158
Addsimps [new_keys_not_seen];
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   159
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   160
(*Another variant: old messages must contain old keys!*)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   161
goal thy 
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   162
 "!!evs. [| Says A B X : set_of_list evs;  \
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   163
\           Key (newK evt) : parts {X};    \
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   164
\           evs : otway                 \
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   165
\        |] ==> length evt < length evs";
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   166
by (rtac ccontr 1);
2052
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   167
by (dtac leI 1);
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   168
by (fast_tac (!claset addSDs [new_keys_not_seen, Says_imp_sees_Spy]
2052
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   169
                      addIs  [impOfSubs parts_mono]) 1);
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   170
qed "Says_imp_old_keys";
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   171
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   172
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   173
(*** Future nonces can't be seen or used! [proofs resemble those above] ***)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   174
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   175
goal thy "!!evs. evs : otway ==> \
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   176
\                length evs <= length evs' --> \
2052
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   177
\                      Nonce (newN evs') ~: (UN C. parts (sees lost C evs))";
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   178
by (etac otway.induct 1);
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   179
(*auto_tac does not work here, as it performs safe_tac first*)
2107
23e8f15ec95f The new proof of the lemma for new_nonces_not_seen is faster
paulson
parents: 2052
diff changeset
   180
by (ALLGOALS (asm_simp_tac (!simpset addsimps [parts_insert2]
23e8f15ec95f The new proof of the lemma for new_nonces_not_seen is faster
paulson
parents: 2052
diff changeset
   181
                                     addcongs [disj_cong])));
23e8f15ec95f The new proof of the lemma for new_nonces_not_seen is faster
paulson
parents: 2052
diff changeset
   182
by (REPEAT_FIRST (fast_tac (!claset 
23e8f15ec95f The new proof of the lemma for new_nonces_not_seen is faster
paulson
parents: 2052
diff changeset
   183
                              addSEs partsEs
23e8f15ec95f The new proof of the lemma for new_nonces_not_seen is faster
paulson
parents: 2052
diff changeset
   184
                              addSDs  [Says_imp_sees_Spy RS parts.Inj]
23e8f15ec95f The new proof of the lemma for new_nonces_not_seen is faster
paulson
parents: 2052
diff changeset
   185
                              addDs  [impOfSubs analz_subset_parts,
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   186
                                      impOfSubs parts_insert_subset_Un,
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   187
                                      Suc_leD]
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   188
                              addss (!simpset))));
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   189
val lemma = result();
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   190
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   191
(*Variant needed for the main theorem below*)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   192
goal thy 
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   193
 "!!evs. [| evs : otway;  length evs <= length evs' |]    \
2052
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   194
\        ==> Nonce (newN evs') ~: parts (sees lost C evs)";
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   195
by (fast_tac (!claset addDs [lemma]) 1);
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   196
qed "new_nonces_not_seen";
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   197
Addsimps [new_nonces_not_seen];
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   198
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   199
(*Another variant: old messages must contain old nonces!*)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   200
goal thy 
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   201
 "!!evs. [| Says A B X : set_of_list evs;  \
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   202
\           Nonce (newN evt) : parts {X};    \
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   203
\           evs : otway                 \
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   204
\        |] ==> length evt < length evs";
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   205
by (rtac ccontr 1);
2052
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   206
by (dtac leI 1);
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   207
by (fast_tac (!claset addSDs [new_nonces_not_seen, Says_imp_sees_Spy]
2052
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   208
                      addIs  [impOfSubs parts_mono]) 1);
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   209
qed "Says_imp_old_nonces";
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   210
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   211
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   212
(*Nobody can have USED keys that will be generated in the future.
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   213
  ...very like new_keys_not_seen*)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   214
goal thy "!!evs. evs : otway ==> \
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   215
\                length evs <= length evs' --> \
2052
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   216
\                newK evs' ~: keysFor (UN C. parts (sees lost C evs))";
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   217
by (etac otway.induct 1);
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   218
by parts_Fake_tac;
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   219
by (ALLGOALS Asm_simp_tac);
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   220
(*OR1 and OR3*)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   221
by (EVERY (map (fast_tac (!claset addDs [Suc_leD] addss (!simpset))) [4,2]));
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   222
(*Fake, OR2, OR4: these messages send unknown (X) components*)
2107
23e8f15ec95f The new proof of the lemma for new_nonces_not_seen is faster
paulson
parents: 2052
diff changeset
   223
by (REPEAT
23e8f15ec95f The new proof of the lemma for new_nonces_not_seen is faster
paulson
parents: 2052
diff changeset
   224
    (best_tac
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   225
      (!claset addDs [impOfSubs (analz_subset_parts RS keysFor_mono),
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   226
                      impOfSubs (parts_insert_subset_Un RS keysFor_mono),
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   227
                      Suc_leD]
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   228
               addEs [new_keys_not_seen RS not_parts_not_analz RSN(2,rev_notE)]
2107
23e8f15ec95f The new proof of the lemma for new_nonces_not_seen is faster
paulson
parents: 2052
diff changeset
   229
               addss (!simpset)) 1));
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   230
val lemma = result();
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   231
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   232
goal thy 
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   233
 "!!evs. [| evs : otway;  length evs <= length evs' |]    \
2052
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   234
\        ==> newK evs' ~: keysFor (parts (sees lost C evs))";
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   235
by (fast_tac (!claset addSDs [lemma] addss (!simpset)) 1);
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   236
qed "new_keys_not_used";
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   237
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   238
bind_thm ("new_keys_not_analzd",
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   239
          [analz_subset_parts RS keysFor_mono,
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   240
           new_keys_not_used] MRS contra_subsetD);
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   241
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   242
Addsimps [new_keys_not_used, new_keys_not_analzd];
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   243
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   244
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   245
(** Lemmas concerning the form of items passed in messages **)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   246
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   247
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   248
(****
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   249
 The following is to prove theorems of the form
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   250
2052
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   251
          Key K : analz (insert (Key (newK evt)) (sees lost Spy evs)) ==>
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   252
          Key K : analz (sees lost Spy evs)
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   253
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   254
 A more general formula must be proved inductively.
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   255
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   256
****)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   257
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   258
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   259
(** Session keys are not used to encrypt other session keys **)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   260
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   261
(*Describes the form of Key K when the following message is sent.  The use of
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   262
  "parts" strengthens the induction hyp for proving the Fake case.  The
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   263
  assumptions on A are needed to prevent its being a Faked message.  (Based
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   264
  on NS_Shared/Says_S_message_form) *)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   265
goal thy
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   266
 "!!evs. evs: otway ==>  \
2052
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   267
\          Crypt {|N, Key K|} (shrK A) : parts (sees lost Spy evs) & \
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   268
\          A ~: lost --> \
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   269
\        (EX evt:otway. K = newK evt)";
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   270
by (etac otway.induct 1);
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   271
by parts_Fake_tac;
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   272
by (Auto_tac());
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   273
(*Deals with Fake message*)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   274
by (best_tac (!claset addDs [impOfSubs analz_subset_parts,
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   275
                             impOfSubs Fake_parts_insert]) 1);
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   276
val lemma = result() RS mp;
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   277
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   278
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   279
(*EITHER describes the form of Key K when the following message is sent, 
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   280
  OR     reduces it to the Fake case.*)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   281
goal thy 
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   282
 "!!evs. [| Says B' A {|N, Crypt {|N, Key K|} (shrK A)|} : set_of_list evs;  \
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   283
\           evs : otway |]                      \
2052
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   284
\        ==> (EX evt:otway. K = newK evt) | Key K : analz (sees lost Spy evs)";
2107
23e8f15ec95f The new proof of the lemma for new_nonces_not_seen is faster
paulson
parents: 2052
diff changeset
   285
by (case_tac "A : lost" 1);
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   286
by (fast_tac (!claset addSDs [Says_imp_sees_Spy RS analz.Inj]
2107
23e8f15ec95f The new proof of the lemma for new_nonces_not_seen is faster
paulson
parents: 2052
diff changeset
   287
                      addss (!simpset)) 1);
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   288
by (forward_tac [lemma] 1);
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   289
by (fast_tac (!claset addEs  partsEs
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   290
                      addSDs [Says_imp_sees_Spy RS parts.Inj]) 1);
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   291
by (Fast_tac 1);
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   292
qed "Reveal_message_form";
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   293
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   294
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   295
(*Lemma for the trivial direction of the if-and-only-if*)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   296
goal thy  
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   297
 "!!evs. (Key K : analz (Key``nE Un sEe)) --> \
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   298
\         (K : nE | Key K : analz sEe)  ==>     \
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   299
\        (Key K : analz (Key``nE Un sEe)) = (K : nE | Key K : analz sEe)";
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   300
by (fast_tac (!claset addSEs [impOfSubs analz_mono]) 1);
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   301
val lemma = result();
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   302
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   303
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   304
(*The equality makes the induction hypothesis easier to apply*)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   305
goal thy  
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   306
 "!!evs. evs : otway ==> \
2052
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   307
\  ALL K E. (Key K : analz (Key``(newK``E) Un (sees lost Spy evs))) = \
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   308
\           (K : newK``E | Key K : analz (sees lost Spy evs))";
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   309
by (etac otway.induct 1);
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   310
by (dtac OR2_analz_sees_Spy 4);
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   311
by (dtac OR4_analz_sees_Spy 6);
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   312
by (dtac Reveal_message_form 7);
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   313
by (REPEAT_FIRST (ares_tac [allI, lemma]));
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   314
by (REPEAT ((eresolve_tac [bexE, disjE] ORELSE' hyp_subst_tac) 7));
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   315
by (ALLGOALS (*Takes 28 secs*)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   316
    (asm_simp_tac 
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   317
     (!simpset addsimps ([insert_Key_singleton, insert_Key_image, pushKey_newK]
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   318
                         @ pushes)
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   319
               setloop split_tac [expand_if])));
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   320
(** LEVEL 7 **)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   321
(*Reveal case 2, OR4, OR2, Fake*) 
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   322
by (EVERY (map spy_analz_tac [7,5,3,2]));
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   323
(*Reveal case 1, OR3, Base*)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   324
by (Auto_tac());
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   325
qed_spec_mp "analz_image_newK";
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   326
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   327
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   328
goal thy
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   329
 "!!evs. evs : otway ==>                               \
2052
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   330
\        Key K : analz (insert (Key (newK evt)) (sees lost Spy evs)) = \
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   331
\        (K = newK evt | Key K : analz (sees lost Spy evs))";
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   332
by (asm_simp_tac (HOL_ss addsimps [pushKey_newK, analz_image_newK, 
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   333
                                   insert_Key_singleton]) 1);
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   334
by (Fast_tac 1);
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   335
qed "analz_insert_Key_newK";
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   336
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   337
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   338
(*Describes the form of K and NA when the Server sends this message.*)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   339
goal thy 
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   340
 "!!evs. [| Says Server B \
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   341
\            {|NA, Crypt {|NA, K|} (shrK A),                      \
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   342
\                  Crypt {|NB, K|} (shrK B)|} : set_of_list evs;  \
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   343
\           evs : otway |]                                        \
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   344
\        ==> (EX evt:otway. K = Key(newK evt)) &            \
2052
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   345
\            (EX i. NA = Nonce i) &                  \
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   346
\            (EX j. NB = Nonce j)";
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   347
by (etac rev_mp 1);
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   348
by (etac otway.induct 1);
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   349
by (ALLGOALS (fast_tac (!claset addIs [less_SucI] addss (!simpset))));
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   350
qed "Says_Server_message_form";
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   351
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   352
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   353
(*Crucial security property, but not itself enough to guarantee correctness!
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   354
  The need for quantification over N, C seems to indicate the problem.
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   355
  Omitting the Reveal message from the description deprives us of even 
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   356
        this clue. *)
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   357
goal thy 
2052
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   358
 "!!evs. [| A ~: lost;  B ~: lost;  evs : otway;  evt : otway |]        \
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   359
\    ==> Says Server B \
2052
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   360
\          {|NA, Crypt {|NA, Key K|} (shrK A), \
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   361
\            Crypt {|NB, Key K|} (shrK B)|} : set_of_list evs --> \
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   362
\        (ALL N C. Says C Spy {|N, Key K|} ~: set_of_list evs) --> \
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   363
\        Key K ~: analz (sees lost Spy evs)";
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   364
by (etac otway.induct 1);
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   365
by (dtac OR2_analz_sees_Spy 4);
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   366
by (dtac OR4_analz_sees_Spy 6);
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   367
by (dtac Reveal_message_form 7);
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   368
by (REPEAT_FIRST (eresolve_tac [asm_rl, bexE, disjE] ORELSE' hyp_subst_tac));
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   369
by (ALLGOALS
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   370
    (asm_full_simp_tac 
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   371
     (!simpset addsimps ([analz_subset_parts RS contra_subsetD,
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   372
                          analz_insert_Key_newK] @ pushes)
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   373
               setloop split_tac [expand_if])));
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   374
(** LEVEL 6 **)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   375
(*Reveal case 1*)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   376
by (Fast_tac 5);
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   377
(*OR3*)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   378
by (fast_tac (!claset addSIs [parts_insertI]
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   379
                      addEs [Says_imp_old_keys RS less_irrefl]
2052
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   380
                      addss (!simpset addsimps [parts_insert2])) 3);
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   381
(*Reveal case 2, OR4, OR2, Fake*) 
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   382
by (rtac conjI 3);
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   383
by (REPEAT (spy_analz_tac 1));
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   384
val lemma = result() RS mp RS mp RSN(2,rev_notE);
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   385
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   386
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   387
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   388
(*WEAK VERSION: NEED TO ELIMINATE QUANTIFICATION OVER N, C!!*)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   389
goal thy 
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   390
 "!!evs. [| Says Server B \
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   391
\            {|NA, Crypt {|NA, K|} (shrK A),                      \
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   392
\                  Crypt {|NB, K|} (shrK B)|} : set_of_list evs;  \
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   393
\           (ALL N C. Says C Spy {|N, K|} ~: set_of_list evs);  \
2052
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   394
\           A ~: lost;  B ~: lost;  evs : otway |]                  \
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   395
\        ==> K ~: analz (sees lost Spy evs)";
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   396
by (forward_tac [Says_Server_message_form] 1 THEN assume_tac 1);
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   397
by (fast_tac (!claset addSEs [lemma]) 1);
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   398
qed "Spy_not_see_encrypted_key";
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   399
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   400
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   401
(*** Attempting to prove stronger properties ***)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   402
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   403
(** The Key K uniquely identifies the Server's  message. **)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   404
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   405
fun ex_strip_tac i = REPEAT (ares_tac [exI, conjI] i) THEN assume_tac (i+1);
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   406
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   407
goal thy 
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   408
 "!!evs. evs : otway ==>                      \
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   409
\      EX A' B' NA' NB'. ALL A B NA NB.                    \
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   410
\       Says Server B \
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   411
\            {|NA, Crypt {|NA, K|} (shrK A),                      \
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   412
\                  Crypt {|NB, K|} (shrK B)|} : set_of_list evs --> \
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   413
\       A=A' & B=B' & NA=NA' & NB=NB'";
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   414
by (etac otway.induct 1);
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   415
by (ALLGOALS (asm_simp_tac (!simpset addsimps [all_conj_distrib])));
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   416
by (Step_tac 1);
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   417
(*Remaining cases: OR3 and OR4*)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   418
by (ex_strip_tac 2);
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   419
by (Fast_tac 2);
2107
23e8f15ec95f The new proof of the lemma for new_nonces_not_seen is faster
paulson
parents: 2052
diff changeset
   420
by (expand_case_tac "K = ?y" 1);
23e8f15ec95f The new proof of the lemma for new_nonces_not_seen is faster
paulson
parents: 2052
diff changeset
   421
by (REPEAT (ares_tac [refl,exI,impI,conjI] 2));
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   422
(*...we assume X is a very new message, and handle this case by contradiction*)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   423
by (fast_tac (!claset addEs [Says_imp_old_keys RS less_irrefl]
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   424
                      delrules [conjI]    (*prevent split-up into 4 subgoals*)
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   425
                      addss (!simpset addsimps [parts_insertI])) 1);
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   426
val lemma = result();
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   427
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   428
goal thy 
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   429
 "!!evs. [| Says Server B                                          \
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   430
\              {|NA, Crypt {|NA, K|} (shrK A),                     \
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   431
\                    Crypt {|NB, K|} (shrK B)|}                    \
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   432
\            : set_of_list evs;                                    \ 
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   433
\           Says Server B'                                         \
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   434
\              {|NA', Crypt {|NA', K|} (shrK A'),                  \
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   435
\                     Crypt {|NB', K|} (shrK B')|}                 \
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   436
\            : set_of_list evs;                                    \
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   437
\           evs : otway |]                                         \
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   438
\        ==> A=A' & B=B' & NA=NA' & NB=NB'";
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   439
by (dtac lemma 1);
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   440
by (REPEAT (etac exE 1));
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   441
(*Duplicate the assumption*)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   442
by (forw_inst_tac [("psi", "ALL C.?P(C)")] asm_rl 1);
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   443
by (fast_tac (!claset addSDs [spec]) 1);
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   444
qed "unique_session_keys";
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   445
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   446
2052
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   447
(*Only OR1 can have caused such a part of a message to appear.
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   448
  I'm not sure why A ~= B premise is needed: OtwayRees.ML doesn't need it.
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   449
  Perhaps it's because OR2 has two similar-looking encrypted messages in
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   450
	this version.*)
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   451
goal thy 
2052
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   452
 "!!evs. [| A ~: lost;  A ~= B; evs : otway |]               \
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   453
\        ==> Crypt {|NA, Agent A, Agent B|} (shrK A)        \
2052
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   454
\             : parts (sees lost Spy evs) -->                  \
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   455
\            Says A B {|NA, Agent A, Agent B,               \
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   456
\                       Crypt {|NA, Agent A, Agent B|} (shrK A)|}  \
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   457
\             : set_of_list evs";
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   458
by (etac otway.induct 1);
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   459
by parts_Fake_tac;
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   460
by (ALLGOALS Asm_simp_tac);
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   461
(*Fake*)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   462
by (best_tac (!claset addSDs [impOfSubs analz_subset_parts,
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   463
                              impOfSubs Fake_parts_insert]) 2);
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   464
by (Auto_tac());
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   465
qed_spec_mp "Crypt_imp_OR1";
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   466
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   467
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   468
(*This key property is FALSE.  Somebody could make a fake message to Server
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   469
          substituting some other nonce NA' for NB.*)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   470
goal thy 
2052
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   471
 "!!evs. [| A ~: lost;  A ~= Spy;  evs : otway |]                        \
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   472
\        ==> Crypt {|NA, Key K|} (shrK A) : parts (sees lost Spy evs) --> \
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   473
\            Says A B {|NA, Agent A, Agent B,  \
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   474
\                       Crypt {|NA, Agent A, Agent B|} (shrK A)|}  \
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   475
\             : set_of_list evs --> \
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   476
\            (EX B NB. Says Server B               \
2052
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   477
\                 {|NA,               \
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   478
\                   Crypt {|NA, Key K|} (shrK A),              \
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   479
\                   Crypt {|NB, Key K|} (shrK B)|}             \
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   480
\                   : set_of_list evs)";
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   481
by (etac otway.induct 1);
2052
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   482
by parts_Fake_tac;
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   483
by (ALLGOALS Asm_simp_tac);
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   484
(*Fake*)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   485
by (best_tac (!claset addSDs [impOfSubs analz_subset_parts,
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   486
                              impOfSubs Fake_parts_insert]) 1);
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   487
(*OR1: it cannot be a new Nonce, contradiction.*)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   488
by (fast_tac (!claset addSIs [parts_insertI]
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   489
                      addSEs partsEs
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   490
                      addEs [Says_imp_old_nonces RS less_irrefl]
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
   491
                      addss (!simpset)) 1);
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   492
(*OR3 and OR4*)  (** LEVEL 5 **)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   493
(*OR4*)
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   494
by (REPEAT (Safe_step_tac 2));
2052
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   495
by (REPEAT (best_tac (!claset addSDs [parts_cut]) 3));
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   496
by (fast_tac (!claset addSIs [Crypt_imp_OR1]
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   497
                      addEs  partsEs
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   498
                      addDs [Says_imp_sees_Spy RS parts.Inj]) 2);
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   499
(*OR3*)  (** LEVEL 8 **)
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   500
by (ALLGOALS (asm_simp_tac (!simpset addsimps [ex_disj_distrib])));
2052
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   501
by (step_tac (!claset delrules [disjCI, impCE]) 1);
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   502
(*The hypotheses at this point suggest an attack in which nonce NA is used
2052
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   503
  in two different roles:
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   504
          Says B' Server
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   505
           {|Nonce NAa, Agent Aa, Agent A,
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   506
             Crypt {|Nonce NAa, Agent Aa, Agent A|} (shrK Aa), Nonce NA,
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   507
             Crypt {|Nonce NAa, Agent Aa, Agent A|} (shrK A)|}
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   508
          : set_of_list evsa;
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   509
          Says A B
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   510
           {|Nonce NA, Agent A, Agent B,
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   511
             Crypt {|Nonce NA, Agent A, Agent B|} (shrK A)|}
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   512
          : set_of_list evsa 
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   513
*)
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   514
writeln "GIVE UP!";
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   515
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
   516
2052
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
   517
(*Thus the key property A_can_trust probably fails too.*)