Skip to content
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

Fix the processing of apdus across multiple sources #451

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

yrichard-ledger
Copy link
Contributor

Description

This PR fixes edge cases when several apdus are sent to the device from different media.

The expected behaviour when two apdus are received in parallel is now:
* The first apdu processing is not impacted by the second one
* The second apdu is not processed and the device replies with an error SWO_IOL_STA_02 (0x1302)

This PR also adds a set of functions so that an application can restrict the apdu source to a single media.
This is intended to lock the media during a complex flow of apdus. In particular during an app installation
we can now reject automatically apdus from other medias

Changes include

  • [*] Bugfix (non-breaking change that solves an issue)
  • [*] New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)
  • Tests
  • Documentation
  • Other (for changes that might not fit in any category)

@codecov-commenter
Copy link

codecov-commenter commented Nov 16, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (876b8a5) 60.42% compared to head (a89f7d0) 60.42%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #451   +/-   ##
=======================================
  Coverage   60.42%   60.42%           
=======================================
  Files          12       12           
  Lines        1660     1660           
=======================================
  Hits         1003     1003           
  Misses        657      657           
Flag Coverage Δ
unittests 60.42% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tdejoigny-ledger
Copy link
Contributor

@yrichard-ledger did you manage the case where we receive a new APDU (via BLE) when still processing the previous APDU (no answer provided) received also via BLE ?

@yrichard-ledger
Copy link
Contributor Author

@yrichard-ledger did you manage the case where we receive a new APDU (via BLE) when still processing the previous APDU (no answer provided) received also via BLE ?

Yes, whatever the media, if we receive a new APDU while the previous apdu is still processing the SDK will reply with SWO_IOL_STA_02 (0x1302)

When two apdus are received in parallel:
* The first one is not impacted by the second one
* The second one receives an error response SWO_IOL_STA_02 (0x1302)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants