mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-26 16:18:22 +00:00
legacy: use fixed font for showing internal entropy
This commit is contained in:
parent
d9c02bb924
commit
3b1f44945a
@ -23,6 +23,7 @@
|
||||
#include "fsm.h"
|
||||
#include "gettext.h"
|
||||
#include "layout2.h"
|
||||
#include "oled.h"
|
||||
#include "memzero.h"
|
||||
#include "messages.h"
|
||||
#include "messages.pb.h"
|
||||
@ -65,20 +66,36 @@ void reset_init(bool display_random, uint32_t _strength,
|
||||
|
||||
random_buffer(int_entropy, 32);
|
||||
|
||||
char ent_str[4][17];
|
||||
data2hex(int_entropy, 8, ent_str[0]);
|
||||
data2hex(int_entropy + 8, 8, ent_str[1]);
|
||||
data2hex(int_entropy + 16, 8, ent_str[2]);
|
||||
data2hex(int_entropy + 24, 8, ent_str[3]);
|
||||
|
||||
if (display_random) {
|
||||
layoutDialogSwipe(&bmp_icon_info, _("Cancel"), _("Continue"), NULL,
|
||||
_("Internal entropy:"), ent_str[0], ent_str[1],
|
||||
ent_str[2], ent_str[3], NULL);
|
||||
if (!protectButton(ButtonRequestType_ButtonRequest_ResetDevice, false)) {
|
||||
fsm_sendFailure(FailureType_Failure_ActionCancelled, NULL);
|
||||
layoutHome();
|
||||
return;
|
||||
for (int start = 0; start < 2; start++) {
|
||||
char ent_str[4][17];
|
||||
char desc[] = "Internal entropy _/2:";
|
||||
data2hex(int_entropy + start * 16, 4, ent_str[0]);
|
||||
data2hex(int_entropy + start * 16 + 4, 4, ent_str[1]);
|
||||
data2hex(int_entropy + start * 16 + 8, 4, ent_str[2]);
|
||||
data2hex(int_entropy + start * 16 + 12, 4, ent_str[3]);
|
||||
layoutLast = layoutDialogSwipe;
|
||||
layoutSwipe();
|
||||
desc[17] = '1' + start;
|
||||
oledDrawStringCenter(OLED_WIDTH / 2, 0, desc, FONT_STANDARD);
|
||||
oledDrawStringCenter(OLED_WIDTH / 2, 2 + 1 * 9, ent_str[0], FONT_FIXED);
|
||||
oledDrawStringCenter(OLED_WIDTH / 2, 2 + 2 * 9, ent_str[1], FONT_FIXED);
|
||||
oledDrawStringCenter(OLED_WIDTH / 2, 2 + 3 * 9, ent_str[2], FONT_FIXED);
|
||||
oledDrawStringCenter(OLED_WIDTH / 2, 2 + 4 * 9, ent_str[3], FONT_FIXED);
|
||||
oledHLine(OLED_HEIGHT - 13);
|
||||
layoutButtonNo(_("Cancel"));
|
||||
layoutButtonYes(_("Continue"));
|
||||
// 40 is the maximum pixels used for a row
|
||||
oledSCA(2 + 1 * 9, 2 + 1 * 9 + 6, 40);
|
||||
oledSCA(2 + 2 * 9, 2 + 2 * 9 + 6, 40);
|
||||
oledSCA(2 + 3 * 9, 2 + 3 * 9 + 6, 40);
|
||||
oledSCA(2 + 4 * 9, 2 + 4 * 9 + 6, 40);
|
||||
oledRefresh();
|
||||
if (!protectButton(ButtonRequestType_ButtonRequest_ResetDevice, false)) {
|
||||
fsm_sendFailure(FailureType_Failure_ActionCancelled, NULL);
|
||||
layoutHome();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user