Add native Python GlobalPlatform runner and wire into run_globalplatform#277
Open
3rdIteration wants to merge 1 commit intodevfrom
Open
Add native Python GlobalPlatform runner and wire into run_globalplatform#2773rdIteration wants to merge 1 commit intodevfrom
3rdIteration wants to merge 1 commit intodevfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
gp.jarshell invocation with a native Python implementation to allow running GlobalPlatform operations without launching Java subprocesses.pyGlobalPlatform/libglobalplatform-backed path for install/delete/list/secure-channel key operations used by the applet tools.Description
src/seedsigner/helpers/globalplatform_native.pywhich implementsGlobalPlatformNativeRunnerand a_PyGlobalPlatformBackendthat maps a subset of GlobalPlatformPro-style CLI commands (-l -v,--install,--create,--params,--delete,--unlock,--lock) topyGlobalPlatformAPI calls and PC/SC actions.run_globalplatforminsrc/seedsigner/helpers/seedkeeper_utils.pyto callGlobalPlatformNativeRunner().run(command)and preserve the previous UI behaviour, PN532 restart handling, and user-facing error mapping.load/installForInstallAndMakeSelectable/deleteApplication/putSCKeyoperations via thepyGlobalPlatformbinding.tests/test_globalplatform_native.pyto validate command parsing, dispatch, output formatting, and unsupported-command handling.Testing
pytest -q tests/test_globalplatform_native.pyand the tests passed.pytest -q tests/test_flows_psbt.py -k satochip_connect_failureto ensure no regression in related flows and it passed.pytest -q tests/test_globalplatform_native.py tests/test_flows_psbt.py -k 'globalplatform_native or satochip_connect_failure'and the selected tests passed.Notes: the native backend requires
pyGlobalPlatform/libglobalplatformto be installed on the target system; when it is missing the code raises a clear error message instructing to installpyGlobalPlatform/libglobalplatform.Codex Task