|
|
@ -101,13 +101,9 @@ bool stellar_signingInit(const StellarSignTx *msg) {
|
|
|
|
// Hash: sequence number
|
|
|
|
// Hash: sequence number
|
|
|
|
stellar_hashupdate_uint64(msg->sequence_number);
|
|
|
|
stellar_hashupdate_uint64(msg->sequence_number);
|
|
|
|
|
|
|
|
|
|
|
|
// Timebounds are only present if timebounds_start or timebounds_end is
|
|
|
|
|
|
|
|
// non-zero
|
|
|
|
|
|
|
|
uint8_t has_timebounds =
|
|
|
|
|
|
|
|
(msg->timebounds_start > 0 || msg->timebounds_end > 0);
|
|
|
|
|
|
|
|
// Hash: the "has timebounds?" boolean
|
|
|
|
// Hash: the "has timebounds?" boolean
|
|
|
|
stellar_hashupdate_bool(has_timebounds);
|
|
|
|
stellar_hashupdate_bool(true);
|
|
|
|
if (has_timebounds) {
|
|
|
|
|
|
|
|
// Timebounds are sent as uint32s since that's all we can display, but they
|
|
|
|
// Timebounds are sent as uint32s since that's all we can display, but they
|
|
|
|
// must be hashed as 64-bit values
|
|
|
|
// must be hashed as 64-bit values
|
|
|
|
stellar_hashupdate_uint32(0);
|
|
|
|
stellar_hashupdate_uint32(0);
|
|
|
@ -115,7 +111,6 @@ bool stellar_signingInit(const StellarSignTx *msg) {
|
|
|
|
|
|
|
|
|
|
|
|
stellar_hashupdate_uint32(0);
|
|
|
|
stellar_hashupdate_uint32(0);
|
|
|
|
stellar_hashupdate_uint32(msg->timebounds_end);
|
|
|
|
stellar_hashupdate_uint32(msg->timebounds_end);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Hash: memo
|
|
|
|
// Hash: memo
|
|
|
|
stellar_hashupdate_uint32(msg->memo_type);
|
|
|
|
stellar_hashupdate_uint32(msg->memo_type);
|
|
|
@ -1297,7 +1292,8 @@ void stellar_format_asset(const StellarAsset *asset, char *str_formatted,
|
|
|
|
memzero(str_asset_issuer_trunc, sizeof(str_asset_issuer_trunc));
|
|
|
|
memzero(str_asset_issuer_trunc, sizeof(str_asset_issuer_trunc));
|
|
|
|
|
|
|
|
|
|
|
|
// Validate issuer account for non-native assets
|
|
|
|
// Validate issuer account for non-native assets
|
|
|
|
if (asset->type != StellarAssetType_NATIVE && !stellar_validateAddress(asset->issuer)) {
|
|
|
|
if (asset->type != StellarAssetType_NATIVE &&
|
|
|
|
|
|
|
|
!stellar_validateAddress(asset->issuer)) {
|
|
|
|
stellar_signingAbort(_("Invalid asset issuer"));
|
|
|
|
stellar_signingAbort(_("Invalid asset issuer"));
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1323,7 +1319,8 @@ void stellar_format_asset(const StellarAsset *asset, char *str_formatted,
|
|
|
|
memcpy(str_asset_issuer_trunc, asset->issuer, 5);
|
|
|
|
memcpy(str_asset_issuer_trunc, asset->issuer, 5);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Issuer is read the same way for both types of custom assets
|
|
|
|
// Issuer is read the same way for both types of custom assets
|
|
|
|
if (asset->type == StellarAssetType_ALPHANUM4 || asset->type == StellarAssetType_ALPHANUM12) {
|
|
|
|
if (asset->type == StellarAssetType_ALPHANUM4 ||
|
|
|
|
|
|
|
|
asset->type == StellarAssetType_ALPHANUM12) {
|
|
|
|
strlcat(str_formatted, _(" ("), len);
|
|
|
|
strlcat(str_formatted, _(" ("), len);
|
|
|
|
strlcat(str_formatted, str_asset_issuer_trunc, len);
|
|
|
|
strlcat(str_formatted, str_asset_issuer_trunc, len);
|
|
|
|
strlcat(str_formatted, _(")"), len);
|
|
|
|
strlcat(str_formatted, _(")"), len);
|
|
|
@ -1676,7 +1673,6 @@ void stellar_layoutTransactionSummary(const StellarSignTx *msg) {
|
|
|
|
memzero(str_lines, sizeof(str_lines));
|
|
|
|
memzero(str_lines, sizeof(str_lines));
|
|
|
|
|
|
|
|
|
|
|
|
// Timebound: lower
|
|
|
|
// Timebound: lower
|
|
|
|
if (msg->timebounds_start || msg->timebounds_end) {
|
|
|
|
|
|
|
|
time_t timebound;
|
|
|
|
time_t timebound;
|
|
|
|
char str_timebound[32] = {0};
|
|
|
|
char str_timebound[32] = {0};
|
|
|
|
const struct tm *tm = NULL;
|
|
|
|
const struct tm *tm = NULL;
|
|
|
@ -1703,16 +1699,13 @@ void stellar_layoutTransactionSummary(const StellarSignTx *msg) {
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
strlcpy(str_lines[3], _("[no restriction]"), sizeof(str_lines[3]));
|
|
|
|
strlcpy(str_lines[3], _("[no restriction]"), sizeof(str_lines[3]));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (msg->timebounds_start || msg->timebounds_end) {
|
|
|
|
|
|
|
|
stellar_layoutTransactionDialog(_("Confirm Time Bounds"), str_lines[0],
|
|
|
|
stellar_layoutTransactionDialog(_("Confirm Time Bounds"), str_lines[0],
|
|
|
|
str_lines[1], str_lines[2], str_lines[3]);
|
|
|
|
str_lines[1], str_lines[2], str_lines[3]);
|
|
|
|
if (!protectButton(ButtonRequestType_ButtonRequest_ProtectCall, false)) {
|
|
|
|
if (!protectButton(ButtonRequestType_ButtonRequest_ProtectCall, false)) {
|
|
|
|
stellar_signingAbort(_("User canceled"));
|
|
|
|
stellar_signingAbort(_("User canceled"));
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|