DarkFlippers / unleashed-firmware

Flipper Zero Unleashed Firmware
https://flipperunleashed.com
GNU General Public License v3.0
17.66k stars 1.46k forks source link

Emv fixes #702

Closed wosk closed 9 months ago

wosk commented 9 months ago

What's new

Verification

Checklist (For Reviewer)

Willy-JL commented 9 months ago

FYI, im seeing empty transaction history on my mastercard with this PR's changes, shows fine without. not sure where exactly the issue would be, dont see any changes related to transactions at a first sweep through the diff...

either way great work, looking forward to this :)

Willy-JL commented 9 months ago

i was able to get transaction history to work again for my mastercard by reverting the emv_poller_read_afl() function to its state before this PR. i found this by looking at logs, stripping out most of them and looking for the SFI attempts, this is what I see:

working (gets transaction history) (dev branch):

[T][EMVPoller] SFI 0x2 record 1:
[T][EMVPoller] SFI 0xB record 1:
[T][EMVPoller] SFI 0xB record 2:
[T][EMVPoller] SFI 0xB record 3:
[T][EMVPoller] SFI 0xB record 4:
[T][EMVPoller] SFI 0xB record 5:
[T][EMVPoller] SFI 0xB record 6:
[T][EMVPoller] SFI 0xB record 7:
[T][EMVPoller] SFI 0xB record 8:
[T][EMVPoller] SFI 0xB record 9:
[T][EMVPoller] SFI 0xB record 10:

broken (no transactions info) (pr head):

[T][EMVPoller] SFI 0x2 record 1:
[T][EMVPoller] SFI 0x4 record 1:
[T][EMVPoller] SFI 0x4 record 2:
[T][EMVPoller] SFI 0x4 record 3:
[T][EMVPoller] SFI 0x4 record 4:
[T][EMVPoller] SFI 0x2 record 2:
[T][EMVPoller] SFI 0x3 record 1:
Leptopt1los commented 9 months ago

@Willy-JL Thank you! the problem was that the attempt to brute force files 2-3 was before reading transactions. Some cards, after attempting to read a record that does not exist on them, refuse to respond to subsequent requests. this seems to be done for security reasons

Leptopt1los commented 9 months ago

@wosk thank you for the productive collaboration!

Willy-JL commented 9 months ago

can confirm the transactions work again, thanks!