Open
Description
Hi there,
If I use the incorrect PIN, python-emv recognises this and bails.
$ emvtool -p 0000 cap
Invalid PIN
…but when I use the correct PIN, python-emv is unable to generate the CAP code.
$ emvtool -p 1111 cap
Traceback (most recent call last):
File "/Users/htw/.pyenv/versions/3.6.4/bin/emvtool", line 11, in <module>
sys.exit(run())
File "/Users/htw/.pyenv/versions/3.6.4/lib/python3.6/site-packages/emv/command/client.py", line 46, in run
cli(obj={})
File "/Users/htw/.pyenv/versions/3.6.4/lib/python3.6/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/Users/htw/.pyenv/versions/3.6.4/lib/python3.6/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/Users/htw/.pyenv/versions/3.6.4/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/htw/.pyenv/versions/3.6.4/lib/python3.6/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/htw/.pyenv/versions/3.6.4/lib/python3.6/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/Users/htw/.pyenv/versions/3.6.4/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/Users/htw/.pyenv/versions/3.6.4/lib/python3.6/site-packages/emv/command/client.py", line 151, in cap
click.echo(card.generate_cap_value(ctx.obj['pin'], challenge=challenge, value=amount))
File "/Users/htw/.pyenv/versions/3.6.4/lib/python3.6/site-packages/emv/card.py", line 118, in generate_cap_value
self.verify_pin(pin)
File "/Users/htw/.pyenv/versions/3.6.4/lib/python3.6/site-packages/emv/card.py", line 89, in verify_pin
res = self.tp.exchange(VerifyCommand(pin))
File "/Users/htw/.pyenv/versions/3.6.4/lib/python3.6/site-packages/emv/transmission.py", line 51, in exchange
res = RAPDU.unmarshal(data + [sw1, sw2])
File "/Users/htw/.pyenv/versions/3.6.4/lib/python3.6/site-packages/emv/protocol/response.py", line 32, in unmarshal
raise obj
emv.protocol.response.ErrorResponse: <ErrorResponse: "Command not allowed; conditions of use not satisfied">
EMV-CAP is able to successfully generate a code, so it seems the card is okay. I've created this as a separate issue since #6 appears to be related to different error messages.
Metadata
Metadata
Assignees
Labels
No labels