src/HOL/Auth/OtwayRees_Bad.thy
author paulson
Tue, 27 Feb 2001 16:13:23 +0100
changeset 11185 1b737b4c2108
parent 6333 b1dec44d0018
child 11251 a6816d47f41d
permissions -rw-r--r--
Some X-symbols for <notin>, <noteq>, <forall>, <exists> Streamlining of Yahalom proofs Removal of redundant proofs
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
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    13
OtwayRees_Bad = Shared + 
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    14
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3465
diff changeset
    15
consts  otway   :: event list set
2052
d9f7f4b2613e Working again with new theory Shared
paulson
parents: 2032
diff changeset
    16
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    17
inductive otway
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    18
  intrs 
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    19
         (*Initial trace is empty*)
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 6333
diff changeset
    20
    Nil  "[] \\<in> otway"
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    21
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2002
diff changeset
    22
         (*The spy MAY say anything he CAN say.  We do not expect him to
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    23
           invent new nonces here, but he can also use NS1.  Common to
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    24
           all similar protocols.*)
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 6333
diff changeset
    25
    Fake "[| evsf \\<in> otway;  X \\<in> synth (analz (knows Spy evsf)) |]
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 6333
diff changeset
    26
          ==> Says Spy B X  # evsf \\<in> otway"
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    27
6308
76f3865a2b1d Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents: 5434
diff changeset
    28
         (*A message that has been sent can be received by the
76f3865a2b1d Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents: 5434
diff changeset
    29
           intended recipient.*)
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 6333
diff changeset
    30
    Reception "[| evsr \\<in> otway;  Says A B X \\<in> set evsr |]
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 6333
diff changeset
    31
               ==> Gets B X # evsr \\<in> otway"
6308
76f3865a2b1d Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents: 5434
diff changeset
    32
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    33
         (*Alice initiates a protocol run*)
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 6333
diff changeset
    34
    OR1  "[| evs1 \\<in> otway;  Nonce NA \\<notin> used evs1 |]
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2451
diff changeset
    35
          ==> Says A B {|Nonce NA, Agent A, Agent B, 
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2451
diff changeset
    36
                         Crypt (shrK A) {|Nonce NA, Agent A, Agent B|} |} 
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 6333
diff changeset
    37
                 # evs1 \\<in> otway"
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    38
6333
b1dec44d0018 deleted obsolete comments
paulson
parents: 6308
diff changeset
    39
         (*Bob's response to Alice's message. 
b1dec44d0018 deleted obsolete comments
paulson
parents: 6308
diff changeset
    40
           This variant of the protocol does NOT encrypt NB.*)
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 6333
diff changeset
    41
    OR2  "[| evs2 \\<in> otway;  Nonce NB \\<notin> used evs2;
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 6333
diff changeset
    42
             Gets B {|Nonce NA, Agent A, Agent B, X|} \\<in> set evs2 |]
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    43
          ==> Says B Server 
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2451
diff changeset
    44
                  {|Nonce NA, Agent A, Agent B, X, Nonce NB,
2284
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2131
diff changeset
    45
                    Crypt (shrK B) {|Nonce NA, Agent A, Agent B|}|}
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 6333
diff changeset
    46
                 # evs2 \\<in> otway"
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    47
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    48
         (*The Server receives Bob's message and checks that the three NAs
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    49
           match.  Then he sends a new session key to Bob with a packet for
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    50
           forwarding to Alice.*)
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 6333
diff changeset
    51
    OR3  "[| evs3 \\<in> otway;  Key KAB \\<notin> used evs3;
6308
76f3865a2b1d Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents: 5434
diff changeset
    52
             Gets Server 
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    53
                  {|Nonce NA, Agent A, Agent B, 
2284
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2131
diff changeset
    54
                    Crypt (shrK A) {|Nonce NA, Agent A, Agent B|}, 
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    55
                    Nonce NB, 
2284
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2131
diff changeset
    56
                    Crypt (shrK B) {|Nonce NA, Agent A, Agent B|}|}
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 6333
diff changeset
    57
               \\<in> set evs3 |]
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    58
          ==> Says Server B 
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    59
                  {|Nonce NA, 
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2451
diff changeset
    60
                    Crypt (shrK A) {|Nonce NA, Key KAB|},
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2451
diff changeset
    61
                    Crypt (shrK B) {|Nonce NB, Key KAB|}|}
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 6333
diff changeset
    62
                 # evs3 \\<in> otway"
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    63
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    64
         (*Bob receives the Server's (?) message and compares the Nonces with
5434
9b4bed3f394c Got rid of not_Says_to_self and most uses of ~= in definitions and theorems
paulson
parents: 5359
diff changeset
    65
	   those in the message he previously sent the Server.
9b4bed3f394c Got rid of not_Says_to_self and most uses of ~= in definitions and theorems
paulson
parents: 5359
diff changeset
    66
           Need B ~= Server because we allow messages to self.*)
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 6333
diff changeset
    67
    OR4  "[| evs4 \\<in> otway;  B ~= Server;
4522
0218c486cf07 Restored the ciphertext in OR4 in order to make the spec closer to that in
paulson
parents: 3683
diff changeset
    68
             Says B Server {|Nonce NA, Agent A, Agent B, X', Nonce NB,
0218c486cf07 Restored the ciphertext in OR4 in order to make the spec closer to that in
paulson
parents: 3683
diff changeset
    69
                             Crypt (shrK B) {|Nonce NA, Agent A, Agent B|}|}
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 6333
diff changeset
    70
               \\<in> set evs4;
6308
76f3865a2b1d Added Bella's "Gets" model for Otway_Rees. Also affects some other theories.
paulson
parents: 5434
diff changeset
    71
             Gets B {|Nonce NA, X, Crypt (shrK B) {|Nonce NB, Key K|}|}
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 6333
diff changeset
    72
               \\<in> set evs4 |]
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 6333
diff changeset
    73
          ==> Says B A {|Nonce NA, X|} # evs4 \\<in> otway"
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    74
2131
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2108
diff changeset
    75
         (*This message models possible leaks of session keys.  The nonces
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2108
diff changeset
    76
           identify the protocol run.*)
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 6333
diff changeset
    77
    Oops "[| evso \\<in> otway;  
2284
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2131
diff changeset
    78
             Says Server B {|Nonce NA, X, Crypt (shrK B) {|Nonce NB, Key K|}|}
11185
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 6333
diff changeset
    79
               \\<in> set evso |]
1b737b4c2108 Some X-symbols for <notin>, <noteq>, <forall>, <exists>
paulson
parents: 6333
diff changeset
    80
          ==> Notes Spy {|Nonce NA, Nonce NB, Key K|} # evso \\<in> otway"
2002
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    81
ed423882c6a9 Bad version of Otway-Rees and the new attack on it
paulson
parents:
diff changeset
    82
end