1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-26 17:38:39 +00:00

firmware: fix stuff broken in the last commit

This commit is contained in:
Pavol Rusnak 2018-07-10 20:44:30 +02:00
parent c02c1979ed
commit 277a01a24c
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
6 changed files with 59 additions and 48 deletions

View File

@ -23,7 +23,7 @@ messages_%_pb2.py: messages-%.proto
$(Q)protoc -I/usr/include -I. $< --python_out=. $(Q)protoc -I/usr/include -I. $< --python_out=.
messages_map.h: messages_map.py messages_pb2.py messages_map.h: messages_map.py messages_pb2.py
$(Q)$(PYTHON) $< | grep -v -e MessageType_Cardano -e MessageType_Lisk -e MessageType_Tezos > $@ $(Q)$(PYTHON) $< | grep -v -e MessageType_Cardano -e MessageType_Lisk -e MessageType_Tezos -e MessageType_Ripple > $@
clean: clean:
rm -f *.pb *.o *.d *.pb.c *.pb.h *_pb2.py messages_map.h rm -f *.pb *.o *.d *.pb.c *.pb.h *_pb2.py messages_map.h

View File

@ -31,10 +31,12 @@ TxAck.TransactionType.extra_data max_size:1024
TxAck.TransactionType.TxInputType.address_n max_count:8 TxAck.TransactionType.TxInputType.address_n max_count:8
TxAck.TransactionType.TxInputType.prev_hash max_size:32 TxAck.TransactionType.TxInputType.prev_hash max_size:32
TxAck.TransactionType.TxInputType.script_sig max_size:1650 TxAck.TransactionType.TxInputType.script_sig max_size:1650
TxAck.TransactionType.TxInputType.prev_block_hash_bip115 max_size:32
TxAck.TransactionType.TxOutputType.address max_size:130 TxAck.TransactionType.TxOutputType.address max_size:130
TxAck.TransactionType.TxOutputType.address_n max_count:8 TxAck.TransactionType.TxOutputType.address_n max_count:8
TxAck.TransactionType.TxOutputType.op_return_data max_size:80 TxAck.TransactionType.TxOutputType.op_return_data max_size:80
TxAck.TransactionType.TxOutputType.block_hash_bip115 max_size:32
TxAck.TransactionType.TxOutputBinType.script_pubkey max_size:520 TxAck.TransactionType.TxOutputBinType.script_pubkey max_size:520

View File

@ -8,29 +8,46 @@ StellarGetPublicKey.address_n max_count:10
StellarPublicKey.public_key max_size:32 StellarPublicKey.public_key max_size:32
StellarSignTx.source_account max_size:57
StellarSignTx.address_n max_count:10 StellarSignTx.address_n max_count:10
StellarSignTx.network_passphrase max_size:1024 StellarSignTx.network_passphrase max_size:1024
StellarSignTx.memo_text max_size:29 StellarSignTx.memo_text max_size:29
StellarSignTx.memo_hash max_size:32 StellarSignTx.memo_hash max_size:32
StellarPaymentOp.source_account max_size:57
StellarPaymentOp.destination_account max_size:57 StellarPaymentOp.destination_account max_size:57
StellarCreateAccountOp.source_account max_size:57
StellarCreateAccountOp.new_account max_size:57 StellarCreateAccountOp.new_account max_size:57
StellarPathPaymentOp.source_account max_size:57
StellarPathPaymentOp.destination_account max_size:57 StellarPathPaymentOp.destination_account max_size:57
StellarPathPaymentOp.paths max_count:5 StellarPathPaymentOp.paths max_count:5
StellarManageOfferOp.source_account max_size:57
StellarCreatePassiveOfferOp.source_account max_size:57
StellarSetOptionsOp.source_account max_size:57
StellarSetOptionsOp.inflation_destination_account max_size:57 StellarSetOptionsOp.inflation_destination_account max_size:57
StellarSetOptionsOp.home_domain max_size:33 StellarSetOptionsOp.home_domain max_size:33
StellarSetOptionsOp.signer_key max_size:32 StellarSetOptionsOp.signer_key max_size:32
StellarChangeTrustOp.source_account max_size:57
StellarAllowTrustOp.source_account max_size:57
StellarAllowTrustOp.trusted_account max_size:57 StellarAllowTrustOp.trusted_account max_size:57
StellarAllowTrustOp.asset_code max_size:13 StellarAllowTrustOp.asset_code max_size:13
StellarAccountMergeOp.source_account max_size:57
StellarAccountMergeOp.destination_account max_size:57 StellarAccountMergeOp.destination_account max_size:57
StellarManageDataOp.source_account max_size:57
StellarManageDataOp.key max_size:65 StellarManageDataOp.key max_size:65
StellarManageDataOp.value max_size:65 StellarManageDataOp.value max_size:65
StellarBumpSequenceOp.source_account max_size:57
StellarSignedTx.public_key max_size:32 StellarSignedTx.public_key max_size:32
StellarSignedTx.signature max_size:64 # ed25519 signatures are 64 bytes, this does not include the hint StellarSignedTx.signature max_size:64 # ed25519 signatures are 64 bytes, this does not include the hint

View File

@ -174,7 +174,7 @@ bool stellar_confirmSourceAccount(bool has_source_account, char *str_account)
str_addr_rows[1], str_addr_rows[1],
str_addr_rows[2] str_addr_rows[2]
); );
if (!protectButton(ButtonRequestType_ButtonRequest_ProtectCall, false)) { if (!protectButton(ButtonRequest_ButtonRequestType_ButtonRequest_ProtectCall, false)) {
stellar_signingAbort(_("User canceled")); stellar_signingAbort(_("User canceled"));
return false; return false;
} }
@ -1199,13 +1199,11 @@ void stellar_signingAbort(const char *reason)
*/ */
void stellar_fillSignedTx(StellarSignedTx *resp) void stellar_fillSignedTx(StellarSignedTx *resp)
{ {
StellarTransaction *activeTx = stellar_getActiveTx();
// Finalize the transaction by hashing 4 null bytes representing a (currently unused) empty union // Finalize the transaction by hashing 4 null bytes representing a (currently unused) empty union
stellar_hashupdate_uint32(0); stellar_hashupdate_uint32(0);
// Add the public key for verification that the right account was used for signing // Add the public key for verification that the right account was used for signing
memcpy(resp->public_key.bytes, &(activeTx->signing_pubkey), 32); memcpy(resp->public_key.bytes, stellar_activeTx.signing_pubkey, 32);
resp->public_key.size = 32; resp->public_key.size = 32;
resp->has_public_key = true; resp->has_public_key = true;
@ -1218,16 +1216,11 @@ void stellar_fillSignedTx(StellarSignedTx *resp)
resp->has_signature = true; resp->has_signature = true;
} }
uint8_t stellar_allOperationsConfirmed() bool stellar_allOperationsConfirmed()
{ {
return stellar_activeTx.confirmed_operations == stellar_activeTx.num_operations; return stellar_activeTx.confirmed_operations == stellar_activeTx.num_operations;
} }
StellarTransaction *stellar_getActiveTx()
{
return &stellar_activeTx;
}
/* /*
* Calculates and sets the signature for the active transaction * Calculates and sets the signature for the active transaction
*/ */

View File

@ -85,9 +85,8 @@ void stellar_hashupdate_address(uint8_t *address_bytes);
void stellar_hashupdate_asset(StellarAssetType *asset); void stellar_hashupdate_asset(StellarAssetType *asset);
void stellar_hashupdate_bytes(uint8_t *data, size_t len); void stellar_hashupdate_bytes(uint8_t *data, size_t len);
StellarTransaction *stellar_getActiveTx(void);
void stellar_fillSignedTx(StellarSignedTx *resp); void stellar_fillSignedTx(StellarSignedTx *resp);
uint8_t stellar_allOperationsConfirmed(void); bool stellar_allOperationsConfirmed(void);
void stellar_getSignatureForActiveTx(uint8_t *out_signature); void stellar_getSignatureForActiveTx(uint8_t *out_signature);
void stellar_format_uint32(uint32_t number, char *out, size_t outlen); void stellar_format_uint32(uint32_t number, char *out, size_t outlen);

@ -1 +1 @@
Subproject commit 51eeb0ed5fedf1506eb607036e9f16ef43dd8580 Subproject commit 32850a62624ce1a6612ff545beb706560c3716da