Tool-Assisted Specification and Verification of the JavaCard Platform
Recommend Documents
Multi-application and post-issuance. New Security Threats ... Cap File Builder package fr.inri import javacar ... (app (heap_f state) new_obj). ( the reference of the ...
workflow management system IBM MQSeries Workflow [3] forms the internal process level. The integrated research project ATHENA [1] investigates enterprise ...
We present the complete process of a formal specifica- tion and verification of the Chilean electronic invoice sys- tem which has been defined by the tax agency.
and to ease the implementation task of the interacting peers. ...... CSk+1 = infer(
CSk) ..... Finally, related to our work on ALP are the abductive query evaluation ...
specifying solely data dependencies for a single activity are called data rules. .... (AQ, EQ, DQ, P, X, C, T , L), the corresponding PLTL formula PQ is defined.
Jul 30, 2012 - bisimulation have, of course, been studied extensively in formal ... in the context of developing semanti
Mar 14, 2005 - but our notion of features is more general than e.g. what defined in [3], in order to ..... Q.1211, Telecommunication Standardization Sector of ITU, Geneva, Mar. 1993. .... represent available stock, that is, items available for loan.
Jul 30, 2012 - IOS Press, 2003. 59. J S. Moore and G. Porter. The Apprentice Challenge. ACM Transactions on Programming.
Mar 14, 2005 - to be viewed as a program source, or is it a dynamic entity, to be viewed through the .... A growing number of Web sites now make extensive ...
However, many cryptographic protocols are being and will be designed and/or ... hidden failures in Needham-Schroeder protocols are a well-known lesson on ...
JOHN DERRICK [email protected]. Computing Laboratory, University of Kent, Canterbury, CT2 7NF, UK. Received March 30, 1998; Accepted March 27, 2000.
Interactive Specification and Verification of Behavioural Adaptation Contracts. Javier Cámara, Gwen ..... An adaptor is a third-party compo- nent that is in charge ...
cedural specification language such as WS-BPEL or WSCDL, she is forced to. ACM Transactions ...... 8See http://www.cl.cam.ac.uk/~afb21/CognitiveDimensions/CDtutorial.pdf. 9Note that, indeed ...... Springer-Verlag, 91â103. BELWOOD, T.
Jun 3, 2010 - Definedness Is the transformation applicable to every model of the source ...... [24] Richters, M. A UML-based Specification Environment, ...
bear this notice and the full citation on the first page. To copy otherwise, to ..... ter removing the edge ex-s3, the new paths in E together with the remaining ...
case e of c1 â e1 |···| cn â en (evaluates to ei if e is of the form ci ). A recursive function or ...... as the properties of Isabelle/HOL. Thus, we see specification and verification as strong bound phases. ...... Robert Bosch GmbH. CAN Spec
the figure, within B, p = A [f U g] holds at s1, s2 and ex. The figure only ...... S has the bit equal to falsa, R has the ack equal to false and the received data equal to .... (Eds.): Integrated Formal Methods 2004, Lecture Notes in Computer. Scien
NL-5600 MB, Eindhoven, The Netherlands, e-mail: [email protected]. ... In a B2B setting, the birth of a service choreography is often determined by.
3 (2003). URL: http://www.eluevxey. .... The approach presented in [dA H01 ] handles both calls to and from a component, and, hence, .... integer nr; boolean busy; initial: nr=0 and !busy; restrict: nr>=0; blocking r-enter {[!busy] nr := nr+1;}.
send its own identity or the identity of a process it knows to others as a means to ... but abstracted to a non-deterministic environment that trig- gers creation and ...
Mar 14, 2005 - First error is because of before tag must be tag. âBordercolorâ attrib is .... NET or JSP and Servlets. Some of tests showed in this ...
Aug 20, 2001 - Printed in Canada. tables.tex; 20/08/2001; ... development and verification of safety critical software for over two decades. [26, 12, 28] ... custom âlight-weightâ formal methods tools (in the sense of [6, 10]) are used to help cr
you download a copy; this is for our records .... Ken Wood and members of the ESPRIT Basic Research Action CONCUR2 provided comments at various ...... LCM fT1; T2; ::: ; Tng , as that is the time in which each task will have an integral num-.
Mar 26, 2014 - We use the term capability policy to describe how capabili- ties are ... it needs in order to function correctly: even a trusted object should not ...
Tool-Assisted Specification and Verification of the JavaCard Platform
High-level language for developing applets. Multi-application and post- ... Jakarta: tool support for specification and verification of virtual machines. ¡£ ¢. ¥¦ ...
Tool-Assisted Specification and Verification of the JavaCard Platform Gilles Barthe INRIA Sophia-Antipolis, France
Joint work with: P. Courtieu, G. Dufay, M. Huisman, L. Jakubiec, B. Serpette, S. Melo de Sousa, S. Stratulat
New generation smartcards Flexibility High-level language for developing applets Multi-application and post-issuance New Security Threats Confidentiality Integrity
Availability
Formal verification for smartcards
Motivations Complex software with high demands on security
Common Criteria require formal methods at level EAL5-EAL7
Formal verification for smartcards
Motivations Complex software with high demands on security
Common Criteria require formal methods at level EAL5-EAL7 Focus Platform vs. program verification
Bytecode vs. source level
Overview JavaCard CertiCartes: verification of the JavaCard platform
Jakarta: tool support for specification and verification of virtual machines
JavaCard A superset of a subset of Java: A subset: no large datatypes, security manager, dynamic class loading, (garbage collection). . . A superset: firewall, entry points, shareable interfaces, transactions, etc.
JavaCard programs use the JavaCard APIs
The JavaCard Platform Class file
Java source
package fr.inri
Java compiler
public class no public Object
Class File Converter Cap File Builder
011100011 101011010 011111001 110110111 100100110
Bytecode verifier Loading Linking
Applet
Applet
Applet
011100011 101011010 011111001 110110111 100100110
011100011 101011010 011111001 110110111 100100110
011100011 101011010 011111001 110110111 100100110
Industry−Specific Extensions APIs Virtual Machine
Operating System
import javacar
011100011 101011010 011111001 110110111 100100110
Cap file
CertiCartes Formal specification/verification of: JCVMs: small-step semantics exec : s t a t e
> returned_state
written in Coq but use a neutral style executable with the JCVM Tools BCV: executable in Caml
part of the JCRE
Program model Record jcprogram : Set : = { i n t e r f a c e s : ( l i s t I n t e r f a c classes
: ( l i s t Class ) ;
methods
: ( l i s t Method )
Record Method : Set : = { is_static
: bool ;
signature
: ( ( l i s t type ) type ) ;
local
: nat ;
h a n d l e r _ l i s t : ( l i s t handler_type ) ; (
Exception handl
bytecode
: ( list
(
i n s t r u c t i o n s to
method_id
: method_idx ;
(
Index o f t h e me
: class_idx
(
Index o f t h e ow
owner
Instruction ) ;
Number o f l o c a l
(
Memory model Stack as a list of frames Record frame : Set : = { locvars
: ( l i s t valu ) ;
(
Local Vari
opstack
: ( l i s t valu ) ;
(
Operand s t
p_count
: bytecode_idx ;
(
Program c o
method_loc
: method_idx ;
(
Location o
context_ref
: package ;
(
Context I n
State
D e f i n i t i o n s t a t e : = s t a t i c _ h e a p heap s t a c k .
Instruction D e f i n i t i o n NEW : = [ i d x : c a p _ c l a s s _ i d x ] [ s t a t e : j c v m _ s t a t e ] Cases ( s t a c k _ f s t a t e ) o f ( cons h l f ) = > E x t r a c t t h e owner c l a s s from thew c a p _ f i l e
(
)
Cases ( N t h _ e l t ( c l a s s e s cap ) i d x ) o f then a new i n s t a n c e i s c r e a t e d and pushed i n t o t h e heap
(
)
(Some c l ) = > l e t new_obj = . . . i n ( Normal ( Build_jcvm_state ( sheap_f s t a t e ) ( app ( heap_f s t a t e ) new_obj ) t h e r e f e r e n c e o f t h e c r e a t e d o b j e c t i s pushed
(
i n t o t h e opstack
)
( cons
( update_opstack ( cons ( vRef ( v R e f _ i n s t a n c e i d x ( S ( l e n g t h ( heap_f s t a t e ) lf ))) | None = > ( AbortCode class_membership_error s t a t e )
end .
_ = > ( AbortCode s t a t e _ e r r o r s t a t e )
end |
Virtual Machines Specification Defensive JCVM is closest to specification: It manipulates typed values
Types are checked at run-time
Virtual Machines Specification Defensive JCVM is closest to specification: It manipulates typed values Types are checked at run-time Offensive JCVM is closest to implementation: It manipulates untyped values
Type correctness enforced by BCV
Virtual Machines Specification Defensive JCVM is closest to specification: It manipulates typed values Types are checked at run-time Offensive JCVM is closest to implementation: It manipulates untyped values Type correctness enforced by BCV Abstract JCVM used in bytecode verification: Manipulates types as values
Operates on a method-per-method basis
Cross-Validation
Defensive and offensive VMs coincide on programs that are well-typed for the abstract VM
Cross-Validation Defensive and offensive VMs coincide on programs that are well-typed for the abstract VM
offensive and defensive VMs coincide on programs well-typed for the defensive VM
Cross-Validation Defensive and offensive VMs coincide on programs that are well-typed for the abstract VM offensive and defensive VMs coincide on programs well-typed for the defensive VM
programs that are well-typed for the abstract VM are well-typed with the defensive VM
Cross-Validation Defensive and offensive VMs coincide on programs that are well-typed for the abstract VM offensive and defensive VMs coincide on programs well-typed for the defensive VM
programs that are well-typed for the abstract VM are well-typed with the defensive VM
Best viewed as some form of correctness of abstract interpretations
Abstraction function:
Offensive vs. Defensive
Abstraction function:
Offensive vs. Defensive
/
/
Diagram commutes
if defensive VM does not raise typing errors
Abstraction function:
Abstract vs. Defensive
Abstraction function:
Abstract vs. Defensive
/
Diagram commutes
/
_
if “execution keeps in the same frame”
Bytecode verifier
Reject programs which go wrong (on the abstract VM) using dataflow analysis (Kildall’s algorithm)
Bytecode verifier Reject programs which go wrong (on the abstract VM) using dataflow analysis (Kildall’s algorithm)
Defensive and offensive machines coincide on programs that pass bytecode verification
Bytecode verifier Reject programs which go wrong (on the abstract VM) using dataflow analysis (Kildall’s algorithm) Defensive and offensive machines coincide on programs that pass bytecode verification
Proof builds upon commuting diagrams, correctness of DFA, methodwise verification, and monotonicity of abstract VM
Assessment
Positive evaluation from Gemplus but CertiCartes is an in-depth feasibility study
Assessment
Positive evaluation from Gemplus but CertiCartes is an in-depth feasibility study
A complete formalization of the JavaCard platform is labour intensive (E. Giménez)
Assessment
Positive evaluation from Gemplus but CertiCartes is an in-depth feasibility study
A complete formalization of the JavaCard platform is labour intensive (E. Giménez)
The methodology works well and could be used for other analyses
Assessment
Positive evaluation from Gemplus but CertiCartes is an in-depth feasibility study
A complete formalization of the JavaCard platform is labour intensive (E. Giménez) The methodology works well and could be used for other analyses
High-level of automation is possible
Assessment
Positive evaluation from Gemplus but CertiCartes is an in-depth feasibility study
A complete formalization of the JavaCard platform is labour intensive (E. Giménez) The methodology works well and could be used for other analyses High-level of automation is possible
Specifications use a restricted language and proofs use well-understood techniques
Jakarta
A dedicated environment for formal specification and verification of typed low-level languages
Jakarta
A dedicated environment for formal specification and verification of typed low-level languages Designed to support: executable specifications abstractions (and refinement) of specifications
automation of correctness proofs
Current focus
Input: defensive virtual machine
Current focus Input: defensive virtual machine
Output:
Current focus Input: defensive virtual machine Output:
offensive and abstract virtual machines
Current focus Input: defensive virtual machine Output: offensive and abstract virtual machines
offensive and defensive machines coincide on well-typed programs
Current focus Input: defensive virtual machine Output: offensive and abstract virtual machines
offensive and defensive machines coincide on well-typed programs programs that are ill-typed for the defensive VM are ill-typed with the abstract VM
Current focus Input: defensive virtual machine Output: offensive and abstract virtual machines
offensive and defensive machines coincide on well-typed programs programs that are ill-typed for the defensive VM are ill-typed with the abstract VM the abstract virtual machine is monotone
Jakarta Specification Language JSL types are first-order polymorphic types
JSL expressions are first-order algebraic terms
are patterns with fresh variables
where
Functions defined by conditional rewrite rules
Compiling JSL Specifications Specifications are executed by rewriting engines
are translated into
are
Partial specifications
Non-deterministic specifications translated into
Deterministic specifications are compiled into case-expressions then CAML, Coq, Isabelle, PVS
and
define
For each datatype
Abstractions
into
, define
For each defined function by transforming
and
define
For each datatype
Abstractions
into
, define
For each defined function by transforming
and
define
For each datatype
Abstractions
Not a legal rule: substitution and cleaning steps declared in abstraction scripts
into
, define
For each defined function by transforming
and
define
For each datatype
Abstractions
Not a legal rule: substitution and cleaning steps declared in abstraction scripts
Generated offensive and abstract JCVMs
Proof automation using Coq
Mostly case analysis + equational reasoning
Proof automation using Coq
to
Built tactics that reduce
Mostly case analysis + equational reasoning
and perform some equational reasoning
Proof automation using Coq
to
Built tactics that reduce
Mostly case analysis + equational reasoning
and perform some equational reasoning
Further automation of equational reasoning is highly desirable
Proof automation using Coq
to
Built tactics that reduce
Mostly case analysis + equational reasoning
and perform some equational reasoning Further automation of equational reasoning is highly desirable
Exploiting abstraction scripts seems promising
Proof automation using Spike
Spike is a first-order prover for “inductive theorems”
Proof automation using Spike Spike is a first-order prover for “inductive theorems”
Cross-validation of the VMs for 2/3 of bytecodes
Proof automation using Spike Spike is a first-order prover for “inductive theorems” Cross-validation of the VMs for 2/3 of bytecodes
Now applying Spike to prove the monotonicity of abstract VM
Conclusions
Formal specification and verification of the JavaCard platform is feasible but labor-intensive
Conclusions
Formal specification and verification of the JavaCard platform is feasible but labor-intensive
Tool support for formal specification and verification of (type safety for) low-level typed languages
Conclusions
Formal specification and verification of the JavaCard platform is feasible but labor-intensive
Tool support for formal specification and verification of (type safety for) low-level typed languages
Some interesting topics: extracting code or tests from specifications tools for certifying certifying compilers
Conclusions
Formal specification and verification of the JavaCard platform is feasible but labor-intensive
Tool support for formal specification and verification of (type safety for) low-level typed languages Some interesting topics: extracting code or tests from specifications tools for certifying certifying compilers
For further information www.inria.fr/lemme/verificard