tool assisted specification and
play

Tool-Assisted Specification and Verification of the JavaCard - PowerPoint PPT Presentation

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.


  1. 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 ✁✄✂

  2. ✝ � ✆ � ✝ � � � � � � New generation smartcards Flexibility High-level language for developing applets Multi-application and post-issuance New Security Threats Confidentiality Integrity Availability ✁✄✂

  3. � � � � � ✆ ✝ Formal verification for smartcards Motivations Complex software with high demands on security Common Criteria require formal methods at levels EAL5-EAL7 ✁✄✂

  4. ✝ � ✆ � � � � � � � Formal verification for smartcards Motivations Complex software with high demands on security Common Criteria require formal methods at levels EAL5-EAL7 Focus Platform vs. program verification Bytecode vs. source level ✁✄✂

  5. � � � � � ✆ ✝ Overview JavaCard CertiCartes: verification of the JavaCard platform Jakarta: tool support for specification and verification of virtual machines ✁✄✂

  6. � � � � � � ✆ ✝ 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 ✁✄✂

  7. ✝ � ✆ � The JavaCard Platform Class file Java source Cap file package fr.inri 011100011 011100011 Class File Converter 101011010 101011010 Java compiler 011111001 import javacar Cap File Builder 011111001 110110111 110110111 100100110 public class no 100100110 public Object Bytecode verifier Loading Linking Applet Applet Applet 011100011 011100011 011100011 101011010 101011010 101011010 011111001 011111001 011111001 110110111 110110111 110110111 100100110 100100110 100100110 Industry−Specific Extensions APIs Virtual Machine Operating System ✁✄✂

  8. ✝ � ✆ ✁ � � � � � � CertiCartes Formal specification/verification of: JCVMs: small-step semantics exec : state > returned_state written in Coq but use a neutral style executable with the JCVM Tools BCV: executable in Caml part of the JCRE ✁✄✂

  9. ✝ � ✆ ✁ � � � � � � Program model Record jcprogram : Set : = { i n t e r f a c e s : ( l i s t Interface classes : ( l i s t Class ) ; methods : ( l i s t Method ) Record Method : Set : = { i s _ s t a t i c : bool ; signature : ( ( l i s t type ) type ) ; l o c a l : nat ; ( Number of l o c a l h a n d l e r _ l i s t : ( l i s t handler_type ) ; ( Exception handl bytecode : ( l i s t I n s t r u c t i o n ) ; ( i n s t r u c t i o n s to method_id : method_idx ; ( Index of the me owner : class_idx ( Index of the ow ✁✄✂

  10. ✝ � ✆ � � � � � � � � � � Memory model Stack as a list of frames Record frame : Set : = { locvars : ( l i s t valu ) ; ( Local Varia opstack : ( l i s t valu ) ; ( Operand sta p_count : bytecode_idx ; ( Program co method_loc : method_idx ; ( Location o context_ref : package ; ( Context Inf State D e f i n i t i o n state : = static_heap heap stack . ✁✄✂

  11. ✝ � ✆ ☎ ✁ � � � � � � Instruction D e f i n i t i o n NEW : = [ idx : cap_class_idx ] [ state : jcvm_state ] Cases ( stack_f state ) of ( cons h l f ) = > ( Extract the owner class from thew c a p _ fi l e ) Cases ( Nth_elt ( classes cap ) idx ) of ( then a new instance i s created and pushed i n t o the heap ) (Some c l ) = > l e t new_obj = . . . in ( Normal ( Build_jcvm_state ( sheap_f state ) ( app ( heap_f state ) new_obj ) ( the reference of the created object i s pushed i n t o the opstack ) ( cons ( update_opstack ( cons ( vRef ( vRef_instance idx ( S ( length ( heap_f state ) l f ) ) ) | None = > ( AbortCode class_membership_error state ) end | _ = > ( AbortCode state_error state ) ✁✄✂ end .

  12. � � � � ☎ ☎ ✆ ✝ Virtual Machines Specification Defensive JCVM is closest to specification: It manipulates typed values Types are checked at run-time ✁✄✂

  13. ✝ � ✆ ☎ ☎ � � � � � � 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 ✁✄✂

  14. ✝ � ✆ � ☎ � ☎ � � � � � � � 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 ✁✄✂

  15. � ☎ ✝ ✆ ✝ Cross-Validation Defensive and offensive VMs coincide on programs that are well-typed for the abstract VM ✁✄✂

  16. � � ☎ ✝ ✆ ✝ 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 ✁✄✂

  17. � � � ☎ ✝ ✆ ✝ 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 ✁✄✂

  18. ✝ � ✆ � ✝ ☎ � 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 ✁✄✂

  19. ✝ � ✆ � ☎ � ✠ ✠ ✟ ☎ ✄ Offensive vs. Defensive ✆✞✝ ✡☞☛ Abstraction function: �✂✁ ✁✄✂

  20. ✝ ✞ ✍ � � ✁ ✄ ☎ � ✑ ✌ ✍ � ✒ ✁ ✄ ☎ ☞ ✓ ☞ ✒ ✌ � ✆ � ✄ ☎ ☎ ✟ ✠ ✠ � � ☎ ✄ ✄ ☎ ✁ ✞ ✎ ☞ Offensive vs. Defensive ✆✞✝ ✡☞☛ Abstraction function: �✂✁ Diagram commutes ☛✝☞ �✂✁ �✏✎ ✄✝✆ ✄✝✆ ✟✡✠ ✟✡✠ ✄✝✆ ✄✝✆ if defensive VM does not raise typing errors ✁✄✂

  21. ✝ � ✆ � ☎ � ✝ ☛ ✡ ✠ ✟ ☎ � Abstract vs. Defensive ✆✞✝ Abstraction function: �✂✁ ✁✄✂

  22. ✝ � ✁ ✄ ☎ ✁ � ✞ ✑ ✟ � ☎ � ✁ ✄ ☎ ✎ ✂ ☞ ✌ ☞ ✍ ✄ ✍ ☎ ✝ ✆ � � ☎ ☎ ✟ ✠ ✡ ☛ � ☞ � ✄ ✄ ☎ ✆ ✞ ✄ � ☎ ✌ � Abstract vs. Defensive ✆✞✝ Abstraction function: �✂✁ Diagram commutes ☛✝☞ �✂✁ �✏✎ ✄✝✆ ✄✝✆ � � ✟ ✁� ✄✝✆ if “execution keeps in the same frame” ✁✄✂

  23. � � ☎ � ✆ ✝ Bytecode verifier Reject programs which go wrong (on the abstract VM) using dataflow analysis (Kildall’s algorithm) ✁✄✂

  24. � � � ☎ � ✆ ✝ 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 ✁✄✂

  25. ✝ � ✆ � � ☎ � � 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 ✁✄✂

  26. � � ☎ � ✆ ✝ Assessment Positive evaluation from Gemplus but CertiCartes is an in-depth feasibility study ✁✄✂

  27. � � � ☎ � ✆ ✝ 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) ✁✄✂

  28. � � � � ☎ � ✆ ✝ 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 ✁✄✂

  29. ✝ � ✆ � � ☎ � � � 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 ✁✄✂

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend