licel / jcardsim

https://jcardsim.org
224 stars 123 forks source link

ALG_DES_MAC4_ISO9797_1_M2_ALG3 algo not supported #92

Closed AbdesElo closed 2 years ago

AbdesElo commented 8 years ago

I'am currently implementing a java card applet which using Signature ALG_DES_MAC4_ISO9797_1_M2_ALG3. When I use JCardSim to test my applet I encounter an error during the installation of the first instance and especialy when my signature object is created:

s_object= Signature.getInstance(Signature.ALG_DES_MAC4_ISO9797_1_M2_ALG3, false); Showing the code Signature.getInstance in JCardSim I easly see that Signature.ALG_DES_MAC4_ISO9797_1_M2_ALG3 case is not taking into account.

Is this will integrated in a near future version?

BR, Abdeslam

AbdesElo commented 8 years ago

Dear licel,

I think that jcardsim can provide the missing functionality "ALG_DES_MAC4_ISO9797_1_M2_ALG3" if we update SignatureProxy.java and SymmetricSignatureImpl.java as ; 1) in SignatureProxy.java the following line should be added in getInstance function: case Signature.ALG_DES_MAC4_ISO9797_1_M2_ALG3: case Signature.ALG_DES_MAC8_ISO9797_1_M2_ALG3:

2)in SymmetricSignatureImpl.java the following lines should be added in init() function: case ALG_DES_MAC4_ISO9797_1_M2_ALG3: engine = new ISO9797Alg3Mac(new DESEngine(), 32, new ISO7816d4Padding()); break;

Whith this update the installation of my applet is going well. but I have not tested it yet..

BR, Abdeslam

AbdesElo commented 8 years ago

Hi,

My modification seems to be good, all my tests are green.

BR, Abdeslam