JCMathLib icon indicating copy to clipboard operation
JCMathLib copied to clipboard

Add conditional execution of JCMathLib methods based on card-specific configuration files

Open petrs opened this issue 5 years ago • 0 comments

Not all operations of JCMathLib are supported on all cards. If executed, some operations will fail or may even block the card (e.g., n_mod_exp on JCOP3 J3H145G see https://github.com/OpenCryptoProject/JCMathLib/issues/13). Currently, developer must remove these operations manually from the code.

Solution: Add simple java file CardSupportCfg.java containing true/false param for each method supported by JCMathLib. The parameter is controlled in runtime and if false, then method is not executed (exception) despite being present in code.

For new card, developer can select pre-prepared CardSupportCfg for tested smartcards or create own using simple testing tool

petrs avatar Oct 29 '20 15:10 petrs