src/HOL/Auth/Recur.ML
author paulson
Fri, 31 Jul 1998 10:48:42 +0200
changeset 5223 4cb05273f764
parent 5114 c729d4c299c1
child 5351 6d6467c2b8b9
permissions -rw-r--r--
Removal of obsolete "open" commands from heads of .ML files
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
     1
(*  Title:      HOL/Auth/Recur
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
     2
    ID:         $Id$
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
     4
    Copyright   1996  University of Cambridge
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
     5
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
     6
Inductive relation "recur" for the Recursive Authentication protocol.
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
     7
*)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
     8
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
     9
Pretty.setdepth 30;
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    10
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    11
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    12
(** Possibility properties: traces that reach the end 
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    13
        ONE theorem would be more elegant and faster!
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    14
        By induction on a list of agents (no repetitions)
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    15
**)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    16
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    17
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    18
(*Simplest case: Alice goes directly to the server*)
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
    19
Goal "A ~= Server                                                      \
4598
649bf14debe7 Added some more explicit guarantees of key secrecy for agents
paulson
parents: 4556
diff changeset
    20
\ ==> EX K NA. EX evs: recur.                                           \
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
    21
\  Says Server A {|Crypt (shrK A) {|Key K, Agent Server, Nonce NA|}, \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
    22
\                  Agent Server|}  : set evs";
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    23
by (REPEAT (resolve_tac [exI,bexI] 1));
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
    24
by (rtac (recur.Nil RS recur.RA1 RS 
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    25
          (respond.One RSN (4,recur.RA3))) 2);
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    26
by possibility_tac;
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    27
result();
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    28
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    29
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    30
(*Case two: Alice, Bob and the server*)
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
    31
Goal "[| A ~= B; A ~= Server; B ~= Server |]                 \
4598
649bf14debe7 Added some more explicit guarantees of key secrecy for agents
paulson
parents: 4556
diff changeset
    32
\ ==> EX K. EX NA. EX evs: recur.                               \
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
    33
\    Says B A {|Crypt (shrK A) {|Key K, Agent B, Nonce NA|}, \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
    34
\               Agent Server|}  : set evs";
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    35
by (cut_facts_tac [Nonce_supply2, Key_supply2] 1);
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    36
by (REPEAT (eresolve_tac [exE, conjE] 1));
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    37
by (REPEAT (resolve_tac [exI,bexI] 1));
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
    38
by (rtac (recur.Nil RS recur.RA1 RS recur.RA2 RS 
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    39
          (respond.One RS respond.Cons RSN (4,recur.RA3)) RS
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    40
          recur.RA4) 2);
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    41
by basic_possibility_tac;
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    42
by (DEPTH_SOLVE (eresolve_tac [asm_rl, less_not_refl2, 
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    43
			       less_not_refl2 RS not_sym] 1));
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    44
result();
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    45
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    46
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    47
(*Case three: Alice, Bob, Charlie and the server
2533
2d5604a51562 Simplified proofs
paulson
parents: 2516
diff changeset
    48
  TOO SLOW to run every time!
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
    49
Goal "[| A ~= B; B ~= C; A ~= Server; B ~= Server; C ~= Server |]   \
4598
649bf14debe7 Added some more explicit guarantees of key secrecy for agents
paulson
parents: 4556
diff changeset
    50
\ ==> EX K. EX NA. EX evs: recur.                                      \
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
    51
\    Says B A {|Crypt (shrK A) {|Key K, Agent B, Nonce NA|},        \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
    52
\               Agent Server|}  : set evs";
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    53
by (cut_facts_tac [Nonce_supply3, Key_supply3] 1);
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    54
by (REPEAT (eresolve_tac [exE, conjE] 1));
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    55
by (REPEAT (resolve_tac [exI,bexI] 1));
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
    56
by (rtac (recur.Nil RS recur.RA1 RS recur.RA2 RS recur.RA2 RS 
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    57
          (respond.One RS respond.Cons RS respond.Cons RSN
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    58
           (4,recur.RA3)) RS recur.RA4 RS recur.RA4) 2);
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    59
(*SLOW: 70 seconds*)
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    60
by basic_possibility_tac;
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    61
by (DEPTH_SOLVE (swap_res_tac [refl, conjI, disjCI] 1 
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    62
		 ORELSE
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    63
		 eresolve_tac [asm_rl, less_not_refl2, 
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    64
			       less_not_refl2 RS not_sym] 1));
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    65
result();
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    66
****************)
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    67
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    68
(**** Inductive proofs about recur ****)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    69
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    70
(*Nobody sends themselves messages*)
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
    71
Goal "evs : recur ==> ALL A X. Says A A X ~: set evs";
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    72
by (etac recur.induct 1);
4477
b3e5857d8d99 New Auto_tac (by Oheimb), and new syntax (without parens), and expandshort
paulson
parents: 4471
diff changeset
    73
by Auto_tac;
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    74
qed_spec_mp "not_Says_to_self";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    75
Addsimps [not_Says_to_self];
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    76
AddSEs   [not_Says_to_self RSN (2, rev_notE)];
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    77
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    78
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    79
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
    80
Goal "(PA,RB,KAB) : respond evs ==> Key KAB : parts{RB}";
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    81
by (etac respond.induct 1);
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    82
by (ALLGOALS Simp_tac);
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    83
qed "respond_Key_in_parts";
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    84
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
    85
Goal "(PA,RB,KAB) : respond evs ==> Key KAB ~: used evs";
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    86
by (etac respond.induct 1);
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    87
by (REPEAT (assume_tac 1));
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    88
qed "respond_imp_not_used";
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    89
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
    90
Goal "[| Key K : parts {RB};  (PB,RB,K') : respond evs |] \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
    91
\     ==> Key K ~: used evs";
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    92
by (etac rev_mp 1);
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    93
by (etac respond.induct 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3961
diff changeset
    94
by (auto_tac(claset() addDs [Key_not_used, respond_imp_not_used],
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3961
diff changeset
    95
             simpset()));
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    96
qed_spec_mp "Key_in_parts_respond";
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    97
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    98
(*Simple inductive reasoning about responses*)
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
    99
Goal "(PA,RB,KAB) : respond evs ==> RB : responses evs";
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   100
by (etac respond.induct 1);
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   101
by (REPEAT (ares_tac (respond_imp_not_used::responses.intrs) 1));
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   102
qed "respond_imp_responses";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   103
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   104
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   105
(** For reasoning about the encrypted portion of messages **)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   106
3683
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3681
diff changeset
   107
val RA2_analz_spies = Says_imp_spies RS analz.Inj |> standard;
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   108
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   109
Goal "Says C' B {|Crypt K X, X', RA|} : set evs \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   110
\             ==> RA : analz (spies evs)";
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3961
diff changeset
   111
by (blast_tac (claset() addSDs [Says_imp_spies RS analz.Inj]) 1);
3683
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3681
diff changeset
   112
qed "RA4_analz_spies";
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   113
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   114
(*RA2_analz... and RA4_analz... let us treat those cases using the same 
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   115
  argument as for the Fake case.  This is possible for most, but not all,
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   116
  proofs: Fake does not invent new nonces (as in RA2), and of course Fake
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   117
  messages originate from the Spy. *)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   118
3683
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3681
diff changeset
   119
bind_thm ("RA2_parts_spies",
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3681
diff changeset
   120
          RA2_analz_spies RS (impOfSubs analz_subset_parts));
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3681
diff changeset
   121
bind_thm ("RA4_parts_spies",
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3681
diff changeset
   122
          RA4_analz_spies RS (impOfSubs analz_subset_parts));
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   123
3683
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3681
diff changeset
   124
(*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
   125
fun parts_induct_tac i = 
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   126
    etac recur.induct i				THEN
3683
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3681
diff changeset
   127
    forward_tac [RA2_parts_spies] (i+3)	THEN
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   128
    forward_tac [respond_imp_responses] (i+4)	THEN
3683
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3681
diff changeset
   129
    forward_tac [RA4_parts_spies] (i+5)	THEN
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   130
    prove_simple_subgoals_tac i;
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   131
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   132
3683
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3681
diff changeset
   133
(** Theorems of the form X ~: parts (spies evs) imply that NOBODY
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   134
    sends messages containing X! **)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   135
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   136
3683
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3681
diff changeset
   137
(** Spy never sees another agent's shared key! (unless it's bad at start) **)
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   138
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   139
Goal "evs : recur ==> (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
   140
by (parts_induct_tac 1);
3121
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   141
by (Fake_parts_insert_tac 1);
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   142
by (ALLGOALS 
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3961
diff changeset
   143
    (asm_simp_tac (simpset() addsimps [parts_insert2, parts_insert_spies])));
2550
8d8344bcf98a Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents: 2533
diff changeset
   144
(*RA3*)
4552
bb8ff763c93d Simplified proofs by omitting PA = {|XA, ...|} from RA2
paulson
parents: 4509
diff changeset
   145
by (blast_tac (claset() addDs [Key_in_parts_respond]) 1);
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   146
qed "Spy_see_shrK";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   147
Addsimps [Spy_see_shrK];
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   148
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   149
Goal "evs : recur ==> (Key (shrK A) : analz (spies evs)) = (A : bad)";
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3961
diff changeset
   150
by (auto_tac(claset() addDs [impOfSubs analz_subset_parts], simpset()));
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   151
qed "Spy_analz_shrK";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   152
Addsimps [Spy_analz_shrK];
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   153
4471
0abf9d3f4391 Tidied using rev_iffD1
paulson
parents: 4449
diff changeset
   154
AddSDs [Spy_see_shrK RSN (2, rev_iffD1), 
0abf9d3f4391 Tidied using rev_iffD1
paulson
parents: 4449
diff changeset
   155
	Spy_analz_shrK RSN (2, rev_iffD1)];
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   156
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   157
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   158
(** Nobody can have used non-existent keys! **)
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   159
4509
828148415197 Making proofs faster, especially using keysFor_parts_insert
paulson
parents: 4477
diff changeset
   160
(*The special case of H={} has the same proof*)
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   161
Goal "[| K : keysFor (parts (insert RB H));  (PB,RB,K') : respond evs |] \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   162
\     ==> K : range shrK | K : keysFor (parts H)";
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   163
by (etac rev_mp 1);
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   164
by (etac (respond_imp_responses RS responses.induct) 1);
4477
b3e5857d8d99 New Auto_tac (by Oheimb), and new syntax (without parens), and expandshort
paulson
parents: 4471
diff changeset
   165
by Auto_tac;
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   166
qed_spec_mp "Key_in_keysFor_parts";
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   167
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   168
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   169
Goal "evs : recur ==>          \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   170
\             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
   171
by (parts_induct_tac 1);
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   172
(*RA3*)
4509
828148415197 Making proofs faster, especially using keysFor_parts_insert
paulson
parents: 4477
diff changeset
   173
by (blast_tac (claset() addSDs [Key_in_keysFor_parts]) 2);
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   174
(*Fake*)
4509
828148415197 Making proofs faster, especially using keysFor_parts_insert
paulson
parents: 4477
diff changeset
   175
by (blast_tac (claset() addSDs [keysFor_parts_insert]) 1);
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   176
qed_spec_mp "new_keys_not_used";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   177
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   178
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   179
bind_thm ("new_keys_not_analzd",
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   180
          [analz_subset_parts RS keysFor_mono,
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   181
           new_keys_not_used] MRS contra_subsetD);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   182
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   183
Addsimps [new_keys_not_used, new_keys_not_analzd];
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   184
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   185
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   186
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   187
(*** Proofs involving analz ***)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   188
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   189
(*For proofs involving analz.*)
3683
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3681
diff changeset
   190
val analz_spies_tac = 
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3681
diff changeset
   191
    dtac RA2_analz_spies 4 THEN 
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   192
    forward_tac [respond_imp_responses] 5                THEN
3683
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3681
diff changeset
   193
    dtac RA4_analz_spies 6;
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   194
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   195
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   196
(** Session keys are not used to encrypt other session keys **)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   197
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   198
(*Version for "responses" relation.  Handles case RA3 in the theorem below.  
3683
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3681
diff changeset
   199
  Note that it holds for *any* set H (not just "spies evs")
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   200
  satisfying the inductive hypothesis.*)
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   201
Goal "[| RB : responses evs;                             \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   202
\        ALL K KK. KK <= Compl (range shrK) -->          \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   203
\                  (Key K : analz (Key``KK Un H)) =      \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   204
\                  (K : KK | Key K : analz H) |]         \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   205
\    ==> ALL K KK. KK <= Compl (range shrK) -->          \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   206
\                  (Key K : analz (insert RB (Key``KK Un H))) = \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   207
\                  (K : KK | Key K : analz (insert RB H))";
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   208
by (etac responses.induct 1);
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   209
by (ALLGOALS (asm_simp_tac analz_image_freshK_ss));
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   210
qed "resp_analz_image_freshK_lemma";
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   211
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   212
(*Version for the protocol.  Proof is almost trivial, thanks to the lemma.*)
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   213
Goal "evs : recur ==>                                 \
4598
649bf14debe7 Added some more explicit guarantees of key secrecy for agents
paulson
parents: 4556
diff changeset
   214
\  ALL K KK. KK <= Compl (range shrK) -->                \
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   215
\         (Key K : analz (Key``KK Un (spies evs))) =  \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   216
\         (K : KK | Key K : analz (spies evs))";
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   217
by (etac recur.induct 1);
3683
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3681
diff changeset
   218
by analz_spies_tac;
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   219
by (REPEAT_FIRST (resolve_tac [allI, impI]));
4552
bb8ff763c93d Simplified proofs by omitting PA = {|XA, ...|} from RA2
paulson
parents: 4509
diff changeset
   220
by (REPEAT_FIRST (rtac analz_image_freshK_lemma));
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   221
by (ALLGOALS 
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   222
    (asm_simp_tac
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   223
     (analz_image_freshK_ss addsimps [resp_analz_image_freshK_lemma])));
3451
d10f100676d8 Made proofs more concise by replacing calls to spy_analz_tac by uses of
paulson
parents: 3207
diff changeset
   224
(*Fake*) 
d10f100676d8 Made proofs more concise by replacing calls to spy_analz_tac by uses of
paulson
parents: 3207
diff changeset
   225
by (spy_analz_tac 1);
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   226
val raw_analz_image_freshK = result();
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   227
qed_spec_mp "analz_image_freshK";
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   228
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   229
3683
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3681
diff changeset
   230
(*Instance of the lemma with H replaced by (spies evs):
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   231
   [| RB : responses evs;  evs : recur; |]
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   232
   ==> KK <= Compl (range shrK) --> 
3683
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3681
diff changeset
   233
       Key K : analz (insert RB (Key``KK Un spies evs)) =
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3681
diff changeset
   234
       (K : KK | Key K : analz (insert RB (spies evs))) 
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   235
*)
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   236
bind_thm ("resp_analz_image_freshK",
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   237
          raw_analz_image_freshK RSN
3961
6a8996fb7d99 Many minor speedups:
paulson
parents: 3919
diff changeset
   238
            (2, resp_analz_image_freshK_lemma) RS spec RS spec RS mp);
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   239
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   240
Goal "[| evs : recur;  KAB ~: range shrK |] ==>           \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   241
\     Key K : analz (insert (Key KAB) (spies evs)) =      \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   242
\     (K = KAB | Key K : analz (spies evs))";
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   243
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: 2485
diff changeset
   244
qed "analz_insert_freshK";
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   245
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   246
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   247
(*Everything that's hashed is already in past traffic. *)
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   248
Goal "[| Hash {|Key(shrK A), X|} : parts (spies evs);  \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   249
\                evs : recur;  A ~: bad |]                     \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   250
\             ==> X : parts (spies evs)";
2550
8d8344bcf98a Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents: 2533
diff changeset
   251
by (etac rev_mp 1);
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   252
by (parts_induct_tac 1);
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   253
(*RA3 requires a further induction*)
3121
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   254
by (etac responses.induct 2);
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   255
by (ALLGOALS Asm_simp_tac);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   256
(*Fake*)
3121
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   257
by (Fake_parts_insert_tac 1);
2550
8d8344bcf98a Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents: 2533
diff changeset
   258
qed "Hash_imp_body";
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   259
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   260
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   261
(** The Nonce NA uniquely identifies A's message. 
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   262
    This theorem applies to steps RA1 and RA2!
2455
9c4444bfd44e Simplification and generalization of the guarantees.
paulson
parents: 2451
diff changeset
   263
9c4444bfd44e Simplification and generalization of the guarantees.
paulson
parents: 2451
diff changeset
   264
  Unicity is not used in other proofs but is desirable in its own right.
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   265
**)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   266
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   267
Goal "[| evs : recur; A ~: bad |]                   \
2560
c57b585eecd9 Tidied unicity theorems
paulson
parents: 2550
diff changeset
   268
\ ==> EX B' P'. ALL B P.                                     \
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   269
\     Hash {|Key(shrK A), Agent A, B, NA, P|} : parts (spies evs) \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   270
\       -->  B=B' & P=P'";
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   271
by (parts_induct_tac 1);
3121
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   272
by (Fake_parts_insert_tac 1);
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   273
by (etac responses.induct 3);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3961
diff changeset
   274
by (ALLGOALS (simp_tac (simpset() addsimps [all_conj_distrib]))); 
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3961
diff changeset
   275
by (clarify_tac (claset() addSEs partsEs) 1);
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   276
(*RA1,2: creation of new Nonce.  Move assertion into global context*)
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   277
by (ALLGOALS (expand_case_tac "NA = ?y"));
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   278
by (REPEAT_FIRST (ares_tac [exI]));
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3961
diff changeset
   279
by (REPEAT (blast_tac (claset() addSDs [Hash_imp_body]
3683
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3681
diff changeset
   280
                               addSEs spies_partsEs) 1));
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   281
val lemma = result();
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   282
5076
fbc9d95b62ba Ran isatool fixgoal
paulson
parents: 4831
diff changeset
   283
Goalw [HPair_def]
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   284
 "[| Hash[Key(shrK A)] {|Agent A, B,NA,P|}   : parts (spies evs); \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   285
\     Hash[Key(shrK A)] {|Agent A, B',NA,P'|} : parts (spies evs); \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   286
\     evs : recur;  A ~: bad |]                                    \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   287
\   ==> B=B' & P=P'";
2481
ee461c8bc9c3 Now uses HPair
paulson
parents: 2455
diff changeset
   288
by (REPEAT (eresolve_tac partsEs 1));
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   289
by (prove_unique_tac lemma 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   290
qed "unique_NA";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   291
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   292
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   293
(*** Lemmas concerning the Server's response
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   294
      (relations "respond" and "responses") 
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   295
***)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   296
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   297
Goal "[| RB : responses evs;  evs : recur |] \
3683
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3681
diff changeset
   298
\ ==> (Key (shrK B) : analz (insert RB (spies evs))) = (B:bad)";
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   299
by (etac responses.induct 1);
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   300
by (ALLGOALS
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   301
    (asm_simp_tac 
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   302
     (analz_image_freshK_ss addsimps [Spy_analz_shrK,
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   303
                                      resp_analz_image_freshK])));
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   304
qed "shrK_in_analz_respond";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   305
Addsimps [shrK_in_analz_respond];
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   306
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   307
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   308
Goal "[| RB : responses evs;                             \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   309
\        ALL K KK. KK <= Compl (range shrK) -->          \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   310
\                  (Key K : analz (Key``KK Un H)) =      \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   311
\                  (K : KK | Key K : analz H) |]         \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   312
\    ==> (Key K : analz (insert RB H)) -->               \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   313
\        (Key K : parts{RB} | Key K : analz H)";
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   314
by (etac responses.induct 1);
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   315
by (ALLGOALS
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   316
    (asm_simp_tac 
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   317
     (analz_image_freshK_ss addsimps [resp_analz_image_freshK_lemma])));
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   318
(*Simplification using two distinct treatments of "image"*)
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3961
diff changeset
   319
by (simp_tac (simpset() addsimps [parts_insert2]) 1);
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3961
diff changeset
   320
by (blast_tac (claset() delrules [allE]) 1);
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   321
qed "resp_analz_insert_lemma";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   322
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   323
bind_thm ("resp_analz_insert",
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   324
          raw_analz_image_freshK RSN
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   325
            (2, resp_analz_insert_lemma) RSN(2, rev_mp));
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   326
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   327
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   328
(*The Server does not send such messages.  This theorem lets us avoid
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   329
  assuming B~=Server in RA4.*)
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   330
Goal "evs : recur \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   331
\     ==> ALL C X Y. Says Server C {|X, Agent Server, Y|} ~: set evs";
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   332
by (etac recur.induct 1);
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   333
by (etac (respond.induct) 5);
4477
b3e5857d8d99 New Auto_tac (by Oheimb), and new syntax (without parens), and expandshort
paulson
parents: 4471
diff changeset
   334
by Auto_tac;
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   335
qed_spec_mp "Says_Server_not";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   336
AddSEs [Says_Server_not RSN (2,rev_notE)];
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   337
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   338
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   339
(*The last key returned by respond indeed appears in a certificate*)
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   340
Goal "(Hash[Key(shrK A)] {|Agent A, B, NA, P|}, RA, K) : respond evs \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   341
\   ==> Crypt (shrK A) {|Key K, B, NA|} : parts {RA}";
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   342
by (etac respond.elim 1);
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   343
by (ALLGOALS Asm_full_simp_tac);
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   344
qed "respond_certificate";
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   345
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   346
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   347
Goal "!!K'. (PB,RB,KXY) : respond evs                          \
2560
c57b585eecd9 Tidied unicity theorems
paulson
parents: 2550
diff changeset
   348
\  ==> EX A' B'. ALL A B N.                                \
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   349
\     Crypt (shrK A) {|Key K, Agent B, N|} : parts {RB} \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   350
\       -->   (A'=A & B'=B) | (A'=B & B'=A)";
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   351
by (etac respond.induct 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3961
diff changeset
   352
by (ALLGOALS (asm_full_simp_tac (simpset() addsimps [all_conj_distrib]))); 
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   353
(*Base case*)
3121
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   354
by (Blast_tac 1);
3730
6933d20f335f Step_tac -> Safe_tac
paulson
parents: 3683
diff changeset
   355
by Safe_tac;
2550
8d8344bcf98a Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents: 2533
diff changeset
   356
by (expand_case_tac "K = KBC" 1);
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   357
by (dtac respond_Key_in_parts 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3961
diff changeset
   358
by (blast_tac (claset() addSIs [exI]
4598
649bf14debe7 Added some more explicit guarantees of key secrecy for agents
paulson
parents: 4556
diff changeset
   359
                        addSEs partsEs
649bf14debe7 Added some more explicit guarantees of key secrecy for agents
paulson
parents: 4556
diff changeset
   360
                        addDs [Key_in_parts_respond]) 1);
2550
8d8344bcf98a Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents: 2533
diff changeset
   361
by (expand_case_tac "K = KAB" 1);
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   362
by (REPEAT (ares_tac [exI] 2));
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   363
by (ex_strip_tac 1);
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   364
by (dtac respond_certificate 1);
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   365
by (Fast_tac 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   366
val lemma = result();
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   367
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   368
Goal "[| Crypt (shrK A) {|Key K, Agent B, N|} : parts {RB};      \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   369
\       Crypt (shrK A') {|Key K, Agent B', N'|} : parts {RB};   \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   370
\       (PB,RB,KXY) : respond evs |]                            \
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   371
\ ==>   (A'=A & B'=B) | (A'=B & B'=A)";
2560
c57b585eecd9 Tidied unicity theorems
paulson
parents: 2550
diff changeset
   372
by (prove_unique_tac lemma 1);
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   373
qed "unique_session_keys";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   374
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   375
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   376
(** Crucial secrecy property: Spy does not see the keys sent in msg RA3
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   377
    Does not in itself guarantee security: an attack could violate 
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   378
    the premises, e.g. by having A=Spy **)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   379
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   380
Goal "[| (PB,RB,KAB) : respond evs;  evs : recur |]              \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   381
\     ==> ALL A A' N. A ~: bad & A' ~: bad -->                   \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   382
\         Crypt (shrK A) {|Key K, Agent A', N|} : parts{RB} -->  \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   383
\         Key K ~: analz (insert RB (spies evs))";
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   384
by (etac respond.induct 1);
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   385
by (forward_tac [respond_imp_responses] 2);
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   386
by (forward_tac [respond_imp_not_used] 2);
3961
6a8996fb7d99 Many minor speedups:
paulson
parents: 3919
diff changeset
   387
by (ALLGOALS (*6 seconds*)
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   388
    (asm_simp_tac 
3961
6a8996fb7d99 Many minor speedups:
paulson
parents: 3919
diff changeset
   389
     (analz_image_freshK_ss 
4831
dae4d63a1318 Renamed expand_const -> split_const.
nipkow
parents: 4598
diff changeset
   390
        addsimps split_ifs
3961
6a8996fb7d99 Many minor speedups:
paulson
parents: 3919
diff changeset
   391
	addsimps 
6a8996fb7d99 Many minor speedups:
paulson
parents: 3919
diff changeset
   392
          [shrK_in_analz_respond, resp_analz_image_freshK, parts_insert2])));
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3961
diff changeset
   393
by (ALLGOALS (simp_tac (simpset() addsimps [ex_disj_distrib])));
3681
61c7469fd0b0 New proof of respond_Spy_not_see_session_key
paulson
parents: 3519
diff changeset
   394
(** LEVEL 5 **)
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3961
diff changeset
   395
by (blast_tac (claset() addIs [impOfSubs analz_subset_parts]) 1);
3961
6a8996fb7d99 Many minor speedups:
paulson
parents: 3919
diff changeset
   396
by (REPEAT_FIRST (resolve_tac [allI, conjI, impI]));
6a8996fb7d99 Many minor speedups:
paulson
parents: 3919
diff changeset
   397
by (ALLGOALS Clarify_tac);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3961
diff changeset
   398
by (blast_tac (claset() addSDs  [resp_analz_insert]
3961
6a8996fb7d99 Many minor speedups:
paulson
parents: 3919
diff changeset
   399
		       addIs  [impOfSubs analz_subset_parts]) 2);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3961
diff changeset
   400
by (blast_tac (claset() addSDs [respond_certificate]) 1);
3961
6a8996fb7d99 Many minor speedups:
paulson
parents: 3919
diff changeset
   401
by (Asm_full_simp_tac 1);
6a8996fb7d99 Many minor speedups:
paulson
parents: 3919
diff changeset
   402
(*by unicity, either B=Aa or B=A', a contradiction if B: bad*)
6a8996fb7d99 Many minor speedups:
paulson
parents: 3919
diff changeset
   403
by (blast_tac
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3961
diff changeset
   404
    (claset() addSEs [MPair_parts]
3961
6a8996fb7d99 Many minor speedups:
paulson
parents: 3919
diff changeset
   405
	     addDs [parts.Body,
6a8996fb7d99 Many minor speedups:
paulson
parents: 3919
diff changeset
   406
		    respond_certificate RSN (2, unique_session_keys)]) 1);
2533
2d5604a51562 Simplified proofs
paulson
parents: 2516
diff changeset
   407
qed_spec_mp "respond_Spy_not_see_session_key";
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   408
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   409
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   410
Goal "[| Crypt (shrK A) {|Key K, Agent A', N|} : parts (spies evs); \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   411
\        A ~: bad;  A' ~: bad;  evs : recur |]                      \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   412
\     ==> Key K ~: analz (spies evs)";
2550
8d8344bcf98a Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents: 2533
diff changeset
   413
by (etac rev_mp 1);
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   414
by (etac recur.induct 1);
3683
aafe719dff14 Global change: lost->bad and sees Spy->spies
paulson
parents: 3681
diff changeset
   415
by analz_spies_tac;
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   416
by (ALLGOALS
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   417
    (asm_simp_tac
4831
dae4d63a1318 Renamed expand_const -> split_const.
nipkow
parents: 4598
diff changeset
   418
     (simpset() addsimps (split_ifs @
4556
e7a4683c0026 Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents: 4552
diff changeset
   419
			 [analz_insert_eq, analz_insert_freshK]))));
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   420
(*RA4*)
2533
2d5604a51562 Simplified proofs
paulson
parents: 2516
diff changeset
   421
by (spy_analz_tac 5);
2d5604a51562 Simplified proofs
paulson
parents: 2516
diff changeset
   422
(*RA2*)
2d5604a51562 Simplified proofs
paulson
parents: 2516
diff changeset
   423
by (spy_analz_tac 3);
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   424
(*Fake*)
2533
2d5604a51562 Simplified proofs
paulson
parents: 2516
diff changeset
   425
by (spy_analz_tac 2);
2d5604a51562 Simplified proofs
paulson
parents: 2516
diff changeset
   426
(*Base*)
3121
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   427
by (Blast_tac 1);
2533
2d5604a51562 Simplified proofs
paulson
parents: 2516
diff changeset
   428
(*RA3 remains*)
4556
e7a4683c0026 Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents: 4552
diff changeset
   429
by (simp_tac (simpset() addsimps [parts_insert_spies]) 1);
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3961
diff changeset
   430
by (safe_tac (claset() delrules [impCE]));
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   431
(*RA3, case 2: K is an old key*)
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3961
diff changeset
   432
by (blast_tac (claset() addSDs [resp_analz_insert]
4556
e7a4683c0026 Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents: 4552
diff changeset
   433
                        addSEs partsEs
e7a4683c0026 Tidying, mostly to do with handling a more specific version of Fake_parts_insert
paulson
parents: 4552
diff changeset
   434
                        addDs  [Key_in_parts_respond]) 2);
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   435
(*RA3, case 1: use lemma previously proved by induction*)
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3961
diff changeset
   436
by (blast_tac (claset() addSEs [respond_Spy_not_see_session_key RSN
3121
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   437
			       (2,rev_notE)]) 1);
2550
8d8344bcf98a Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents: 2533
diff changeset
   438
qed "Spy_not_see_session_key";
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   439
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   440
(**** Authenticity properties for Agents ****)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   441
2481
ee461c8bc9c3 Now uses HPair
paulson
parents: 2455
diff changeset
   442
(*The response never contains Hashes*)
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   443
Goal "[| Hash {|Key (shrK B), M|} : parts (insert RB H); \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   444
\        (PB,RB,K) : respond evs |]                      \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   445
\     ==> Hash {|Key (shrK B), M|} : parts H";
2550
8d8344bcf98a Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents: 2533
diff changeset
   446
by (etac rev_mp 1);
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   447
by (etac (respond_imp_responses RS responses.induct) 1);
4477
b3e5857d8d99 New Auto_tac (by Oheimb), and new syntax (without parens), and expandshort
paulson
parents: 4471
diff changeset
   448
by Auto_tac;
2550
8d8344bcf98a Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents: 2533
diff changeset
   449
qed "Hash_in_parts_respond";
2481
ee461c8bc9c3 Now uses HPair
paulson
parents: 2455
diff changeset
   450
2533
2d5604a51562 Simplified proofs
paulson
parents: 2516
diff changeset
   451
(*Only RA1 or RA2 can have caused such a part of a message to appear.
2d5604a51562 Simplified proofs
paulson
parents: 2516
diff changeset
   452
  This result is of no use to B, who cannot verify the Hash.  Moreover,
2d5604a51562 Simplified proofs
paulson
parents: 2516
diff changeset
   453
  it can say nothing about how recent A's message is.  It might later be
2d5604a51562 Simplified proofs
paulson
parents: 2516
diff changeset
   454
  used to prove B's presence to A at the run's conclusion.*)
5076
fbc9d95b62ba Ran isatool fixgoal
paulson
parents: 4831
diff changeset
   455
Goalw [HPair_def]
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   456
 "[| Hash {|Key(shrK A), Agent A, Agent B, NA, P|} : parts(spies evs); \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   457
\        A ~: bad;  evs : recur |]                      \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   458
\  ==> Says A B (Hash[Key(shrK A)] {|Agent A, Agent B, NA, P|}) : set evs";
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   459
by (etac rev_mp 1);
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   460
by (parts_induct_tac 1);
3121
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   461
by (Fake_parts_insert_tac 1);
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   462
(*RA3*)
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3961
diff changeset
   463
by (blast_tac (claset() addSDs [Hash_in_parts_respond]) 1);
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   464
qed_spec_mp "Hash_auth_sender";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   465
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   466
(** These two results subsume (for all agents) the guarantees proved
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   467
    separately for A and B in the Otway-Rees protocol.
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   468
**)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   469
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   470
2533
2d5604a51562 Simplified proofs
paulson
parents: 2516
diff changeset
   471
(*Certificates can only originate with the Server.*)
5114
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   472
Goal "[| Crypt (shrK A) Y : parts (spies evs);    \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   473
\        A ~: bad;  evs : recur |]                \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   474
\     ==> EX C RC. Says Server C RC : set evs  &  \
c729d4c299c1 Deleted leading parameters thanks to new Goal command
paulson
parents: 5076
diff changeset
   475
\                  Crypt (shrK A) Y : parts {RC}";
2550
8d8344bcf98a Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents: 2533
diff changeset
   476
by (etac rev_mp 1);
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   477
by (parts_induct_tac 1);
3121
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   478
by (Fake_parts_insert_tac 1);
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   479
(*RA4*)
3121
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   480
by (Blast_tac 4);
2455
9c4444bfd44e Simplification and generalization of the guarantees.
paulson
parents: 2451
diff changeset
   481
(*RA3*)
4091
771b1f6422a8 isatool fixclasimp;
wenzelm
parents: 3961
diff changeset
   482
by (full_simp_tac (simpset() addsimps [parts_insert_spies]) 3
3121
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   483
    THEN Blast_tac 3);
2455
9c4444bfd44e Simplification and generalization of the guarantees.
paulson
parents: 2451
diff changeset
   484
(*RA1*)
3121
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   485
by (Blast_tac 1);
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   486
(*RA2: it cannot be a new Nonce, contradiction.*)
3121
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   487
by (Blast_tac 1);
2550
8d8344bcf98a Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents: 2533
diff changeset
   488
qed "Cert_imp_Server_msg";