src/HOL/Auth/Yahalom_Bad.ML
author wenzelm
Tue, 07 Sep 1999 10:40:58 +0200
changeset 7499 23e090051cb8
parent 6400 1f495d4d922b
child 10833 c0844a30ea4e
permissions -rw-r--r--
isatool expandshort;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6400
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
     1
(*  Title:      HOL/Auth/Yahalom
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
     2
    ID:         $Id$
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
     4
    Copyright   1996  University of Cambridge
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
     5
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
     6
Inductive relation "yahalom" for the Yahalom protocol.
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
     7
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
     8
From page 257 of
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
     9
  Burrows, Abadi and Needham.  A Logic of Authentication.
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    10
  Proc. Royal Soc. 426 (1989)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    11
*)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    12
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    13
(*A "possibility property": there are traces that reach the end*)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    14
Goal "A ~= Server \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    15
\     ==> EX X NB K. EX evs: yahalom.          \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    16
\            Says A B {|X, Crypt K (Nonce NB)|} : set evs";
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    17
by (REPEAT (resolve_tac [exI,bexI] 1));
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    18
by (rtac (yahalom.Nil RS 
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    19
          yahalom.YM1 RS yahalom.Reception RS
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    20
          yahalom.YM2 RS yahalom.Reception RS 
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    21
          yahalom.YM3 RS yahalom.Reception RS yahalom.YM4) 2);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    22
by possibility_tac;
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    23
result();
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    24
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    25
Goal "[| Gets B X : set evs; evs : yahalom |] ==> EX A. Says A B X : set evs";
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    26
by (etac rev_mp 1);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    27
by (etac yahalom.induct 1);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    28
by Auto_tac;
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    29
qed "Gets_imp_Says";
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    30
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    31
(*Must be proved separately for each protocol*)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    32
Goal "[| Gets B X : set evs; evs : yahalom |]  ==> X : knows Spy evs";
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    33
by (blast_tac (claset() addSDs [Gets_imp_Says, Says_imp_knows_Spy]) 1);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    34
qed"Gets_imp_knows_Spy";
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    35
AddDs [Gets_imp_knows_Spy RS parts.Inj];
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    36
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    37
fun g_not_bad_tac s = 
7499
23e090051cb8 isatool expandshort;
wenzelm
parents: 6400
diff changeset
    38
  ftac Gets_imp_Says THEN' assume_tac THEN' not_bad_tac s;
6400
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    39
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    40
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    41
(**** Inductive proofs about yahalom ****)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    42
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    43
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    44
(** For reasoning about the encrypted portion of messages **)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    45
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    46
(*Lets us treat YM4 using a similar argument as for the Fake case.*)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    47
Goal "[| Gets A {|Crypt (shrK A) Y, X|} : set evs;  evs : yahalom |]  \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    48
\     ==> X : analz (knows Spy evs)";
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    49
by (blast_tac (claset() addSDs [Gets_imp_knows_Spy RS analz.Inj]) 1);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    50
qed "YM4_analz_knows_Spy";
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    51
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    52
bind_thm ("YM4_parts_knows_Spy",
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    53
          YM4_analz_knows_Spy RS (impOfSubs analz_subset_parts));
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    54
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    55
(*For proving the easier theorems about X ~: parts (knows Spy evs).*)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    56
fun parts_knows_Spy_tac i = 
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    57
  EVERY
7499
23e090051cb8 isatool expandshort;
wenzelm
parents: 6400
diff changeset
    58
   [ftac YM4_parts_knows_Spy (i+6), assume_tac (i+6),
6400
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    59
    prove_simple_subgoals_tac i];
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    60
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    61
(*Induction for regularity theorems.  If induction formula has the form
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    62
   X ~: analz (knows Spy evs) --> ... then it shortens the proof by discarding
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    63
   needless information about analz (insert X (knows Spy evs))  *)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    64
fun parts_induct_tac i = 
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    65
    etac yahalom.induct i
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    66
    THEN 
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    67
    REPEAT (FIRSTGOAL analz_mono_contra_tac)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    68
    THEN  parts_knows_Spy_tac i;
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    69
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    70
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    71
(** Theorems of the form X ~: parts (knows Spy evs) imply that NOBODY
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    72
    sends messages containing X! **)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    73
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    74
(*Spy never sees another agent's shared key! (unless it's bad at start)*)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    75
Goal "evs : yahalom ==> (Key (shrK A) : parts (knows Spy evs)) = (A : bad)";
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    76
by (parts_induct_tac 1);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    77
by (Fake_parts_insert_tac 1);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    78
by (ALLGOALS Blast_tac);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    79
qed "Spy_see_shrK";
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    80
Addsimps [Spy_see_shrK];
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    81
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    82
Goal "evs : yahalom ==> (Key (shrK A) : analz (knows Spy evs)) = (A : bad)";
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    83
by (auto_tac(claset() addDs [impOfSubs analz_subset_parts], simpset()));
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    84
qed "Spy_analz_shrK";
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    85
Addsimps [Spy_analz_shrK];
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    86
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    87
AddSDs [Spy_see_shrK RSN (2, rev_iffD1), 
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    88
	Spy_analz_shrK RSN (2, rev_iffD1)];
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    89
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    90
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    91
(*Nobody can have used non-existent keys!  Needed to apply analz_insert_Key*)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    92
Goal "evs : yahalom ==>          \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    93
\      Key K ~: used evs --> K ~: keysFor (parts (knows Spy evs))";
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    94
by (parts_induct_tac 1);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    95
(*Fake*)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    96
by (blast_tac (claset() addSDs [keysFor_parts_insert]) 1);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    97
(*YM2-4: Because Key K is not fresh, etc.*)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    98
by (REPEAT (blast_tac (claset() addSEs knows_Spy_partsEs) 1));
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
    99
qed_spec_mp "new_keys_not_used";
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   100
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   101
bind_thm ("new_keys_not_analzd",
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   102
          [analz_subset_parts RS keysFor_mono,
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   103
           new_keys_not_used] MRS contra_subsetD);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   104
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   105
Addsimps [new_keys_not_used, new_keys_not_analzd];
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   106
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   107
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   108
(*For proofs involving analz.*)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   109
val analz_knows_Spy_tac = 
7499
23e090051cb8 isatool expandshort;
wenzelm
parents: 6400
diff changeset
   110
    ftac YM4_analz_knows_Spy 7 THEN assume_tac 7;
6400
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   111
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   112
(****
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   113
 The following is to prove theorems of the form
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   114
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   115
  Key K : analz (insert (Key KAB) (knows Spy evs)) ==>
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   116
  Key K : analz (knows Spy evs)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   117
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   118
 A more general formula must be proved inductively.
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   119
****)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   120
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   121
(** Session keys are not used to encrypt other session keys **)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   122
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   123
Goal "evs : yahalom ==>                              \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   124
\  ALL K KK. KK <= - (range shrK) -->                \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   125
\         (Key K : analz (Key``KK Un (knows Spy evs))) = \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   126
\         (K : KK | Key K : analz (knows Spy evs))";
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   127
by (etac yahalom.induct 1);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   128
by analz_knows_Spy_tac;
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   129
by (REPEAT_FIRST (resolve_tac [allI, impI]));
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   130
by (REPEAT_FIRST (rtac analz_image_freshK_lemma));
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   131
by (ALLGOALS (asm_simp_tac analz_image_freshK_ss));
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   132
(*Fake*) 
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   133
by (spy_analz_tac 1);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   134
qed_spec_mp "analz_image_freshK";
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   135
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   136
Goal "[| evs : yahalom;  KAB ~: range shrK |]                  \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   137
\      ==> Key K : analz (insert (Key KAB) (knows Spy evs)) =  \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   138
\          (K = KAB | Key K : analz (knows Spy evs))";
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   139
by (asm_simp_tac (analz_image_freshK_ss addsimps [analz_image_freshK]) 1);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   140
qed "analz_insert_freshK";
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   141
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   142
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   143
(*** The Key K uniquely identifies the Server's  message. **)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   144
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   145
Goal "evs : yahalom ==>                                     \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   146
\   EX A' B' na' nb' X'. ALL A B na nb X.                   \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   147
\       Says Server A                                       \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   148
\        {|Crypt (shrK A) {|Agent B, Key K, na, nb|}, X|}   \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   149
\       : set evs --> A=A' & B=B' & na=na' & nb=nb' & X=X'";
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   150
by (etac yahalom.induct 1);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   151
by (ALLGOALS (asm_simp_tac (simpset() addsimps [all_conj_distrib])));
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   152
by (ALLGOALS Clarify_tac);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   153
by (ex_strip_tac 2);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   154
by (Blast_tac 2);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   155
(*Remaining case: YM3*)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   156
by (expand_case_tac "K = ?y" 1);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   157
by (REPEAT (ares_tac [refl,exI,impI,conjI] 2));
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   158
(*...we assume X is a recent message and handle this case by contradiction*)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   159
by (blast_tac (claset() addSEs knows_Spy_partsEs
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   160
                        delrules [conjI]    (*no split-up to 4 subgoals*)) 1);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   161
val lemma = result();
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   162
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   163
Goal "[| Says Server A                                                 \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   164
\         {|Crypt (shrK A) {|Agent B, Key K, na, nb|}, X|} : set evs;  \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   165
\       Says Server A'                                                 \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   166
\         {|Crypt (shrK A') {|Agent B', Key K, na', nb'|}, X'|} : set evs; \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   167
\       evs : yahalom |]                                    \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   168
\    ==> A=A' & B=B' & na=na' & nb=nb'";
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   169
by (prove_unique_tac lemma 1);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   170
qed "unique_session_keys";
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   171
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   172
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   173
(** Crucial secrecy property: Spy does not see the keys sent in msg YM3 **)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   174
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   175
Goal "[| A ~: bad;  B ~: bad;  evs : yahalom |]                \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   176
\     ==> Says Server A                                        \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   177
\           {|Crypt (shrK A) {|Agent B, Key K, na, nb|},       \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   178
\             Crypt (shrK B) {|Agent A, Key K|}|}              \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   179
\          : set evs -->                                       \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   180
\         Key K ~: analz (knows Spy evs)";
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   181
by (etac yahalom.induct 1);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   182
by analz_knows_Spy_tac;
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   183
by (ALLGOALS
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   184
    (asm_simp_tac 
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   185
     (simpset() addsimps split_ifs @ pushes @
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   186
                         [analz_insert_eq, analz_insert_freshK])));
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   187
(*YM3*)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   188
by (blast_tac (claset() delrules [impCE]
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   189
                        addSEs knows_Spy_partsEs
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   190
                        addIs [impOfSubs analz_subset_parts]) 2);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   191
(*Fake*) 
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   192
by (spy_analz_tac 1);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   193
val lemma = result() RS mp RSN(2,rev_notE);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   194
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   195
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   196
(*Final version*)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   197
Goal "[| Says Server A                                         \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   198
\           {|Crypt (shrK A) {|Agent B, Key K, na, nb|},       \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   199
\             Crypt (shrK B) {|Agent A, Key K|}|}              \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   200
\          : set evs;                                          \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   201
\        A ~: bad;  B ~: bad;  evs : yahalom |]                \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   202
\     ==> Key K ~: analz (knows Spy evs)";
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   203
by (blast_tac (claset() addSEs [lemma]) 1);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   204
qed "Spy_not_see_encrypted_key";
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   205
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   206
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   207
(** Security Guarantee for A upon receiving YM3 **)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   208
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   209
(*If the encrypted message appears then it originated with the Server*)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   210
Goal "[| Crypt (shrK A) {|Agent B, Key K, na, nb|} : parts (knows Spy evs); \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   211
\        A ~: bad;  evs : yahalom |]                          \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   212
\      ==> Says Server A                                      \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   213
\           {|Crypt (shrK A) {|Agent B, Key K, na, nb|},      \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   214
\             Crypt (shrK B) {|Agent A, Key K|}|}             \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   215
\          : set evs";
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   216
by (etac rev_mp 1);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   217
by (parts_induct_tac 1);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   218
by (Fake_parts_insert_tac 1);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   219
qed "A_trusts_YM3";
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   220
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   221
(*The obvious combination of A_trusts_YM3 with Spy_not_see_encrypted_key*)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   222
Goal "[| Crypt (shrK A) {|Agent B, Key K, na, nb|} : parts (knows Spy evs); \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   223
\        A ~: bad;  B ~: bad;  evs : yahalom |]                \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   224
\     ==> Key K ~: analz (knows Spy evs)";
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   225
by (blast_tac (claset() addSDs [A_trusts_YM3, Spy_not_see_encrypted_key]) 1);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   226
qed "A_gets_good_key";
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   227
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   228
(** Security Guarantees for B upon receiving YM4 **)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   229
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   230
(*B knows, by the first part of A's message, that the Server distributed 
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   231
  the key for A and B.  But this part says nothing about nonces.*)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   232
Goal "[| Crypt (shrK B) {|Agent A, Key K|} : parts (knows Spy evs);  \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   233
\        B ~: bad;  evs : yahalom |]                                 \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   234
\     ==> EX NA NB. Says Server A                                    \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   235
\                     {|Crypt (shrK A) {|Agent B, Key K,             \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   236
\                                        Nonce NA, Nonce NB|},       \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   237
\                       Crypt (shrK B) {|Agent A, Key K|}|}          \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   238
\                    : set evs";
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   239
by (etac rev_mp 1);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   240
by (parts_induct_tac 1);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   241
by (Fake_parts_insert_tac 1);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   242
(*YM3*)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   243
by (Blast_tac 1);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   244
qed "B_trusts_YM4_shrK";
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   245
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   246
(** Up to now, the reasoning is similar to standard Yahalom.  Now the
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   247
    doubtful reasoning occurs.  We should not be assuming that an unknown
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   248
    key is secure, but the model allows us to: there is no Oops rule to
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   249
    let session keys go.*)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   250
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   251
(*B knows, by the second part of A's message, that the Server distributed 
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   252
  the key quoting nonce NB.  This part says nothing about agent names. 
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   253
  Secrecy of K is assumed; the valid Yahalom proof uses (and later proves)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   254
  the secrecy of NB.*)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   255
Goal "evs : yahalom                                          \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   256
\     ==> Key K ~: analz (knows Spy evs) -->                 \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   257
\         Crypt K (Nonce NB) : parts (knows Spy evs) -->     \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   258
\         (EX A B NA. Says Server A                          \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   259
\                     {|Crypt (shrK A) {|Agent B, Key K,     \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   260
\                               Nonce NA, Nonce NB|},        \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   261
\                       Crypt (shrK B) {|Agent A, Key K|}|}  \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   262
\                    : set evs)";
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   263
by (parts_induct_tac 1);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   264
by (ALLGOALS Clarify_tac);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   265
(*YM3 & Fake*)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   266
by (Blast_tac 2);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   267
by (Fake_parts_insert_tac 1);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   268
(*YM4*)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   269
(*A is uncompromised because NB is secure*)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   270
by (g_not_bad_tac "A" 1);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   271
(*A's certificate guarantees the existence of the Server message*)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   272
by (blast_tac (claset() addDs [Says_imp_knows_Spy RS parts.Inj RS parts.Fst RS
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   273
			       A_trusts_YM3]) 1);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   274
bind_thm ("B_trusts_YM4_newK", result() RS mp RSN (2, rev_mp));
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   275
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   276
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   277
(*B's session key guarantee from YM4.  The two certificates contribute to a
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   278
  single conclusion about the Server's message. *)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   279
Goal "[| Gets B {|Crypt (shrK B) {|Agent A, Key K|},                    \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   280
\                 Crypt K (Nonce NB)|} : set evs;                       \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   281
\        Says B Server                                                  \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   282
\          {|Agent B, Nonce NB, Crypt (shrK B) {|Agent A, Nonce NA|}|}  \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   283
\          : set evs;                                                   \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   284
\        A ~: bad;  B ~: bad;  evs : yahalom |]                         \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   285
\      ==> EX na nb. Says Server A                                      \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   286
\                  {|Crypt (shrK A) {|Agent B, Key K, na, nb|},         \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   287
\                    Crypt (shrK B) {|Agent A, Key K|}|}                \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   288
\            : set evs";
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   289
by (etac (Gets_imp_knows_Spy RS parts.Inj RS MPair_parts) 1 THEN
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   290
    assume_tac 1 THEN dtac B_trusts_YM4_shrK 1);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   291
by (dtac B_trusts_YM4_newK 3);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   292
by (REPEAT_FIRST (eresolve_tac [asm_rl, exE]));
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   293
by (etac Spy_not_see_encrypted_key 1 THEN REPEAT (assume_tac 1));
7499
23e090051cb8 isatool expandshort;
wenzelm
parents: 6400
diff changeset
   294
by (ftac unique_session_keys 1 THEN REPEAT (assume_tac 1));
6400
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   295
by (blast_tac (claset() addDs []) 1);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   296
qed "B_trusts_YM4";
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   297
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   298
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   299
(*The obvious combination of B_trusts_YM4 with Spy_not_see_encrypted_key*)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   300
Goal "[| Gets B {|Crypt (shrK B) {|Agent A, Key K|},                   \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   301
\                    Crypt K (Nonce NB)|} : set evs;                   \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   302
\        Says B Server                                                 \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   303
\          {|Agent B, Nonce NB, Crypt (shrK B) {|Agent A, Nonce NA|}|} \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   304
\          : set evs;                                                  \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   305
\        A ~: bad;  B ~: bad;  evs : yahalom |]                \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   306
\     ==> Key K ~: analz (knows Spy evs)";
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   307
by (blast_tac (claset() addSDs [B_trusts_YM4, Spy_not_see_encrypted_key]) 1);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   308
qed "B_gets_good_key";
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   309
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   310
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   311
(*** Authenticating B to A: these proofs are not considered.
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   312
     They are irrelevant to showing the need for Oops. ***)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   313
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   314
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   315
(*** Authenticating A to B using the certificate Crypt K (Nonce NB) ***)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   316
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   317
(*Assuming the session key is secure, if both certificates are present then
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   318
  A has said NB.  We can't be sure about the rest of A's message, but only
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   319
  NB matters for freshness.*)  
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   320
Goal "evs : yahalom                                              \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   321
\     ==> Key K ~: analz (knows Spy evs) -->                     \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   322
\         Crypt K (Nonce NB) : parts (knows Spy evs) -->         \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   323
\         Crypt (shrK B) {|Agent A, Key K|} : parts (knows Spy evs) --> \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   324
\         B ~: bad -->                                           \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   325
\         (EX X. Says A B {|X, Crypt K (Nonce NB)|} : set evs)";
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   326
by (parts_induct_tac 1);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   327
(*Fake*)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   328
by (Fake_parts_insert_tac 1);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   329
(*YM3: by new_keys_not_used we note that Crypt K (Nonce NB) could not exist*)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   330
by (fast_tac (claset() addSDs [Crypt_imp_keysFor] addss (simpset())) 1); 
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   331
(*YM4: was Crypt K (Nonce NB) the very last message?  If not, use ind. hyp.*)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   332
by (asm_simp_tac (simpset() addsimps [ex_disj_distrib]) 1);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   333
(*yes: apply unicity of session keys*)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   334
by (g_not_bad_tac "Aa" 1);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   335
by (blast_tac (claset() addSEs [MPair_parts]
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   336
                        addSDs [A_trusts_YM3, B_trusts_YM4_shrK]
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   337
		        addDs  [Says_imp_knows_Spy RS parts.Inj,
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   338
				unique_session_keys]) 1);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   339
qed_spec_mp "A_Said_YM3_lemma";
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   340
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   341
(*If B receives YM4 then A has used nonce NB (and therefore is alive).
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   342
  Moreover, A associates K with NB (thus is talking about the same run).
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   343
  Other premises guarantee secrecy of K.*)
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   344
Goal "[| Gets B {|Crypt (shrK B) {|Agent A, Key K|},                   \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   345
\                 Crypt K (Nonce NB)|} : set evs;                      \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   346
\        Says B Server                                                 \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   347
\          {|Agent B, Nonce NB, Crypt (shrK B) {|Agent A, Nonce NA|}|} \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   348
\          : set evs;                                                  \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   349
\        A ~: bad;  B ~: bad;  evs : yahalom |]       \
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   350
\     ==> EX X. Says A B {|X, Crypt K (Nonce NB)|} : set evs";
7499
23e090051cb8 isatool expandshort;
wenzelm
parents: 6400
diff changeset
   351
by (ftac B_trusts_YM4 1);
6400
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   352
by (REPEAT_FIRST assume_tac);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   353
by (etac (Gets_imp_knows_Spy RS parts.Inj RS MPair_parts) 1 THEN assume_tac 1);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   354
by (Clarify_tac 1);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   355
by (rtac A_Said_YM3_lemma 1);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   356
by (rtac Spy_not_see_encrypted_key 2);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   357
by (REPEAT_FIRST assume_tac);
1f495d4d922b added new theory Yahalom_Bad
paulson
parents:
diff changeset
   358
qed_spec_mp "YM4_imp_A_Said_YM3";