src/HOL/Auth/Yahalom.thy
changeset 3465 e85c24717cad
parent 3447 c7c8c0db05b9
child 3481 256f38c01b98
equal deleted inserted replaced
3464:315694e22856 3465:e85c24717cad
    30           ==> Says A B {|Agent A, Nonce NA|} # evs : yahalom lost"
    30           ==> Says A B {|Agent A, Nonce NA|} # evs : yahalom lost"
    31 
    31 
    32          (*Bob's response to Alice's message.  Bob doesn't know who 
    32          (*Bob's response to Alice's message.  Bob doesn't know who 
    33 	   the sender is, hence the A' in the sender field.*)
    33 	   the sender is, hence the A' in the sender field.*)
    34     YM2  "[| evs: yahalom lost;  B ~= Server;  Nonce NB ~: used evs;
    34     YM2  "[| evs: yahalom lost;  B ~= Server;  Nonce NB ~: used evs;
    35              Says A' B {|Agent A, Nonce NA|} : set_of_list evs |]
    35              Says A' B {|Agent A, Nonce NA|} : set evs |]
    36           ==> Says B Server 
    36           ==> Says B Server 
    37                   {|Agent B, Crypt (shrK B) {|Agent A, Nonce NA, Nonce NB|}|}
    37                   {|Agent B, Crypt (shrK B) {|Agent A, Nonce NA, Nonce NB|}|}
    38                 # evs : yahalom lost"
    38                 # evs : yahalom lost"
    39 
    39 
    40          (*The Server receives Bob's message.  He responds by sending a
    40          (*The Server receives Bob's message.  He responds by sending a
    41             new session key to Alice, with a packet for forwarding to Bob.*)
    41             new session key to Alice, with a packet for forwarding to Bob.*)
    42     YM3  "[| evs: yahalom lost;  A ~= Server;  Key KAB ~: used evs;
    42     YM3  "[| evs: yahalom lost;  A ~= Server;  Key KAB ~: used evs;
    43              Says B' Server 
    43              Says B' Server 
    44                   {|Agent B, Crypt (shrK B) {|Agent A, Nonce NA, Nonce NB|}|}
    44                   {|Agent B, Crypt (shrK B) {|Agent A, Nonce NA, Nonce NB|}|}
    45                : set_of_list evs |]
    45                : set evs |]
    46           ==> Says Server A
    46           ==> Says Server A
    47                    {|Crypt (shrK A) {|Agent B, Key KAB, Nonce NA, Nonce NB|},
    47                    {|Crypt (shrK A) {|Agent B, Key KAB, Nonce NA, Nonce NB|},
    48                      Crypt (shrK B) {|Agent A, Key KAB|}|}
    48                      Crypt (shrK B) {|Agent A, Key KAB|}|}
    49                 # evs : yahalom lost"
    49                 # evs : yahalom lost"
    50 
    50 
    51          (*Alice receives the Server's (?) message, checks her Nonce, and
    51          (*Alice receives the Server's (?) message, checks her Nonce, and
    52            uses the new session key to send Bob his Nonce.*)
    52            uses the new session key to send Bob his Nonce.*)
    53     YM4  "[| evs: yahalom lost;  A ~= Server;  A ~= B;  
    53     YM4  "[| evs: yahalom lost;  A ~= Server;  A ~= B;  
    54              Says S A {|Crypt (shrK A) {|Agent B, Key K, Nonce NA, Nonce NB|},
    54              Says S A {|Crypt (shrK A) {|Agent B, Key K, Nonce NA, Nonce NB|},
    55                         X|}  : set_of_list evs;
    55                         X|}  : set evs;
    56              Says A B {|Agent A, Nonce NA|} : set_of_list evs |]
    56              Says A B {|Agent A, Nonce NA|} : set evs |]
    57           ==> Says A B {|X, Crypt K (Nonce NB)|} # evs : yahalom lost"
    57           ==> Says A B {|X, Crypt K (Nonce NB)|} # evs : yahalom lost"
    58 
    58 
    59          (*This message models possible leaks of session keys.  The Nonces
    59          (*This message models possible leaks of session keys.  The Nonces
    60            identify the protocol run.  Quoting Server here ensures they are
    60            identify the protocol run.  Quoting Server here ensures they are
    61            correct.*)
    61            correct.*)
    62     Oops "[| evs: yahalom lost;  A ~= Spy;
    62     Oops "[| evs: yahalom lost;  A ~= Spy;
    63              Says Server A {|Crypt (shrK A)
    63              Says Server A {|Crypt (shrK A)
    64                                    {|Agent B, Key K, Nonce NA, Nonce NB|},
    64                                    {|Agent B, Key K, Nonce NA, Nonce NB|},
    65                              X|}  : set_of_list evs |]
    65                              X|}  : set evs |]
    66           ==> Says A Spy {|Nonce NA, Nonce NB, Key K|} # evs : yahalom lost"
    66           ==> Says A Spy {|Nonce NA, Nonce NB, Key K|} # evs : yahalom lost"
    67 
    67 
    68 
    68 
    69 constdefs 
    69 constdefs 
    70   KeyWithNonce :: [key, nat, event list] => bool
    70   KeyWithNonce :: [key, nat, event list] => bool
    71   "KeyWithNonce K NB evs ==
    71   "KeyWithNonce K NB evs ==
    72      EX A B na X. 
    72      EX A B na X. 
    73        Says Server A {|Crypt (shrK A) {|Agent B, Key K, na, Nonce NB|}, X|} 
    73        Says Server A {|Crypt (shrK A) {|Agent B, Key K, na, Nonce NB|}, X|} 
    74          : set_of_list evs"
    74          : set evs"
    75 
    75 
    76 end
    76 end