Fix signature generation for SET_EXTERNAL_PLUGIN in client
This commit is contained in:
@@ -222,7 +222,7 @@ class EthAppClient:
|
||||
tmp = self._cmd_builder.set_external_plugin(plugin_name, contract_address, method_selelector, bytes())
|
||||
|
||||
# skip APDU header & empty sig
|
||||
sig = sign_data(Key.SET_PLUGIN, tmp[5:-1])
|
||||
sig = sign_data(Key.CAL, tmp[5:])
|
||||
return self._send(self._cmd_builder.set_external_plugin(plugin_name, contract_address, method_selelector, sig))
|
||||
|
||||
def personal_sign(self, path: str, msg: bytes):
|
||||
|
||||
@@ -48,7 +48,9 @@ void handleSetExternalPlugin(uint8_t p1,
|
||||
workBuffer + payload_size,
|
||||
dataLength - payload_size)) {
|
||||
#ifndef HAVE_BYPASS_SIGNATURES
|
||||
PRINTF("Invalid plugin signature %.*H\n", payload_size, workBuffer);
|
||||
PRINTF("Invalid plugin signature %.*H\n",
|
||||
dataLength - payload_size,
|
||||
workBuffer + payload_size);
|
||||
THROW(0x6A80);
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user