Allow SCP when only short APDUs are supported by smart card connection #177
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces support for handling both short and extended APDUs (Application Protocol Data Units) in the smart card protocol, along with associated updates to the testing framework. Key changes include modifications to the
ScpProcessor
andSmartCardProtocol
classes to enable this functionality, as well as new tests to validate APDU size handling.Core functionality updates:
ScpProcessor
: Added ausingShortApdus
flag and anExtendedApduProcessor
to handle short APDUs when extended APDUs are not supported. Adjusted thesendApdu
method to conditionally use the appropriate processor based on APDU size. [1] [2]SmartCardProtocol
: UpdatedinitScp
to support a newshortApdus
parameter, enabling the selection of short or extended APDUs dynamically. Adjusted logic to determine maximum APDU size based on device capabilities and user input. [1] [2] [3] [4]Testing enhancements:
testApduSizes
method inScp11DeviceTests
to validate handling of different APDU sizes and formats (short and extended). This includes generating payloads of varying sizes and verifying round-trip communication with the smart card.testApduSizes
method into both Android and desktop test suites (Scp11Tests
). [1] [2]Utility and callback additions:
DeviceCallback
interface inTestState
and awithDevice
method inSecurityDomainTestState
to facilitate device-specific test operations. [1] [2]Minor updates:
These changes enhance the flexibility of the smart card protocol implementation while ensuring robust testing for various APDU handling scenarios.