src/HOL/Auth/OtwayRees_AN.ML
author paulson
Thu, 05 Feb 1998 10:38:34 +0100
changeset 4598 649bf14debe7
parent 4537 4e835bd9fada
child 4831 dae4d63a1318
permissions -rw-r--r--
Added some more explicit guarantees of key secrecy for agents Deleted spurious A~=Spy assumptions
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4598
649bf14debe7 Added some more explicit guarantees of key secrecy for agents
paulson
parents: 4537
diff changeset
     1
(*  Title:      HOL/Auth/OtwayRees_AN
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
     2
    ID:         $Id$
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
     4
    Copyright   1996  University of Cambridge
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
     5
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
     6
Inductive relation "otway" for the Otway-Rees protocol.
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
     7
4598
649bf14debe7 Added some more explicit guarantees of key secrecy for agents
paulson
parents: 4537
diff changeset
     8
Abadi-Needham version: minimal encryption, explicit messages
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
     9
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    10
From page 11 of
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    11
  Abadi and Needham.  Prudent Engineering Practice for Cryptographic Protocols.
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    12
  IEEE Trans. SE 22 (1), 1996
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    13
*)
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    14
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    15
open OtwayRees_AN;
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    16
4449
wenzelm
parents: 4422
diff changeset
    17
set proof_timing;
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    18
HOL_quantifiers := false;
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    19
4470
af3239def3d4 Tidied using more default rules
paulson
parents: 4449
diff changeset
    20
AddEs spies_partsEs;
af3239def3d4 Tidied using more default rules
paulson
parents: 4449
diff changeset
    21
AddDs [impOfSubs analz_subset_parts];
af3239def3d4 Tidied using more default rules
paulson
parents: 4449
diff changeset
    22
AddDs [impOfSubs Fake_parts_insert];
af3239def3d4 Tidied using more default rules
paulson
parents: 4449
diff changeset
    23
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    24
2331
d6a56ff0d94e Minor renamings
paulson
parents: 2284
diff changeset
    25
(*A "possibility property": there are traces that reach the end*)
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    26
goal thy 
2331
d6a56ff0d94e Minor renamings
paulson
parents: 2284
diff changeset
    27
 "!!A B. [| A ~= B; A ~= Server; B ~= Server |]                               \
3543
82f33248d89d Cosmetic changes: margins, indentation, ...
paulson
parents: 3519
diff changeset
    28
\        ==> EX K. EX NA. EX evs: otway.                                      \
2284
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2264
diff changeset
    29
\             Says B A (Crypt (shrK A) {|Nonce NA, Agent A, Agent B, Key K|}) \
3465
e85c24717cad set_of_list -> set
nipkow
parents: 3451
diff changeset
    30
\             : set evs";
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    31
by (REPEAT (resolve_tac [exI,bexI] 1));
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    32
by (rtac (otway.Nil RS otway.OR1 RS otway.OR2 RS otway.OR3 RS otway.OR4) 2);
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
    33
by possibility_tac;
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    34
result();
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    35
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    36
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    37
(**** Inductive proofs about otway ****)
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    38
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    39
(*Nobody sends themselves messages*)
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
    40
goal thy "!!evs. evs : otway ==> ALL A X. Says A A X ~: set evs";
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    41
by (etac otway.induct 1);
4477
b3e5857d8d99 New Auto_tac (by Oheimb), and new syntax (without parens), and expandshort
paulson
parents: 4470
diff changeset
    42
by Auto_tac;
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    43
qed_spec_mp "not_Says_to_self";
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    44
Addsimps [not_Says_to_self];
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    45
AddSEs   [not_Says_to_self RSN (2, rev_notE)];
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    46
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    47
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    48
(** For reasoning about the encrypted portion of messages **)
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    49
3465
e85c24717cad set_of_list -> set
nipkow
parents: 3451
diff changeset
    50
goal thy "!!evs. Says S' B {|X, Crypt(shrK B) X'|} : set evs ==> \
3683
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3674
diff changeset
    51
\                X : analz (spies evs)";
4477
b3e5857d8d99 New Auto_tac (by Oheimb), and new syntax (without parens), and expandshort
paulson
parents: 4470
diff changeset
    52
by (dtac (Says_imp_spies RS analz.Inj) 1);
4470
af3239def3d4 Tidied using more default rules
paulson
parents: 4449
diff changeset
    53
by (Blast_tac 1);
3683
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3674
diff changeset
    54
qed "OR4_analz_spies";
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    55
2284
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2264
diff changeset
    56
goal thy "!!evs. Says Server B {|X, Crypt K' {|NB, a, Agent B, K|}|} \
3683
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3674
diff changeset
    57
\                  : set evs ==> K : parts (spies evs)";
4470
af3239def3d4 Tidied using more default rules
paulson
parents: 4449
diff changeset
    58
by (Blast_tac 1);
3683
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3674
diff changeset
    59
qed "Oops_parts_spies";
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    60
3683
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3674
diff changeset
    61
bind_thm ("OR4_parts_spies",
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3674
diff changeset
    62
          OR4_analz_spies RS (impOfSubs analz_subset_parts));
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    63
3683
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3674
diff changeset
    64
(*For proving the easier theorems about X ~: parts (spies evs).*)
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
    65
fun parts_induct_tac i = 
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
    66
    etac otway.induct i			THEN 
3683
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3674
diff changeset
    67
    forward_tac [Oops_parts_spies] (i+6) THEN
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3674
diff changeset
    68
    forward_tac [OR4_parts_spies]  (i+5) THEN
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
    69
    prove_simple_subgoals_tac  i;
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    70
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    71
3683
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3674
diff changeset
    72
(** Theorems of the form X ~: parts (spies evs) imply that NOBODY
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    73
    sends messages containing X! **)
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    74
4537
4e835bd9fada Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents: 4509
diff changeset
    75
(*Spy never sees a good agent's shared key!*)
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    76
goal thy 
3683
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3674
diff changeset
    77
 "!!evs. evs : otway ==> (Key (shrK A) : parts (spies evs)) = (A : bad)";
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
    78
by (parts_induct_tac 1);
3961
6a8996fb7d99 Many minor speedups:
paulson
parents: 3919
diff changeset
    79
by (ALLGOALS Blast_tac);
2131
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2106
diff changeset
    80
qed "Spy_see_shrK";
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2106
diff changeset
    81
Addsimps [Spy_see_shrK];
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    82
2131
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2106
diff changeset
    83
goal thy 
3683
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3674
diff changeset
    84
 "!!evs. evs : otway ==> (Key (shrK A) : analz (spies evs)) = (A : bad)";
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3961
diff changeset
    85
by (auto_tac(claset() addDs [impOfSubs analz_subset_parts], simpset()));
2131
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2106
diff changeset
    86
qed "Spy_analz_shrK";
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2106
diff changeset
    87
Addsimps [Spy_analz_shrK];
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    88
4470
af3239def3d4 Tidied using more default rules
paulson
parents: 4449
diff changeset
    89
AddSDs [Spy_see_shrK RSN (2, rev_iffD1), 
af3239def3d4 Tidied using more default rules
paulson
parents: 4449
diff changeset
    90
	Spy_analz_shrK RSN (2, rev_iffD1)];
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    91
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
    92
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
    93
(*Nobody can have used non-existent keys!*)
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
    94
goal thy "!!evs. evs : otway ==>          \
3683
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3674
diff changeset
    95
\         Key K ~: used evs --> K ~: keysFor (parts (spies evs))";
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
    96
by (parts_induct_tac 1);
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
    97
(*Fake*)
4509
828148415197 Making proofs faster, especially using keysFor_parts_insert
paulson
parents: 4477
diff changeset
    98
by (blast_tac (claset() addSDs [keysFor_parts_insert]) 1);
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
    99
(*OR3*)
3102
4d01cdc119d2 Some blast_tac calls; more needed
paulson
parents: 2891
diff changeset
   100
by (Blast_tac 1);
2160
ad4382e546fc Simplified new_keys_not_seen, etc.: replaced the
paulson
parents: 2131
diff changeset
   101
qed_spec_mp "new_keys_not_used";
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   102
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   103
bind_thm ("new_keys_not_analzd",
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   104
          [analz_subset_parts RS keysFor_mono,
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   105
           new_keys_not_used] MRS contra_subsetD);
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   106
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   107
Addsimps [new_keys_not_used, new_keys_not_analzd];
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   108
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   109
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   110
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   111
(*** Proofs involving analz ***)
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   112
2131
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2106
diff changeset
   113
(*Describes the form of K and NA when the Server sends this message.*)
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   114
goal thy 
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   115
 "!!evs. [| Says Server B                                           \
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   116
\              {|Crypt (shrK A) {|NA, Agent A, Agent B, Key K|},    \
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   117
\                Crypt (shrK B) {|NB, Agent A, Agent B, Key K|}|}   \
3466
30791e5a69c4 Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents: 3465
diff changeset
   118
\             : set evs;                                            \
3543
82f33248d89d Cosmetic changes: margins, indentation, ...
paulson
parents: 3519
diff changeset
   119
\           evs : otway |]                                          \
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   120
\        ==> K ~: range shrK & (EX i. NA = Nonce i) & (EX j. NB = Nonce j)";
2131
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2106
diff changeset
   121
by (etac rev_mp 1);
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2106
diff changeset
   122
by (etac otway.induct 1);
3102
4d01cdc119d2 Some blast_tac calls; more needed
paulson
parents: 2891
diff changeset
   123
by (ALLGOALS Asm_simp_tac);
4d01cdc119d2 Some blast_tac calls; more needed
paulson
parents: 2891
diff changeset
   124
by (Blast_tac 1);
2131
3106a99d30a5 Changing from the Reveal to the Oops rule
paulson
parents: 2106
diff changeset
   125
qed "Says_Server_message_form";
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   126
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   127
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   128
(*For proofs involving analz.*)
3683
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3674
diff changeset
   129
val analz_spies_tac = 
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3674
diff changeset
   130
    dtac OR4_analz_spies 6 THEN
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   131
    forward_tac [Says_Server_message_form] 7 THEN
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   132
    assume_tac 7 THEN
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2417
diff changeset
   133
    REPEAT ((eresolve_tac [exE, conjE] ORELSE' hyp_subst_tac) 7);
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   134
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   135
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   136
(****
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   137
 The following is to prove theorems of the form
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   138
3683
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3674
diff changeset
   139
  Key K : analz (insert (Key KAB) (spies evs)) ==>
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3674
diff changeset
   140
  Key K : analz (spies evs)
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   141
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   142
 A more general formula must be proved inductively.
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   143
****)
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   144
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   145
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   146
(** Session keys are not used to encrypt other session keys **)
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   147
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   148
(*The equality makes the induction hypothesis easier to apply*)
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   149
goal thy  
4598
649bf14debe7 Added some more explicit guarantees of key secrecy for agents
paulson
parents: 4537
diff changeset
   150
 "!!evs. evs : otway ==>                                 \
649bf14debe7 Added some more explicit guarantees of key secrecy for agents
paulson
parents: 4537
diff changeset
   151
\  ALL K KK. KK <= Compl (range shrK) -->                \
3683
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3674
diff changeset
   152
\            (Key K : analz (Key``KK Un (spies evs))) =  \
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3674
diff changeset
   153
\            (K : KK | Key K : analz (spies evs))";
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   154
by (etac otway.induct 1);
3683
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3674
diff changeset
   155
by analz_spies_tac;
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   156
by (REPEAT_FIRST (resolve_tac [allI, impI]));
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   157
by (REPEAT_FIRST (rtac analz_image_freshK_lemma ));
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   158
by (ALLGOALS (asm_simp_tac analz_image_freshK_ss));
3451
d10f100676d8 Made proofs more concise by replacing calls to spy_analz_tac by uses of
paulson
parents: 3207
diff changeset
   159
(*Fake*) 
4422
21238c9d363e Simplified proofs using rewrites for f``A where f is injective
paulson
parents: 4155
diff changeset
   160
by (spy_analz_tac 1);
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   161
qed_spec_mp "analz_image_freshK";
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   162
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   163
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   164
goal thy
4598
649bf14debe7 Added some more explicit guarantees of key secrecy for agents
paulson
parents: 4537
diff changeset
   165
 "!!evs. [| evs : otway;  KAB ~: range shrK |] ==>       \
3683
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3674
diff changeset
   166
\        Key K : analz (insert (Key KAB) (spies evs)) =  \
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3674
diff changeset
   167
\        (K = KAB | Key K : analz (spies evs))";
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   168
by (asm_simp_tac (analz_image_freshK_ss addsimps [analz_image_freshK]) 1);
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   169
qed "analz_insert_freshK";
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   170
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   171
4155
53f60f51333c fixed comment
paulson
parents: 4091
diff changeset
   172
(*** The Key K uniquely identifies the Server's message. **)
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   173
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   174
goal thy 
3543
82f33248d89d Cosmetic changes: margins, indentation, ...
paulson
parents: 3519
diff changeset
   175
 "!!evs. evs : otway ==>                                            \
82f33248d89d Cosmetic changes: margins, indentation, ...
paulson
parents: 3519
diff changeset
   176
\      EX A' B' NA' NB'. ALL A B NA NB.                             \
82f33248d89d Cosmetic changes: margins, indentation, ...
paulson
parents: 3519
diff changeset
   177
\       Says Server B                                               \
3466
30791e5a69c4 Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents: 3465
diff changeset
   178
\         {|Crypt (shrK A) {|NA, Agent A, Agent B, K|},             \
3465
e85c24717cad set_of_list -> set
nipkow
parents: 3451
diff changeset
   179
\           Crypt (shrK B) {|NB, Agent A, Agent B, K|}|} : set evs  \
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   180
\       --> A=A' & B=B' & NA=NA' & NB=NB'";
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   181
by (etac otway.induct 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3961
diff changeset
   182
by (ALLGOALS (asm_simp_tac (simpset() addsimps [all_conj_distrib])));
3730
6933d20f335f Step_tac -> Safe_tac
paulson
parents: 3683
diff changeset
   183
by (ALLGOALS Clarify_tac);
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   184
(*Remaining cases: OR3 and OR4*)
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   185
by (ex_strip_tac 2);
3102
4d01cdc119d2 Some blast_tac calls; more needed
paulson
parents: 2891
diff changeset
   186
by (Blast_tac 2);
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   187
by (expand_case_tac "K = ?y" 1);
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   188
by (REPEAT (ares_tac [refl,exI,impI,conjI] 2));
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   189
(*...we assume X is a recent message and handle this case by contradiction*)
4509
828148415197 Making proofs faster, especially using keysFor_parts_insert
paulson
parents: 4477
diff changeset
   190
by (blast_tac (claset() addSEs spies_partsEs) 1);
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   191
val lemma = result();
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   192
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   193
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   194
goal thy 
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   195
"!!evs. [| Says Server B                                           \
2284
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2264
diff changeset
   196
\            {|Crypt (shrK A) {|NA, Agent A, Agent B, K|},         \
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2264
diff changeset
   197
\              Crypt (shrK B) {|NB, Agent A, Agent B, K|}|}        \
3466
30791e5a69c4 Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents: 3465
diff changeset
   198
\           : set evs;                                             \
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   199
\          Says Server B'                                          \
2284
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2264
diff changeset
   200
\            {|Crypt (shrK A') {|NA', Agent A', Agent B', K|},     \
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2264
diff changeset
   201
\              Crypt (shrK B') {|NB', Agent A', Agent B', K|}|}    \
3466
30791e5a69c4 Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents: 3465
diff changeset
   202
\           : set evs;                                             \
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   203
\          evs : otway |]                                          \
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   204
\       ==> A=A' & B=B' & NA=NA' & NB=NB'";
2417
95f275c8476e New tactic: prove_unique_tac
paulson
parents: 2375
diff changeset
   205
by (prove_unique_tac lemma 1);
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   206
qed "unique_session_keys";
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   207
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   208
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   209
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   210
(**** Authenticity properties relating to NA ****)
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   211
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   212
(*If the encrypted message appears then it originated with the Server!*)
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   213
goal thy 
3683
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3674
diff changeset
   214
 "!!evs. [| A ~: bad;  evs : otway |]                 \
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3674
diff changeset
   215
\ ==> Crypt (shrK A) {|NA, Agent A, Agent B, Key K|} : parts (spies evs) \
2331
d6a56ff0d94e Minor renamings
paulson
parents: 2284
diff changeset
   216
\     --> (EX NB. Says Server B                                          \
2284
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2264
diff changeset
   217
\                  {|Crypt (shrK A) {|NA, Agent A, Agent B, Key K|},     \
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2264
diff changeset
   218
\                    Crypt (shrK B) {|NB, Agent A, Agent B, Key K|}|}    \
3465
e85c24717cad set_of_list -> set
nipkow
parents: 3451
diff changeset
   219
\                  : set evs)";
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   220
by (parts_induct_tac 1);
4470
af3239def3d4 Tidied using more default rules
paulson
parents: 4449
diff changeset
   221
by (Blast_tac 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3961
diff changeset
   222
by (ALLGOALS (asm_simp_tac (simpset() addsimps [ex_disj_distrib])));
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   223
(*OR3*)
3102
4d01cdc119d2 Some blast_tac calls; more needed
paulson
parents: 2891
diff changeset
   224
by (Blast_tac 1);
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   225
qed_spec_mp "NA_Crypt_imp_Server_msg";
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   226
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   227
2454
92f43ed48935 Corrected comments
paulson
parents: 2451
diff changeset
   228
(*Corollary: if A receives B's OR4 message then it originated with the Server.
92f43ed48935 Corrected comments
paulson
parents: 2451
diff changeset
   229
  Freshness may be inferred from nonce NA.*)
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   230
goal thy 
2284
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2264
diff changeset
   231
 "!!evs. [| Says B' A (Crypt (shrK A) {|NA, Agent A, Agent B, Key K|})  \
3466
30791e5a69c4 Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents: 3465
diff changeset
   232
\            : set evs;                                                 \
3683
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3674
diff changeset
   233
\           A ~: bad;  evs : otway |]                                  \
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   234
\        ==> EX NB. Says Server B                                       \
2284
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2264
diff changeset
   235
\                    {|Crypt (shrK A) {|NA, Agent A, Agent B, Key K|},  \
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2264
diff changeset
   236
\                      Crypt (shrK B) {|NB, Agent A, Agent B, Key K|}|} \
3465
e85c24717cad set_of_list -> set
nipkow
parents: 3451
diff changeset
   237
\                   : set evs";
4470
af3239def3d4 Tidied using more default rules
paulson
parents: 4449
diff changeset
   238
by (blast_tac (claset() addSIs [NA_Crypt_imp_Server_msg]) 1);
2331
d6a56ff0d94e Minor renamings
paulson
parents: 2284
diff changeset
   239
qed "A_trusts_OR4";
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   240
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   241
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   242
(** Crucial secrecy property: Spy does not see the keys sent in msg OR3
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   243
    Does not in itself guarantee security: an attack could violate 
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   244
    the premises, e.g. by having A=Spy **)
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   245
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   246
goal thy 
4537
4e835bd9fada Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents: 4509
diff changeset
   247
 "!!evs. [| A ~: bad;  B ~: bad;  evs : otway |]                   \
3543
82f33248d89d Cosmetic changes: margins, indentation, ...
paulson
parents: 3519
diff changeset
   248
\        ==> Says Server B                                         \
82f33248d89d Cosmetic changes: margins, indentation, ...
paulson
parents: 3519
diff changeset
   249
\             {|Crypt (shrK A) {|NA, Agent A, Agent B, Key K|},    \
82f33248d89d Cosmetic changes: margins, indentation, ...
paulson
parents: 3519
diff changeset
   250
\               Crypt (shrK B) {|NB, Agent A, Agent B, Key K|}|}   \
82f33248d89d Cosmetic changes: margins, indentation, ...
paulson
parents: 3519
diff changeset
   251
\            : set evs -->                                         \
4537
4e835bd9fada Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents: 4509
diff changeset
   252
\            Notes Spy {|NA, NB, Key K|} ~: set evs -->            \
3683
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3674
diff changeset
   253
\            Key K ~: analz (spies evs)";
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   254
by (etac otway.induct 1);
3683
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3674
diff changeset
   255
by analz_spies_tac;
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   256
by (ALLGOALS
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3961
diff changeset
   257
    (asm_simp_tac (simpset() addcongs [conj_cong, if_weak_cong] 
4509
828148415197 Making proofs faster, especially using keysFor_parts_insert
paulson
parents: 4477
diff changeset
   258
                             addsimps [analz_insert_eq, analz_insert_freshK]
828148415197 Making proofs faster, especially using keysFor_parts_insert
paulson
parents: 4477
diff changeset
   259
                             addsimps (pushes@expand_ifs))));
3451
d10f100676d8 Made proofs more concise by replacing calls to spy_analz_tac by uses of
paulson
parents: 3207
diff changeset
   260
(*Oops*)
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3961
diff changeset
   261
by (blast_tac (claset() addSDs [unique_session_keys]) 4);
3451
d10f100676d8 Made proofs more concise by replacing calls to spy_analz_tac by uses of
paulson
parents: 3207
diff changeset
   262
(*OR4*) 
d10f100676d8 Made proofs more concise by replacing calls to spy_analz_tac by uses of
paulson
parents: 3207
diff changeset
   263
by (Blast_tac 3);
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   264
(*OR3*)
4470
af3239def3d4 Tidied using more default rules
paulson
parents: 4449
diff changeset
   265
by (Blast_tac 2);
3451
d10f100676d8 Made proofs more concise by replacing calls to spy_analz_tac by uses of
paulson
parents: 3207
diff changeset
   266
(*Fake*) 
d10f100676d8 Made proofs more concise by replacing calls to spy_analz_tac by uses of
paulson
parents: 3207
diff changeset
   267
by (spy_analz_tac 1);
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   268
val lemma = result() RS mp RS mp RSN(2,rev_notE);
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   269
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   270
goal thy 
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   271
 "!!evs. [| Says Server B                                           \
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   272
\              {|Crypt (shrK A) {|NA, Agent A, Agent B, Key K|},    \
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2454
diff changeset
   273
\                Crypt (shrK B) {|NB, Agent A, Agent B, Key K|}|}   \
3466
30791e5a69c4 Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents: 3465
diff changeset
   274
\             : set evs;                                            \
4537
4e835bd9fada Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents: 4509
diff changeset
   275
\           Notes Spy {|NA, NB, Key K|} ~: set evs;                 \
4e835bd9fada Expressed most Oops rules using Notes instead of Says, and other tidying
paulson
parents: 4509
diff changeset
   276
\           A ~: bad;  B ~: bad;  evs : otway |]                    \
3683
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3674
diff changeset
   277
\        ==> Key K ~: analz (spies evs)";
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   278
by (forward_tac [Says_Server_message_form] 1 THEN assume_tac 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3961
diff changeset
   279
by (blast_tac (claset() addSEs [lemma]) 1);
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   280
qed "Spy_not_see_encrypted_key";
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   281
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   282
4598
649bf14debe7 Added some more explicit guarantees of key secrecy for agents
paulson
parents: 4537
diff changeset
   283
(*A's guarantee.  The Oops premise quantifies over NB because A cannot know
649bf14debe7 Added some more explicit guarantees of key secrecy for agents
paulson
parents: 4537
diff changeset
   284
  what it is.*)
649bf14debe7 Added some more explicit guarantees of key secrecy for agents
paulson
parents: 4537
diff changeset
   285
goal thy 
649bf14debe7 Added some more explicit guarantees of key secrecy for agents
paulson
parents: 4537
diff changeset
   286
 "!!evs. [| Says B' A (Crypt (shrK A) {|NA, Agent A, Agent B, Key K|})  \
649bf14debe7 Added some more explicit guarantees of key secrecy for agents
paulson
parents: 4537
diff changeset
   287
\            : set evs;                                                 \
649bf14debe7 Added some more explicit guarantees of key secrecy for agents
paulson
parents: 4537
diff changeset
   288
\           ALL NB. Notes Spy {|NA, NB, Key K|} ~: set evs;         \
649bf14debe7 Added some more explicit guarantees of key secrecy for agents
paulson
parents: 4537
diff changeset
   289
\           A ~: bad;  B ~: bad;  evs : otway |]                    \
649bf14debe7 Added some more explicit guarantees of key secrecy for agents
paulson
parents: 4537
diff changeset
   290
\        ==> Key K ~: analz (spies evs)";
649bf14debe7 Added some more explicit guarantees of key secrecy for agents
paulson
parents: 4537
diff changeset
   291
by (blast_tac (claset() addSDs [A_trusts_OR4, Spy_not_see_encrypted_key]) 1);
649bf14debe7 Added some more explicit guarantees of key secrecy for agents
paulson
parents: 4537
diff changeset
   292
qed "A_gets_good_key";
649bf14debe7 Added some more explicit guarantees of key secrecy for agents
paulson
parents: 4537
diff changeset
   293
649bf14debe7 Added some more explicit guarantees of key secrecy for agents
paulson
parents: 4537
diff changeset
   294
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   295
(**** Authenticity properties relating to NB ****)
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   296
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   297
(*If the encrypted message appears then it originated with the Server!*)
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   298
goal thy 
3683
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3674
diff changeset
   299
 "!!evs. [| B ~: bad;  evs : otway |]                                 \
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3674
diff changeset
   300
\    ==> Crypt (shrK B) {|NB, Agent A, Agent B, Key K|} : parts (spies evs) \
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   301
\        --> (EX NA. Says Server B                                          \
2284
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2264
diff changeset
   302
\                     {|Crypt (shrK A) {|NA, Agent A, Agent B, Key K|},     \
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2264
diff changeset
   303
\                       Crypt (shrK B) {|NB, Agent A, Agent B, Key K|}|}    \
3465
e85c24717cad set_of_list -> set
nipkow
parents: 3451
diff changeset
   304
\                     : set evs)";
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   305
by (parts_induct_tac 1);
4470
af3239def3d4 Tidied using more default rules
paulson
parents: 4449
diff changeset
   306
by (Blast_tac 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3961
diff changeset
   307
by (ALLGOALS (asm_simp_tac (simpset() addsimps [ex_disj_distrib])));
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   308
(*OR3*)
3102
4d01cdc119d2 Some blast_tac calls; more needed
paulson
parents: 2891
diff changeset
   309
by (Blast_tac 1);
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   310
qed_spec_mp "NB_Crypt_imp_Server_msg";
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   311
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   312
2454
92f43ed48935 Corrected comments
paulson
parents: 2451
diff changeset
   313
(*Guarantee for B: if it gets a well-formed certificate then the Server
92f43ed48935 Corrected comments
paulson
parents: 2451
diff changeset
   314
  has sent the correct message in round 3.*)
2090
307ebbbec862 Abadi and Needham's variant of Otway-Rees
paulson
parents:
diff changeset
   315
goal thy 
4598
649bf14debe7 Added some more explicit guarantees of key secrecy for agents
paulson
parents: 4537
diff changeset
   316
 "!!evs. [| Says S' B {|X, Crypt (shrK B) {|NB, Agent A, Agent B, Key K|}|} \
649bf14debe7 Added some more explicit guarantees of key secrecy for agents
paulson
parents: 4537
diff changeset
   317
\             : set evs;                                                    \
649bf14debe7 Added some more explicit guarantees of key secrecy for agents
paulson
parents: 4537
diff changeset
   318
\           B ~: bad;  evs : otway |]                                       \
2106
1a52e2c5897e Generaly tidying up
paulson
parents: 2090
diff changeset
   319
\        ==> EX NA. Says Server B                                           \
2284
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2264
diff changeset
   320
\                     {|Crypt (shrK A) {|NA, Agent A, Agent B, Key K|},     \
80ebd1a213fd Swapped arguments of Crypt (for clarity and because it is conventional)
paulson
parents: 2264
diff changeset
   321
\                       Crypt (shrK B) {|NB, Agent A, Agent B, Key K|}|}    \
3465
e85c24717cad set_of_list -> set
nipkow
parents: 3451
diff changeset
   322
\                     : set evs";
4470
af3239def3d4 Tidied using more default rules
paulson
parents: 4449
diff changeset
   323
by (blast_tac (claset() addSIs [NB_Crypt_imp_Server_msg]) 1);
2331
d6a56ff0d94e Minor renamings
paulson
parents: 2284
diff changeset
   324
qed "B_trusts_OR3";
4598
649bf14debe7 Added some more explicit guarantees of key secrecy for agents
paulson
parents: 4537
diff changeset
   325
649bf14debe7 Added some more explicit guarantees of key secrecy for agents
paulson
parents: 4537
diff changeset
   326
649bf14debe7 Added some more explicit guarantees of key secrecy for agents
paulson
parents: 4537
diff changeset
   327
(*The obvious combination of B_trusts_OR3 with Spy_not_see_encrypted_key*)
649bf14debe7 Added some more explicit guarantees of key secrecy for agents
paulson
parents: 4537
diff changeset
   328
goal thy 
649bf14debe7 Added some more explicit guarantees of key secrecy for agents
paulson
parents: 4537
diff changeset
   329
 "!!evs. [| Says S' B {|X, Crypt (shrK B) {|NB, Agent A, Agent B, Key K|}|} \
649bf14debe7 Added some more explicit guarantees of key secrecy for agents
paulson
parents: 4537
diff changeset
   330
\            : set evs;                                            \
649bf14debe7 Added some more explicit guarantees of key secrecy for agents
paulson
parents: 4537
diff changeset
   331
\           ALL NA. Notes Spy {|NA, NB, Key K|} ~: set evs;                \
649bf14debe7 Added some more explicit guarantees of key secrecy for agents
paulson
parents: 4537
diff changeset
   332
\           A ~: bad;  B ~: bad;  evs : otway |]                   \
649bf14debe7 Added some more explicit guarantees of key secrecy for agents
paulson
parents: 4537
diff changeset
   333
\        ==> Key K ~: analz (spies evs)";
649bf14debe7 Added some more explicit guarantees of key secrecy for agents
paulson
parents: 4537
diff changeset
   334
by (blast_tac (claset() addDs [B_trusts_OR3, Spy_not_see_encrypted_key]) 1);
649bf14debe7 Added some more explicit guarantees of key secrecy for agents
paulson
parents: 4537
diff changeset
   335
qed "B_gets_good_key";