src/HOL/Auth/OtwayRees_Bad.thy
author paulson
Fri Sep 19 18:27:31 1997 +0200 (1997-09-19)
changeset 3686 4b484805b4c4
parent 3683 aafe719dff14
child 4522 0218c486cf07
permissions -rw-r--r--
First working version with Oops event for session keys
paulson@2002
     1
(*  Title:      HOL/Auth/OtwayRees_Bad
paulson@2002
     2
    ID:         $Id$
paulson@2002
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
paulson@2002
     4
    Copyright   1996  University of Cambridge
paulson@2002
     5
paulson@2002
     6
Inductive relation "otway" for the Otway-Rees protocol.
paulson@2002
     7
paulson@2002
     8
The FAULTY version omitting encryption of Nonce NB, as suggested on page 247 of
paulson@2002
     9
  Burrows, Abadi and Needham.  A Logic of Authentication.
paulson@2002
    10
  Proc. Royal Soc. 426 (1989)
paulson@2002
    11
*)
paulson@2002
    12
paulson@2002
    13
OtwayRees_Bad = Shared + 
paulson@2002
    14
paulson@3519
    15
consts  otway   :: event list set
paulson@2052
    16
paulson@2002
    17
inductive otway
paulson@2002
    18
  intrs 
paulson@2002
    19
         (*Initial trace is empty*)
paulson@2002
    20
    Nil  "[]: otway"
paulson@2002
    21
paulson@2032
    22
         (*The spy MAY say anything he CAN say.  We do not expect him to
paulson@2002
    23
           invent new nonces here, but he can also use NS1.  Common to
paulson@2002
    24
           all similar protocols.*)
paulson@3683
    25
    Fake "[| evs: otway;  B ~= Spy;  X: synth (analz (spies evs)) |]
paulson@2032
    26
          ==> Says Spy B X  # evs : otway"
paulson@2002
    27
paulson@2002
    28
         (*Alice initiates a protocol run*)
paulson@3659
    29
    OR1  "[| evs1: otway;  A ~= B;  B ~= Server;  Nonce NA ~: used evs1 |]
paulson@2516
    30
          ==> Says A B {|Nonce NA, Agent A, Agent B, 
paulson@2516
    31
                         Crypt (shrK A) {|Nonce NA, Agent A, Agent B|} |} 
paulson@3659
    32
                 # evs1 : otway"
paulson@2002
    33
paulson@2002
    34
         (*Bob's response to Alice's message.  Bob doesn't know who 
paulson@2002
    35
	   the sender is, hence the A' in the sender field.
paulson@2002
    36
           We modify the published protocol by NOT encrypting NB.*)
paulson@3659
    37
    OR2  "[| evs2: otway;  B ~= Server;  Nonce NB ~: used evs2;
paulson@3659
    38
             Says A' B {|Nonce NA, Agent A, Agent B, X|} : set evs2 |]
paulson@2002
    39
          ==> Says B Server 
paulson@2516
    40
                  {|Nonce NA, Agent A, Agent B, X, Nonce NB,
paulson@2284
    41
                    Crypt (shrK B) {|Nonce NA, Agent A, Agent B|}|}
paulson@3659
    42
                 # evs2 : otway"
paulson@2002
    43
paulson@2002
    44
         (*The Server receives Bob's message and checks that the three NAs
paulson@2002
    45
           match.  Then he sends a new session key to Bob with a packet for
paulson@2002
    46
           forwarding to Alice.*)
paulson@3659
    47
    OR3  "[| evs3: otway;  B ~= Server;  Key KAB ~: used evs3;
paulson@2002
    48
             Says B' Server 
paulson@2002
    49
                  {|Nonce NA, Agent A, Agent B, 
paulson@2284
    50
                    Crypt (shrK A) {|Nonce NA, Agent A, Agent B|}, 
paulson@2002
    51
                    Nonce NB, 
paulson@2284
    52
                    Crypt (shrK B) {|Nonce NA, Agent A, Agent B|}|}
paulson@3659
    53
               : set evs3 |]
paulson@2002
    54
          ==> Says Server B 
paulson@2002
    55
                  {|Nonce NA, 
paulson@2516
    56
                    Crypt (shrK A) {|Nonce NA, Key KAB|},
paulson@2516
    57
                    Crypt (shrK B) {|Nonce NB, Key KAB|}|}
paulson@3659
    58
                 # evs3 : otway"
paulson@2002
    59
paulson@2002
    60
         (*Bob receives the Server's (?) message and compares the Nonces with
paulson@2002
    61
	   those in the message he previously sent the Server.*)
paulson@3659
    62
    OR4  "[| evs4: otway;  A ~= B;
paulson@2516
    63
             Says B Server {|Nonce NA, Agent A, Agent B, X', Nonce NB, X''|}
paulson@3659
    64
               : set evs4;
paulson@2837
    65
             Says S' B {|Nonce NA, X, Crypt (shrK B) {|Nonce NB, Key K|}|}
paulson@3659
    66
               : set evs4 |]
paulson@3659
    67
          ==> Says B A {|Nonce NA, X|} # evs4 : otway"
paulson@2002
    68
paulson@2131
    69
         (*This message models possible leaks of session keys.  The nonces
paulson@2131
    70
           identify the protocol run.*)
paulson@3659
    71
    Oops "[| evso: otway;  B ~= Spy;
paulson@2284
    72
             Says Server B {|Nonce NA, X, Crypt (shrK B) {|Nonce NB, Key K|}|}
paulson@3659
    73
               : set evso |]
paulson@3659
    74
          ==> Says B Spy {|Nonce NA, Nonce NB, Key K|} # evso : otway"
paulson@2002
    75
paulson@2002
    76
end