1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 23:48:12 +00:00

fix confirm layouts in multisig operation

This commit is contained in:
Pavol Rusnak 2014-12-20 02:36:28 +01:00
parent cce9d783a6
commit 0d427f2cd2
4 changed files with 13 additions and 2 deletions

View File

@ -25,6 +25,7 @@
#include "aes.h"
#include "hmac.h"
#include "bip32.h"
#include "layout2.h"
uint32_t ser_length(uint32_t len, uint8_t *out)
{
@ -264,7 +265,7 @@ uint8_t *cryptoHDNodePathToPubkey(const HDNodePathType *hdnodepath)
for (i = 0; i < hdnodepath->address_n_count; i++) {
if (hdnode_public_ckd(&node, hdnodepath->address_n[i]) == 0) {
return 0;
};
}
}
return node.public_key;
}

View File

@ -323,6 +323,7 @@ void signing_txack(TransactionType *tx)
case STAGE_REQUEST_3_OUTPUT:
layoutProgress("Signing", 1000 * progress / progress_total, progress); progress++;
co = compile_output(coin, root, tx->outputs, &bin_output, idx1i == 0);
layoutProgress("Signing", 1000 * progress / progress_total, progress); progress++;
if (co < 0) {
fsm_sendFailure(FailureType_Failure_Other, "Signing cancelled by user");
signing_abort();
@ -392,6 +393,11 @@ void signing_txack(TransactionType *tx)
memcpy(input.multisig.signatures[pubkey_idx].bytes, resp.serialized.signature.bytes, resp.serialized.signature.size);
input.multisig.signatures[pubkey_idx].size = resp.serialized.signature.size;
input.script_sig.size = serialize_script_multisig(&(input.multisig), input.script_sig.bytes);
if (input.script_sig.size == 0) {
fsm_sendFailure(FailureType_Failure_Other, "Failed to serialize multisig script");
signing_abort();
return;
}
} else { // SPENDADDRESS
input.script_sig.size = serialize_script_sig(resp.serialized.signature.bytes, resp.serialized.signature.size, pubkey, 33, input.script_sig.bytes);
}
@ -422,6 +428,7 @@ void signing_txack(TransactionType *tx)
signing_abort();
return;
}
layoutProgress("Signing", 1000 * progress / progress_total, progress); progress++;
send_req_4_output();
}
}

View File

@ -209,6 +209,9 @@ uint32_t serialize_script_multisig(const MultisigRedeemScriptType *multisig, uin
out[r] = 0x01; r++;
}
uint32_t script_len = compile_script_multisig(multisig, 0);
if (script_len == 0) {
return 0;
}
r += op_push(script_len, out + r);
r += compile_script_multisig(multisig, out + r);
return r;

@ -1 +1 @@
Subproject commit 10a92c3c6276d5b1955331b7a33ebe9d6a32c37e
Subproject commit c6ca89a8507bd9310c0c92c180525989629fb7d4