diff --git a/jadepy/jade.py b/jadepy/jade.py index 4b5af40f..bf0ba70a 100644 --- a/jadepy/jade.py +++ b/jadepy/jade.py @@ -1220,28 +1220,18 @@ def sign_identity(self, identity, curve, challenge, index=0): params = {'identity': identity, 'curve': curve, 'index': index, 'challenge': challenge} return self._jadeRpc('sign_identity', params) - def get_master_blinding_key(self, only_if_silent=False): + def get_master_blinding_key(self): """ RPC call to fetch the master (SLIP-077) blinding key for the hw signer. - May block temporarily to request the user's permission to export. Passing 'only_if_silent' - causes the call to return the 'denied' error if it would normally ask the user. NOTE: the master blinding key of any registered multisig wallets can be obtained from the result of `get_registered_multisigs()`. - Parameters - ---------- - only_if_silent : boolean, optional - If True Jade will return the denied error if it would normally ask the user's permission - to export the master blinding key. Passing False (or letting default) may block while - asking the user to confirm the export on Jade. - Returns ------- 32-bytes SLIP-077 master blinding key """ - params = {'only_if_silent': only_if_silent} - return self._jadeRpc('get_master_blinding_key', params) + return self._jadeRpc('get_master_blinding_key') def get_blinding_key(self, script, multisig_name=None): """ diff --git a/main/process/get_master_blinding_key.c b/main/process/get_master_blinding_key.c index ae279340..da0fbe08 100644 --- a/main/process/get_master_blinding_key.c +++ b/main/process/get_master_blinding_key.c @@ -14,14 +14,18 @@ void get_master_blinding_key_process(void* process_ptr) // We expect a current message to be present ASSERT_CURRENT_MESSAGE(process, "get_master_blinding_key"); ASSERT_KEYCHAIN_UNLOCKED_BY_MESSAGE_SOURCE(process); - GET_MSG_PARAMS(process); // Ask the user if necessary if (keychain_get_confirm_export_blinding_key()) { // Optional field to suppress asking user for permission and instead // error in the cases where we would normally need to ask the user. bool onlyIfSilent = false; - rpc_get_boolean("only_if_silent", ¶ms, &onlyIfSilent); + + CborValue params; + const CborError cberr = cbor_value_map_find_value(&process->ctx.value, CBOR_RPC_TAG_PARAMS, ¶ms); + if (cberr == CborNoError || cbor_value_is_valid(¶ms) || cbor_value_is_map(¶ms)) { + rpc_get_boolean("only_if_silent", ¶ms, &onlyIfSilent); + } const char* question[] = { "Export master", "blinding key?" }; if (onlyIfSilent || !await_yesno_activity("Blinding Key", question, 2, true, "blkstrm.com/blindingkey")) {