src/HOL/Auth/Recur.ML
author paulson
Mon, 14 Jul 1997 12:47:21 +0200
changeset 3519 ab0a9fbed4c0
parent 3516 470626799511
child 3681 61c7469fd0b0
permissions -rw-r--r--
Changing "lost" from a parameter of protocol definitions to a constant. Advantages: no "lost" argument everywhere; fewer Vars in subgoals; less need for specially instantiated rules Disadvantage: can no longer prove "Agent_not_see_encrypted_key", but this theorem was never used, and its original proof was also broken the introduction of the "Notes" constructor.
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
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
     9
open Recur;
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    10
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    11
proof_timing:=true;
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    12
HOL_quantifiers := false;
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    13
Pretty.setdepth 30;
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    14
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    15
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    16
(** 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
    17
        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
    18
        By induction on a list of agents (no repetitions)
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    19
**)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    20
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    21
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    22
(*Simplest case: Alice goes directly to the server*)
2481
ee461c8bc9c3 Now uses HPair
paulson
parents: 2455
diff changeset
    23
goal thy
3483
6988394a6008 Tidying; also simplified the lemma Says_Server_not
paulson
parents: 3466
diff changeset
    24
 "!!A. A ~= Server                                                      \
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
    25
\ ==> EX K NA. EX evs: recur.                                      \
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    26
\     Says Server A {|Crypt (shrK A) {|Key K, Agent Server, Nonce NA|}, \
3466
30791e5a69c4 Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents: 3465
diff changeset
    27
\                     Agent Server|}  : set evs";
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    28
by (REPEAT (resolve_tac [exI,bexI] 1));
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
    29
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
    30
          (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
    31
by possibility_tac;
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    32
result();
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    33
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    34
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    35
(*Case two: Alice, Bob and the server*)
2481
ee461c8bc9c3 Now uses HPair
paulson
parents: 2455
diff changeset
    36
goal thy
3483
6988394a6008 Tidying; also simplified the lemma Says_Server_not
paulson
parents: 3466
diff changeset
    37
 "!!A B. [| A ~= B; A ~= Server; B ~= Server |]                 \
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
    38
\ ==> EX K. EX NA. EX evs: recur.                          \
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    39
\       Says B A {|Crypt (shrK A) {|Key K, Agent B, Nonce NA|}, \
3466
30791e5a69c4 Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents: 3465
diff changeset
    40
\                  Agent Server|}  : set evs";
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    41
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
    42
by (REPEAT (eresolve_tac [exE, conjE] 1));
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    43
by (REPEAT (resolve_tac [exI,bexI] 1));
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
    44
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
    45
          (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
    46
          recur.RA4) 2);
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    47
by basic_possibility_tac;
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    48
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
    49
			       less_not_refl2 RS not_sym] 1));
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    50
result();
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    51
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    52
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    53
(*Case three: Alice, Bob, Charlie and the server
2533
2d5604a51562 Simplified proofs
paulson
parents: 2516
diff changeset
    54
  TOO SLOW to run every time!
2481
ee461c8bc9c3 Now uses HPair
paulson
parents: 2455
diff changeset
    55
goal thy
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    56
 "!!A B. [| A ~= B; B ~= C; A ~= Server; B ~= Server; C ~= Server |]   \
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
    57
\ ==> EX K. EX NA. EX evs: recur.                                 \
3483
6988394a6008 Tidying; also simplified the lemma Says_Server_not
paulson
parents: 3466
diff changeset
    58
\       Says B A {|Crypt (shrK A) {|Key K, Agent B, Nonce NA|},        \
3466
30791e5a69c4 Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents: 3465
diff changeset
    59
\                  Agent Server|}  : set evs";
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    60
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
    61
by (REPEAT (eresolve_tac [exE, conjE] 1));
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    62
by (REPEAT (resolve_tac [exI,bexI] 1));
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
    63
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
    64
          (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
    65
           (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
    66
(*SLOW: 70 seconds*)
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    67
by basic_possibility_tac;
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    68
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
    69
		 ORELSE
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    70
		 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
    71
			       less_not_refl2 RS not_sym] 1));
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    72
result();
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    73
****************)
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    74
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    75
(**** Inductive proofs about recur ****)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    76
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    77
(*Nobody sends themselves messages*)
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
    78
goal thy "!!evs. evs : recur ==> ALL A X. Says A A X ~: set evs";
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    79
by (etac recur.induct 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    80
by (Auto_tac());
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    81
qed_spec_mp "not_Says_to_self";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    82
Addsimps [not_Says_to_self];
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    83
AddSEs   [not_Says_to_self RSN (2, rev_notE)];
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    84
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
    85
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    86
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    87
goal thy "!!evs. (PA,RB,KAB) : respond evs ==> Key KAB : parts{RB}";
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    88
by (etac respond.induct 1);
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    89
by (ALLGOALS Simp_tac);
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    90
qed "respond_Key_in_parts";
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    91
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    92
goal thy "!!evs. (PA,RB,KAB) : respond evs ==> Key KAB ~: used evs";
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    93
by (etac respond.induct 1);
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    94
by (REPEAT (assume_tac 1));
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    95
qed "respond_imp_not_used";
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    96
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    97
goal thy
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    98
 "!!evs. [| Key K : parts {RB};  (PB,RB,K') : respond evs |] \
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
    99
\        ==> Key K ~: used evs";
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   100
by (etac rev_mp 1);
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   101
by (etac respond.induct 1);
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   102
by (auto_tac(!claset addDs [Key_not_used, respond_imp_not_used],
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   103
             !simpset));
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   104
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
   105
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   106
(*Simple inductive reasoning about responses*)
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   107
goal thy "!!evs. (PA,RB,KAB) : respond evs ==> RB : responses evs";
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   108
by (etac respond.induct 1);
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   109
by (REPEAT (ares_tac (respond_imp_not_used::responses.intrs) 1));
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   110
qed "respond_imp_responses";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   111
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   112
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   113
(** For reasoning about the encrypted portion of messages **)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   114
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   115
val RA2_analz_sees_Spy = Says_imp_sees_Spy RS analz.Inj |> standard;
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   116
3465
e85c24717cad set_of_list -> set
nipkow
parents: 3451
diff changeset
   117
goal thy "!!evs. Says C' B {|Crypt K X, X', RA|} : set evs \
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   118
\                ==> RA : analz (sees Spy evs)";
3121
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   119
by (blast_tac (!claset addSDs [Says_imp_sees_Spy RS analz.Inj]) 1);
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   120
qed "RA4_analz_sees_Spy";
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   121
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   122
(*RA2_analz... and RA4_analz... let us treat those cases using the same 
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   123
  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
   124
  proofs: Fake does not invent new nonces (as in RA2), and of course Fake
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   125
  messages originate from the Spy. *)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   126
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   127
bind_thm ("RA2_parts_sees_Spy",
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   128
          RA2_analz_sees_Spy RS (impOfSubs analz_subset_parts));
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   129
bind_thm ("RA4_parts_sees_Spy",
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   130
          RA4_analz_sees_Spy RS (impOfSubs analz_subset_parts));
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   131
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   132
(*For proving the easier theorems about X ~: parts (sees Spy evs).*)
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   133
fun parts_induct_tac i = 
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   134
    etac recur.induct i				THEN
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   135
    forward_tac [RA2_parts_sees_Spy] (i+3)	THEN
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   136
    etac subst (i+3) (*RA2: DELETE needless definition of PA!*)  THEN
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   137
    forward_tac [respond_imp_responses] (i+4)	THEN
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   138
    forward_tac [RA4_parts_sees_Spy] (i+5)	THEN
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   139
    prove_simple_subgoals_tac i;
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   140
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   141
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   142
(** Theorems of the form X ~: parts (sees Spy evs) imply that NOBODY
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   143
    sends messages containing X! **)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   144
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   145
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   146
(** Spy never sees another agent's shared key! (unless it's lost at start) **)
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   147
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   148
goal thy 
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   149
 "!!evs. evs : recur ==> (Key (shrK A) : parts (sees Spy evs)) = (A : lost)";
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   150
by (parts_induct_tac 1);
3121
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   151
by (Fake_parts_insert_tac 1);
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   152
by (ALLGOALS 
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   153
    (asm_simp_tac (!simpset addsimps [parts_insert2, parts_insert_sees])));
2550
8d8344bcf98a Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents: 2533
diff changeset
   154
(*RA3*)
3121
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   155
by (blast_tac (!claset addDs [Key_in_parts_respond]) 2);
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   156
(*RA2*)
3121
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   157
by (blast_tac (!claset addSEs partsEs  addDs [parts_cut]) 1);
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   158
qed "Spy_see_shrK";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   159
Addsimps [Spy_see_shrK];
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   160
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   161
goal thy 
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   162
 "!!evs. evs : recur ==> (Key (shrK A) : analz (sees Spy evs)) = (A : lost)";
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   163
by (auto_tac(!claset addDs [impOfSubs analz_subset_parts], !simpset));
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   164
qed "Spy_analz_shrK";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   165
Addsimps [Spy_analz_shrK];
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   166
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   167
goal thy  "!!A. [| Key (shrK A) : parts (sees Spy evs);       \
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   168
\                  evs : recur |] ==> A:lost";
3121
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   169
by (blast_tac (!claset addDs [Spy_see_shrK]) 1);
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   170
qed "Spy_see_shrK_D";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   171
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   172
bind_thm ("Spy_analz_shrK_D", analz_subset_parts RS subsetD RS Spy_see_shrK_D);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   173
AddSDs [Spy_see_shrK_D, Spy_analz_shrK_D];
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   174
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   175
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   176
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   177
(** Nobody can have used non-existent keys! **)
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   178
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   179
goal thy
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   180
 "!!evs. [| K : keysFor (parts {RB});  (PB,RB,K') : respond evs |] \
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   181
\        ==> K : range shrK";
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   182
by (etac rev_mp 1);
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   183
by (etac (respond_imp_responses RS responses.induct) 1);
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   184
by (Auto_tac());
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   185
qed_spec_mp "Key_in_keysFor_parts";
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   186
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   187
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   188
goal thy "!!evs. evs : recur ==>          \
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   189
\                Key K ~: used evs --> K ~: keysFor (parts (sees Spy evs))";
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   190
by (parts_induct_tac 1);
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   191
(*RA3*)
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   192
by (best_tac (!claset addDs  [Key_in_keysFor_parts]
3207
fe79ad367d77 renamed unsafe_addss to addss
oheimb
parents: 3121
diff changeset
   193
	      addss  (!simpset addsimps [parts_insert_sees])) 2);
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   194
(*Fake*)
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   195
by (best_tac
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   196
      (!claset addIs [impOfSubs analz_subset_parts]
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   197
               addDs [impOfSubs (analz_subset_parts RS keysFor_mono),
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   198
                      impOfSubs (parts_insert_subset_Un RS keysFor_mono)]
3207
fe79ad367d77 renamed unsafe_addss to addss
oheimb
parents: 3121
diff changeset
   199
               addss (!simpset)) 1);
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   200
qed_spec_mp "new_keys_not_used";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   201
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   202
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   203
bind_thm ("new_keys_not_analzd",
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   204
          [analz_subset_parts RS keysFor_mono,
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   205
           new_keys_not_used] MRS contra_subsetD);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   206
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   207
Addsimps [new_keys_not_used, new_keys_not_analzd];
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   208
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   209
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   210
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   211
(*** Proofs involving analz ***)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   212
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   213
(*For proofs involving analz.*)
3121
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   214
val analz_sees_tac = 
2485
c4368c967c56 Simplification of some proofs, especially by eliminating
paulson
parents: 2481
diff changeset
   215
    etac subst 4 (*RA2: DELETE needless definition of PA!*)  THEN
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   216
    dtac RA2_analz_sees_Spy 4 THEN 
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   217
    forward_tac [respond_imp_responses] 5                THEN
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   218
    dtac RA4_analz_sees_Spy 6;
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   219
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   220
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   221
(** Session keys are not used to encrypt other session keys **)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   222
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   223
(*Version for "responses" relation.  Handles case RA3 in the theorem below.  
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   224
  Note that it holds for *any* set H (not just "sees Spy evs")
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   225
  satisfying the inductive hypothesis.*)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   226
goal thy  
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   227
 "!!evs. [| RB : responses evs;                             \
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   228
\           ALL K KK. KK <= Compl (range shrK) -->          \
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   229
\                     (Key K : analz (Key``KK Un H)) =      \
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   230
\                     (K : KK | Key K : analz H) |]         \
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   231
\       ==> ALL K KK. KK <= Compl (range shrK) -->          \
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   232
\                     (Key K : analz (insert RB (Key``KK Un H))) = \
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   233
\                     (K : KK | Key K : analz (insert RB H))";
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   234
by (etac responses.induct 1);
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   235
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
   236
qed "resp_analz_image_freshK_lemma";
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   237
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   238
(*Version for the protocol.  Proof is almost trivial, thanks to the lemma.*)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   239
goal thy  
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   240
 "!!evs. evs : recur ==>                                    \
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   241
\  ALL K KK. KK <= Compl (range shrK) -->                   \
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   242
\            (Key K : analz (Key``KK Un (sees Spy evs))) =  \
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   243
\            (K : KK | Key K : analz (sees Spy evs))";
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   244
by (etac recur.induct 1);
3121
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   245
by analz_sees_tac;
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   246
by (REPEAT_FIRST (resolve_tac [allI, impI]));
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   247
by (REPEAT_FIRST (rtac analz_image_freshK_lemma ));
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   248
by (ALLGOALS 
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   249
    (asm_simp_tac
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   250
     (analz_image_freshK_ss addsimps [resp_analz_image_freshK_lemma])));
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   251
(*Base*)
3121
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   252
by (Blast_tac 1);
3451
d10f100676d8 Made proofs more concise by replacing calls to spy_analz_tac by uses of
paulson
parents: 3207
diff changeset
   253
(*Fake*) 
d10f100676d8 Made proofs more concise by replacing calls to spy_analz_tac by uses of
paulson
parents: 3207
diff changeset
   254
by (spy_analz_tac 1);
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   255
val raw_analz_image_freshK = result();
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   256
qed_spec_mp "analz_image_freshK";
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   257
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   258
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   259
(*Instance of the lemma with H replaced by (sees Spy evs):
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   260
   [| RB : responses evs;  evs : recur; |]
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   261
   ==> KK <= Compl (range shrK) --> 
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   262
       Key K : analz (insert RB (Key``KK Un sees Spy evs)) =
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   263
       (K : KK | Key K : analz (insert RB (sees Spy evs))) 
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   264
*)
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   265
bind_thm ("resp_analz_image_freshK",
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   266
          raw_analz_image_freshK RSN
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   267
            (2, resp_analz_image_freshK_lemma) RS spec RS spec);
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   268
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   269
goal thy
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   270
 "!!evs. [| evs : recur;  KAB ~: range shrK |] ==>              \
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   271
\        Key K : analz (insert (Key KAB) (sees Spy evs)) =      \
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   272
\        (K = KAB | Key K : analz (sees Spy evs))";
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   273
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
   274
qed "analz_insert_freshK";
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   275
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   276
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   277
(*Everything that's hashed is already in past traffic. *)
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   278
goal thy "!!evs. [| Hash {|Key(shrK A), X|} : parts (sees Spy evs);  \
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   279
\                   evs : recur;  A ~: lost |]                       \
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   280
\                ==> X : parts (sees Spy evs)";
2550
8d8344bcf98a Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents: 2533
diff changeset
   281
by (etac rev_mp 1);
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   282
by (parts_induct_tac 1);
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   283
(*RA3 requires a further induction*)
3121
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   284
by (etac responses.induct 2);
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   285
by (ALLGOALS Asm_simp_tac);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   286
(*Fake*)
3121
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   287
by (simp_tac (!simpset addsimps [parts_insert_sees]) 1);
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   288
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
   289
qed "Hash_imp_body";
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   290
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   291
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   292
(** 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
   293
    This theorem applies to steps RA1 and RA2!
2455
9c4444bfd44e Simplification and generalization of the guarantees.
paulson
parents: 2451
diff changeset
   294
9c4444bfd44e Simplification and generalization of the guarantees.
paulson
parents: 2451
diff changeset
   295
  Unicity is not used in other proofs but is desirable in its own right.
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   296
**)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   297
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   298
goal thy 
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   299
 "!!evs. [| evs : recur; A ~: lost |]                   \
2560
c57b585eecd9 Tidied unicity theorems
paulson
parents: 2550
diff changeset
   300
\ ==> EX B' P'. ALL B P.                                     \
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   301
\        Hash {|Key(shrK A), Agent A, B, NA, P|} : parts (sees Spy evs) \
2560
c57b585eecd9 Tidied unicity theorems
paulson
parents: 2550
diff changeset
   302
\          -->  B=B' & P=P'";
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   303
by (parts_induct_tac 1);
3121
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   304
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
   305
by (etac responses.induct 3);
2485
c4368c967c56 Simplification of some proofs, especially by eliminating
paulson
parents: 2481
diff changeset
   306
by (ALLGOALS (simp_tac (!simpset addsimps [all_conj_distrib]))); 
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   307
by (step_tac (!claset addSEs partsEs) 1);
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   308
(*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
   309
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
   310
by (REPEAT_FIRST (ares_tac [exI]));
3121
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   311
by (REPEAT (blast_tac (!claset addSDs [Hash_imp_body]
3483
6988394a6008 Tidying; also simplified the lemma Says_Server_not
paulson
parents: 3466
diff changeset
   312
                               addSEs sees_Spy_partsEs) 1));
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   313
val lemma = result();
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   314
2481
ee461c8bc9c3 Now uses HPair
paulson
parents: 2455
diff changeset
   315
goalw thy [HPair_def]
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   316
 "!!A.[| Hash[Key(shrK A)] {|Agent A, B,NA,P|}   : parts(sees Spy evs); \
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   317
\        Hash[Key(shrK A)] {|Agent A, B',NA,P'|} : parts(sees Spy evs); \
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   318
\        evs : recur;  A ~: lost |]                                     \
3483
6988394a6008 Tidying; also simplified the lemma Says_Server_not
paulson
parents: 3466
diff changeset
   319
\      ==> B=B' & P=P'";
2481
ee461c8bc9c3 Now uses HPair
paulson
parents: 2455
diff changeset
   320
by (REPEAT (eresolve_tac partsEs 1));
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   321
by (prove_unique_tac lemma 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   322
qed "unique_NA";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   323
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   324
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   325
(*** Lemmas concerning the Server's response
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   326
      (relations "respond" and "responses") 
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   327
***)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   328
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   329
goal thy
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   330
 "!!evs. [| RB : responses evs;  evs : recur |] \
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   331
\ ==> (Key (shrK B) : analz (insert RB (sees Spy evs))) = (B:lost)";
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   332
by (etac responses.induct 1);
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   333
by (ALLGOALS
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   334
    (asm_simp_tac 
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   335
     (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
   336
                                      resp_analz_image_freshK])));
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   337
qed "shrK_in_analz_respond";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   338
Addsimps [shrK_in_analz_respond];
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   339
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   340
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   341
goal thy  
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   342
 "!!evs. [| RB : responses evs;                             \
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   343
\           ALL K KK. KK <= Compl (range shrK) -->          \
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   344
\                     (Key K : analz (Key``KK Un H)) =      \
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   345
\                     (K : KK | Key K : analz H) |]         \
3483
6988394a6008 Tidying; also simplified the lemma Says_Server_not
paulson
parents: 3466
diff changeset
   346
\       ==> (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
   347
\           (Key K : parts{RB} | Key K : analz H)";
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   348
by (etac responses.induct 1);
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   349
by (ALLGOALS
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   350
    (asm_simp_tac 
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   351
     (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
   352
(*Simplification using two distinct treatments of "image"*)
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   353
by (simp_tac (!simpset addsimps [parts_insert2]) 1);
3121
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   354
by (blast_tac (!claset delrules [allE]) 1);
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   355
qed "resp_analz_insert_lemma";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   356
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   357
bind_thm ("resp_analz_insert",
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   358
          raw_analz_image_freshK RSN
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   359
            (2, resp_analz_insert_lemma) RSN(2, rev_mp));
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   360
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   361
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   362
(*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
   363
  assuming B~=Server in RA4.*)
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   364
goal thy 
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   365
 "!!evs. evs : recur \
3483
6988394a6008 Tidying; also simplified the lemma Says_Server_not
paulson
parents: 3466
diff changeset
   366
\        ==> ALL C X Y. Says Server C {|X, Agent Server, Y|} ~: set evs";
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   367
by (etac recur.induct 1);
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   368
by (etac (respond.induct) 5);
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   369
by (Auto_tac());
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   370
qed_spec_mp "Says_Server_not";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   371
AddSEs [Says_Server_not RSN (2,rev_notE)];
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   372
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   373
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   374
(*The last key returned by respond indeed appears in a certificate*)
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   375
goal thy 
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   376
 "!!K. (Hash[Key(shrK A)] {|Agent A, B, NA, P|}, RA, K) : respond evs \
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   377
\ ==> Crypt (shrK A) {|Key K, B, NA|} : parts {RA}";
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   378
by (etac respond.elim 1);
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   379
by (ALLGOALS Asm_full_simp_tac);
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   380
qed "respond_certificate";
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   381
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   382
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   383
goal thy 
2560
c57b585eecd9 Tidied unicity theorems
paulson
parents: 2550
diff changeset
   384
 "!!K'. (PB,RB,KXY) : respond evs                          \
c57b585eecd9 Tidied unicity theorems
paulson
parents: 2550
diff changeset
   385
\  ==> EX A' B'. ALL A B N.                                \
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   386
\        Crypt (shrK A) {|Key K, Agent B, N|} : parts {RB} \
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   387
\          -->   (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
   388
by (etac respond.induct 1);
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   389
by (ALLGOALS (asm_full_simp_tac (!simpset addsimps [all_conj_distrib]))); 
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   390
(*Base case*)
3121
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   391
by (Blast_tac 1);
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   392
by (Step_tac 1);
2550
8d8344bcf98a Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents: 2533
diff changeset
   393
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
   394
by (dtac respond_Key_in_parts 1);
3121
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   395
by (blast_tac (!claset addSIs [exI]
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   396
                       addSEs partsEs
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   397
                       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
   398
by (expand_case_tac "K = KAB" 1);
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   399
by (REPEAT (ares_tac [exI] 2));
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   400
by (ex_strip_tac 1);
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   401
by (dtac respond_certificate 1);
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   402
by (Fast_tac 1);
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   403
val lemma = result();
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   404
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   405
goal thy 
2560
c57b585eecd9 Tidied unicity theorems
paulson
parents: 2550
diff changeset
   406
 "!!RB. [| Crypt (shrK A) {|Key K, Agent B, N|} : parts {RB};      \
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   407
\          Crypt (shrK A') {|Key K, Agent B', N'|} : parts {RB};   \
2560
c57b585eecd9 Tidied unicity theorems
paulson
parents: 2550
diff changeset
   408
\          (PB,RB,KXY) : respond evs |]                            \
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   409
\ ==>   (A'=A & B'=B) | (A'=B & B'=A)";
2560
c57b585eecd9 Tidied unicity theorems
paulson
parents: 2550
diff changeset
   410
by (prove_unique_tac lemma 1);
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   411
qed "unique_session_keys";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   412
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   413
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   414
(** Crucial secrecy property: Spy does not see the keys sent in msg RA3
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   415
    Does not in itself guarantee security: an attack could violate 
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   416
    the premises, e.g. by having A=Spy **)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   417
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   418
goal thy 
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   419
 "!!evs. [| (PB,RB,KAB) : respond evs;  evs : recur |]              \
2533
2d5604a51562 Simplified proofs
paulson
parents: 2516
diff changeset
   420
\        ==> ALL A A' N. A ~: lost & A' ~: lost -->                 \
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   421
\            Crypt (shrK A) {|Key K, Agent A', N|} : parts{RB} -->  \
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   422
\            Key K ~: analz (insert RB (sees Spy evs))";
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   423
by (etac respond.induct 1);
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   424
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
   425
by (forward_tac [respond_imp_not_used] 2);
2533
2d5604a51562 Simplified proofs
paulson
parents: 2516
diff changeset
   426
by (ALLGOALS (*23 seconds*)
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   427
    (asm_simp_tac 
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   428
     (analz_image_freshK_ss addsimps 
2533
2d5604a51562 Simplified proofs
paulson
parents: 2516
diff changeset
   429
       [shrK_in_analz_respond, resp_analz_image_freshK, parts_insert2])));
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   430
by (ALLGOALS Simp_tac);
3121
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   431
by (blast_tac (!claset addIs [impOfSubs analz_subset_parts]) 1);
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   432
by (step_tac (!claset addSEs [MPair_parts]) 1);
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   433
(** LEVEL 7 **)
3121
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   434
by (blast_tac (!claset addSDs [resp_analz_insert, Key_in_parts_respond]
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   435
                      addDs  [impOfSubs analz_subset_parts]) 4);
3121
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   436
by (blast_tac (!claset addSDs [respond_certificate]) 3);
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   437
by (blast_tac (!claset addSEs partsEs
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   438
                       addDs [Key_in_parts_respond]) 2);
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   439
by (dtac unique_session_keys 1);
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   440
by (etac respond_certificate 1);
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   441
by (assume_tac 1);
3121
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   442
by (Blast_tac 1);
2533
2d5604a51562 Simplified proofs
paulson
parents: 2516
diff changeset
   443
qed_spec_mp "respond_Spy_not_see_session_key";
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   444
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   445
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   446
goal thy
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   447
 "!!evs. [| Crypt (shrK A) {|Key K, Agent A', N|}     \
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   448
\              : parts (sees Spy evs);                \
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   449
\           A ~: lost;  A' ~: lost;  evs : recur |]   \
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   450
\        ==> Key K ~: analz (sees Spy evs)";
2550
8d8344bcf98a Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents: 2533
diff changeset
   451
by (etac rev_mp 1);
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   452
by (etac recur.induct 1);
3121
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   453
by analz_sees_tac;
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   454
by (ALLGOALS
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   455
    (asm_simp_tac
2533
2d5604a51562 Simplified proofs
paulson
parents: 2516
diff changeset
   456
     (!simpset addsimps [parts_insert_sees, analz_insert_freshK] 
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   457
               setloop split_tac [expand_if])));
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   458
(*RA4*)
2533
2d5604a51562 Simplified proofs
paulson
parents: 2516
diff changeset
   459
by (spy_analz_tac 5);
2d5604a51562 Simplified proofs
paulson
parents: 2516
diff changeset
   460
(*RA2*)
2d5604a51562 Simplified proofs
paulson
parents: 2516
diff changeset
   461
by (spy_analz_tac 3);
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   462
(*Fake*)
2533
2d5604a51562 Simplified proofs
paulson
parents: 2516
diff changeset
   463
by (spy_analz_tac 2);
2d5604a51562 Simplified proofs
paulson
parents: 2516
diff changeset
   464
(*Base*)
3121
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   465
by (Blast_tac 1);
2533
2d5604a51562 Simplified proofs
paulson
parents: 2516
diff changeset
   466
(*RA3 remains*)
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   467
by (step_tac (!claset delrules [impCE]) 1);
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   468
(*RA3, case 2: K is an old key*)
3121
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   469
by (blast_tac (!claset addSDs [resp_analz_insert]
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   470
                       addSEs partsEs
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   471
                       addDs [Key_in_parts_respond]) 2);
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   472
(*RA3, case 1: use lemma previously proved by induction*)
3121
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   473
by (blast_tac (!claset addSEs [respond_Spy_not_see_session_key RSN
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   474
			       (2,rev_notE)]) 1);
2550
8d8344bcf98a Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents: 2533
diff changeset
   475
qed "Spy_not_see_session_key";
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   476
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   477
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   478
(**** Authenticity properties for Agents ****)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   479
2481
ee461c8bc9c3 Now uses HPair
paulson
parents: 2455
diff changeset
   480
(*The response never contains Hashes*)
ee461c8bc9c3 Now uses HPair
paulson
parents: 2455
diff changeset
   481
goal thy
2550
8d8344bcf98a Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents: 2533
diff changeset
   482
 "!!evs. [| Hash {|Key (shrK B), M|} : parts (insert RB H); \
8d8344bcf98a Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents: 2533
diff changeset
   483
\           (PB,RB,K) : respond evs |]                      \
8d8344bcf98a Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents: 2533
diff changeset
   484
\        ==> Hash {|Key (shrK B), M|} : parts H";
8d8344bcf98a Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents: 2533
diff changeset
   485
by (etac rev_mp 1);
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   486
by (etac (respond_imp_responses RS responses.induct) 1);
2481
ee461c8bc9c3 Now uses HPair
paulson
parents: 2455
diff changeset
   487
by (Auto_tac());
2550
8d8344bcf98a Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents: 2533
diff changeset
   488
qed "Hash_in_parts_respond";
2481
ee461c8bc9c3 Now uses HPair
paulson
parents: 2455
diff changeset
   489
2533
2d5604a51562 Simplified proofs
paulson
parents: 2516
diff changeset
   490
(*Only RA1 or RA2 can have caused such a part of a message to appear.
2d5604a51562 Simplified proofs
paulson
parents: 2516
diff changeset
   491
  This result is of no use to B, who cannot verify the Hash.  Moreover,
2d5604a51562 Simplified proofs
paulson
parents: 2516
diff changeset
   492
  it can say nothing about how recent A's message is.  It might later be
2d5604a51562 Simplified proofs
paulson
parents: 2516
diff changeset
   493
  used to prove B's presence to A at the run's conclusion.*)
2481
ee461c8bc9c3 Now uses HPair
paulson
parents: 2455
diff changeset
   494
goalw thy [HPair_def]
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   495
 "!!evs. [| Hash {|Key(shrK A), Agent A, Agent B, NA, P|}         \
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   496
\             : parts (sees Spy evs);                        \
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   497
\            A ~: lost;  evs : recur |]                      \
3466
30791e5a69c4 Corrected indentations and margins after the renaming of "set_of_list"
paulson
parents: 3465
diff changeset
   498
\     ==> 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
   499
by (etac rev_mp 1);
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   500
by (parts_induct_tac 1);
3121
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   501
by (Fake_parts_insert_tac 1);
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   502
(*RA3*)
3121
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   503
by (blast_tac (!claset addSDs [Hash_in_parts_respond]) 1);
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   504
qed_spec_mp "Hash_auth_sender";
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   505
2516
4d68fbe6378b Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents: 2485
diff changeset
   506
(** These two results subsume (for all agents) the guarantees proved
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   507
    separately for A and B in the Otway-Rees protocol.
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   508
**)
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   509
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   510
2533
2d5604a51562 Simplified proofs
paulson
parents: 2516
diff changeset
   511
(*Certificates can only originate with the Server.*)
2449
d30ad12b1397 Recursive Authentication Protocol
paulson
parents:
diff changeset
   512
goal thy 
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   513
 "!!evs. [| Crypt (shrK A) Y : parts (sees Spy evs);    \
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   514
\           A ~: lost;  A ~= Spy;  evs : recur |]       \
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   515
\        ==> EX C RC. Says Server C RC : set evs  &     \
2550
8d8344bcf98a Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents: 2533
diff changeset
   516
\                     Crypt (shrK A) Y : parts {RC}";
8d8344bcf98a Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents: 2533
diff changeset
   517
by (etac rev_mp 1);
3519
ab0a9fbed4c0 Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents: 3516
diff changeset
   518
by (parts_induct_tac 1);
3121
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   519
by (Fake_parts_insert_tac 1);
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   520
(*RA4*)
3121
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   521
by (Blast_tac 4);
2455
9c4444bfd44e Simplification and generalization of the guarantees.
paulson
parents: 2451
diff changeset
   522
(*RA3*)
9c4444bfd44e Simplification and generalization of the guarantees.
paulson
parents: 2451
diff changeset
   523
by (full_simp_tac (!simpset addsimps [parts_insert_sees]) 3
3121
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   524
    THEN Blast_tac 3);
2455
9c4444bfd44e Simplification and generalization of the guarantees.
paulson
parents: 2451
diff changeset
   525
(*RA1*)
3121
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   526
by (Blast_tac 1);
2451
ce85a2aafc7a Extensive tidying and simplification, largely stemming from
paulson
parents: 2449
diff changeset
   527
(*RA2: it cannot be a new Nonce, contradiction.*)
3121
cbb6c0c1c58a Conversion to use blast_tac (with other improvements)
paulson
parents: 2637
diff changeset
   528
by (Blast_tac 1);
2550
8d8344bcf98a Re-ordering of certificates so that session keys appear in decreasing order
paulson
parents: 2533
diff changeset
   529
qed "Cert_imp_Server_msg";