Merge pull request #510 from LedgerHQ/fix/apa/standard_plugin_variant

Fix standard plugin variant + null-check on parameters
This commit is contained in:
apaillier-ledger
2023-12-07 16:52:40 +01:00
committed by GitHub
3 changed files with 30 additions and 24 deletions

View File

@@ -5,11 +5,13 @@
| :rotating_light: | Breaks build |
| :warning: | Breaks compatibility with app |
## [latest](/) - 2023/12/06
## [latest](/) - 2023/12/07
### Fixed
* standard\_plugin build ([this PR on the SDK](https://github.com/LedgerHQ/ledger-secure-sdk/pull/473) had broken it)
* Broken variant auto-setting in the standard\_plugin Makefile
* Missing null-check on parameters received by the plugins
### Changed

View File

@@ -53,28 +53,32 @@ static void call_app_ethereum() {
// Function to dispatch calls from the ethereum app.
static void dispatch_call(int message, void *parameters) {
switch (message) {
case ETH_PLUGIN_INIT_CONTRACT:
handle_init_contract(parameters);
break;
case ETH_PLUGIN_PROVIDE_PARAMETER:
handle_provide_parameter(parameters);
break;
case ETH_PLUGIN_FINALIZE:
handle_finalize(parameters);
break;
case ETH_PLUGIN_PROVIDE_INFO:
handle_provide_token(parameters);
break;
case ETH_PLUGIN_QUERY_CONTRACT_ID:
handle_query_contract_id(parameters);
break;
case ETH_PLUGIN_QUERY_CONTRACT_UI:
handle_query_contract_ui(parameters);
break;
default:
PRINTF("Unhandled message %d\n", message);
break;
if (parameters != NULL) {
switch (message) {
case ETH_PLUGIN_INIT_CONTRACT:
handle_init_contract(parameters);
break;
case ETH_PLUGIN_PROVIDE_PARAMETER:
handle_provide_parameter(parameters);
break;
case ETH_PLUGIN_FINALIZE:
handle_finalize(parameters);
break;
case ETH_PLUGIN_PROVIDE_INFO:
handle_provide_token(parameters);
break;
case ETH_PLUGIN_QUERY_CONTRACT_ID:
handle_query_contract_id(parameters);
break;
case ETH_PLUGIN_QUERY_CONTRACT_UI:
handle_query_contract_ui(parameters);
break;
default:
PRINTF("Unhandled message %d\n", message);
break;
}
} else {
PRINTF("Received null parameters\n");
}
}

View File

@@ -48,7 +48,7 @@ CURVE_APP_LOAD_PARAMS = secp256k1
PATH_APP_LOAD_PARAMS ?= "44'/60'"
VARIANT_PARAM = COIN
VARIANTS_VALUES ?= $(NORMAL_NAME)
VARIANT_VALUES ?= $(NORMAL_NAME)
HAVE_APPLICATION_FLAG_LIBRARY = 1