src/HOL/Auth/Event.thy
changeset 1930 cdf9bcd53749
parent 1929 f0839bab4b00
child 1933 8b24773de6db
     1.1 --- a/src/HOL/Auth/Event.thy	Tue Aug 20 17:46:24 1996 +0200
     1.2 +++ b/src/HOL/Auth/Event.thy	Tue Aug 20 18:53:17 1996 +0200
     1.3 @@ -85,24 +85,27 @@
     1.4  (*NS3 DOESN'T ALLOW INTERLEAVING -- that is, it only responds to the
     1.5    MOST RECENT message.*)
     1.6  
     1.7 +(*Needham-Schroeder Shared-Key protocol (from BAN paper, page 247)*)
     1.8  consts  traces   :: "event list set"
     1.9  inductive traces
    1.10    intrs 
    1.11 +         (*Initial trace is empty*)
    1.12      Nil  "[]: traces"
    1.13  
    1.14 -    (*The enemy MAY say anything he CAN say.  We do not expect him to
    1.15 -      invent new nonces here, but he can also use NS1.*)
    1.16 -    Fake "[| evs: traces;  B ~= Enemy;  
    1.17 -             X: synth(analz(sees Enemy evs))
    1.18 +         (*The enemy MAY say anything he CAN say.  We do not expect him to
    1.19 +           invent new nonces here, but he can also use NS1.  Common to
    1.20 +           all similar protocols.*)
    1.21 +    Fake "[| evs: traces;  B ~= Enemy;  X: synth (analz (sees Enemy evs))
    1.22            |] ==> (Says Enemy B X) # evs : traces"
    1.23  
    1.24 +         (*Alice initiates a protocol run*)
    1.25      NS1  "[| evs: traces;  A ~= Server
    1.26            |] ==> (Says A Server {|Agent A, Agent B, Nonce (newN evs)|}) 
    1.27                   # evs : traces"
    1.28  
    1.29 -          (*We can't trust the sender field, hence the A' in it.
    1.30 -            This allows the Server to respond more than once to A's
    1.31 -            request...*)
    1.32 +         (*Server's response to Alice's message.
    1.33 +           !! It may respond more than once to A's request !!
    1.34 +	   We can't trust the sender field, hence the A' in it.*)
    1.35      NS2  "[| evs: traces;  A ~= B;  A ~= Server;
    1.36               (Says A' Server {|Agent A, Agent B, Nonce NA|}) : set_of_list evs
    1.37            |] ==> (Says Server A 
    1.38 @@ -110,9 +113,9 @@
    1.39                             (Crypt {|Key (newK evs), Agent A|} (serverKey B))|}
    1.40                     (serverKey A))) # evs : traces"
    1.41  
    1.42 -           (*We can't assume S=Server.  Agent A "remembers" her nonce.
    1.43 -             May assume WLOG that she is NOT the Enemy: the Fake rule
    1.44 -             covers this case.  Can inductively show A ~= Server*)
    1.45 +          (*We can't assume S=Server.  Agent A "remembers" her nonce.
    1.46 +            May assume WLOG that she is NOT the Enemy: the Fake rule
    1.47 +            covers this case.  Can inductively show A ~= Server*)
    1.48      NS3  "[| evs: traces;  A ~= B;
    1.49               (Says S A (Crypt {|Nonce NA, Agent B, Key K, X|} (serverKey A))) 
    1.50                 : set_of_list evs;
    1.51 @@ -120,12 +123,8 @@
    1.52               (Says A Server {|Agent A, Agent B, Nonce NA|}) : set_of_list evs
    1.53            |] ==> (Says A B X) # evs : traces"
    1.54  
    1.55 -(*Initial version of NS2 had 
    1.56 -
    1.57 -        {|Agent A, Agent B, Key (newK evs), Nonce NA|}
    1.58 -
    1.59 -  for the encrypted part; the version above is LESS explicit, hence
    1.60 -  HARDER to prove.  Also it is precisely as in the BAN paper.
    1.61 -*)
    1.62 -
    1.63 +    NS4  "[| evs: traces;  A ~= B;  
    1.64 +             (Says A' B (Crypt {|Key K, Agent A|} (serverKey B))) 
    1.65 +               : set_of_list evs
    1.66 +          |] ==> (Says B A (Crypt (Nonce (newN evs)) K)) # evs : traces"
    1.67  end