Giter Site home page Giter Site logo

nexoid-ed's Introduction

nexoid-ed

Nexo 4 Executable Diagrams

nexoid-ed's People

Contributors

hurufu avatar

Watchers

 avatar  avatar

nexoid-ed's Issues

Generate stubs.c for windows builds

Right now stubs.c is hand-coded, but this approach is suboptimal, because this file has to be modified each time new procedure is added or removed from the lib. Consider generating this file from nm -u output. Custom script may be required.

Consider rewritting bussiness logic in Ada

Ada is a strongly typed language that is well suited for describing Nexo specification.

Pros:

  1. Very-strong type checking
  2. Well defined bit fields that are used a lot in EMV and Nexo.
  3. Preconditions and postconditions that actually are there in the nexo specification, and it would be nice to have them. They usually state which variables must change their value or must only be read.
  4. Maps well from Drakon
    1. it has goto which is needed for blazing fast implementation
    2. high-level looping constructs compared to C
    3. nested function which may be used to implement procedures/functions with multiple entry points

Cons:

  1. I have to implement Ada generator from Drakon diagram
  2. I have to learn Ada well enough to be able to design this generator properly
  3. There aren't many free and open source ASN.1 compilers for Ada.

References:

Consider converting bussiness logic from C to C++

As time goes I begin to see issues that aren't easily solvable in C. They can be roughly divided into 2 categories:

  1. Technical
    1. Porting to Windows - this is big one, right now it's impossible to create DLL, without trying to jump over your head.
    2. Testing - Right now in order to test nexoid-ed it's needed to defined interface symbols for a test. Basically that means that in a single executable can be only single implementation of APIs (SCAPI, HAPI etc), which defies the point of testing, because normally we want to test different scenarios, like failure in a particular API call, etc. There is still a possibility to connect API to some scripting language and work with that, but for now experiments with libctl failed (#2).
  2. Non-technical
    1. Readability
      1. Operator overloading - It can simplify look of executable diagrams, which was the main point of them in the first place. ttd.transactionAmount > 1 is way more readable for non-programmer than amount_compare(ttd.transactionAmount, create_bcd(1)) > 1 or something similar.
      2. Implicit memory handling - It was solved partially using ptmalloc3 and memory pools, but still one have to use special macros acpval and acpptr to allocate a copy of a variable. This can be simplified with custom allocators in C++

Skip formatting errors for some tags

In EMV Book 3, section 7.5 it is specified that terminal may ignore formatting errors for some tags like Cardholder Name (5F20). TODO: Check if nexo also supports this.

Consider replacing `ttd` with a pointer

This is a major refactoring, but may be done quite mechanically. It's not needed now, but it may be useful to have if I'll want to scale-up.

I'm still unsure if I should do it. Here I will gather all pros and cons of such change.

Pros:

  1. It will be possible to allocate TTD on a heap (right now it will be always in .bss)
  2. Erasing data will be simpler. If DMAPI is used than just ttd = NULL is good enough.

Cons:

  1. A time consuming task that has zero immediate value
  2. Pointer de-reference instead of a direct jump for each access to TTD value.
  3. Trusted layer should guarantee immutability of a pointer for a duration of transaction

Also, the general idea is that nexoid-ed project should be as small as possible. It should be able to run on most restricted embedded systems. Maybe, it would be nice to be able to run using deterministic amount of memory.

UT ut/nexoid-ut-x86_64.t:118:F:utils:yymmdd_years_differ fails

Test fails

./ut/nexoid
Running suite(s): tag_retrival
 utils
95%: Checks: 23, Failures: 1, Errors: 0
ut/nexoid-ut-x86_64.t:118:F:utils:yymmdd_years_differ:0: Assertion 'yymmdd_cmp(b, a) == -1' failed: yymmdd_cmp(b, a) == 0, -1 == -1
make: *** [Makefile:168: test] Error 1

Function yymmdd_cmp isn't implemented correctly

Replace "Authorise Service" with "Data Interaction"

Service authorisation is out of scope of nexo-FAST, but I think it's a sensible idea to move it to "Data Entry Interaction" and it should set bool securityPermission variable.

Moreover function scap_Authorise_Service is deprecated for very long time.

Migrate to nexo-FAST v.3.3

Also, figure out how to support both versions at the same time. I think I will have to have two branches FASTv3.2 and FASTv3.3.

Implement nexo IFR

As described in multiple sections, one of them is nexo-FAST v.3.2 section 6.6.7.2

Move variables that aren't related to current transaction to a separate structure

Move some dangling global variables (like g_callTms) and data that isn't strictly speaking related to the current transaction (ttd) to a separate structure called tld (Terminal Lifecycle Data).

This task may involve implementing some changes that are against specification. All such inconsistencies should be documented and reported.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.