Lecture Notes in Computer Science Edited by G. Goos, J. Hartmanis and J. van Leeuwen
2140
3
Berlin Heidelberg New York Barcelona Hong Kong London Milan Paris Tokyo
Isabelle Attali Thomas Jensen (Eds.)
Smart Card Programming and Security International Conference on Research in Smart Cards, E-smart 2001 Cannes, France, September 19-21, 2001 Proceedings
13
Series Editors Gerhard Goos, Karlsruhe University, Germany Juris Hartmanis, Cornell University, NY, USA Jan van Leeuwen, Utrecht University, The Netherlands Volume Editors Isabelle Attali INRIA Sophia Antipolis BP 93, 06902 Sophia Antipolis Cedex, France E-mail:
[email protected] Thomas Jensen IRISA/CNRS Campus de Beaulieu 35042 Rennes, France E-mail:
[email protected] Cataloging-in-Publication Data applied for Die Deutsche Bibliothek - CIP-Einheitsaufnahme Smart card programming and security ; proceedings / International Conference on Research in Smart Cards, E-Smart 2001, Cannes, France, September 19 - 21, 2001. Isabell Attali ; Thomas Jensen (ed.). - Berlin ; Heidelberg ; New York ; Barcelona ; Hong Kong ; London ; Milan ; Paris ; Tokyo : Springer, 2001 (Lecture notes in computer science ; Vol. 2140) ISBN 3-540-42610-8
CR Subject Classification (1998): C.3, C.2, D.3.2, D.4.6, E.3, F.3, K.6.5, K.4.4 ISSN 0302-9743 ISBN 3-540-42610-8 Springer-Verlag Berlin Heidelberg New York This work is subject to copyright. All rights are reserved, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, re-use of illustrations, recitation, broadcasting, reproduction on microfilms or in any other way, and storage in data banks. Duplication of this publication or parts thereof is permitted only under the provisions of the German Copyright Law of September 9, 1965, in its current version, and permission for use must always be obtained from Springer-Verlag. Violations are liable for prosecution under the German Copyright Law. Springer-Verlag Berlin Heidelberg New York a member of BertelsmannSpringer Science+Business Media GmbH http://www.springer.de © Springer-Verlag Berlin Heidelberg 2001 Printed in Germany Typesetting: Camera-ready by author, data conversion by DA TeX Gerd Blumenstein Printed on acid-free paper SPIN 10840169 06/3142 543210
Foreword
The E-smart 2001 international conference on research in smart cards was held in Cannes, France on 19–21 September. The conference was jointly organized by the Java Card Forum, Eurosmart and INRIA, and received helpful financial support from the Conseil R´egional Provence-Alpes-Cˆ ote d’Azur. The intention with E-smart is to provide a forum for discussion and exchange of results on smart card development, security, and applications. This year’s program was established by an international program committee that examined 38 papers submitted and selected 20 of these for presentation. The list of topics of this year’s presentations includes biometrics, cryptography and electronic signatures on smart cards, hardware and software solution for smart card security, formal methods for smart card evaluation and certification, architectures for multi-applications and secure open platforms, middleware for smart cards and novel applications of smart cards. The conference also featured an invited talk by Simon Moore from the University of Cambridge.
Isabelle Attali Thomas Jensen E-smart 2001 program committee co-chairs.
Organization
Program Committee Isabelle Attali, INRIA Dominique Bolignano, Trusted Logic Bertrand du Castel, Schlumberger Wolfgang Effing, Giesecke & Devrient Christian Goire, Bull CP8 Pieter Hartel, University of Twente Peter Honeyman, University of Michigan Thomas Jensen, IRISA / CNRS Pierre Paradinas, Gemplus Joachim Posegga, SAP AG Peter Ryan, CERT Jean-Paul Thomasson, ST Microelectronics Yasuyoshi Uemura, ECSEC
Thanks are due to the following people for their help with the refereeing of papers: Thomas Genet, Valerie Viet Triem Tong, Stefan Friedich, Harald Vogt, Jaap-Henk Hoepman, Neil Henderson, Adam Field, and Jordan Chong.
Table of Contents
Invited Talk Protecting Consumer Security Devices (The Next 10 Years) . . . . . . . . . . . . . . . . . 1 Simon Moore
Contributed Papers Jakarta: A Toolset for Reasoning about JavaCard . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 G. Barthe, G. Dufay, M. Huisman, and S. Melo de Sousa Mechanising a Protocol for Smart Cards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Giampaolo Bella JCCM: Flexible Certificates for Smartcards with Java Card . . . . . . . . . . . . . . . . 34 Celeste Campo, Andr´es Marm, Arturo Garc´ıa, Ignacio D´ıaz, Peter T. Breuer, Carlos Delgado, and Carlos Garc´ıa Context Inference for Static Analysis of Java Card Object Sharing . . . . . . . . . 43 Denis Caromel, Ludovic Henrio, and Bernard Serpette Automated Test and Oracle Generation for Smart-Card Applications . . . . . . .58 Duncan Clarke, Thierry J´eron, Vlad Rusu, and Elena Zinovieva An Internet Authorization Scheme Using Smart-Card-Based Security Kernels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 Yves Deswarte, Noreddine Abghour, Vincent Nicomette, and David Powell Turning Multi-applications Smart Cards Services Available from Anywhere at Anytime: A SOAP/MOM Approach in the Context of Java Cards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 Didier Donsez, S´ebastien Jean, Sylvain Lecomte, and Olivier Thomas An Operational Semantics of the Java Card Firewall . . . . . . . . . . . . . . . . . . . . . . . 95 ´ Marc Eluard, Thomas Jensen, and Ewen Denne CardS4: Modal Theorem Proving on Java Smartcards . . . . . . . . . . . . . . . . . . . . . 111 Rajeev Prabhakar Gor´e and Phuong Thˆe Nguyˆen iButton Enrolment and Verification Requirements for the Pressure Sequence Smartcard Biometric . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 Neil J. Henderson, Neil M. White, and Pieter H. Hartel SIMspeak – Towards an Open and Secure Application Platform for GSM SIMs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 Roger Kehr and Hendrik Mieves
VIII
Table of Contents
On-Card Bytecode Verification for Java Card . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 Xavier Leroy Towards a Full Formal Specification of the JavaCard API . . . . . . . . . . . . . . . . . 165 Hans Meijer and Erik Poll Protection Profiles and Generic Security Targets for Smart Cards as Secure Signature Creation Devices – Existing Solutions for the Payment Sector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179 Gisela Meister and Michael Vogel A Flexible Invocation Framework for Java Card . . . . . . . . . . . . . . . . . . . . . . . . . . .188 Michael Montgomery and Ksheerabdhi Krishna ElectroMagnetic Analysis (EMA): Measures and Counter-Measures for Smart Cards . . . . . . . . . . . . . . . . . . . . . . . . . 200 Jean-Jacques Quisquater and David Samyde Information Leakage Attacks against Smart Card Implementations of the Elliptic Curve Digital Signature Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . 211 Tanja R¨ omer and Jean-Pierre Seifert Use of Biometrics for User Verification in Electronic Signature Smartcards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220 Bruno Struif Programming Internet Smartcard with XML Scripts . . . . . . . . . . . . . . . . . . . . . . 228 Pascal Urien Public-Key-Based High-Speed Payment (Electronic Money) System Using Contact-Less Smart Cards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .242 Hideo Yamamoto, Tetsutaro Kobayashi, Masahiro Morita, and Ryuji Yamada Author Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .255
Protecting Consumer Security Devices The Next 10 Years Simon Moore University of Cambridge, Computer Laboratory
[email protected]
Extended Abstract In this talk, I will speculate about the likely near-term and medium-term scientific developments in the protection of low cost consumer security devices. The mass adoption of embedded computing devices (mobile phones, PDAs, smartcards, etc) is moving us rapidly into the ubiquitous computing age. If these devices are too be a boon rather than a bane then robustness is going to be increasingly important. Security will be increasingly important, not only for traditional roles like payment mechanisms and access control, but also for peer to peer transactions and new business structures. Peer to peer transactions between ones own devices need to be transparent and robust. Transactions between your devices and others needs more control to ensure that communication only takes place at your convenience. This requires robust authentication mechanisms (e.g., the Resurrecting Duckling Protocol1 ) coupled with a simple, elegant and intuitive user interface. Novel business models arise from low cost embedded security devices. For example, per use leasing arrangements in a variety of guises, e.g. washing machines and other home appliances, software, videos, pay TV, public bicycles and car pools. In practice we have seen how invasive attacks (reverse engineering), litigation attacks (abusing the legal discovery process) and business process failures have resulted in design discovery. Thus, inline with Kerckhoffs’ principle, the security of a consumer security devices should only lie in keeping the key secret. Extracting a key must be kept economically unattractive. Invasive attacks (probing the chip) to obtain key information are simpler than full reverse engineering attacks. These attacks tend to leave tamper evidence which limits their scope for some applications, but is a significant risk in any environment where identical copies of the same security device are useful (e.g. current PayTV systems). Non-invasive attacks, on the other hand, extract information by analysing side channel information like electromagnetic emissions and power consumption, which leave little tamper evidence. As part of the G3Card European project (IST-1999-13515) we have been advancing attack techniques to better understand threat models. This knowledge is being used to guide the development of novel circuit and software techniques to make non-invasive attacks more difficult. 1
see http://www.cl.cam.ac.uk/users/rja14/duckling.html
I. Attali and T. Jensen (Eds.): E-smart 2001, LNCS 2140, pp. 1–1, 2001. c Springer-Verlag Berlin Heidelberg 2001
Jakarta: A Toolset for Reasoning about JavaCard G. Barthe, G. Dufay, M. Huisman, and S. Melo de Sousa INRIA Sophia-Antipolis, France {gbarthe,gdufay,mhuisman,sdesousa}@sophia.inria.fr
1
Introduction
JavaCard [22] is a dialect of Java that enables Java technology to run on new generation smart cards and other devices with limited memory. As JavaCard is becoming increasingly popular, there has been a strong interest, both from academics and industrials, to reason formally about the JavaCard platform. This paper reports on preliminary results with Jakarta, a toolset for specifying and reasoning about the JavaCard platform. The main ingredients of the toolset are: 1. the Jakarta Specification Language (JSL), a front-end for producing highly readable executable specifications; 2. the Jakarta Transformation Kit (JTK), a program to manipulate and transform JSL specifications; 3. the Jakarta Prover Interface (JPI), a compiler that translates JSL specifications into proof assistants; 4. the Jakarta Automation Kit (JAK), a toolset to support reasoning about executable specifications within proof assistants. The main slogan behind Jakarta’s design is that: a dedicated specification language is not only useful to achieve readable executable specifications that are easy to animate and debug, but it also can have a dramatic positive impact on formal verification. To support this slogan, the benefits of this approach over using a proof assistant directly, as done in our previous work [3], are illustrated. 1.1
Background
Formal Methods for Smart Cards With the increasing popularity of Java and JavaCard, there has been a spate of efforts, both by academics and industrials, to develop formal models for the Java and JavaCard platforms, see e.g. [3,6,9,16,20,21,27,28,31].
On leave from University of Beira Interior-Portugal, and partially supported by the Portuguese research grant sfrh/bd/790/2000.
I. Attali and T. Jensen (Eds.): E-smart 2001, LNCS 2140, pp. 2–18, 2001. c Springer-Verlag Berlin Heidelberg 2001
Jakarta: A Toolset for Reasoning about JavaCard
3
In earlier work [3], we report on CertiCartes, a formalisation in Coq [2] of a large part of the JavaCard platform. With over 15,000 lines of Coq scripts, our formalisation constitutes to date the most in-depth machine-checked account of the JavaCard platform. CertiCartes contains a formal executable specification of the (defensive) JavaCard Virtual Machine JCVM, and a formal executable specification of the JavaCard ByteCode Verifier BCV, with its correctness proof. This BCV has been constructed in a systematic way, by abstraction, from the specification of the virtual machine. First an abstract virtual machine has been constructed, describing the computational behaviour of bytecode verification. This abstract virtual machine is obtained systematically from the concrete virtual machine by defining a notion of abstract state, a function α mapping states to abstract states, and by adapting the semantics of each instruction to abstract states. It has been shown that the abstraction function “commutes with” execution (up to subtyping). Next, a data flow analyser has been build, that computes from the abstract virtual machine the BCV as a predicate on programs, and it has been shown that this data flow analyser terminates. The methodology followed to specify and prove the correctness of the BCV is very appealing, in that it provides a systematic approach to the design and validation of static analyses for JCVM programs. Indeed, we are keen on applying a similar methodology for analysing object initialisation, information flow etc. However, our experiences with proving the correctness of the BCV suggest that Coq and more generally current proof assistants are not completely adapted for such endeavours: the specification of the virtual machine is cluttered, proofs are tedious and the level of automation is low. Prototyping Environments and Proof Assistants Many of these difficulties can be solved by using a dedicated prototyping environment that supports some/most administrative aspects of formal semantics. A number of tools have been designed for this purpose, including ASF+SDF [15], Centaur [10], Letos [18] and RML [30]. These tools are rather diverse in their design and functionalities, but they all provide: – a readable format for giving a formal semantics to programming languages; – support to execute the semantics, which in particular allows to check that the semantics reflects the intended behaviour of the language. However, prototyping environments lack functionalities to reason formally about the semantics, in contrast to proof assistants such as Coq [2], Isabelle [29] or PVS [32], which feature advanced type systems that support precise specifications and sophisticated reasoning. In order to deal with real-size programming languages, there is thus considerable interest in integrating prototyping environments and proof assistants. Despite preliminary work in this direction, see Section 6.1, we still lack a tool that reflects manipulations in the specification environment of prototyping systems directly into the reasoning environment of proof assistants.
4
G. Barthe et al.
1.2
This Paper
The Jakarta toolset is an attempt to overcome the difficulties encountered in CertiCartes through the design of a suitable bridge between a prototyping environment and a proof assistant. The main goal of Jakarta is to provide support for refinements and abstractions. Through JTK, Jakarta offers interactive support to define a function f : σ → σ from a previously defined function f : σ → σ. The process, which operates at the level of rewrite rules, can be used if (1) σ is less specific than σ, in which case the process requires an abstraction function α : σ → σ or; (2) σ is more precise than σ, in which case the process requires a refinement function α : σ → σ. Currently, Jakarta supports abstractions, refinements will be future work. In the context of reasoning about the JavaCard platform, abstraction is useful to construct e.g. the BCV from the JCVM. To improve the support for refinement and abstractions, the Jakarta toolset has been designed with the following objectives. – Clarity of specifications: Jakarta specifications are written in JSL, a frontend for producing executable specifications. The JSL language is a first-order, polymorphically typed system which features polymorphic datatype declarations and function definitions by conditional rewrite rules. The formalism is reasonably neutral and leads to specifications that are easy to read, extend and manipulate. – Tool independence: the JSL specification language is minimal and JSL specifications are thus easy to embed into other formalisms. We have developed a compiler JPI that translates JSL specifications into an intermediate representation language JIR, and then from JIR to proof assistants, prototyping environments and programming languages. Due to the limited format of JSL rewrite rules, JSL specifications are close to their compiled counterpart, which ensures that what you specify (in JSL) is what you reason about (e.g. in Coq). – Proof automation: the limited format of JSL makes it possible to develop customised tools to reason about JSL specifications. For example, JAK generates for every JSL function f an inversion principle, which is based on an analysis of JSL rewrite rules. Given a predicate φ, relating f ’s input to its output, an application of the inversion principle reduces the task of proving ∀x : σ. φ (x, f x) to several simpler subtasks. This has shown particularly useful in proving the correctness of the BCV. A further pay-off of the independence of proof assistants is that JSL supports partial functions, such as the head of a list. While such partial functions cannot be compiled into the specification language of proof assistants, they can be transformed automatically via JTK into a specification based on total functions, which can be translated to proof assistants. The Jakarta toolset is implemented in Objective Caml [24]. Figure 1 summarises its basic architecture. In its standard use, the Jakarta toolset takes JSL specifications as input. The Jakarta Transformation Kit (JTK) can transform a JSL specification into a more abstract one. The Jakarta Prover Interface (JPI)
Jakarta: A Toolset for Reasoning about JavaCard
5
Fig. 1. Jakarta Architecture
translates JSL specifications into a format that is readable for e.g. a proof assistant or a prototyping environment, via an intermediate language (JIR). The Jakarta Automation Kit (JAK) generates appropriate proof strategies in the proof assistant, based on the JSL specification. 1.3
Organisation of the Paper
The remaining of the paper is organised as follows: Section 2 introduces JSL and presents the specification of the JCVM in JSL. Section 3 gives an overview of JPI, and Section 4 describes the functionalities that will be provided by the JTK. Section 5 is concerned with JAK, and discusses its usefulness in establishing the correctness of the BCV. Section 6 concludes with related work and directions for future research.
2
The Jakarta Specification Language
Jakarta’s input language JSL is a minimal language (Figure 2 gives a flavour of JSL, below a larger example of a JSL specification is discussed): – JSL types are first-order polymorphic types; – JSL expressions are standard first-order algebraic terms; – JSL functions are defined by conditional rewrite rules. Having a restricted framework is useful to abstract or refine specifications and to compile and reason about them in proof assistants. JSL Expressions JSL expressions are first-order terms built from variables and constant symbols. The latter are either constructor symbols, introduced by datatype declarations, or defined symbols, introduced by function definitions. Formally, expressions are defined as follows.
6
G. Barthe et al.
data nat = Zero | Succ of nat. function plus : nat -> nat -> nat := begin m -> Zero => plus m n -> n; m -> Succ y => plus m n -> Succ (plus y n); end.
Fig. 2. Example of JSL specification
Definition 1. – A signature Σ consists of a set C of constructor symbols, D of defined symbols and an arity function ar : (C ∪ D) → N. – Let Σ be a signature and let V be a fixed set of variables. The set E of expressions (over Σ) is defined by the abstract syntax: E := V | E == E | c E | f E where c ranges over C, f ranges over D, and in the last two clauses it is assumed that E is of length ar(c) and ar(f ) respectively. For every f ∈ D, we let Ed (f ) ⊂ E be the set of expressions with head symbol f , i.e. we let Ed (f ) = {f t | t ∈ E}. Moreover, we let Ed denote V ∪ ( f ∈D Ed (f )). JSL provides concrete syntax for records. Internally they are represented as inductive datatypes with a single constructors, as is done in Coq, thus no abstract syntax has to be defined for them explicitly. We assume the reader to be familiar with standard notions such as subterms, occurrences, substitutions, and the associated notations, see e.g. [23]. JSL Rules Defined function symbols are specified by rewrite rules. In term rewriting jargon, our formalism is a restriction of constructor-based oriented conditional rewriting with extra variables! More precisely, the semantics of a defined function symbol is described by a set of oriented conditional rewrite rules of the form l1 r1 , . . . , ln rn ⇒ g → d The novelty of JSL rules is that we require that the right-hand sides of conditions are patterns with fresh variables. This restriction yields a formalism that is closely related to pattern-matching. Definition 2 (Rewrite rule). Let Σ be a signature.
Jakarta: A Toolset for Reasoning about JavaCard
7
– The set P of patterns is defined by the abstract syntax P := V | c P where in the second clause it is assumed that patterns have pairwise disjoint sets of variables (in other words, patterns are required to be linear). – An f -rewrite rule is a compound R of the form l1 r1 , . . . , ln rn ⇒ g → d where: • r1 . . . rn ∈ P, l1 . . . ln ∈ Ed and d ∈ E; • g = f x where x ∈ V are pairwise distinct; • for 1 ≤ i ≤ n, var(li ) ⊆ var(g) ∪ var(r1 ) ∪ . . . ∪ var(ri−1 ); • for 1 ≤ i, j ≤ n with i = j, var(ri ) ∩ var(g) = ∅ and var(ri ) ∩ var(rj ) = ∅; • var(d) ⊆ var(g) ∪ var(r1 ) ∪ . . . ∪ var(rn ). – The domain dom(R) of a rewrite rule R is defined as var(ri ) var(g) ∪ 1≤i≤n
– The set of rewrite rules is denoted by R, so R ⊆ List (Ed × P) × (Ed × E). – The set of rewrite systems is denoted by R, so R = PowFin R. JSL rewrite rules have a restricted format, but the Jakarta toolset provides some syntactic sugar, e.g. to allow more complex structures in the rewrite rules, and to provide means to define constants and records. For example, record foo = {one : nat; two : bool;} defines a record with two entries, labelled one and two. An instance in this record type is created as {one = Zero; two = False}. Entries in the record can be accessed using the dot notation, e.g. x.one returns the value of the one entry in the record x, and updated using the with notation, e.g. x with {two = True} replaces the two entry in the record x with the value True. Rewrite rules using this syntactic sugar internally are transformed into pure JSL rules. JSL Execution Model As pointed out by [5], the notion of rewriting for conditional rules is defined inductively. Figure 3 illustrates the execution model for JSL rules. Formally this is defined as follows. Definition 3. Let R be a set of rewrite rules. An expression s R-rewrites to t, written s →R t, if there exists a rule R ∈ R l1 r1 , . . . , ln rn ⇒ g → d a position p of s and a substitution θ with domain dom(R) such that: – s |p = θg and t = s[p ← θd]; – for 1 ≤ i ≤ n, θli R θri ; where R is the reflexive-transitive closure of →R .
8
G. Barthe et al.
n -> Succ m, l -> Cons hd tl => take n l -> Cons hd (take m tl); – The first condition simplifies the function argument n, checks whether this is non-zero and introduces its predecessor as the fresh variable m; – The second condition uses the function argument l, checks whether it is a nonempty list and introduces its head as the fresh variable hd and its tail as the fresh variable tl; – The result is expressed using the fresh variables introduced in the conditions.
Fig. 3. Semantics of a JSL rule
Application: JSL Specification of the JavaCard Virtual Machine To illustrate JSL, we take the formalisation of the JCVM as an example. This application has been the initial motivation for the work on Jakarta. The JSL specification of the JCVM is derived automatically from the CertiCartes formalisation of the JCVM in Coq. Basically, the JCVM is described as a state transformer: execution of an instruction modifies the internal state space. The virtual machine takes as input the initial state space, and a program (in cap-format) and executes the appropriate code. The state that is produced by an instruction is tagged with a label Normal or Abnormal. If the state is tagged with Abnormal, this means that something bad has happened: either an exception has been thrown (and not been caught), or there is an error in the bytecode, noticed by the virtual machine. These errors in the bytecode normally are found by a bytecode verifier. That we are still checking for these kind of errors makes our virtual machine defensive, i.e. we do not expect the input program to be certified. By making different abstractions of a defensive virtual machine, one can construct different bytecode verifiers. To illustrate the virtual machine, we give the semantics for the negation instruction NEG. Its CertiCartes definition reads as follows. Definition NEG := [t:type_prim][state:jcvm_state] Cases state of (sh, (hp, (cons h lf))) => Cases (head (opstack h)) of (value x) => (* if the value pushed from the stack is typed by t *) (* then the NEG operation is performed *) Cases x of ((Prim tx), vx) => (if (beq_primitive_type t tx) then (update_frame (update_opstack (cons ((Prim t), (t_minus t ZERO vx)) (tail (opstack h))) h) state) else (AbortCode opstack_error state)) |
Jakarta: A Toolset for Reasoning about JavaCard
9
_ => (AbortCode opstack_error state) end| error => (AbortCode opstack_error state) end | _ => (AbortCode state_error state) end.
This instruction assumes that there is a primitive value on the top of the operand stack, and replaces it with its negated value. The Jakarta toolset transforms this into the following JSL rewrite rules1 . function neg : type_prim -> state -> returned_state := begin s -> {static = sh; heap = hp; stack = Nil} => neg p s -> Abnormal s Error; s -> {static = sh; heap = hp; stack = Cons f lf}, f.opstack -> Nil => neg p s -> Abnormal s Error; s -> {static = sh; heap = hp; stack = Cons f lf}, f.opstack -> Cons o os, o -> {data_type = Ref r; value = k} => neg p s -> Abnormal s Error; s -> {static = sh; heap = hp; stack = Cons f lf}, f.opstack -> Cons o os, o -> {data_type = Prim p’; value = k}, p == p’ -> false => neg p s -> Abnormal s Error; s -> {static = sh; heap = hp; stack = Cons f lf}, f.opstack -> Cons o os, o -> {data_type = Prim p’; value = k}, p == p’ -> true => neg p s -> Normal (s with {stack := Cons (f with {p_count := Succ (f.p_count); opstack := Cons ({data_type = Prim p; value = k}) os}) lf}); end.
Notice how these rules systematically consider all possible cases. A more complicated instruction to describe formally is invoke virtual, which contains more different cases that might cause an exception or an error. Below we give the rewrite rule for the normal termination case, the complete formalisation also contains rules for all complementary cases. Exceptions are thrown if this instruction is called with a null pointer argument or if there is 1
Notice that we have changed some tuples to labelled tuples or records.
10
G. Barthe et al.
a security problem, signalled by the function test security invokevirtual. In all other cases, an error in the bytecode is signalled. The JSL specification closely follows the JCVM specification. The reader is not expected to understand all the details of this formalisation, but hopefully appreciates how the rewrite rule encodes the evaluation order in a natural way. Again, this formalisation is derived from our earlier work on CertiCartes. function invoke_virtual : nat -> class_method_idx -> state -> capprogram -> returned_state := begin s -> {static = sh; heap = hp; stack = Cons f lf}, nargs -> Succ n, nth_func f.opstack nargs -> {data_type = Ref r; value = vx}, vx == null -> False, nth_func hp vx -> ob, nth_elt cap.classes (get_obj_class_idx ob) -> c, get_method c cm_id -> m, take nargs f.opstack -> l, drop nargs f.opstack -> l’, test_security_invokevirtual f ob -> True, signature_verification (datalist_to_typelist l) m.domain cap -> True => invoke_virtual nargs cm_id s cap -> Normal (s with {stack := (Cons {opstack = Nil; locvars = make_locvars l m.local; method_loc = m.method_id; context_ref = get_owner_context ob; pc = Zero} (Cons (f with {opstack := l’}) lf))}); end.
3
The Jakarta Prover Interface
Proof assistants such as Coq support the definition of total, terminating recursive definitions through the combination of fixpoint definitions and case analysis. Under suitable circumstances, which we describe below, it is possible to compile JSL functions into recursive definitions ` a la Coq. In order to target several proof assistants, prototyping environments and programming languages, we translate JSL specifications first into an intermediate language JIR (Jakarta Intermediate Representation language), supporting such recursive definitions. The Jakarta Intermediate Representation language (JIR) The Jakarta Intermediate Representation Language is a mild extension of JSL with case expressions.
Jakarta: A Toolset for Reasoning about JavaCard
11
Definition 4. Let Σ be a signature. – The set E + of JIR expressions (over Σ) is defined by the abstract syntax: E + := V | E + == E + | c E + | f E + | case E + of {M} where the set M of matches is defined as: M := | M|p ⇒ E – A JIR rewrite rule is a rewrite rule of the form f x→e where x = (x1 , . . . , xn ) are pairwise distinct variables and e ∈ E + verifies var(e) ⊆ {x1 , . . . , xn }. The set of JIR rewrite rules is denoted by RJIR . Compiling JSL Specifications The Jakarta Prover Interface JPI transforms deterministic JSL functions into JIR functions. The transformation may fail, for example if the rewrite system is not deterministic. If it succeeds, it transforms a set of f -rewrite rules into a recursive function definition ` a la Coq. The function K is defined thanks to an auxiliary recursive function K which transforms a set of rewrite rules into a single case expression. Definition 5. – We define K : R E + as follows: K ({([], (e, d))}) = d K (X1 , . . . , Xk ) = case t of {p1 ⇒ K (X1 ) | ··· pk ⇒ K (Xk )} where in the last clause it is assumed that p1 , . . . , pk are pairwise distinct (for the decomposition to be unique) and: • for every 1 ≤ i ≤ k and R ∈ Xi , head (π R) = (t, pi ); • for every 1 ≤ i ≤ k, Xi = {(tail (π R), π R) | R ∈ Xi }. – We define K : R RJIR as follows: K( 1≤i≤k {Ci ⇒ f x → ri }) = f x → K ( 1≤i≤k {Ci ⇒ f x → ri }) where it is assumed that x = (x1 , . . . , xs ) are pairwise distinct. In other words, K proceeds by checking that all the left-hand sides of the rewrite rule coincide before calling the auxiliary function K . The function K proceeds by first partitioning the set of rewrite rules on the right-hand side of the first condition, and then making recursive calls on the partitions, leaving out the first condition.
12
G. Barthe et al.
Note that in practice, the function is parameterised by a predicate φ which ensures that the resulting function is of a suitable shape; for example, the predicate φ can be used to enforce that the resulting function is total (case expressions must be exhaustive and treat all the possible cases) and unambiguous (the patterns of a case expression must be non-overlapping). JIR expressions can easily be transformed into input for a specific proof assistant or programming language (to provide execution). Currently our tool supports the proof assistant Coq and the programming language OCaml and we are extending it to support other tools. We have also implemented a decompiler which transforms case expressions into rewrite rules. The decompiler can be used to translate Coq formalisations to JSL. Notice that the decompiler J is the inverse of the compiler K. Definition 6. We define J : RJIR → R as follows: J(f x → e) = {(, (g, e))} if e is not a case-expression J(f x → case M of {p1 →e1 | . . . |pk → ek }) = 1≤j≤k {((M, pj ) : (π R), π R) | R ∈ J(f x → ej )}
4
The Jakarta Transformation Kit
The core of Jakarta’s functionality is the Transformation Kit, which provides interactive support for abstractions. As emphasised in the introduction, the constrained format of JSL facilitates (1) manipulation of JSL specifications, and (2) development of automatic transformation procedures for this purpose. Below, we will sketch how JTK provides support for abstractions, the support for refinements will be similar. The user of Jakarta specifies an abstraction function (in JSL), describing how the abstract state is constructed from the concrete one. For example, the so-called ‘type’ abstraction, which removes all values, will contain the following rewrite rule (among others, that propagate this abstraction to the level of states): x -> {data_type = t; value = v} => abs_type x -> {data_type = t}
The user can tell the JTK to apply this abstraction to a particular JSL function. The JTK performs a syntactical transformation, applying the abstraction function to every component of the rewrite rules, defining the function. For example, applying the type abstraction to invoke virtual (as defined in Section 2) will change the 3rd condition into: nth_func f.opstack nargs -> {data_type = Ref r},
After applying this abstraction, the toolset will signal that there are problems with several conditions, and with the right-hand side of the conclusion of the rewrite rule, because variables are used which have not been introduced before (conflicting with the 3rd condition on rewrite rules, Definition 2). E.g., the 4th condition uses the variable vx, which is not introduced in the abstracted version of the 3rd condition.
Jakarta: A Toolset for Reasoning about JavaCard
13
The user analyses the outcome of the syntactical abstraction and determines what should be changed. For example, in the case of the invoke virtual instruction, the 6th condition describes the lookup of the dynamic type of an object. In the abstract virtual machine, there are no values, and one can only lookup the static type of a variable. Therefore, the user specifies how this condition should be replaced, by another condition, introducing the variable c. These replacements identify the crucial steps in the abstraction. Finally, the JTK performs some cleaning, removing conditions which still depend on variables that have not been introduced before. The abstraction process, including replacements, is stored in a so-called abstraction script, in order to guide the correctness proof of the abstraction.
5
The Jakarta Automation Kit
As emphasised in the introduction, the constrained format of JSL facilitates (1) reasoning about JSL specifications (2) developing automatic proof procedures for this purpose. We are currently developing a repository of tools to generate proof rules and tactics to reason about executable specifications. This repository, which is called the Jakarta Automation Kit, is tool-specific and oriented towards Coq. However, its underlying principles are applicable to other proof assistants. One of the proof techniques to reason about JSL functions is the so-called inversion principle. For every function f , an associated inversion principle is derived, based on an analysis of the rewrite rules defining f . Given a predicate φ, relating f ’s input to its output, application of the inversion principle breaks down the proof of ∀x : σ. φ (x, f x) into several smaller subgoals. For each rewrite rule defining f , a subgoal is generated with the following format: assuming that all left-hand sides of the conditions can be rewritten in their right-hand sides, and assuming that f x rewrites into an expression d (as specified by the rewrite rule), one shows that φ (x, f x) holds. For example, to show the correctnes of the bytecode verifier, one has to show that for every instruction, execution commutes with the abstraction function. Suppose we have a predicate P specifying this. Then, in particular we have to show in Coq: (nargs:nat)(cm_id:class_method_idx)(s:state)(cap:jcprogram) (P nargs cm_id s cap (invoke_virtual nargs cm_id s cap))
(where invoke virtual is described in Section 2). Application of the inversion principle reduces this goal to several subgoals (one for each defining rewrite rule), including the following subgoal: (nargs:nat)(cm_id:class_method_idx)(s:state)(cap:jcprogram) (sh:sheap)(hp:heap)(f:frame)(lf:stack)(n:nat)(r:type_ref)(vx:Z) (ob:obj)(c:Class)(m:Method)(l,l’:(list valu)) (s = (Build_state sh hp (Cons f lf))) -> (nargs = (S n)) -> ((Nth_func (opstack f) nargs) = (Build_data (Ref r) vx)) -> ((vx = Null) = False)
14 -> -> -> -> -> -> -> ->
->
G. Barthe et al. ((Nth_func hp vx) = ob) ((Nth_elt (classes cap) (get_obj_class_idx ob)) = c) ((get_method c cm_id) = m) ((take nargs (opstack f)) = l) ((drop nargs (opstack f)) = l’) ((test_security_invokevirtual f ob) = True) ((signature_verification (datalist_to_typelist l) (domain m) cap) = True) ((invoke_virtual nargs cm_id s cap) = (update_stack (Cons (Make_frame Nil (make_locvars l (local m)) (method_id m) (get_owner_context ob) O) (Cons (update_opstack l’ f ) lf)) s)) (P nargs cm_id s cap (invoke_virtual nargs cm_id s cap)).
Using rewriting, this subgoal can be simplified further. We have proven the commutation property before, without using the inversion principle, and in our experience, using the inversion principle is very useful: by pulling out all the different cases at once, it allows to simplify the goals by applying suitable rewriting tactics at the onset of the proof. Consequently, the proofs become shorter and are much easier to perform and understand, resulting in a substantial increase in the speed of proving. Without the inversion principle the proof took a few days (and we were often faced with goals that were more than 3 pages long!), while using the inversion principle it only took a couple of hours to complete the proof.
6
Conclusion
We have described the general structure of the Jakarta toolset, which provides a tool-independent front-end to specify and reason about the JavaCard platform. In particular, the toolset provides support to construct abstractions, in order to derive certified bytecode verifiers from the formalisation of the JavaCard virtual machine. 6.1
Related Work
Prototyping Environments and Proof Assistants The Jakarta Prover Interface provides a “shallow embedding” of JSL into proof assistants such as Coq and programming languages such as Caml—the embedding is called shallow because we do not formalise the syntax of JSL as datatypes in the target language, as a deep embedding would do. Several implementations relate such environments, including B, VDM, Z and Centaur, to proof assistants, see e.g. [1,11,26,34]. In contrast to Jakarta, these specification languages are extremely powerful, which makes it difficult to generate proof principles for the specifications automatically.
Jakarta: A Toolset for Reasoning about JavaCard
15
Abstractions The idea of deriving abstract functions from a concrete function and an abstraction function, which traces back to Cousot and Cousot’s seminal paper [14], see also [12,13], has been exploited in a number of contexts, and in particular in the context of formal verification, see e.g. [4,8,17] for recent examples. Our work around JTK can be viewed as a simple application of abstract interpretation techniques to term-rewriting. Applications to JavaCard Jakarta is tailored to the design of certified bytecode verifiers. There have been a number of related efforts, both to prove the standard bytecode verifier correct [7,27,33], and to suggest new bytecode verifiers based on more complex type systems [25]. Most of this work is tailored towards a particular security policy, to the exception of [27], where it is shown how to use a data flow analyser to construct a bytecode verifier from an abstract virtual machine. In contrast, our work is focused on deriving abstract virtual machines from defensive ones, and proving them correct. We are not aware of any similar effort, despite tremendous activity in the field—see e.g. [19] for a recent survey of ongoing work. 6.2
Future Work
The paper reports on preliminary results with the implementation and use of Jakarta. Clearly, much work remains to be done, e.g. extending JSL with modules, extending JPI to support other proof assistants, programming languages, and modifying JPI to translate JSL specifications as inductive relations. . . Below, we single out two important directions for future research. JAK: Automating Correctness Proofs for Bytecode Verifiers We intend to combine the correctness proof of the data flow analyser of [27] with the correctness proofs for abstract virtual machines to achieve modular, highly automated proofs of correctness for a range of bytecode verifiers. As a first step in this direction, N. Baudru, S. Coupet-Grimal and D. Sanchez have ported Nipkow’s development to Coq. Hence future work only needs to focus on automating the proof of correctness of abstract virtual machines. This involves automating the proof of ∀x. (α (f x)) ∈ f (α x) where α is the abstraction function, f is the function to be abstracted and f is the abstracted function—in some instances, the result only holds up to subtyping, see e.g. [3]. To this end, one needs to automate the proof of the inversion principle for f and to perform rewriting steps to conclude—in most cases, these two passes are sufficient; for instructions such as invoke virtual, some further reasoning is required. In the latter case, we need to integrate rewriting techniques into Coq so that rewrite steps in the JSL execution model are translated into proof terms acceptable by Coq.
16
G. Barthe et al.
In order to apply our methodology, we are currently extracting an offensive virtual machine from our specification and building up appropriate defensive virtual machines that verify (1) initialisation and (2) information flow. JTK: Support the Construction of Refined Virtual Machines Currently, JTK only supports abstractions. We are planning to extend it to support interactive refinements, i.e. tools to define a function f : σ → σ from a previously defined function f : σ → σ and a refinement function α : σ → σ; here it is assumed that σ is more precise than σ, and that α forgets some of the information contained in σ . In the context of reasoning about the JavaCard platform, refinement is useful e.g. to construct a JCVM with a more precise memory model—currently our formalisation does not treat transient objects.
References 1. S. Agerholm and J. Frost. Towards an integrated CASE and theorem proving tool for VDM-SL. In J. Fitzgerald, C. B. Jones, and P. Lucas, editors, Proceedings of FME’97, volume 1313 of Lecture Notes in Computer Science, pages 278-297. Springer-Verlag, 1997. 14 2. B. Barras, S. Boutin, C. Comes, J. Courant, Y. Coscoy, D. Delahaye, D. de Rauglaudre, J.-C. Filliˆ atre, E. Gim´enez, H. Herbelin, G. Huet, H. Laulh`ere, P. Loiseleur, C. Mu˜ noz, C. Murthy, C. Parent-Vigouroux, C. Paulin-Mohring, A. Sa¨ıbi, and B. Werner. The Coq Proof Assistant User’s Guide. Version 6.3.1, December 1999. 3 3. G. Barthe, G. Dufay, L. Jakubiec, B. Serpette, and S. Melo de Sousa. A Formal Executable Semantics of the JavaCard Platform. In D. Sands, editor, Proceedings of ESOP’01, volume 2028 of Lecture Notes in Computer Science, pages 302-319. Springer-Verlag, 2001. 2, 3, 15 4. S. Bensalem, V. Ganesh, Y. Lakhnech, C. Mu˜ noz, S. Owre, H. Rueß, J. Rushby, V. Rusu, H. Sa¨ıdi, N. Shankar, E. Singerman, and A. Tiwari. An overview of SAL. In Proceedings of NASA’s Workshop on Formal Methods, 2000. 15 5. J. Bergstra and J. W. Klop. Conditional rewrite rules: confluence and termination. Journal of Computer and System Sciences, 32:323-362, 1986. 7 6. P. Bertelsen. Semantics of Java Byte Code. Master’s thesis, Department of Computer Science, Royal Veterinary and Agricultural University of Copenhagen, 1997. 2 7. Y. Bertot. Formalizing in Coq a type system for object initialization in the Java bytecode language. In G. Berry, H. Comon, and A. Finkel, editors, Proceedings of CAV’01, volume 2xxx of Lecture Notes in Computer Science. Springer-Verlag, 2001. 15 8. P. Bieber, J. Cazin, V. Wiels, G. Zanon, P. Girard, and J.-L. Lanet. Electronic purse applet certification: extended abstract. In S. Schneider and P. Ryan, editors, Proceedings of the workshop on secure architectures and information flow, volume 32 of Electronic Notes in Theoretical Computer Science. Elsevier Publishing, 2000. 15 9. E. B¨ orger and W. Schulte. A Programmer Friendly Modular Definition of the Semantics of Java. In J. Alves-Foss, editor, Formal Syntax and Semantics of Java, volume 1523 of Lecture Notes in Computer Science, pages 353-404. Springer-Verlag, 1999. 2
Jakarta: A Toolset for Reasoning about JavaCard
17
10. P. Borras, D. Cl´ement, Th. Despeyroux, J. Incerpi, G. Kahn, B. Lang, and V. Pascual. Centaur: the system. In Proceedings of the ACM SIGSOFT/SIGPLAN Software Engineering Symposium on Practical Software Development Environments, pages 14-24. ACM Press, 1988. 3 11. J. P. Bowen and M. J. C. Gordon. A shallow embedding of Z in HOL. Information and Software Technology, 37(5-6):269-276, 1995. 14 12. P. Cousot. Program analysis: The abstract interpretation perspective. ACM Computing Surveys, 28A(4es):165-es, December 1996. 15 13. P. Cousot. Types as abstract interpretations, invited paper. In Proceedings of POPL’97, pages 316-331. ACM Press, 1997. 15 14. P. Cousot and R. Cousot. Abstract interpretation: A unified lattice model for static analysis of programs by construction or approximation of fixpoints. In Proceedings of POPL’77, pages 238-252. ACM Press, 1977. 15 15. A. van Deursen, J. Heering, and P. Klint, editors. Language Prototyping: an algebraic specification approach. AMAST Series in Computing. World Scientific, 1996. 3 16. S. Drossopoulou and S. Eisenbach. Describing the semantics of Java and Proving Type Soundness. In J. Alves-Foss, editor, Formal Syntax and Semantics of Java, volume 1523 of Lecture Notes in Computer Science, pages 41-82. Springer-Verlag, 1999. 2 17. M. Dwyer, J. Hatcliff, R. Joehanes, S. Laubach, C. Pasareanu, Robby, W. Visser, and H. Zheng. Tool-supported program abstraction for finite-state verification. In Proceedings of ICSE’01, 2001. 15 18. P. Hartel. LETOS - a lightweight execution tool for operational semantics. Software-practice and experience, 29:1379-1416, September 1999. 3 19. P. Hartel and L. Moreau. Formalizing the Safety of Java, the Java Virtual Machine and Java Card. ACM Computing Surveys, 2001. To appear. 15 20. P. H. Hartel, M. J. Butler, and M. Levy. The Operational Semantics of a Java Secure Processor. In J. Alves-Foss, editor, Formal Syntax and Semantics of Java, volume 1523 of Lecture Notes in Computer Science, pages 313-352. Springer-Verlag, 1999. 2 21. B. Jacobs, J. van den Berg, M. Huisman, M. van Berkum, U. Hensel, and H. Tews. Reasoning about Java classes. ACM SIGPLAN Notices, 33(10):329-340, October 1998. 2 22. JavaCard Technology. http://java.sun.com/products/javacard 2 23. J. W. Klop. Term-rewriting systems. In S. Abramsky, D. Gabbay, and T. Maibaum, editors, Handbook of Logic in Computer Science, pages 1-116. Oxford Science Publications, 1992. Volume 2. 6 24. X. Leroy, D. Doligez, J. Garrigue, D. R´emy, and J. Vouillon. The Objective Caml system, release 3.00, 2000. 4 25. P. M¨ uller and A. Poetzsch-Heffter. A type system for checking applet isolation in Java Card. In S. Drossopoulou, editor, Formal Techniques for Java Programs, 2001. To appear. 15 26. C. Mu˜ noz. PBS: Support for the B-method in PVS. Technical Report SRI-CSL99-01, SRI International, February 1999. 14 27. T. Nipkow. Verified Bytecode Verifiers. In F. Honsell and M. Miculan, editors, Proceedings of FOSSACS’01, volume 2030 of Lecture Notes in Computer Science, pages 347-363. Springer-Verlag, 2001. 2, 15 28. T. Nipkow and D. von Oheimb. Java/light is type-safe—definitely. In Proceedings of POPL’98, pages 161-170. ACM Press, 1998. 2
18
G. Barthe et al.
29. L. Paulson. Isabelle: a generic theorem prover, volume 828 of Lecture Notes in Computer Science. Springer-Verlag, 1994. 3 30. M. Petersson. Compiling Natural Semantics. PhD thesis, Link¨ oping University, 1995. 3 31. C. Pusch. Proving the soundness of a Java bytecode verifier specification in Isabelle/HOL. In W. R. Cleaveland, editor, Proceedings of TACAS’99, volume 1579 of Lecture Notes in Computer Science, pages 89-103. Springer-Verlag, 1999. 2 32. N. Shankar, S. Owre, and J. M. Rushby. The PVS Proof Checker: A Reference Manual. Computer Science Laboratory, SRI International, February 1993. Supplemented with the PVS2 Quick Reference Manual, 1997. 3 33. R. Stata and M. Abadi. A type system for Java bytecode subroutines. ACM Transactions on Programming Languages and Systems, 21(1):90-137, January 1999. 15 34. D. Terrasse. Vers un environnement d’aide au developpement de preuves en Semantique Naturelle. PhD thesis, Ecole Nationale des Ponts et Chaussees, 1995. 14
Mechanising a Protocol for Smart Cards Giampaolo Bella1,2 1
2
Computer Laboratory, University of Cambridge Pembroke Street, Cambridge CB2 3QG, UK
[email protected] Dipartimento di Matematica e Informatica, Universit` a di Catania Viale A. Doria 6, I-95125 Catania, Italy
[email protected]
Abstract. Paulson’s Inductive Approach for verifying traditional cryptographic protocols is tailored to those where agents make use of smart cards. An intruder can actively exploit other agents’ cards, which can be stolen or cloned. The approach is demonstrated on the Shoup-Rubin protocol, which is modelled and verified thoroughly. The protocol achieves strong goals of confidentiality, authentication and key distribution. However, our proofs highlight that a few messages require additional explicitness in order to guarantee those goals to the peers when the cards’ data buses are unreliable. Keywords: smart card protocols, Inductive Approach, confidentiality, authentication, key distribution.
1
Introduction
Smart card technology attempts to strengthen modern security protocols by offering essential computational power and data storage with high resistance to external tampering. Typically, all long-term secrets are stored into the cards, so each agent merely needs to remember the PIN to activate his own card. An increasing number of companies are considering the purchase of smart cards and related protocols at present. However, if on one side smart cards have become inexpensive, on the other side there still exists stringent demand for adequate guarantees that the new technology is worth buying. To our knowledge, the major attempt of satisfying that demand by mathematical proofs is due to Shoup and Rubin [14]. They take into account an existing session key distribution protocol due to Leighton and Micali [10], which does not use smart cards, and prove it secure using Bellare and Rogaway’s notion of provable security. In short, this amounts to a complexity-theoretic study of confidentiality, which is conducted under the assumption that pseudo-random functions exist. Shoup and Rubin also design a new protocol for session key distribution in a three-agent setting where each agent is endowed with a smart card. Finally, they extend Bellare and Rogaway’s approach to account for smart cards, and prove that the new
I. Attali and T. Jensen (Eds.): E-smart 2001, LNCS 2140, pp. 19–33, 2001. c Springer-Verlag Berlin Heidelberg 2001
20
Giampaolo Bella
protocol keeps the session keys confidential. Their proofs are conducted without mechanical tools. Shoup and Rubin’s protocol was later implemented by Jerdonek et al. [9]. We have introduced a realistic treatment of smart cards into Paulson’s Inductive Approach for verifying security protocols [12], which is mechanised by the interactive theorem prover Isabelle [11]. The protocol model is constructed by induction, so it allows an unbounded number of agents to interleave an unbounded number of protocol sessions. An intruder is modelled, spy below, who can exploit an unspecified set of stolen smart cards by preparing queries that conform to the cards’ functional interface. The spy has reverse engineered another unspecified set of cloned cards and has discovered their internal secrets. The two sets are in no way related with each other so to model all possible conditions of the cards. The approach scales up, at the price of minor modifications, to all smart card protocols regardless of whether they assume secure or insecure means between agents and cards. We demonstrate our extended approach on the Shoup-Rubin protocol, and verify its goals of confidentiality, authentication and key distribution. Our analysis supports the claim that the protocol achieves strong goals. However, if the data buses of the smart cards are corrupted so to produce outputs in an unspecified order, then two of the protocol messages necessitate extra explicitness to confirm the goals to the peers. The corresponding proofs suggest a simple fix. The main results achieved by this paper are: (i) tailoring the Inductive Approach to the analysis of protocols based smart cards; (ii) the first full mechanisation (formal verification supported by a mechanised tool) of a provably secure protocol based on smart cards; (iii) the discovery that the protocol needs additional explicitness to achieve its goals of confidentiality, authentication and key distribution when the cards’ buses are unreliable; (iv) a fix to that need of explicitness. The paper gives an abstract presentation of the Shoup-Rubin protocol (Sect. 2), and outlines our extensions to the Inductive Approach (Sect. 3). It goes on with the inductive modelling of the protocol (Sect. 4) and its verification (Sect. 5). Then, it analyses a version of the protocol with added explicitness (Sect. 6) and concludes (Sect. 7).
2
The Shoup-Rubin Protocol
This protocol presupposes that each agent P has a long-term key Kp that is stored into the agent’s card Cp and is shared with the server. The card also stores its own long-term key KCp . All keys are symmetric. The concept of pairkey (due to Leighton and Micali [10]) is adopted to establish a long-term secret between the smart cards of a pair of agents. The pairkey is historically referred to the pair of agents: the one for agents A and B is Πab = {|A|}Kb ⊕ {|B|}Ka , where ⊕ is the exclusive-or operator. While A’s card can compute {|B|}Ka and then πab = {|A|}Kb from Πab , B’s card can compute πab directly. Hence, the two cards share the long-term secret πab , which we call pair-k for A and B. The main goal
Mechanising a Protocol for Smart Cards
I:
1. A → S : A, B 2. S → A : Πab , {|Πab , B|}Ka
II :
3. A → Ca : A 4. Ca → A : Na, {|Na|}KCa
III :
5. A → B : A, Na
IV :
6. B → Cb : A, Na 7. Cb → B : Nb, Kab, {|Na, Nb|}πab , {|Nb|}πab
V:
8. B → A : Nb, {|Na, Nb|}πab
VI :
9. A → Ca : B, Na, Nb, Πab , {|Πab , B|}Ka , {|Na, Nb|}πab , {|Na|}KCa 10. Ca → A : Kab, {|Nb|}πab
VII :
11. A → B : {|Nb|}πab
21
Fig. 1. The Shoup-Rubin protocol
of the protocol is distributing a session key, which is computed by the smart cards out of a pair-k and a nonce as explained below. The full protocol (Fig.1) develops through seven phases. The odd ones take place over the network, while the even ones concern the communication between agents and smart cards. Phase I. An initiator A tells the trusted server that she wants to initiate a session with a responder B, and receives in return the pairkey Πab and its certificate encrypted under her long-term key. Phase II. A queries her card and receives a fresh nonce and its certificate encrypted under the card’s long-term key. (The form of A’s query is specified neither by the designers nor by the implementors, so our choice of message 3 is arbitrary). Phase III. A contacts B sending her identity and her nonce Na. Phase IV. B queries his card with the data received from A, and obtains a new nonce Nb, the session key Kab, a certificate for Na and Nb, and a certificate for Nb; Kab is constructed by a function of Nb and πab . Phase V. B forwards his nonce Nb and the certificate for Na and Nb to A. Phase VI. A feeds her card B’s name, the two nonces (she has just received Nb), the pairkey and its certificate, the two certificates for the nonces; A’s card computes πab from Πab and uses it with the nonce Nb to compute the session key Kab; the card outputs Kab and the certificate for Nb, which is encrypted under πab . Phase VII. A forwards the certificate for Nb to B.
22
Giampaolo Bella
The protocol assumes secure means between agents and cards, so the spy cannot overhear the messages in transit between an agent and his card. The cards indeed output the session keys in clear. Although this assumption may seem unrealistic to make on a vast scale, in general it adds robustness to a protocol by reducing each agent’s knowledge to the PIN to activate his card. The ShoupRubin protocol also works with cards that are not pin-operated, so agents know no long-term keys and can only identify the messages by the fact that they are compound or not. All encryption and decryption operations are performed by the smart cards. Should the spy steal a card, she would gain the card’s computational power; should the spy also clone the card, she would also discover the card’s stored secrets. In either case, the spy can discover a session key only by feeding the card the specific inputs that produce that key. Also, certain features of the protocol design, such as both A and B’s nonces sent in the clear (messages 5 and 8), may seem incautious, but an informal account for the consequences can be hardly given. In particular, B’s nonce is used to compute the session key, but we formally verify that intercepting that nonce does not help the spy discover the session key as long as she cannot use A and B’s cards.
3
Extending the Inductive Approach
Smart Cards. We associate a new type to the smart cards and define a function Card mapping the agents to their respective cards. Recall that agent is the Isabelle datatype for agents [12, Sect. 3.1] and includes: the trusted third party, Server (often abbreviated in S); a malicious eavesdropper, Spy; unlimited “friendly” agents, Friend i (i being a natural). The agents are associated to their keys shared with the server by the function shrK [12, Sect. 3.5], and likewise we associate the smart cards to their long-term keys by a function crdK. For example, crdK(Card A) denotes A’s card’s key. The cards’ pins can be formalised in the same fashion. All these long-term secrets for a specific agent are are stored into the agent’s smart card, as formalised below by the functions knows and initState. We declare a set stolen of cards that can be used by the spy and not by their legal owners. Should the cards be pin-operated, the spy would also need to discover the pin to activate the stolen cards. She could do so either by monitoring the network or by colluding with the card’s owner (the latter chance can be formally defined by trivial updates to the function initState, Sect. 4). Additionally, the spy may use modern techniques (such as microprobing [2]) to break the physical security of the card, access its EEPROM where the long-term secrets are stored and, in the worst case, reverse engineer the card’s chip. At this stage, the spy would be able to build a clone of the card for her own use. Such cards are modelled by the set cloned. The two sets are not related with each other, so that a card could even be temporarily stolen, then cloned, and finally returned to the owner, resulting in the set cloned but not in the set stolen. This seems impossible by current cloning
Mechanising a Protocol for Smart Cards
23
techniques, which are invasive and therefore unrecoverably damage the original card, but in fact the spy could build two clones and return one to the unaware owner. The protocol model allows the spy to use her own card and those that are either stolen or cloned (Sect. 4.6). We assume that the cards’ buses are unreliable as explained below. Events. The existing approach includes a datatype event that formally allows three possible events: Says A B X, meaning that agent A sends agent B a message X; Notes A X, meaning that A notes down X [12]; Gets B X, meaning that B receives X [3]. We extend that datatype with two new events: Inputs A C X, meaning that agent A queries card C with message X; Outputs C A X, meaning that card C responds to agent A with message X. When an agent queries his card with a message, then the card certainly receives the message if the communication means is assumed to be secure, as with the Shoup-Rubin protocol. The same applies to a card’s response in transit in the opposite direction. With protocols that assume insecure means between agents and cards, reception is not guaranteed because the spy can intercept any messages in transit, so two additional events modelling reception on both sides are needed. A list of events, trace in the sequel, occurring when an (unbounded) population of agents run a protocol may be interpreted as a possible history of the network where the protocol is executed. The set of all possible traces is the formal model for the protocol [12]. Since the model is defined by induction, no event is forced to happen on a generic trace. This feature also formalises the failure mode of smart cards: the model cards can stop working at any time. Besides, events can take place in any order, so if a message X is sent in the network earlier than X , it could be received later than X . Likewise, if X is input to a card earlier than X , the card could produce the output for X later than that for X . This signifies that the cards’ data buses are unreliable so to give outputs in an order that is not influenced by the order of the inputs. The more permissive is the model, the broader are the properties that can be investigated. Agents’ Knowledge. The knowledge that each agent derives from a trace of events is formalised by the function knows [4, Sect. 3], which takes as inputs an agent name and a trace, returning a set of messages. The function is defined inductively by the following six rules. We have added the last two to account for the events pertaining to the smart cards. 1. An agent knows his initial knowledge (which is defined in the next section). 2. An agent knows what he alone sends to anyone on a trace; in particular, the spy also knows all messages that anyone sends on it. 3. An agent knows what he alone notes on a trace; in particular, the spy also knows compromised agents’ notes. 4. An agent, except the spy, knows what he alone receives on a trace. 5. An agent knows what he alone inputs to any card on a trace. 6. An agent knows what he alone is output from any card on a trace.
24
Giampaolo Bella
Case 4 states that the spy’s knowledge must not be extended with any of the received messages because the formal protocol model (Sect. 4.1) only allows reception of those messages that were sent, so the spy already knows them by case 2. The last two cases also apply to the spy, so she only knows the inputs that she produces or the outputs that are addressed to her, for the means between agents and cards is secure.
4
Modelling Shoup-Rubin
The protocol never uses pairkeys to encrypt, so we model them as nonces, which are natural numbers. On the contrary, the pair-k’s are used as proper keys. The session keys are computed out of nonces and pair-k’s. The following functions construct these components. – Pairkey : agent ∗ agent −→ nat – pairK : agent ∗ agent −→ key – sesK : nat ∗ key −→ key At the operational level, we are only interested in their abstract properties. For example, the function Pairkey cannot be assumed collision-free because it is implemented in terms of the exclusive-or operator, but we can assume that collision of keys is impossible. We can now define the function initState for Shoup-Rubin, formalising the agents’ initial knowledge. The server’s comprises all long-term secrets. initState S {Key (crdK C)} ∪ {Key (shrK A)} ∪ {Key (pairK(A, B))} ∪ {Nonce (Pairkey(A, B))} The friendly agents’ initial knowledge is empty, so they cannot reveal secrets to the spy. initState (Friend i) {} The spy’s initial knowledge comprises all long-term secrets stored into cloned cards and those obtainable from them. From the definitions of pairkeys and pair-k’s (Sect. 2), it follows that the spy can forge the pair-k for a pair of agents in case the card of the second agent is cloned, and a pairkey if both the corresponding cards are cloned. initState Spy {Key (crdK C) | C ∈ cloned} ∪ {Key (shrK A) | (Card A) ∈ cloned} ∪ {Key (pairK(A, B)) | (Card B) ∈ cloned} ∪ {Nonce (Pairkey(A, B)) | (Card A) ∈ cloned ∧ (Card B) ∈ cloned} We declare the constant shouprubin as a set of lists of events. It designates the formal protocol model and is defined in the rest of the section by means of inductive rules. The rules for phases III, V and VII are omitted here for space limitations.
Mechanising a Protocol for Smart Cards
4.1
25
Basics
The empty trace formalises the initial scenario, where no protocol session has begun. Rule Base settles the base of the induction stating that the empty trace is admissible in the protocol model. All other rules represent inductive steps, so they detail how to extend a given trace of the model. Rule Reception [3] allows messages sent in the network to be received by their respective intended recipients: once the trace evsR of the protocol model contains the event whereby A sends X to B, then evsR extended with the event whereby B receives X is still a trace of the model. All other rules have the same syntax. Base [ ] ∈ shouprubin Reception [| evsR ∈ shouprubin; Says A B X ∈ set evsR |] =⇒ Gets B X # evsR ∈ shouprubin
4.2
Phase I
Any agent except the server may initiate a protocol session at any time, hence the corresponding event may extend any trace of the model (SR1). Upon reception of a message quoting two agent names — initiator and responder of the session — the server computes the pairkey for them and sends it with a certificate to the initiator (SR2). The pairkey itself does not reveal its peers, but the certificate explicitly associates it to its peers. SR1 [| evs1 ∈ shouprubin; A =Server |] =⇒ Says A Server {|Agent A, Agent B|} # evs1 ∈ shouprubin SR2 [| evs2 ∈ shouprubin; Gets Server {|Agent A, Agent B|} ∈ set evs2 |] =⇒ Says Server A {|Nonce (Pairkey(A,B)), Crypt (shrK A) {|Nonce (Pairkey(A,B)), Agent B|} |} # evs2 ∈ shouprubin
4.3
Phase II
The initiator of a protocol session may query her own smart card provided that she received a message containing a nonce and a certificate (SR3). The initiator gets no assurance that the nonce is in fact the pairkey for her and the intended responder, or that the certificate is specific for the pairkey, because the message is compound. It would seem sensible that the agent forwarded the entire message to the smart card, which would be able to decrypt the certificate and verify the integrity and authenticity of the pairkey. However, the protocol specification does not state this, so we choose a simpler input message containing only the
26
Giampaolo Bella
initiator’s name. Given the input, the card issues a fresh nonce and a certificate for it (SR4). The card keeps no record of the nonce in order to conserve memory. The certificate will subsequently show the card the authenticity of the nonce. Both rules rest on a card that has not been stolen, so that it can be used by its owner. SR3 [| evs3 ∈ shouprubin; Card A ∈stolen; Says A Server {|Agent A, Agent B|} ∈ set evs3; Gets A {|Nonce Pk, Cert|} ∈ set evs3 |] =⇒ Inputs A (Card A) (Agent A) # evs3 ∈ shouprubin SR4 [| evs4 ∈ shouprubin; Card A ∈stolen; Nonce Na ∈used evs4; Inputs A (Card A) (Agent A) ∈ set evs4 |] =⇒ Outputs (Card A) A {|Nonce Na, Crypt (crdK (Card A)) (Nonce Na)|} # evs4 ∈ shouprubin
4.4
Phase IV
This phase sees the responder forward a compound message received from the network to his smart card (SR6). The smart card issues a fresh nonce, computes the pair-k for initiator and responder, and uses these components to produce a session key. The nonce being fresh, the session key also results fresh. Finally, the card outputs the nonce, the session key and two certificates (SR7). One certificate establishes the association between the initiator’s nonce and the responder’s, and will be inspected by the initiator’s card in phase VI. The other certificate will be retained by the responder, who will expect it again from the network in the final phase. SR6 [| evs6 ∈ shouprubin; Card B ∈stolen; Gets B {|Agent A, Nonce Na|} ∈ set evs6 |] =⇒ Inputs B (Card B) {|Agent A, Nonce Na|} # evs6 ∈ shouprubin SR7 [| evs7 ∈ shouprubin; Card B ∈stolen; Nonce Nb ∈used evs7; Key (sesK(Nb,pairK(A,B))) ∈used evs7; Inputs B (Card B) {|Agent A, Nonce Na|} ∈ set evs7|] =⇒ Outputs (Card B) B {|Nonce Nb, Key (sesK(Nb,pairK(A,B))), Crypt (pairK(A,B)) {|Nonce Na, Nonce Nb|}, Crypt (pairK(A,B)) (Nonce Nb)|} # evs7 ∈ shouprubin
4.5
Phase VI
The scenario returns upon the initiator. Before she queries her non-stolen card, she verifies having taken hold of three messages, each containing a nonce and
Mechanising a Protocol for Smart Cards
27
a certificate. She takes on trust the nonce Pk as the pairkey and Cert1 as its certificate, and recalls having obtained from her smart card a nonce Na and a certificate. Then, she treats Nb as the responder’s nonce and Cert3 as a certificate for Na and Nb. Finally, she feeds these components to her smart card (SR9). The card can verify that all the received components have the correct form and, if this is affirmative, computes the pair-k from the pairkey and then produces the session key and a certificate for the responder’s nonce (SR10). SR9 [| evs9 ∈ shouprubin; Card A ∈stolen; Says A Server {|Agent A, Agent B|} ∈ set evs9; Gets A {|Nonce Pk, Cert1|} ∈ set evs9; Outputs (Card A) A {|Nonce Na, Cert2|} ∈ set evs9; Gets A {|Nonce Nb, Cert3|} ∈ set evs9 |] =⇒ Inputs A (Card A) {|Agent B, Nonce Na, Nonce Nb, Nonce Pk, Cert1, Cert3, Cert2|} # evs9 ∈ shouprubin SR10 [| evs10 ∈ shouprubin; Card A ∈stolen; Inputs A (Card A) {|Agent B, Nonce Na, Nonce Nb, Nonce (Pairkey(A,B)), Crypt (shrK A) {|Nonce (Pairkey(A,B)), Agent B|}, Crypt (PairK (A,B)) {|Nonce Na, Nonce Nb|}, Crypt (crdK (Card A)) (Nonce Na)|} ∈ set evs10 |] =⇒ Outputs (Card A) A {|Key (sesK(Nb,pairK(A,B))), Crypt (pairK(A,B)) (Nonce Nb)|} # evs10 ∈ shouprubin
4.6
Threats
Also the spy can act as a friendly agent and thus follow the rules given above. In addition, she may also act illegally. She observes the given trace, extracts all message components by the function analz, and builds all possible messages out of them by the function synth [12, Sect. 3.2]. She may send any of these fake messages in the network or input them to the cards that are either stolen or cloned. This is modelled by the following rule Fake. Fake [| evsF ∈ shouprubin; Card A ∈ stolen ∪ cloned; X ∈ synth (analz (knows Spy evsF)) |] =⇒ Says Spy B X # Inputs Spy (Card A) X # evsF ∈ shouprubin
We assume that the algorithm used by the cards to compute the session keys is publicly known. Therefore, if the spy obtains a nonce and a pair-k, she can compute the corresponding session key (Forge), thus acquiring knowledge of it. Since the pair-k’s are never sent in the network, they can only be known initially (by definitions of initState and case 1 of knows).
28
Giampaolo Bella Forge [| evsFo ∈ shouprubin; Nonce Nb ∈ analz (knows Spy evsFo); Key (pairK(A,B)) ∈ knows Spy evsFo |] =⇒ Notes Spy (Key (sesK(Nb,pairK(A,B)))) # evsFo ∈ shouprubin
The model must be extended to allow the spy to obtain the outputs of the cards that are either stolen or cloned. Therefore, we must introduce a further rule per each card’s output, formalising the fact that a card outputs towards the spy rather than its owner in case it lies in the spy’s hands. Rule SR4 Fake, built from SR4, is presented below, while rules SR7 Fake and SR10 Fake, built in the same fashion from SR7 and SR10 respectively, are also needed but omitted here. SR4 Fake [| evs4F ∈ shouprubin; Card A ∈ stolen ∪ cloned; Nonce Na ∈used evs4F; Inputs Spy (Card A) (Agent A) ∈ set evs4F |] =⇒ Outputs (Card A) Spy {|Nonce Na, Crypt (crdK (Card A)) (Nonce Na)|} # evs4F ∈ shouprubin
4.7
Accidents
We complete the model by allowing accidents (or breaches of security) on session keys. This has been typically done by a single rule [8,12], or by two rules leaking two different kinds of session keys [7]. Shoup-Rubin requires both peers to handle the same session key, respectively in phases IV and VI. Therefore, the spy has a chance of learning the session key from both of them. In the worst case, she will also learn the nonce used to compute the key and the identity of its peers (Oops1, Oops2). Oops1 [| evsO1 ∈ shouprubin; Outputs (Card B) B {|Nonce Nb, Key Sk, Cert, Crypt (pairK(A,B)) (Nonce Nb)|} ∈ set evsO1 |] =⇒ Notes Spy {|Key Sk, Nonce Nb, Agent A, Agent B|} # evsO1 ∈ shouprubin Oops2 [| evsO2 ∈ shouprubin; Outputs (Card A) A {|Key Sk, Crypt (pairK(A,B)) (Nonce Nb)|} ∈ set evsO2 |] =⇒ Notes Spy {|Key Sk, Nonce Nb, Agent A, Agent B|} # evsO2 ∈ shouprubin
The spy cannot learn any pair-k’s by accident because no agent ever sees any.
5
Verifying Shoup-Rubin
While confidentiality is discussed in detail, authentication and key distribution are only introduced on an upgraded protocol (Sect. 6), due to space limitations.
Mechanising a Protocol for Smart Cards
5.1
29
Confidentiality
Given a trace evs, confidentiality of a message X on the trace is expressed as X ∈ analz(knows Spy evs), signifying that the spy cannot extract X from the analysis of the messages obtained from monitoring the trace evs. The confidentiality argument for a protocol responder B who is not the spy concerns the session key. Message 7 delivers the session key to B. The event formalising that message, Outputs (Card B) B {|Nonce Nb, Key Sk , Cert1 , Cert2 |}, includes two certificates, Cert1 and Cert2 , that B cannot inspect because they are sealed by specific long-term keys (no agent knows any long-term keys). We have attempted to prove Sk confidential on a trace evs that contains no oops event leaking Sk but does contain the mentioned event. In the attempt, B’s card must be assumed not to be cloned otherwise the spy would know pairK(P, B) for any agent P and could forge the session key by rule Forge. The assumption that B is not the spy solves case SR7, and the freshness assumption on the session key solves case SR7 Fake. Cases SR10 and SR10 Fake remain unsolved. The former shows that B’s peer might be the spy, who could so obtain a copy of Sk from her own smart card and falsify the theorem. The latter subgoal shows that B’s peer’s card could be either stolen or cloned, so the spy would be able to use such card to compute Sk , regardless the identity of the card’s owner. These situations are due to the fact that, while B’s card issues a fresh session key in message 7, his peer’s card in fact computes a copy of that key out of available components in message 10. Therefore, solving the corresponding subgoals requires assuming that B’s peer is not the spy, and that B’s peer’s card cannot be used by the spy. But message 7 does not state the identity of such peer. This signifies that B gets no explicit information about the peer with which the session key is to be used, which violates a well-known explicitness principle due to Abadi and Needham [1, Principle 3]. If we inspect either one of the certificates, then the relevant assumptions can be stated and theorem 1 can be proved. Note that there is no need to assume B’s card not to be stolen — were it stolen, it would compute a fresh key. Theorem 1. If A and B are not the spy, A’s card is neither stolen nor cloned, B’s card is not cloned, and evs contains Outputs (Card B) B {|Nonce Nb, Key Sk , Cert, Crypt(pairK(A, B))(Nonce Nb)|} but does not contain Notes Spy {|Key Sk , Nonce Nb, Agent A, Agent B|}, then Key Sk ∈ analz(knows Spy evs). From B’s viewpoint, trusting that his peer is not the spy and that his card cannot be used by the spy is indispensable. So is trusting that the key has not been leaked by accident. These assumptions, which are never verifiable, constitute the minimal trust [5,13]. However, B cannot even verify that the main event mentioned by the theorem ever occurs because he cannot inspect the encrypted certificate. Therefore, B certainly cannot apply the theorem, even under the minimal trust.
30
Giampaolo Bella
Analogous considerations apply to A’s viewpoint. Message 10 delivers the session key to A, so we attempt to prove that key confidential on the assumption that the event formalising message 10, Outputs (Card A) A {|Key Sk , Cert|}, occurs. While the freshness assumption on the session key solves case SR7 as above, we need to assume that A’s card is neither stolen nor cloned to solve case SR10 Fake, otherwise the spy could exploit A’s card to compute her copy of the session key. Cases SR7 and SR10 remain unsolved. The former highlights that A’s peer could be the spy. The latter highlights that, even assuming that A is not the spy, A’s card could be computing a session key already available to the spy who got it from A’s peer’s card. To solve these subgoals, we must assume that A’s peer is not the spy, and that A’s peer’s card is neither stolen nor cloned. But message 10 fails to express A’s peer. This theorem can be proved if the form of Cert is explicit, resulting in a guarantee that cannot be applied by A even under the minimal trust. These weaknesses were not highlighted by the provable security analysis.
6
Verifying an Upgraded Shoup-Rubin
Our findings suggest to upgrade the protocol so that both messages 7 and 10 state explicitly the intended peer for the session key (Fig. 2). Quoting also the nonce in message 10 is not indispensable. It is straightforward to upgrade the protocol model accordingly.
7. Cb → B : Nb, A, Kab, {|Na, Nb|}πab , {|Nb|}πab 10. Ca → A : Nb, B, Kab, {|Nb|}πab
Fig. 2. Adding explicitness to two messages of Shoup-Rubin
6.1
Confidentiality
In the upgraded protocol model, two significant confidentiality theorems (2 and 3) hold about the session key. Theorem 2. If A and B are not the spy, A’s card is neither stolen nor cloned, B’s card is not cloned, and evs contains Outputs (Card B) B {|Nonce Nb, Agent A, Key Sk , Cert1 , Cert2 |} but does not contain Notes Spy {|Key Sk , Nonce Nb, Agent A, Agent B|}, then Key Sk ∈ analz(knows Spy evs).
Mechanising a Protocol for Smart Cards
31
Theorem 3. If A and B are not the spy, both A and B’s cards are neither stolen nor cloned, and evs contains Outputs (Card A) A {|Nonce Nb, Agent B, Key Sk , Cert|} but does not contain Notes Spy {|Key Sk , Nonce Nb, Agent A, Agent B|}, then Key Sk ∈ analz(knows Spy evs). We prove these theorems following the reasoning developed in the previous section, which also motivates the assumptions about peers and cards. These theorems are applicable under the minimal trust by B and A respectively because the agents only need to verify the presence of the encrypted certificates without having to inspect them. If message 10 did not mention the nonce Nb, then theorem 3 would require a stronger assumption: the oops event universally quantified over the nonce it mentions. 6.2
Authentication
If B obtains the session key with the two certificates from his card and then receives the second of the certificates from the network, then theorem 4 states that A was alive and meant to communicate with him after he issued Nb. Theorem 4. If B is not the spy, both A and B’s cards are neither stolen nor cloned, and evs contains Outputs (Card B) B {|Nonce Nb, Agent A, Key Sk , Cert1 , Cert2 |} and Gets B (Cert2 ) then evs also contains Outputs (Card A) A {|Nonce Nb, Agent B, Key Sk , Cert2 |}. The theorem certainly does not hold of the original protocol, where none of the two events verified by B expresses his peer A. The proof develops through the following steps. Since A is explicit in the first event, the complete form of Cert2 can be proved by induction. Because the means between agents and smart cards is secure, the second event (and not the first) implies that the certificate is known to the spy. Then, the authenticity argument for the certificate, omitted in this paper, derives that it originated with A in message 10 under the assumptions about peers and cards that theorem 4 reports. Likewise, upon reception of message 10, theorem 5 informs A that B was alive and meant to communicate with her. Theorem 5. If B’s card is neither stolen nor cloned, and evs contains Outputs (Card A) A {|Nonce Nb, Agent B, Key Sk , Cert2 |} then, for some Cert1 , evs also contains Outputs (Card B) B {|Nonce Nb, Agent A, Key Sk , Cert1 , Cert2 |}.
32
Giampaolo Bella
The theorem clearly does not hold of the original protocol, where A is not informed of her peer’s identity. Once we prove by induction that the main assumption of the theorem implies that the certificate {|Na, Nb|}πab is known to the spy, the authenticity argument for the certificate, omitted here, completes the proof of theorem 5 at the price of the assumptions on B’s card. Unlike B, A gets no assurances about how recently B was alive, because the event of the assumption contains no nonce invented by A [6]. Our theorems remark that the spy can impersonate any agent whose smart card is stolen or cloned: she just needs to intercept the relevant communication and to exploit that agent’s card to acquire the necessary message components. 6.3
Key Distribution
Applying the definition of knows to the authentication theorems, we can prove formally that the upgraded protocol meets the goal of key distribution and confirms it to the peers. Theorem 6 formally assures agent A that the session key she receives is also available to her peer B. Theorem 7 provides the same guarantee to B. This goal cannot be proved formally of the original protocol because of the mentioned lack of explicitness. Theorem 6. If B is not the spy, both A and B’s cards are neither stolen nor cloned, and evs contains Outputs (Card B) B {|Nonce Nb, Agent A, Key Sk , Cert1 , Cert2 |} and Gets B (Cert2 ) then Key Sk ∈ analz(knows A evs). Theorem 7. If B’s card is neither stolen nor cloned, and evs contains Outputs (Card A) A {|Nonce Nb, Agent B, Key Sk , Cert2 |} then Key Sk ∈ analz(knows B evs).
7
Conclusions
Our work makes Paulson’s Inductive Approach usable for analysing smart card protocols. We have mechanised the Shoup-Rubin protocol showing that it meets strong goals of confidentiality, authentication and key distribution. But two of the protocol messages must quote their intended recipients explicitly if the cards’ buses can output in a random order. Our theorems show that verifying smart card protocols requires significant man-effort in understanding the roles played by the cards and in realising how the messages they compute may influence the protocol goals. However, none of the theorems discussed here executes in more than 10 seconds on a 600Mhz PentiumIII, so the computational resources necessary for the analysis are limited.
Mechanising a Protocol for Smart Cards
33
Acknowledgements I am grateful to Peter Honeyman who kindly explained to me a few features of the Shoup-Rubin protocol. I am indebted to Larry Paulson and to Peter Ryan for their large comments on a draft of this paper. Thanks also to the anonymous referees for helping me improve the presentation. This work was funded by the epsrc grant GR/R01156/01 Verifying Electronic Commerce Protocols.
References 1. M. Abadi and R. M. Needham. Prudent Engineering Practice for Cryptographic Protocols. IEEE Transactions on Software Engineering, 22(1):6–15, January 1996. 29 2. R. J. Anderson and M. J. Kuhn. Low Cost Attacks on Tamper Resistant Devices. In M. e. a. Lomas, editor, Proc. of the 5th International Workshop on Security Protocols, LNCS 1361, pages 125–136. Springer-Verlag, 1997. 22 3. G. Bella. Message Reception in the Inductive Approach. Research Report 460, University of Cambridge — Computer Laboratory, 1999. 23, 25 4. G. Bella. Modelling Agents’ Knowledge Inductively. In Proc. of the 7th International Workshop on Security Protocols, LNCS 1796. Springer-Verlag, 1999. 23 5. G. Bella. Inductive Verification of Cryptographic Protocols. PhD thesis, University of Cambridge, Computer Laboratory, 2000. Research Report 493. 29 6. G. Bella and L. C. Paulson. Are Timestamps Worth the Effort? A Formal Treatment. Research Report 447, University of Cambridge — Computer Laboratory, 1998. 32 7. G. Bella and L. C. Paulson. Kerberos Version IV: Inductive Analysis of the Secrecy Goals. In J.-J. Quisquater, Y. Desware, C. Meadows, and D. Gollmann, editors, Proc. of the 5th European Symposium on Research in Computer Security (ESORICS’98), LNCS 1485, pages 361–375. Springer-Verlag, 1998. 28 8. G. Bella and L. C. Paulson. Mechanising BAN Kerberos by the Inductive Method. In A. J. Hu and M. Y. Vardi, editors, Proc. of the International Conference on Computer-Aided Verification (CAV’98), LNCS 1427, pages 416–427. SpringerVerlag, 1998. 28 9. R. Jerdonek, P. Honeyman, K. Coffman, J. Rees, and K. Wheeler. Implementation of a Provably Secure, Smartcard-based Key Distribution Protocol. In J.-J. Quisquater and B. Schneier, editors, Proc. of the 3rd Smart Card Research and Advanced Application Conference (CARDIS’98), 1998. 20 10. T. Leighton and S. Micali. Secret-key Agreement without Public-key Cryptography. In D. R. Stinson, editor, Proc. of Advances in Cryptography — CRYPTO’93, LNCS 773, pages 456–479. Springer-Verlag, 1993. 19, 20 11. L. C. Paulson. Isabelle: A Generic Theorem Prover. LNCS 828. Springer-Verlag, 1994. 20 12. L. C. Paulson. The Inductive Approach to Verifying Cryptographic Protocols. Journal of Computer Security, 6:85–128, 1998. 20, 22, 23, 27, 28 13. P. Y. A. Ryan and S. A. Schneider. The Modelling and Analysis of Security Protocols: the CSP Approach. Addison-Wesley, 2000. 29 14. V. Shoup and A. Rubin. Session Key Distribution using Smart Cards. In U. Maurer, editor, Advances in Cryptology — Eurocrypt’96, LNCS 1070, pages 321–331. Springer-Verlag, 1996. 19
1
4
$
%
'
$
+
.
$
.
/
6
7
8
9
;
=
;
>
@
;
9
D
F
G
I
K
M
O
P
Q
;
S
>
6
D
Q
S
O
K
M
Q
@
X
Q
I
Y
D
Q
\
S
U
e
;
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
p
s
º
v
Þ
m
q
w
¹
}
o
£ n
}
z
s
y
o
¹
°
|
°
t
s
q
¢
l
t
p
¯
¦
v
p
s
¦
¯
s
l
r
s
p
s
l
r
q
±
v
p
r
¶
¾
s
q
o
r
t
p
¯
¦
v
p
s
r
!
¦
½
%
r
t
¯
s
l
s
ª s
r
s
p
p
r
v
r
£ ~
n
z
}
°
p
m
n
s
o
¶
¢
o
¯
w
l
¨
v
p
s
m
v
l
¯
l
s
Á
s
l
r
!
p
!
s
p
¯
p
¦
o
l
v
m
p
o
s
¶
¦
s
¯
u
s
u
w
l
l
r
´
z
o
±
v
p
³
o
§
p
m
¯
°
p
m
l
m
¦
u
o
q
s
l
r
p
s
y
s
¦
°
°
w
¼
q
´
v
½
§
p
o
¨
v
p
s
p
o
z
l
o
m
l
¦
!
p
v
v
"
o
q
s
q
q
s
v
p
t
q
§
m
m
l
v
s
l
¢
¢
t
¦
£
±
±
½
±
z
¼
o
o
¦
u
§
q
*
z
#
v
¦
p
p
v
v
r
r
§
§
q
q
!
q
v
¼
¨
o
±
¦
s
p
o
u
§
q
o
q
s
¨
o
m
l
r
o
y
v
p
ª s
¶
m
o
q
w
l
z
y
p
º
¸
z
y
y ¼
|
ª s
v
p
s
¶
r
!
y
ª s
v
¶
z
º
x
¸
|
z
½
o
z
y ¸
~
p
|
y
¸
£
}
z
¹ ¸
¹
}
¹ ¸
p
z
º ¸
o
¾
t
¾
¦
°
¢
±
t
±
±
£
z
¯
ª
½
o
p
t
ª
o
¯
Á
z
o
v
p
o
Á
p
v
r
§
o
q
q
q
,
¢
!
u
§
ª o
p
o
p
Á
z
u
m
o
q
!
s
u
u
m
l
q
Context Inference for Static Analysis of Java Card Object Sharing Denis Caromel, Ludovic Henrio, and Bernard Serpette INRIA Sophia Antipolis, CNRS - I3S - Univ. Nice Sophia Antipolis, BP 93, 06902 Sophia Antipolis Cedex - France
[email protected]
Abstract. This article presents an analysis to statically check the Java Card sharing policy. From the program text, both the violation and the guaranty of correctness can be detected in certain cases avoiding Runtime exception. Using type inference techniques, a specific inference algorithm is proposed in order to achieve such result. The current implementation is outlined, and experimental results are given on a benchmark program. Keywords: Java Card, security, type inference, static analysis, objects
1
Introduction
Within the framework of increasing need for secured software, many systems are using sophisticated policies to ensure some level of security. Most of them involve dynamic checks, with de facto presence of dynamic errors and exceptions. In order to avoid the occurrence of such runtime errors, static analysis has to be used – to figure out, for instance, information on the calling graph, the heap structure, or alias information. Those forms of analysis require sophisticated and time consuming algorithms, which can make them rather ineffective on actual size programs. In this paper, we propose to use for the same purpose a rather simpler technique: type inference-like algorithms for security checks. We experienced that idea on the Java Card security system. Java Card security policy is based on a firewall and a marker interface (Shareable). The firewall separates objects in different contexts: there is one context per package. Two objects belonging to two different contexts cannot access each other directly: the firewall in that case throws a dedicated exception (SecurityException). Method calls can only occur between contexts through Shareable interface. Our aim is to statically detect which accesses to objects may throw a SecurityException in order to help the applet developer to improve his sharing mechanism and avoid such exceptions. The applet developer needs to provide the byte code of the set of applets he wants to analyse. Our context inference analysis will return the set of instructions which may throw a security exception. I. Attali and T. Jensen (Eds.): E-smart 2001, LNCS 2140, pp. 43–57, 2001. c Springer-Verlag Berlin Heidelberg 2001
44
Denis Caromel et al.
Then, the developer will know which parts of his program have to be improved in order to avoid this kind of exceptions. This paper presents a context inference method to analyse the sharing of objects. The basic idea is to define an abstract context as the set of all possible creation contexts of an object. Then we apply a type-inference like and a typechecking like mechanism, considering abstract context as a type. For example, a call statement o.foo (...) is guaranteed to be correct only if type of o is a sub-interface of Shareable or if the potential context of o is unique and identical to the context of execution. The current inference system is defined on a large and representative subset of the Java Card Bytecode. With minor modifications, the system could as well be directly specified and implemented on the Java Card source code. Section 2 presents the JavaCard security policy and related work on static analysis and type inference. Section 3 presents the object sharing analysis. In section 4, we briefly describe an implementation of the analysis, and experimental results on a benchmark program.
2 2.1
Context and Related Work Java Card, Sharing, and Security
The Java Card language is a restriction of the Java language described in [1], [13] and [16]. In this section we present the Java Card security policy and a reduced set of bytcodes on which the analysis will be described. Java Card application are called Applets. The Java Card Runtime Environment (JCRE) is the operating system of the card ([14]). Java Card Security The Java Card firewall is described in the section 6 of [14]. Some Java Card security limitations and how to improve it are presented in [5], [6] and [8]. The main principles of Java Card firewall are described below. The Java Card firewall partition the set of existing objects into contexts. A context is associated to each applet when it is installed. There is one context per package so two applets declared in the same package won’t be separated by the firewall. The JCRE belongs to its own context. At any point, there is a currently active context. Each object belongs to a context which is the context which was active when the object has been created. A context switch occurs when executing certain method invocations. When a bytecode accesses an object (field access, cast or method invocation), a runtime check is performed and if the access is refused then a SecurityException is thrown. An access to an object is allowed if the current execution context is the same as the object context, that is to say an object can only be accessed by its owning context except in the cases below. Static fields and methods do not belong to any context and can be accessed from any context.
Context Inference for Static Analysis of Java Card Object Sharing
45
The JCRE can access to objects in every context. The JCRE can specify objects as entry points, their methods are accessible from any context. In the same way, fields of global arrays are accessible from any context. In order to allow the dialog between two applets, Shareable interfaces have been defined. An interface is Shareable if it extends the interface Shareable. A method can be invoked through a Shareable interface even if the object context is different from the current context. When a non-static method is invoked, and the call is authorised, the VM performs a context switch if necessary that is to say the current context is switched to the context of the object of the invoked method. Bytecode Subset We present a subset of Java Card bytecode that is sufficient for understanding and designing the analysis. The whole bytecodes are described in [15] aload i pushes the ith local variable on the operand stack; astore i pops an element of the stack and writes it in the ith local variable; getfield f pushes on the operand stack the field f of an object popped from the stack; putfield f pops a value and an object from the stack and writes the value in the field f of the object; new A allocates a new instance of the class A and puts the new reference on the stack; invokeVirtual M calls method M. M is a reference to the method corresponding to the static type of the object accessed; invokeStatic M calls the static method M ; invokeShareable M calls method M on a shareable interface; return returns the top of the stack from a method. invokeShareable does not correspond to any Java Card bytecode but we can statically classify invokeInterface commands into the invokeShareable instructions and the others which can be considered as invokeVirtual for our analysis. Indeed, we determine statically if an invokeInterface command concerns a Shareable interface or not. Our analysis is based on bytecode because ambiguities (name resolution) are removed during compilation. Moreover, since the JVM is the target of several languages (see [17] for a complete list of such languages), our analysis may be applied independently of the source language. If we wanted to apply our analysis on Java Card language, we would have to resolve all these ambiguities and most of the analysis would be redundant with the compilation phase. In fact the context analysis would be translated easily but we would need to extend our analysis with aspects that are independent from Java Card sharing mechanism.
46
2.2
Denis Caromel et al.
Static Analysis Techniques
The firewall characteristics brought us to think about static analysis techniques because firewall analysis could be rewritten in terms of aliasing between contexts which could be analysed like [2,3,4,10,11]. But such analysis are very difficult to implement especially because we need a precise interprocedural analysis (cf. [12]) and both may and must-aliasing properties must be computed if we want to give precise results to the developer. Our analysis infers a set of possible creation contexts for each object. The context inference is similar to set constraints [7] but constraints solving is much simpler because abstract contexts does not contain function symbols. Indeed function symbols are used in [7] to introduce more complex constraints and are not necessary in our analysis. 2.3
Java Card Exceptions
The LOOP project (see for example [9]) developed a tool to specify pre- and post-conditions for Java methods. It provides static verification that a program will not throw certain kind of exception. Our aim is to provide a mechanism dedicated to object sharing and to ensure that a program will not throw a security exceptions with a static analysis. Moreover, an important contribution of our analysis is to provide context inference for Java Card programs. In our case, the developer do not have any information to specify nor source code annotation to write.
3 3.1
Sharing Analysis Aim and Principles of the Analysis
The aim of the analysis is to determine if an access to an object may throw a security exception or not. So, we have to compare, for each access to an object (field access, field update or method invocation), the creation context of this object and the execution context of the instruction we are analysing. Statically, we infer a set of possible creation contexts (abstract context) for every location containing objects. We suppose that the analysed bytecode is correct that is to say, a program that would be rejected by the type checker can not be analysed. 3.2
Overview of the Analysis
In order to make context inference, we extract from the bytecode of the program a set of inequations. These inequations represent the dependencies between Abstract Contexts (AC) and are obtained from data dependencies by adding relations between contexts, for example between current method context and the context of an allocated object upon a new instruction,
Context Inference for Static Analysis of Java Card Object Sharing
47
We need to define temporary variables named ACVariable to denote locations before an AC has been inferred. M ∈ M ethods T ∈ ACV ariable ::= M.Local[i] | M.Return | label | ACV ariable.f ield Where M.Local[i] is the ACVariable denoting the abstract contexts of the ith local variable of method M. M.Return is an ACVariable corresponding to the object returned by method M. label is a variable corresponding to an object allocation bytecode (we write (new A)label ). There should be a unique label for each new instruction. ACV ariable.f ield denotes the AC of the field f ield of the objects corresponding to ACVariable. The analysis determines an AC for every ACVariable which has been created. Then, for each object access bytecode, we compare object’s AC set with the set of possible execution contexts to find instructions which may throw a security exception. The analysis consists of five steps: 1. Establish dataflow information from the bytecode. Here we obtain a partial dataflow graph which does not take into account possible aliases between objects. 2. Add dataflow dependencies due to possible aliases. After this step, we must obtain a relation x→F y which can be read as “every value stored in x can be stored in y”. 3. Create context flow graph from the dependence graph. This step consists in adding to dataflow some context dependencies specific to Java Card security policy (e.g. the context of an object is the context of the method which instantiates it). 4. Infer an abstract context for each location representing an object. That means find the smallest solution of constraints expressed by the context flow graph. 5. Abstractly execute the bytecode to determine which object accesses may throw a security exception or not. Alike a control flow insensitive algorithm, the context inference presented here does not take into account the order of instructions. In fact order of instructions are only useful to determine the abstract execution stack. This could be improved by other techniques like aliasing [2] or shape analysis [11] which would generally be more complicated and slower. Our analysis is based on type inference like algorithm. The dataflow information obtained here is sufficient in order to make type inference (they could be seen as some kind of type constraints). Then, the abstract context obtained could be considered as a type. 3.3
Abstract Stack
In table 1, we describe the action of each bytecode instruction on the abstract stack. The stack is represented by a list of ACVariables. In the following, CM is the method currently analysed.
48
Denis Caromel et al.
Table 1. Abstract execution of bytecode
aload i S → CM.Local[i] :: S (1) astore i T :: S → S (2) getf ield f T :: S → T.f :: S (3) putf ield f Tv :: T :: S → S (4) (new A)T S → T :: S (5) invokeV irtual M0 Tk :: .. :: T0 :: S → M0 .Return :: S (6) invokeStatic M0 Tk :: .. :: T0 :: S → M0 .Return :: S (7) invokeShareable M0 Tk :: .. :: T0 :: S → M0 .Return :: S (8) Return T :: S → S (9)
The signature of the abstract stack definition rules is : Instruction ACV ariable∗ → ACV ariable∗ For instance ins s1 → s2 means that the abstract execution of ins on the abstract stack s1 produces the abstract stack s2 . 3.4
Dataflow Analysis
In order to make a sharing analysis, we first need dataflow information to be able to infer an AC. We compute a dataflow graph from source bytecode. →F is the dataflow dependence relation. It is a transitive relation on ACVariable. x→F y must be read as every value stored in x can be stored in y. The rules presented in table 2 describe how a set of dependence constraints can be extracted from the program source. Every affectation (explicit or implicit) is interpreted as a dataflow constraint. In order to take into account the dynamic binding without analysing the possible types of each variable, we added a relation M ≤ M defined in rules 17 and 18 which is the reflexive extension of the overloading relationship. Then every invocation of a method M can dynamically invoke the method M . This implies the data flow dependencies expressed in the rules 12, 14 and 15. 3.5
Aliasing
The relation we have obtained with the rules above does not really correspond to a complete dataflow dependence relation. Indeed, some aliases between references may cause additional dataflow edges. If two locations may reference the same object then any object modifications on one location may act on the other. That is why we define the alias relation ↔A on ACVariable.
Context Inference for Static Analysis of Java Card Object Sharing
49
Table 2. Data flow rules Rules related to affectations: astore i T :: S → S
(10)
T →F CM.Local[i]
putf ield f Tv :: T :: S → S Tv →F T.f invokeV irtual M Tk :: .. :: T0 :: S → S
(11) ∧
M0 ≤ M
∀i ∈ 0 . . . k, Ti →F M0 .Local[i] invokeStatic M Tk :: .. :: T0 :: S → S ∀i ∈ 0 . . . k, Ti →F M.Local[i] invokeShareable M Tk :: .. :: T0 :: S → S
∧
(13) M0 ≤ M
∀i ∈ 0 . . . k, Ti →F M0 .Local[i] Return T :: S → S
∧
CM ≤ M
T →F M.Return
(12)
(14)
(15)
Transitivity: T →F T
∧
T →F T
T →F T
(16)
Method overloading: M ethod2 redefines M ethod1 M ethod2 ≤ M ethod1
(17)
M ≤ M (18)
The table 3 defines an alias relation ↔A and the influence of aliasing on dataflow graph. ↔A is a reflexive relation. It determines whether two ACVariable may represent references which may be aliased. The rules 19 and 20 corresponds to this definition of aliasing. Moreover field access expressions of aliased variables are aliased (21). The last rule (22) correspond to effects of aliases on dataflow: if two objects are aliased then a field update on one object may update the other one.
50
Denis Caromel et al.
Table 3. Aliasing T →F T
T →F T
∧ T ↔A T
(19)
data flow ⇒ aliasing T →F T T ↔A T
(20)
alias ⇒ fields alias T ↔A T T.x↔A T .x
(21)
Alias acts upon field update: T ↔A T
∧
T →F T.x
T →F T .x
3.6
(22)
Context Flow
Given a dataflow graph, we need to add context information to infer abstract contexts. We define Context Variables V ∈ ContextV ariable ::= T | M.CC | (T ∩ M.CC) | P ackage Where M.CC represent the execution context (current context) of methodM . Dynamically, the current context can be included in the current frame properties. A new frame is created when a method is invoked. As we decided to have one AC for each variable of the program, we only need to have an abstract current context by method. The table 4 presents the specification of context additional properties. Context flow(c ) is obtained from data flow by adding creation context and context switch information. In our simplified bytecode, context switch can occur only if a shareable interface method is called. Then, we obtain a context flow graph which express constraints between ACVariable due to dataflow or context dependencies. c is a transitive relation between ContextVariables. x c y must be read as abstract context of x is included in abstract context of y.
Context Inference for Static Analysis of Java Card Object Sharing
51
Table 4. Context flow dataflow ⇒ context inclusion
T →F T T
@c T
(23)
Object creation context: (newC)T S → T :: S CM.CC
@c T
(24)
Applet context: applet A is defined in package P ackage ∧ M corresponds to install, process, (de)select or (25) getShareableInterfaceObject P ackage
@c M.CC
Current context propagation for method invocation: invokeV irtual M0 Tk :: .. :: T0 :: S → M0 .Return :: S (T0 ∩ CM.CC)
@c M0.CC
invokeStatic M0 Tk :: .. :: T0 :: S → M0 .Return :: S CM.CC
@c M0 .CC
(26)
(27)
invokeShareable M0 int Tk :: .. :: T0 :: S → M0 .Return :: S T0
@c M0 .CC
(28)
Transitivity: V1
@c V2
∧ V1
@c V3
V2
@c V3
(29)
Context intersection : P
@c V1 ∧ P @c V2 P @c (V1 ∩ V2 )
(30)
The rule 25 initialises the context of applet specific methods with their definition package. This corresponds to the fact that the JCRE instantiates and
52
Denis Caromel et al.
activates an applet in a context corresponding to the package of applet definition. The rule 26 could be simplified by only requiring CM.CC c M0 .CC or T0 c M0 .CC which would be correct but less precise. It is the role of the type checker to verify that T0 = CM.CC. Thus requiring (T0 ∩ CM.CC) c M0 .CC is only useful when the sharing checking can not determine whether an exception could be raised by the invokeV irtual statement or not. In this case, we consider in the rest of the analysis that no exception has been raised by this method invocation. 3.7
Context Inference
Context inference consists in determining an AC for each ContextVariable. From the context flow graph, the AC of a ContextVariable V is given by the set of all packages P such that P c V . Leaves of context flow graph should be packages. We can not infer contexts from other kind of leaves which would correspond for example to instructions which would never be executed. An AC is a set of type Packages. AC ::= P ackage∗ C : ContextV ariable → AC C(P ackage) = {P ackage} C(V ) = P P c V
C(V ) is the AC inferred for the ContextVariableV. It gives the smallest set verifying the constraints expressed in the context flow graph. 3.8
Sharing Checking
This step looks like a type checking phase. It classifies the accesses to the object in three categories: – The instructions that will never throw a security exception. This case occurs when: • both execution and object accessed contexts are identical singletons. • the instruction is a method invocation on a shareable interface or a JCRE entry point. – The instructions that may throw a security exception: intersection of execution and object accessed contexts is non empty. – The instructions that will always throw a security exception: intersection of execution and object accessed contexts is empty. This step consists of an abstract execution of each instruction of the programs. It behaves like a classical type checker but returns a classification of the instructions accessing to objects (getfield, putfield, invokeVirtual) in accordance with the categories defined above and the security policy of the Java Card firewall.
Context Inference for Static Analysis of Java Card Object Sharing
3.9
53
Sharing Analysis of Java Card Programs
In order to analyse real Java Card programs within our implementation, the most important characteristics that have been added to the analysis formally presented above are the following. Manipulations of simple data do not generate constraints but we need to have an ACVariable to represent them in the stack. One ACVariable for every simple type constant and variables is sufficient. As for Arrays, they are abstracted by a unique variable. That is sufficient when all elements belong to the same context. For conditional branches we need to make a union of abstract stacks at each junction point. In order to do this, we only replace abstract stack at this point by an abstract stack composed of new ACVariable and add new dataflow relations between abstract values before the junction and ACVariable at the junction. Exceptions have not been implemented at all in our analysis. As our analysis is insensitive to control flow, analysing exception would be simple. Indeed the point where the exception can be thrown is not important for our analysis.
4 4.1
Implementation, Performance, and Results The Cap Tool Framework
The Cap Tool (figure 1) is a tool taking cap files (Java Card bytecode) and returning a structured and linked program. It provides visualisation of the bytecode of each method and a bytecode interpreter. We use this linked version of bytecode to implement our analysis. We have implemented a simple sharing analysis on the bytecode language except exception handling. The results of the analysis are integrated to the bytecode as comments. Every instruction accessing to object is annotated with OK if it is sure, ??? if an exception may be thrown or ERROR if the access will always throw a security exception. 4.2
Examples of Results
Figure 2 gives an example to illustrate the sharing analysis mechanism. It defines two applets, a class A and its shareable interface. These applets have been analysed by our type inference mechanism. The results of the analysis have been inserted in the code comments. Figure 1 shows the results of the analysis of method applet0.process. In figure 2, there are 4 instructions accessing to objects. In instruction **1**, an object can be instantiated in two different contexts and the result is control flow dependant. It is impossible to determine whether an exception will be thrown or not. In instruction **2**, our analysis can not infer that aa is always instantiated in the calling context. A more precise version of our analysis, for example control flow dependant analysis or an analysis which would analyse a method twice if it is executed in two different contexts could improve this result.
54
Denis Caromel et al.
Fig. 1. The Cap Tool and partial results of the analysis The Bytecode is a part of the method process of class Applet0 of figure 2
In instruction **3** the object is accessed in his creation context. And in instruction **4** it is accessed through a shareable interface. In these two cases our analysis verify that no security exception will be thrown. This example shows some interesting cases and limitations of our analysis. A lot of cases where our analysis can not determine whether a security exception can be raised or not could only be improved by taking into account the control flow corresponding to the program. For example we could greatly improve our analysis by duplicating the bytecode of some functions and analysing it twice depending on the execution context. Such a solution is in fact a mean of improving the interprocedural analysis.
Context Inference for Static Analysis of Java Card Object Sharing
package applet0; import javacard.framework.*;
55
package applet0; public class A implements Ashare{ public A aa; public A() { aa=this; } public void f0(byte e){ } }
public interface Ashare extends Shareable{ public void f0(byte e); }
(a) AShare.java
(b) A.java package applet0; import javacard.framework.*; public class applet0 extends Applet {
package applet1; import javacard.framework.*; import applet0.*; public class applet1 extends Applet {
public static A a; public static Ashare shareA;
public static void install() { A b=new A(); // b is instantiated in // the context of applet1 b.aa=applet0.a; //**3** // acces to b in the // context of applet1 -> OK (new applet1()).process(); }
public static void install(A a0) { a=new A(); shareA=new A(); } public void process() { a.f0((byte)0); // **1** // a may be instantiated // by applet1 -> ??? (new A()).aa.f0((byte)0);//**2** // aa can be modified in // constructor A which can be // called from applet1 -> ??? }
public void process() { applet0.a=new A(); // can change the // context of field a // of applet0 applet0.shareA.f0((byte)3);//**4** // access to shareable //interface -> OK }
}
(c) Applet0.java.
}
(d) Applet1.java
Fig. 2. Example of analysed code
5
Conclusion
We have presented a sharing analysis for Java Card language. It is based on a type inference like analysis. Indeed contexts could be considered as some kind of types and a security exception as an incompatibility between such types. Our analysis abstracts the dynamic context by a set of possible contexts. It is based on the Java Card bytecode but could be implemented on Java Card language as well. Our objective is to help the developer to design complex sharing mechanisms. We provide him the list of instructions that may throw a security exception. The developer will only have to focus on these instructions in order to determine whether they may really throw a security exception or not. Moreover, we give
56
Denis Caromel et al.
him the set of possible creation contexts for each variable and the set of possible execution contexts for each method of the analysed applets. In order to improve our analysis, we can duplicate some method. For example, we could create an instance of a method for each possible execution context. This would make us analyse more functions but could greatly improve the precision of our analysis on some crucial locations.
References 1. Zhiqun Chen. How to write a java card applet: A developer’s guide. http://www.javaworld.com/javaworld/jw-07-1999/jw-07-javacard p.html. 44 2. A. Deutsch. Interprocedural may-alias analysis for pointers: Beyond k-limiting. In SIGPLAN’94 Conf. on Programming Language Design and Implementation, pages 230–241, Orlando (Florida, USA), June 1994. ACM. SIGPLAN Notices, 29(6). 46, 47 3. Alain Deutsch. A storeless model of aliasing and its abstractions using finite representations of right-regular equivalence relations. In Proceedings of the IEEE 1992 International Conference on Computer Languages, pages 2–13, San Francisco, April 1992. IEEE Press. 46 4. Alain Deutsch. Semantic models and abstract interpretation techniques for inductive data structures and pointers. In Proceedings of the ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation, pages 226–229, La Jolla, California, June 21–23, 1995. 46 5. Anup K. Ghosh. Security risks of java cards. In Proceedings of the Twelfth IFIP WG 11.3 Working Conference on Database Security, Greece, 1999. 44 6. Pierre Girard. Which security policy for multiapplication smart cards. In Proceedings of the USENIX Workshop on Smartcard Technology (SMARTCARD-99), pages 21–28, Berkeley, CA, May 10–11 1999. USENIX Association. 44 7. Nevin Heintze. Set constraints in program analysis. Technical report, CarnegieMellon University, July 1993. 46 8. Michael Montgomery and Ksheerabdhi Krishna. Secure object sharing in java card. In Proceedings of the USENIX Workshop on Smartcard Technology (SMARTCARD-99), pages 119–128, Berkeley, CA, May 10–11 1999. USENIX Association. 44 9. Erik Poll, Joachim van den Berg, and Bart Jacobs. Specification of the JavaCard API in JML. In Fourth Smart Card Research and Advanced Application Conference (IFIP Cardis). Kluwer Academic Publishers, 2000. 46 10. M. Sagiv, T. Reps, and S. Horwitz. Precise interprocedural dataflow analysis with applications to constant propagation. Lecture Notes in Computer Science, 915:651–??, 1995. 46 11. Mooly Sagiv, Thomas Reps, and Reinhard Wilhelm. Parametric shape analysis via 3-valued logic. Technical Report CS-TR-1998-1383, University of Wisconsin, Madison, August 1998. 46, 47 12. M. Sharir and A. Pnueli. Two approaches to interprocedural data flow analysis. 1981. 46 13. SUN microsystems. Java card 2.1 platform api specification. http://java.sun.com/products/javacard/htmldoc/index.html. 44 14. SUN microsystems. Java card 2.1 runtime environment (jcre) specification. http://java.sun.com/products/javacard/JCRESpec.pdf. 44
Context Inference for Static Analysis of Java Card Object Sharing 15. SUN microsystems. Java card 2.1 virtual machine specification. http://java.sun.com/products/javacard/javacard21.html. 45 16. SUN microsystems. Java card applet developper’s guide. http://java.sun.com/products/javacard/AppletDevelopersGuide.html. 44 17. Robert Tolksdorf. Programming languages for the java virtual machine. http://grunge.cs.tu-berlin.de/ tolk/vmlanguages.html. 45
57
58
%
4
5
7
8
9
7
<
>
9
'
A
C
D
E
F
G
H
D
A
A
*
+
J
K
D
M
A
O
7
/
E
Q
>
9
/
R
S
5
#
U
5
9
#
7
R
V
>
D
#
3
7
9
Y
H
7
O
]
H
D
]
9
`
R
o
¢
|
{
¾
§
|
¿
¤
{
µ
À
Á
Ã
|
Ä
Å
À
Ç
Â
{
{
{
§
¦
|
¨
{
{
{
·
·
¼
|
s
{
·
{
{
{
{
·
§
{
{
|
|
±
´
{
¯
|
{
{
®
³
|
¦
{
|
{
¢
¢
|
¦
|
|
|
{
¥
{
¥
{
{
·
³
|
{
{
{
¤
|
¤
{
{
{
A
|
l
{
k
{
{
9
{
|
U
p
{
»
¨
§
{
H
A
|
{
{
{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>
U
5
8
G
D
é
O
A
É
è 8
O
8
7
O
l
7
O
l
A
O
Ë
A
9
Ë
7
9
8
7
D
8
É
D
D
É
U
D
É
U
H
É
H
7
7
Ï
O
Ï
l
9
l
Í
O
A
A
O
Ë
É
9
O
>
8
O
>
Ë
U
O
ê
R
D
â
U
Þ
O
O
R
9
É
D
H
U
H
7
U
Í
D
8
H
Î
8
9
É
H
O
7
9
7
R
ì
ë
>
É
l
É
í
G
k
D
â
Í
7
A
Í
O
É
A
O
8
O
É
O
O
>
8
H
O
U
>
8
A
U
D
Í
9
D
É
8
D
H
Î
R
8
5
9
U
É
H
H
7
O
Ï
7
9
9
7
Ó
R
D
>
ì R
D
Î
7
D
R
l
O
A
Ë
9
>
H
U
Ë
Ó
H
É
G
9
U
O
5
7
R
Ë
9
É
G
D
Ë
9
É
H
8
9
>
ã
9
U
H
U
U
5
8
G
9
U
ë
4
ï
ê
â
>
×
ñ
F
í
ò
s
v
¼
{
·
ö
|
¦
¥
ó
ô
u
ó
»
|
õ
®
I. Attali and T. Jensen (Eds.): E-smart 2001, LNCS 2140, pp. 58-70, 2001. c Springer-Verlag Berlin Heidelberg 2001
|
õ
{
o
x
p
o
u
|
Automated Test and Oracle Generation for Smart-Card Applications 59 è O
A
D
É
8
O
É
7
O
O
U
H
7
G
D
U
U
8
9
9
A
í
H
U
7
É
D
Ë
É
D
O
]
>
H
É
H
9
Í
A
9
A
É
Í
>
H
D
D
D
D
H
G
É
H
O
É
D
A
A
G
ß
9
8
Í
>
8
O
D
O
D
9
H
D
>
É
U
5
G
É
H
ã
R
A
R
O
9
9
]
l
7
É
G
R
U
Î
Ë
G
D
>
A
É
Ï
É
O
D
O
D
5
D
É
R
l
]
O
U
7
9
A
H
O
G
É
D
D
í
O
É
É
ñ
D
É
9
U
O
]
F
7
G
D
É
U
O
É
É
R
É
ê
H
R
A
D
7
9
D
D
]
9
A
É
9
R
D
É
D
7
A
7
8
É
É
D
7
A
7
H
Ë
5
U
H
A
D
Ë
D
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H
D
8
A
O
É
U
9
G
Ë
É
>
H
H
9
7
D
U
É
O
Í
É
G
7
5
É
É
9
D
D
O
5
R
9
O
É
É
D
>
U
O
Ë
U
9
G
D
k
É
Í
5
8
R
9
A
9
ã
D
É
H
Í
>
O
>
U
O
>
J
ß
É
8
O
O
Í
U
D
>
U
O
l
â
A
9
A
D
7
A
ë
U
Í
O
É
Ë
F
O
7
O
E
ë
H
D
k
Û
R
7
k
l
U
8
Ï
8
É
O
E
A
8
k
O
Í
É
O
O
]
H
G
A
D
Ï
A
D
9
A
5
8
É
9
D
D
Ï
Ü
5
A
Ë
D
Ý
A
D
D
8
A
k
7
8
H
É
F
É
G
9
D
G
U
7
A
H
D
Í
É
H
9
U
9
É
5
9
Ë
ê
U
S
A
É
O
U
O
É
l
l
É
O
9
í
É
G
G
5
D
D
R
É
É
O
Ë
H
D
9
U
9
Ï
É
É
A
H
Ï
9
8
D
9
k
High-Level Formal Specification
Feasible, Covering Test Generation
High-Level Spec’ to IOSTS
Specification IOSTS
Test Purpose IOSTS
Symbolic Test Generation
Test IOSTS Smart Card Application IOSTS to C++
Test C++ C++ Object
Test Result: Pass, Fail, Inconclusive
!
s
¥
¦
#
{
$
{
|
{
|
¼
{
®
Ë
7
>
×
>
J
62 !
H
Duncan Clarke et al.
"
#
Î
É
8
G
H
9
É
D
7
H
É
Ï
D
H
D
H
É
É
H
9
7
ã
U
ã
D
H
É
Ó
U
D
É
G
D
Ï
O
l
O
5
O
D
H
U
O
7
U
7
Ï
D
9
k
7
Í
R
>
U
U
U
É
U
É
H
8
D
ã
D
H
9
G
D
É
U
G
F
G
U
7
É
U
É
O
D
É
7
7
8
9
D
O
O
H
8
Ë
Ó
Í
É
É
7
>
A
9
U
>
5
>
A
D
D
A
Í
D
É
D
É
7
9
Ó
D
U
D
E
ã
É
É
É
D
O
l
7
U
U
D
É
O
D
O
D
D
U
D
É
Í
G
R
É
8
A
É
O
U
H
5
l
8
U
>
Í
O
D
7
O
É
7
>
O
Ë
D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an Clarke et al. L0:
mType = FirstSlot sync CepInquiry?(mType) vSlotIndex := 0 vSlotsReported := 0
vSlotIndex < pSlotCount ^ not vSlots[vSlotIndex].InUse sync tau vSlots[vSlotIndex].Reported := true vSlotIndex := vSlotIndex + 1 vSlotsReported := vSlotsReported + 1
mType = FirstSlot CepInquiry?(mType) vSlotIndex := 0 vSlotsReported := 0
vSlotIndex < pSlotCount ^ vSlots[vSlotIndex].InUse sync tau vSlots[vSlotIndex].Reported := false vSlotIndex := vSlotIndex + 1
L1:
vSlotIndex = pSlotCount sync tau L2:
vSlotsReported = pSlotCount ^ mStatus = Finished sync CepReply!(mStatus,mSlot)
mStatus = Normal ^ vSlotsReported < pSlotCount ^ mSlot.Index >= 0 ^ mSlot.Index < pSlotCount ^ (not vSlots[mSlot.Index].Reported) ^ mSlot = vSlots[mSlot.Index] sync CepReply!(mStatus,mSlot) vSlots[mSlot.Index].Reported := true vSlotsReported := vSlotsReported + 1
L3
L4
mType = NextSlot sync CepInquiry?(mType)
(not mType = FirstSlot) ^ (not mType = NextSlot) sync CepInquiry?(mType) L5:
mStatus = SequenceError sync CepReply!(mStatus,mSlot) L6:
F
Í
9
Ê
H
G
5
A
H
U
A
D
E
É
U
D
A
O
J
É
8
O
Ë
H
G
7
D
Ë
9
H
Ë
>
7
9
É
7
É
D
O
A
8
9
R
9
8
É
Ó
H
A
H
É
R
O
H
7
7
É
G
ã
D
D
9
A
É
Í
l
9
Ó
9
8
D
A
D
D
9
s
l
7
O
É
Ë
D
É
{
A
D
³
<
A
D
V
Ë
A
H
Ë
7
|
ë
9
F
H
>
J
U
9
Í
ã
7
9
U
R
D
D
8
D
Ê
R
9
5
O
A
9
7
R
8
ã
>
É
D
O
Ë
Ï
O
H
Ë
7
H
9
U
A
7
Ó
U
É
H
ë
R
É
>
G
O
A
D
9
É
U
Í
<
Û
O
D
*
#
7
Í
*
â
É
U
D
7
×
G
D
È É
A
9
Í
7
D
É
A
H
l
O
]
9
H
O
>
ë
>
É
H
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8
8
D
H
D
A
]
H
D
7
Ê
5
Ï
D
U
9
É
8
O
H
Ë
A
×
U
É
×
ñ ë
>
8
O
Ë
Ë
9
7
R
9
É
É
G
H
U
Í
O
H
7
É
Ó
H
>
>
A
D
×
H
7
H
É
H
9
>
H
f
D
É
G
D
H
É
D
A
9
É
H
O
7
Û
É
A
9
7
U
H
É
H
O
7
ï
Automated Test and Oracle Generation for Smart-Card Applications 65
mType = FirstSlot sync CepInquiry?(mType) mStatus = Finished sync CepReply!(mStatus,mSlot) mStatus = Normal SyncCepReply!(mStatus,mSlot)
mType = NextSlot sync CepInquiry?(mType) Accept
É
O
ï
Ü
Ý
k
â
l
9
8
O
Ë
Ë
9
7
R
O
É
G
D
A
É
G
9
#
7
{
¼
H
A
U
É
ë
>
O
{
É
O
A
D
ß
É
ë
>
O
É
H
U
A
D
8
D
H
]
D
R
9
ñ U
D
Ê
5
D
7
8
D
D
A
A
O
A
H
U
Ï
D
7
D
A
9
É
D
R
Û
É
A
9
7
U
H
É
H
O
7
ï
É
O
ï
É
O
ï
Ý
k
È
!
"
É
#
G
H
D
>
>
U
5
U
9
É
5
É
D
7
9
H
É
D
Î
D
É
É
8
É
7
D
A
U
H
#
Í
A
É
9
9
A
'
9
U
G
8
É
É
5
H
É
U
ß
D
#
É *
7
D
D
Í
O
É
É
D
Í
A
R
G
8
ã
9
5
H
A
U
J
U
Ê
D
H
Í
D
H
A
D
>
É
A
H
D
U
D
D
U
D
É
>
D
O
ã
9
Ï
8
A
O
G
7
7
5
É
É
U
5
Í
D
D
9
D
É
A
O
U
U
U
9
Í
D
D
É
D
D
O
ß
8
A
A
8
l
H
O
U
H
U
É
O
5
A
É
9
U
U
D
A
O
D
É
R
U
A
É
H
8
É
D
9
Ï
É
R
V
G
7
D
D
<
Ï
É
>
G
D
5
A
D
É
G
O
9
U
J
É
G
×
O
ã
Ë
É
A
R
D
7
A
D
U
>
O
G
A
ë
>
É
G
D
>
H
H
>
É
G
É
É
U
D
D
R
O
D
G
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ã
G
7
O
D
U
J
H
8
É
H
Í
R
9
É
O
H
O
l
7
É
Ý
O
O
>
D
Ë
9
É
J
U
D
U
7
A
9
ë
A
D
9
Í
R
A
Ë
7
H
E
Í
Ë
R
A
D
5
9
O
>
U
7
á
J
G
ë
D
H
F
U
R
ã
k
O
ß
è H
7
D
ß
Í
H
A
Ï
D
5
U
A
U
D
D
Ü
R
H
k
F
7
G
9
H
R
U
H
H
9
>
7
8
D
8
>
5
É
R
O
D
l
U
â
Û
Ü
ê
Ý
A
D
9
R
H
ì
A
O
Ë
9
7
Ï
9
7
R
Í
9
A
U
H
7
Ï
â
ë
F
ë
ì
U
Í
D
8
H
Î
8
9
É
H
O
7
U
è í
è l
7
E
Û
Þ
Ý
8
O
Ë
Í
5
É
H
7
Ï
9
7
â
ë
F
ë
É
D
U
É
8
9
U
D
è
â
ë
F
ë
U
Í
D
8
H
Î
8
9
É
H
O
7
9
7
R
â
ë
F
ë
É
D
U
É
Í
5
A
Í
O
U
D
9
8
8
O
A
R
H
7
Ï
É
O
É
G
D
è É
G
D
O
A
J
O
l
ê
S
R
K
í
E
9
7
R
Û
á
Ý
É
A
9
7
U
>
9
É
H
O
7
O
l
É
G
D
â
ë
F
ë
É
D
U
É
8
9
U
D
É
O
<
E
Automated Test and Oracle Generation for Smart-Card Applications 67
mType = FirstSlot sync CepInquiry!(mType) vSlotIndex := 0 vSlotsReported := 0
vSlotIndex < pSlotCount ^ vSlots[vSlotIndex].InUse sync tau vSlots[vSlotIndex].Reported := false vSlotIndex := vSlotIndex + 1
vSlotIndex < pSlotCount ^ not vSlots[vSlotIndex].InUse sync tau vSlots[vSlotIndex].Reported := true vSlotIndex := vSlotIndex + 1 vSlotsReported := vSlotsReported + 1 vSlotIndex = pSlotCount ^ mStatus = Normal ^ vSlotsReported < pSlotCount ^ mSlot.Index >= 0 ^ mSlot.Index < pSlotCount ^ (not vSlots[mSlot.Index].Reported) ^ mSlot = vSlots[mSlot.Index] sync CepReply?(mStatus,mSlot) vSlots[mSlot.Index].Reported := true vSlotsReported := vSlotsReported + 1
vSlotIndex = pSlotCount ^ vSlotsReported = pSlotCount ^ mStatus = Finished sync CepReply?(mStatus,mSlot)
mStatus = Normal ^ vSlotsReported < pSlotCount ^ mSlot.Index >= 0 ^ mSlot.Index < pSlotCount ^ (not vSlots[mSlot.Index].Reported) ^ mSlot = vSlots[mSlot.Index] sync CepReply?(mStatus,mSlot) vSlots[mSlot.Index].Reported := true vSlotsReported := vSlotsReported + 1
mType = NextSlot sync CepInquiry!(mType)
Pass vSlotIndex = pSlotCount ^ vSlotsReported = pSlotCount ^ mStatus = Finished sync CepReply?(mStatus,mSlot)
not (vSlotIndex = pSlotCount ^ vSlotsReported = pSlotCount ^ mStatus = Finished) and not (mStatus = Normal ^ vSlotsReported < pSlotCount ^ mSlot.Index >= 0 ^ mSlot.Index < pSlotCount ^ (not vSlots[mSlot.Index].Reported) ^ mSlot = vSlots[mSlot.Index]) sync CepReply?(mStatus,mSlot)
...
Fail
#
{
68 A
Duncan Clarke et al.
D
9
9
R
7
J
É
R
D
O
ß
ã
D
8
D
5
8
É
D
O
R
Ë
Í
H
>
D
R
E
>
H
7
C
D
R
É
O
9
7
H
7
É
D
A
l
9
8
D
×
8
O
Ë
Í
9
É
H
ã
>
D
H
Ë
Í
>
D
Ë
D
7
É
9
è F
É
D
U
9
É
ã
l
U
J
H
U
É
8
A
D
A
U
Û
O
A
H
A
D
>
7
9
Í
H
5
U
O
É
H
7
O
U
9
D
>
H
H
É
U
D
9
>
G
8
É
Ï
]
É
É
×
l
D
O
A
]
Ë
>
U
5
U
ã
ã
D
5
O
A
5
8
Ï
É
9
D
Í
5
U
A
l
5
É
D
Ó
O
A
U
D
Ë
O
R
5
l
É
>
G
D
9
Í
U
D
D
Ý
É
7
É
D
U
R
O
O
É
D
D
7
]
A
É
9
k
â
>
G
5
D
9
7
Ë
É
Í
A
D
É
9
8
D
G
É
Ï
5
H
D
8
9
>
8
D
ê
9
É
Í
O
É
7
G
U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