Hello,
Afair, PIN 2 should correspond to the PUK code, which is traditionally 8 digits, not 4. Here, you get an error indicated by the SW code 6B 00, which means "wrong parameters P1 or P2". This can correspond to the length of the PIN 2 expected to be longer than the one you provide.

Le jeu. 4 juil. 2024 à 17:11, Valentin Maillet (EXT) <Valentin.MAILLET.ext@keas-group.com> a écrit :
Good afternoon,


I am trying to verify the CHV2 verification on an Amarisoft  Test SIM Card. With a HID OMNIKEY 3121.
I have issues with the CHV2 verification with the pySim software and amarisoft simcard.
I get the error below.

Can you please give me some hints on how to fix this issue as I have no idea of how to start.

Sincerely,

Valentin M.



pySIM-shell (00:MF)> verify_chv --pin-nr 1 1234
CHV verification successful
pySIM-shell (00:MF)> verify_chv --pin-nr 2 1234
EXCEPTION of type 'SwMatchError' occurred with message: SW match failed! Expected 9000 and got 6b00.
To enable full traceback, run the following command: 'set debug true'
pySIM-shell (00:MF)> set debug true
debug - was: False
now: True
pySIM-shell (00:MF)> verify_chv --pin-nr 2 1234
Traceback (most recent call last):
  File "/home/keas/.local/lib/python3.10/site-packages/cmd2/cmd2.py", line 2399, in onecmd_plus_hooks
    stop = self.onecmd(statement, add_to_history=add_to_history)
  File "/home/keas/.local/lib/python3.10/site-packages/cmd2/cmd2.py", line 2852, in onecmd
    stop = func(statement)
  File "/home/keas/.local/lib/python3.10/site-packages/cmd2/decorators.py", line 382, in cmd_wrapper
    return func(*args_list, **kwargs)  # type: ignore[call-arg]
  File "/home/keas/pysim/./pySim-shell.py", line 824, in do_verify_chv
    (data, sw) = self._cmd.lchan.scc.verify_chv(opts.pin_nr, h2b(pin))
  File "/home/keas/pysim/pySim/commands.py", line 693, in verify_chv
    self._chv_process_sw('verify', chv_no, code, sw)
  File "/home/keas/pysim/pySim/commands.py", line 682, in _chv_process_sw
    raise SwMatchError(sw, '9000')
pySim.exceptions.SwMatchError: SW match failed! Expected 9000 and got 6b00.
EXCEPTION of type 'SwMatchError' occurred with message: SW match failed! Expected 9000 and got 6b00.
pySIM-shell (00:MF)>