HSM Simulator's bugs

May 20, 2010 at 3:44 AM

Hi all,

When I use HSM Simulator for testing, I discover some bugs:

Here is my code functions;

public String verifyVisaPVV(String TPK_LMK, String PVK_LMK, String PINBlock, String PINBlock_Format, String AccNum, String PVKI, String PVV) {...};

 

and call function

System.out.println("code: "+pro.verifyVisaPVV("X289262FA944D515072747E302803FF0E", "U3668D76AA218E20202B933A06FEB9BB7", "733BC92274C49820", "01", "412550004821", "0", "5262"));

 

Sent to HSM: 1234DCX289262FA944D515072747E302803FF0EU3668D76AA218E20202B933A06FEB9BB7733BC92274C498200141255000482105262
Response from HSM: 1234DE00

The HSM simulator response successfully code 00 but in HSM document the reponse Command of DC is DD, not DE

=============================================================================

And the second bug:

public String translatePIN_from_ZPK_to_LMK(String ZPK_LMK, String PINBlock, String PINFormat, String accountNumber) throws Exception {...}

String PIN = tran.translatePIN_from_ZPK_to_LMK("U3D0B0B997360FABB84D3A0D95D24313D", "2BD3FCC48BC9C78A", "01", "412550004821");

Sent to HSM: 1234JEU3D0B0B997360FABB84D3A0D95D24313D014125500048212BD3FCC48BC9C78A
java.lang.Exception:
Error Code 23: Invalid PIN block format code
        at hsm.provider.PINTranslator.translatePIN_from_ZPK_to_LMK(Response from HSM: 1234JF23
PINTranslator.java:153)
        at hsm.provider.PINTranslator.main(PINTranslator.java:267)

Command Events in HSM

Field HEADER, value 1234
Field COMMAND_CODE, value JE
Field SOURCE_ZPK, value 3D0B0B997360FABB84D3A0D95D24313D
Field PIN_BLOCK, value 014125500048212B
Field SOURCE_PB_FORMAT, value D3
Field ACCOUNT_NUMBER, value FCC48BC9C78A

Description:

I input the PIN BLock format is 01 but it understart my format is D3 (It 's get in my input PINBlock 2BD3FCC48BC9C78A)

So it can't translate my PINblock

 

There are still alse some wrong output print command events in some function but never mind, it's running well

Hope you fix them soon

Thanks.

 


Coordinator
May 20, 2010 at 9:09 AM
Edited May 20, 2010 at 9:13 AM

;

; The HSM simulator response successfully code 00 but in HSM document the reponse Command of DC is DD, not DE

;

You're absolutely right, this will be fixed in the next release but I'll add it to the code repository sooner.

;

; Sent to HSM: 1234JEU3D0B0B997360FABB84D3A0D95D24313D014125500048212BD3FCC48BC9C78A

; java.lang.Exception:

; Error Code 23: Invalid PIN block format code

; at hsm.provider.PINTranslator.translatePIN_from_ZPK_to_LMK(Response from HSM: 1234JF23

; PINTranslator.java:153)

; at hsm.provider.PINTranslator.main(PINTranslator.java:267)

;

Breaking down the command 1234JEU3D0B0B997360FABB84D3A0D95D24313D014125500048212BD3FCC48BC9C78, seems like you're sending ZPK+PIN Block Format+Account Number+PIN Block. My understanding is that the correct order is ZPK+PIN Block+PIN Block Format+Account Number. If this is incorrect, please let me know.

;

; There are still alse some wrong output print command events in some function but never mind, it's running well

;

Please let us know about as many problems as possible. Yours is the most valuable input this project can get!

May 21, 2010 at 3:52 AM
Edited May 21, 2010 at 10:36 AM

; Breaking down the command 1234JEU3D0B0B997360FABB84D3A0D95D24313D014125500048212BD3FCC48BC9C78, seems like you're sending ZPK+PIN

; Block Format+Account Number+PIN Block.

; My understanding is that the correct order is ZPK+PIN Block+PIN Block Format+Account Number. If this is incorrect, please let me know.

 

Yes you are correct in order ZPK + PIN Block + PIN Block Format + Account Number. I have input wrong parameter in my code, thank you very much

Here is the result:

Sent to HSM: 1234JEU3D0B0B997360FABB84D3A0D95D24313D4D42BFED91665E4A01412550004821
Response from HSM: 1234JF000123456
PIN: 0123456

 

; Please let us know about as many problems as possible. Yours is the most valuable input this project can get!

I will run all these function again then I will post any problem while testing.