mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-25 17:09:44 +00:00
legacy: correctly handle set/clear flags
This commit is contained in:
parent
31494dad6c
commit
6a9d986e20
@ -607,6 +607,10 @@ bool stellar_confirmSetOptionsOp(const StellarSetOptionsOp *msg) {
|
||||
strlcpy(str_title, _("Clear Flag(s)"), sizeof(str_title));
|
||||
|
||||
// Auth required
|
||||
if (msg->clear_flags > 7) {
|
||||
stellar_signingAbort(_("Invalid flags"));
|
||||
return false;
|
||||
}
|
||||
if (msg->clear_flags & 0x01) {
|
||||
strlcpy(rows[row_idx], _("AUTH_REQUIRED"), sizeof(rows[row_idx]));
|
||||
row_idx++;
|
||||
@ -616,6 +620,11 @@ bool stellar_confirmSetOptionsOp(const StellarSetOptionsOp *msg) {
|
||||
strlcpy(rows[row_idx], _("AUTH_REVOCABLE"), sizeof(rows[row_idx]));
|
||||
row_idx++;
|
||||
}
|
||||
// Auth immutable
|
||||
if (msg->clear_flags & 0x04) {
|
||||
strlcpy(rows[row_idx], _("AUTH_IMMUTABLE"), sizeof(rows[row_idx]));
|
||||
row_idx++;
|
||||
}
|
||||
|
||||
stellar_layoutTransactionDialog(str_title, rows[0], rows[1], rows[2],
|
||||
rows[3]);
|
||||
@ -636,6 +645,10 @@ bool stellar_confirmSetOptionsOp(const StellarSetOptionsOp *msg) {
|
||||
strlcpy(str_title, _("Set Flag(s)"), sizeof(str_title));
|
||||
|
||||
// Auth required
|
||||
if (msg->set_flags > 7) {
|
||||
stellar_signingAbort(_("Invalid flags"));
|
||||
return false;
|
||||
}
|
||||
if (msg->set_flags & 0x01) {
|
||||
strlcpy(rows[row_idx], _("AUTH_REQUIRED"), sizeof(rows[row_idx]));
|
||||
row_idx++;
|
||||
@ -645,6 +658,11 @@ bool stellar_confirmSetOptionsOp(const StellarSetOptionsOp *msg) {
|
||||
strlcpy(rows[row_idx], _("AUTH_REVOCABLE"), sizeof(rows[row_idx]));
|
||||
row_idx++;
|
||||
}
|
||||
// Auth immutable
|
||||
if (msg->set_flags & 0x04) {
|
||||
strlcpy(rows[row_idx], _("AUTH_IMMUTABLE"), sizeof(rows[row_idx]));
|
||||
row_idx++;
|
||||
}
|
||||
|
||||
stellar_layoutTransactionDialog(str_title, rows[0], rows[1], rows[2],
|
||||
rows[3]);
|
||||
|
Loading…
Reference in New Issue
Block a user