-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error with cap #6
Comments
Does |
Blimey, that was quick!
You wrote:
Does emvtool info show any applications at all?
Yes, if you mean: 'Available apps: "Visa Debit", "LINK ATM", “BARCLAYS”’
That’s what I get with a Barclays card, followed by what looks like a complete set of card info.
With a Nationwide card:
Available apps: "Visa Debit”
and again all looks good.
It’s the `cap` command that gives trouble. With three Visa debit cards – two Barclays and one Nationwide (which works in a Barclays card reader and vice versa) – I’ve got three different errors:
Mostly this one, which I quoted before:
Traceback (most recent call last):
File "/Users/charles/Library/Python/3.6/bin/emvtool", line 11, in <module>
sys.exit(run())
File "/Users/charles/Library/Python/3.6/lib/python/site-packages/emv/command/client.py", line 37, in run
EMVClient().run()
File "/Users/charles/Library/Python/3.6/lib/python/site-packages/emv/command/client.py", line 75, in run
self.args.func()
File "/Users/charles/Library/Python/3.6/lib/python/site-packages/emv/command/client.py", line 130, in cap
except InvalidPINException as e:
TypeError: catching classes that do not inherit from BaseException is not allowed
But I also saw these, though I can’t seem to reproduce them:
Traceback (most recent call last):
File "/Users/charles/Library/Python/3.6/lib/python/site-packages/emv/command/client.py", line 129, in cap
value=self.args.amount))
File "/Users/charles/Library/Python/3.6/lib/python/site-packages/emv/card.py", line 88, in generate_cap_value
self.select_application(apps[-1][Tag.ADF_NAME])
KeyError: -1
and:
Traceback (most recent call last):
File "/Users/charles/Library/Python/3.6/lib/python/site-packages/emv/command/client.py", line 129, in cap
value=self.args.amount))
File "/Users/charles/Library/Python/3.6/lib/python/site-packages/emv/card.py", line 99, in generate_cap_value
self.verify_pin(pin)
File "/Users/charles/Library/Python/3.6/lib/python/site-packages/emv/card.py", line 73, in verify_pin
res = self.tp.exchange(VerifyCommand(pin))
File "/Users/charles/Library/Python/3.6/lib/python/site-packages/emv/protocol/command.py", line 168, in __init__
data = b'2%x%s' % (len(str(pin)), pin)
TypeError: %b requires a bytes-like object, or an object that implements __bytes__, not ‘str’
Does that help?
Very best
Charles
…----------------------------------------------------------------------------------------------------------
PS With a MasterCard credit card I get:
Available apps: “MASTERCARD"
followed by FCI Proprietary Data, but no File 1, File 2 etc, then:
Fetching card data...
Unable to fetch card data: <ErrorResponse: "Referenced data (data objects) not found">
Since I’m guessing you created this with Barclays debit cards in mind, that’s not a problem.
|
It’s the `cap` command that gives trouble.
as in:
`emvtool -p xxxx cap`
where xxxx is a PIN. That’s correct, isn’t it?
|
It look me a ridiculously long time today to get my dev environment working on my Mac again... I've released a new version which fixes a few minor bugs in what you were seeing. It turns out it probably wasn't compatible with Python 3 - it's now only compatible with python 3. If you're still seeing issues, let me know. |
Russ
You wrote:
It look me a ridiculously long time today to get my dev environment working on my Mac again...
I've released a new version which fixes a few minor bugs in what you were seeing. pip3 install --upgrade emv to get the newest version.
It turns out it probably wasn't compatible with Python 3 - it's now only compatible with python 3.
Thanks for that. I was previously trying to install via pip3 from the remote repository and it wasn’t working (I had to download it first). Now I have 1.0.1 in place.
"Requirement not upgraded as not directly required:"
terminaltables
argparse
pycountry
pyscard
click
enum-compat
are those OK?
If you're still seeing issues, let me know.
File "/usr/local/bin/emvtool", line 11, in <module>
sys.exit(run())
File "/usr/local/lib/python3.6/site-packages/emv/command/client.py", line 45, in run
cli(obj={})
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/emv/command/client.py", line 131, in cap
click.echo(card.generate_cap_value(ctx.obj['pin'], challenge=challenge, value=amount))
File "/usr/local/lib/python3.6/site-packages/emv/card.py", line 90, in generate_cap_value
self.select_application(apps[-1][Tag.ADF_NAME])
KeyError: -1
Cheers
Charles
|
Sorry, that was from `emvtool -p <PIN> cap`, if that wasn’t obvious.
|
I've pushed a new version which has a few more changes. It may at least give you a better error message. But this is quite bizarre. |
Russ
You wrote:
I've pushed a new version which has a few more changes. It may at least give you a better error message. But this is quite bizarre.
Thanks. Now on 1.0.2.
Tested with three Visa debit cards. One (Barclays business account) now seems to work fine:
charles@Charles-Mac-mini:~$ emvtool -p 0000 cap
40253358
I’ve not tested that code, but I assume that since we’re getting a credible value all is OK. It handles an incorrect PIN properly, too.
Two other cards now give errors on reading card data as well as the cap command.
Barclays personal account card
emvtool info
[card data mostly displayed OK, but:
2PAY.SYS.DDF01 (Index of apps for contactless payments)
Unable to access app: <ErrorResponse: "Wrong parameter(s) P1 P2; file not found">
Available named apps: "Visa Debit”]
then:
Traceback (most recent call last):
File "/usr/local/bin/emvtool", line 11, in <module>
sys.exit(run())
File "/usr/local/lib/python3.6/site-packages/emv/command/client.py", line 48, in run
cli(obj={})
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/emv/command/client.py", line 120, in info
render_app(card, app[Tag.ADF_NAME], redact)
File "/usr/local/lib/python3.6/site-packages/emv/command/client.py", line 93, in render_app
rec = card.read_record(j, sfi=i).data
File "/usr/local/lib/python3.6/site-packages/emv/card.py", line 33, in read_record
return self.tp.exchange(ReadCommand(record_number, sfi))
File "/usr/local/lib/python3.6/site-packages/emv/transmission.py", line 51, in exchange
res = RAPDU.unmarshal(data + [sw1, sw2])
File "/usr/local/lib/python3.6/site-packages/emv/protocol/response.py", line 27, in unmarshal
obj.data = TLV.unmarshal(data[:-2])
File "/usr/local/lib/python3.6/site-packages/emv/protocol/structures.py", line 39, in unmarshal
value = TLV.unmarshal(value)
File "/usr/local/lib/python3.6/site-packages/emv/protocol/structures.py", line 39, in unmarshal
value = TLV.unmarshal(value)
File "/usr/local/lib/python3.6/site-packages/emv/protocol/structures.py", line 49, in unmarshal
value = CVMList.unmarshal(value)
File "/usr/local/lib/python3.6/site-packages/emv/protocol/structures.py", line 247, in unmarshal
cvm_list.y = decode_int(data[4:8])
File "/usr/local/lib/python3.6/site-packages/emv/util.py", line 33, in decode_int
result = val[0]
IndexError: list index out of range
charles@Charles-Mac-mini:~$ emvtool -p 0000 cap
Traceback (most recent call last):
File "/usr/local/bin/emvtool", line 11, in <module>
sys.exit(run())
File "/usr/local/lib/python3.6/site-packages/emv/command/client.py", line 48, in run
cli(obj={})
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/emv/command/client.py", line 146, in cap
click.echo(card.generate_cap_value(ctx.obj['pin'], challenge=challenge, value=amount))
File "/usr/local/lib/python3.6/site-packages/emv/card.py", line 103, in generate_cap_value
app_data = self.get_application_data(opts['AFL'])
File "/usr/local/lib/python3.6/site-packages/emv/card.py", line 70, in get_application_data
res = self.tp.exchange(ReadCommand(start_rec, sfi))
File "/usr/local/lib/python3.6/site-packages/emv/transmission.py", line 51, in exchange
res = RAPDU.unmarshal(data + [sw1, sw2])
File "/usr/local/lib/python3.6/site-packages/emv/protocol/response.py", line 27, in unmarshal
obj.data = TLV.unmarshal(data[:-2])
File "/usr/local/lib/python3.6/site-packages/emv/protocol/structures.py", line 39, in unmarshal
value = TLV.unmarshal(value)
File "/usr/local/lib/python3.6/site-packages/emv/protocol/structures.py", line 39, in unmarshal
value = TLV.unmarshal(value)
File "/usr/local/lib/python3.6/site-packages/emv/protocol/structures.py", line 49, in unmarshal
value = CVMList.unmarshal(value)
File "/usr/local/lib/python3.6/site-packages/emv/protocol/structures.py", line 247, in unmarshal
cvm_list.y = decode_int(data[4:8])
File "/usr/local/lib/python3.6/site-packages/emv/util.py", line 33, in decode_int
result = val[0]
IndexError: list index out of range
Nationwide card (works in Barclays card reader and vice-versa)
emvtool info
[card data displayed OK]
WARNING:emv.protocol.structures:Invalid TLV - too short: []
Traceback (most recent call last):
File "/usr/local/bin/emvtool", line 11, in <module>
sys.exit(run())
File "/usr/local/lib/python3.6/site-packages/emv/command/client.py", line 48, in run
cli(obj={})
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/emv/command/client.py", line 109, in info
render_app(card, '1PAY.SYS.DDF01', redact)
File "/usr/local/lib/python3.6/site-packages/emv/command/client.py", line 94, in render_app
click.echo(as_table(rec[Tag.RECORD], 'File: %s,%s' % (i, j), redact=redact))
KeyError: 112
charles@Charles-Mac-mini:~$ emvtool -p 0000 cap
Traceback (most recent call last):
File "/usr/local/bin/emvtool", line 11, in <module>
sys.exit(run())
File "/usr/local/lib/python3.6/site-packages/emv/command/client.py", line 48, in run
cli(obj={})
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/emv/command/client.py", line 146, in cap
click.echo(card.generate_cap_value(ctx.obj['pin'], challenge=challenge, value=amount))
File "/usr/local/lib/python3.6/site-packages/emv/card.py", line 107, in generate_cap_value
resp = self.tp.exchange(get_arqc_req(app_data, challenge=challenge, value=value))
File "/usr/local/lib/python3.6/site-packages/emv/cap.py", line 34, in get_arqc_req
cdol1 = app_data[0x8C]
KeyError: 140
Any help?
Charles
|
Ah, I'm glad your Barclays card works now! I think the issue there was that emvtool had a bug when there was only one app on the card. I've published 1.0.3 which should fix those errors on your other Barclays card - it's failing to decode some objects which are unnecessary to do the CAP process. The Nationwide card is going to be a bit harder unfortunately... |
Hi Russ
You wrote:
Ah, I'm glad your Barclays card works now! I think the issue there was that emvtool had a bug when there was only one app on the card.
I've published 1.0.3 which should fix those errors on your other Barclays card - it's failing to decode some objects which are unnecessary to do the CAP process.
Thanks. 1.0.3 still errors with the second Barclays card, however:
charles@Charles-Mac-mini:~$ emvtool -p 0000 cap
WARNING:emv.protocol.structures:Invalid TLV - too short: [3]
WARNING:emv.protocol.structures:Invalid TLV - too short: [3]
Traceback (most recent call last):
File "/usr/local/bin/emvtool", line 11, in <module>
sys.exit(run())
File "/usr/local/lib/python3.6/site-packages/emv/command/client.py", line 48, in run
cli(obj={})
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/emv/command/client.py", line 147, in cap
click.echo(card.generate_cap_value(ctx.obj['pin'], challenge=challenge, value=amount))
File "/usr/local/lib/python3.6/site-packages/emv/card.py", line 110, in generate_cap_value
resp = self.tp.exchange(get_arqc_req(app_data, challenge=challenge, value=value))
File "/usr/local/lib/python3.6/site-packages/emv/cap.py", line 34, in get_arqc_req
cdol1 = app_data[0x8C]
KeyError: 140
The Nationwide card is going to be a bit harder unfortunately…
Perhaps not, since it generates exactly the same error ;-)
Thanks
Charles
PS Here are details of the failing Barclays card in case it helps. I redacted the hex strings in case there’s anything sensitive in there.
emvtool info
1PAY.SYS.DDF01 (Index of apps for chip payments)
┌FCI Proprietary Data─────────────┬───────┐
│ Tag │ Name │ Value │
├─────────┼───────────────────────┼───────┤
│ [5F 2D] │ Language Preference │ "en" │
│ [88] │ Short File Identifier │ [01] │
└─────────┴───────────────────────┴───────┘
┌File: 1,1────────────────────┬─────────────────────────────────────────────────────────────────────────────────┐
│ Tag │ Name │ Value │
├──────┼──────────────────────┼─────────────────────────────────────────────────────────────────────────────────┤
│ [61] │ Application Template │ { (4F) Application Dedicated File (ADF) Name: [00 00 00 00 00 00 00], (50) │
│ │ │ Application Label: "Visa Debit", (87) Application Priority Indicator: 2, (73) │
│ │ │ Directory Discretionary Template: { ([9F 0A]) Application Selection Registered │
│ │ │ Proprietary Data: <ASRPD: Electronic Product Identification: Debit>}} │
└──────┴──────────────────────┴─────────────────────────────────────────────────────────────────────────────────┘
┌File: 1,2────────────────────┬─────────────────────────────────────────────────────────────────────────────┐
│ Tag │ Name │ Value │
├──────┼──────────────────────┼─────────────────────────────────────────────────────────────────────────────┤
│ [61] │ Application Template │ { (4F) Application Dedicated File (ADF) Name: [00 00 00 00 00 00 00], (50) │
│ │ │ Application Label: "LINK ATM", (87) Application Priority Indicator: 1} │
└──────┴──────────────────────┴─────────────────────────────────────────────────────────────────────────────┘
┌File: 1,3────────────────────┬─────────────────────────────────────────────────────────────────────────────┐
│ Tag │ Name │ Value │
├──────┼──────────────────────┼─────────────────────────────────────────────────────────────────────────────┤
│ [61] │ Application Template │ { (4F) Application Dedicated File (ADF) Name: [00 00 00 00 00 00 00], (50) │
│ │ │ Application Label: "BARCLAYS", (87) Application Priority Indicator: 0} │
└──────┴──────────────────────┴─────────────────────────────────────────────────────────────────────────────┘
2PAY.SYS.DDF01 (Index of apps for contactless payments)
2PAY.SYS.DDF01 not available (this is normal on some cards)
Available named apps: "Visa Debit"
Application "Visa Debit", DF Name: [00 00 00 00 00 00 00]
┌FCI Proprietary Data──────────────────────┬────────────────────────────────────────────────────────────────────────┐
│ Tag │ Name │ Value │
├─────────┼────────────────────────────────┼────────────────────────────────────────────────────────────────────────┤
│ [50] │ Application Label │ "Visa Debit" │
│ [87] │ Application Priority Indicator │ 2 │
│ [5F 2D] │ Language Preference │ "en" │
│ [BF 0C] │ FCI Issuer Discretionary Data │ { ([9F 0A]) Application Selection Registered Proprietary Data: <ASRPD: │
│ │ │ Electronic Product Identification: Debit>} │
└─────────┴────────────────────────────────┴────────────────────────────────────────────────────────────────────────┘
┌File: 1,1┬────────────────────────────┬───────────────────────────────────────────────────────────────────────────┐
│ Tag │ Name │ Value │
├─────────┼────────────────────────────┼───────────────────────────────────────────────────────────────────────────┤
│ [5F 20] │ Cardholder Name │ "BUTCHER /C.MR" │
│ [57] │ Track 2 Equivalent Data │ [00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00] │
│ [9F 1F] │ Track 1 Discretionary Data │ [00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00] │
└─────────┴────────────────────────────┴───────────────────────────────────────────────────────────────────────────┘
WARNING:emv.protocol.structures:Invalid TLV - too short: [3]
Traceback (most recent call last):
File "/usr/local/bin/emvtool", line 11, in <module>
sys.exit(run())
File "/usr/local/lib/python3.6/site-packages/emv/command/client.py", line 48, in run
cli(obj={})
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/emv/command/client.py", line 121, in info
render_app(card, app[Tag.ADF_NAME], redact)
File "/usr/local/lib/python3.6/site-packages/emv/command/client.py", line 92, in render_app
click.echo(as_table(rec[Tag.RECORD], 'File: %s,%s' % (i, j), redact=redact))
File "/usr/local/lib/python3.6/site-packages/emv/command/client.py", line 31, in as_table
'\n'.join(textwrap.wrap(render_element(tag, value, redact=redact), 80))])
File "/usr/local/lib/python3.6/site-packages/emv/protocol/data.py", line 125, in render_element
return repr(value)
File "/usr/local/lib/python3.6/site-packages/emv/protocol/structures.py", line 69, in __repr__
out += render_element(key, val)
File "/usr/local/lib/python3.6/site-packages/emv/protocol/data.py", line 125, in render_element
return repr(value)
File "/usr/local/lib/python3.6/site-packages/emv/protocol/structures.py", line 261, in __repr__
return "<CVM List x: %s, y: %s, rules: %s>" % (self.x, self.y,
AttributeError: 'CVMList' object has no attribute ‘x'
|
1.0.4 released, which should fix that CVMList error. I've also improved the error handling in the CAP process, but I suspect I haven't fixed that KeyError bug. On the non-working Barclays card: you can now run |
You wrote:
1.0.4 released, which should fix that CVMList error.
… and 1.0.5, I see.
I've also improved the error handling in the CAP process, but I suspect I haven't fixed that KeyError bug.
On the non-working Barclays card: you can now run emvtool listapps which will show the list of apps. Can you show me the output of that, and take a note of the index of the "Barclays" app and then run emvtool --redact appdata 2 (replacing "2" with the index of the Barclays app if it's different), and send the output of that as well.
Aha. Turns out this card doesn’t have a Barclays app:
emvtool listapps
┌Applications──────────┬────────────────────────┐
│ Index │ Label │ ADF │
├───────┼──────────────┼────────────────────────┤
│ 0 │ "Visa Debit" │ [A0 00 00 00 03 10 10] │
└───────┴──────────────┴────────────────────────┘
Full error message below, but I guess the key is:
Error in CAP generation: Application data doesn't include CDOL1 field:
This card issued in my name, but on my dad’s account under a power of attorney. The odd things is that it works in a standalone card reader – I’ve just tested that by using it to log into my own account. Apart from the fact that it’s not contactless (possibly because my dad’s card isn’t either), I’d assumed it was the same as any other debit card. Gosh this stuff is complicated.
Best
Charles
Just in case, here’s the output from the Visa Debit app:
emvtool --redact appdata 0
Selected application "Visa Debit" ([A0 00 00 00 03 10 10])
┌Processing Options────────────────────────────┐
│ Key │ Value │
├─────┼────────────────────────────────────────┤
│ AIP │ [60, 0] │
│ AFL │ [8, 1, 1, 0, 16, 1, 2, 0, 24, 1, 3, 2] │
└─────┴────────────────────────────────────────┘
┌Application Data────────────────────────────────────────────────────┬──────────────────────────────────────────────────────────────────────────────────┐
│ Tag │ Name │ Value │
├─────────┼──────────────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────────────────────────┤
│ [5F 20] │ Cardholder Name │ "BUTCHER /C.MR" │
│ [57] │ Track 2 Equivalent Data │ [REDACTED] │
│ [9F 1F] │ Track 1 Discretionary Data │ [REDACTED] │
│ [E0] │ │ { 01: [90 81 B0 84 C1 15 15 F4], 7D: { 5C: [43 90 38 68 82 C9 7C A8 4F 87 E1 1E │
│ │ │ EE 53 04 62 60 9B 0F D9 AB F5 A4 7C E1 D4 17 11 EF 00 87 51 11 51 16 62 A7 73 00 │
│ │ │ 10 2F 4F 3D C5 9D CD 20 E3 50 FE BC BE 28 35 2F A2 C0 A6 27 24 DB 02 FC 7F 23 A5 │
│ │ │ D0 5A 9C D1 16 A6 50 0B AC 75 7A A8 A7 65 F4 ED 64 1B 0A 2C 0A]}, (8E) │
│ │ │ Cardholder Verification Method (CVM) List: <CVM List x: None, y: None, rules: >, │
│ │ │ B4: { (8A) Authorisation Response Code: [FF 90 03 C0 71 5E F5 5C 21 BB AA 2F 6E │
│ │ │ 0C 0A F6 98]}} │
│ [5F 25] │ Application Effective Date │ 18/02/01 │
│ [5F 24] │ Application Expiration Date │ 21/02/28 │
│ [5A] │ Application Primary Account Number (PAN) │ [REDACTED] │
│ [5F 34] │ Application Primary Account Number (PAN) Sequence Number │ 0 │
│ [9F 07] │ Application Usage Control │ <AUC: Valid for domestic cash transactions, Valid for international cash │
│ │ │ transactions, Valid for domestic goods, Valid for international goods, Valid for │
│ │ │ domestic services, Valid for international services, Valid at ATMs, Valid at │
│ │ │ terminals other than ATMs> │
│ [9F 0D] │ Issuer Action Code - Default │ [B8 60 6C 08 00] │
│ [9F 0E] │ Issuer Action Code - Denial │ [00 10 80 00 00] │
│ [9F 0F] │ Issuer Action Code - Online │ [B8 68 7C 98 00] │
│ [5F 28] │ Issuer Country Code │ GB │
│ [9F 42] │ Application Currency Code │ GBP │
│ [9F 44] │ Application Currency Exponent │ 2 │
│ [8E] │ Cardholder Verification Method (CVM) List │ <CVM List x: 0, y: 0, rules: If terminal supports the CVM, Plaintext PIN │
│ │ │ verification performed by ICC. Else, fail verification.; If terminal supports │
│ │ │ the CVM, Enciphered PIN verified online; If terminal supports the CVM, │
│ │ │ Enciphered PIN verified online; If terminal supports the CVM, Plaintext PIN │
│ │ │ verification performed by ICC> │
│ [9F 4A] │ Static Data Authentication Tag List │ [(82) Application Interchange Profile] │
└─────────┴──────────────────────────────────────────────────────────┴──────────────────────────────────────────────────────────────────────────────────┘
c
|
[Unfortunately the error message you posted contained the card number. I've removed it from your comment and I doubt anyone else would have spotted it in the short time it was up.] This is very interesting. Unfortunately there's not a huge amount I can do here - from my perspective this card is missing the information I need to be able to construct the CAP query. It's complicated because the exact process of generating the CAP/pinsentry codes is not publicly standardised. It's clear that there may be more to this than I'm aware of, but short of having possession of a problematic card and a modified reader, it's impossible for me to work out what's happening. |
You wrote:
[Unfortunately the error message you posted contained the card number. I've removed it from your comment and I doubt anyone else would have spotted it in the short time it was up.]
Whoops! Thank you.
This is very interesting. Unfortunately there's not a huge amount I can do here - from my perspective this card is missing the information I need to be able to construct the CAP query.
It's complicated because the exact process of generating the CAP/pinsentry codes is not publicly standardised. It's clear that there may be more to this than I'm aware of, but short of having possession of a problematic card and a modified reader, it's impossible for me to work out what's happening.
If you ever do get it cracked I guess the same method will also work for other UK banks, given that the card readers seem to be interchangeable.
One lives and learns, and we made some progress, so thanks for all your help with this. Now I might have a go at Barclayscrape…
Very best
Charles
|
Closing this because as of v1.0.8 everything seemed to be fine for the cards mentioned here. Now I have a new card and a new error ;-) #12 |
emvtool info
works fine.emvtool -p 0000 cap
errors:File "/Users/charles/Library/Python/3.6/lib/python/site-packages/emv/command/client.py", line 129, in cap
value=self.args.amount))
File "/Users/charles/Library/Python/3.6/lib/python/site-packages/emv/card.py", line 88, in generate_cap_value
self.select_application(apps[-1][Tag.ADF_NAME])
KeyError: -1
I haven’t a clue about Python, so apologies if this is a problem with my setup. macOS 10.13.4, with libpcsclite pre-installed as part of the OS.
This is a fantastic project! Keep up the great work.
The text was updated successfully, but these errors were encountered: