mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-11 07:50:57 +00:00
Merge branch 'master' into matejcik/storage-relocation
This commit is contained in:
commit
75622d92d2
@ -186,7 +186,6 @@ legacy fw regular build:
|
|||||||
script:
|
script:
|
||||||
- cd legacy
|
- cd legacy
|
||||||
- pipenv run script/cibuild
|
- pipenv run script/cibuild
|
||||||
- pipenv run make -C bootloader
|
|
||||||
- pipenv run make -C demo
|
- pipenv run make -C demo
|
||||||
- cd ..
|
- cd ..
|
||||||
- export VERSION=$(./tools/version.sh legacy/firmware/version.h)
|
- export VERSION=$(./tools/version.sh legacy/firmware/version.h)
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
Version 2.x.x [not yet released]
|
Version 2.x.x [not yet released]
|
||||||
* SD card protection
|
* SD card protection
|
||||||
* Remove unused ButtonRequest.data field
|
* Remove unused ButtonRequest.data field
|
||||||
|
* Rework Recovery persistence internally
|
||||||
|
|
||||||
Version 2.1.8 [Nov 2019]
|
Version 2.1.8 [Nov 2019]
|
||||||
* Support Tezos 005-BABYLON hardfork
|
* Support Tezos 005-BABYLON hardfork
|
||||||
|
@ -56,8 +56,7 @@ STATIC mp_obj_t mod_trezorcrypto_nem_compute_address(mp_obj_t public_key,
|
|||||||
mp_raise_ValueError(
|
mp_raise_ValueError(
|
||||||
"Failed to compute a NEM address from provided public key");
|
"Failed to compute a NEM address from provided public key");
|
||||||
}
|
}
|
||||||
return mp_obj_new_str_of_type(&mp_type_str, (const uint8_t *)address,
|
return mp_obj_new_str(address, strlen(address));
|
||||||
strlen(address));
|
|
||||||
}
|
}
|
||||||
STATIC MP_DEFINE_CONST_FUN_OBJ_2(mod_trezorcrypto_nem_compute_address_obj,
|
STATIC MP_DEFINE_CONST_FUN_OBJ_2(mod_trezorcrypto_nem_compute_address_obj,
|
||||||
mod_trezorcrypto_nem_compute_address);
|
mod_trezorcrypto_nem_compute_address);
|
||||||
|
@ -145,9 +145,9 @@ async def _finish_recovery(
|
|||||||
storage.device.set_slip39_identifier(identifier)
|
storage.device.set_slip39_identifier(identifier)
|
||||||
storage.device.set_slip39_iteration_exponent(exponent)
|
storage.device.set_slip39_iteration_exponent(exponent)
|
||||||
|
|
||||||
await show_success(ctx, ("You have successfully", "recovered your wallet."))
|
|
||||||
|
|
||||||
storage.recovery.end_progress()
|
storage.recovery.end_progress()
|
||||||
|
|
||||||
|
await show_success(ctx, ("You have successfully", "recovered your wallet."))
|
||||||
return Success(message="Device recovered")
|
return Success(message="Device recovered")
|
||||||
|
|
||||||
|
|
||||||
|
@ -4,6 +4,13 @@ OBJS += bootloader.o
|
|||||||
OBJS += signatures.o
|
OBJS += signatures.o
|
||||||
OBJS += usb.o
|
OBJS += usb.o
|
||||||
|
|
||||||
|
# overrides from libtrezor
|
||||||
|
CFLAGS += -DFONT_SKIP_FIXED=1
|
||||||
|
OBJS += ../gen/fonts.small.o
|
||||||
|
|
||||||
|
# overrides from trezor-crypto
|
||||||
|
CFLAGS += -DUSE_PRECOMPUTED_IV=0
|
||||||
|
CFLAGS += -DUSE_PRECOMPUTED_CP=0
|
||||||
OBJS += ../vendor/trezor-crypto/bignum.small.o
|
OBJS += ../vendor/trezor-crypto/bignum.small.o
|
||||||
OBJS += ../vendor/trezor-crypto/ecdsa.small.o
|
OBJS += ../vendor/trezor-crypto/ecdsa.small.o
|
||||||
OBJS += ../vendor/trezor-crypto/secp256k1.small.o
|
OBJS += ../vendor/trezor-crypto/secp256k1.small.o
|
||||||
@ -11,9 +18,6 @@ OBJS += ../vendor/trezor-crypto/sha2.small.o
|
|||||||
OBJS += ../vendor/trezor-crypto/memzero.small.o
|
OBJS += ../vendor/trezor-crypto/memzero.small.o
|
||||||
OBJS += ../vendor/trezor-crypto/hmac_drbg.small.o
|
OBJS += ../vendor/trezor-crypto/hmac_drbg.small.o
|
||||||
|
|
||||||
CFLAGS += -DUSE_PRECOMPUTED_IV=0
|
|
||||||
CFLAGS += -DUSE_PRECOMPUTED_CP=0
|
|
||||||
|
|
||||||
OPTFLAGS ?= -Os
|
OPTFLAGS ?= -Os
|
||||||
|
|
||||||
include ../Makefile.include
|
include ../Makefile.include
|
||||||
|
@ -57,6 +57,11 @@ void show_halt(const char *line1, const char *line2) {
|
|||||||
shutdown();
|
shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void show_unplug(const char *line1, const char *line2) {
|
||||||
|
layoutDialog(&bmp_icon_ok, NULL, NULL, NULL, line1, line2, NULL,
|
||||||
|
"You may now", "unplug your Trezor.", NULL);
|
||||||
|
}
|
||||||
|
|
||||||
static void show_unofficial_warning(const uint8_t *hash) {
|
static void show_unofficial_warning(const uint8_t *hash) {
|
||||||
layoutDialog(&bmp_icon_warning, "Abort", "I'll take the risk", NULL,
|
layoutDialog(&bmp_icon_warning, "Abort", "I'll take the risk", NULL,
|
||||||
"WARNING!", NULL, "Unofficial firmware", "detected.", NULL,
|
"WARNING!", NULL, "Unofficial firmware", "detected.", NULL,
|
||||||
@ -136,10 +141,7 @@ int main(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (SIG_OK != check_firmware_hashes(hdr)) {
|
if (SIG_OK != check_firmware_hashes(hdr)) {
|
||||||
layoutDialog(&bmp_icon_error, NULL, NULL, NULL, "Broken firmware",
|
show_halt("Broken firmware", "detected.");
|
||||||
"detected.", NULL, "Unplug your Trezor,",
|
|
||||||
"reinstall firmware.", NULL);
|
|
||||||
shutdown();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mpu_config_off();
|
mpu_config_off();
|
||||||
|
@ -25,14 +25,11 @@
|
|||||||
#define STR(X) #X
|
#define STR(X) #X
|
||||||
#define VERSTR(X) STR(X)
|
#define VERSTR(X) STR(X)
|
||||||
|
|
||||||
#define VERSION_MAJOR_CHAR "\x01"
|
|
||||||
#define VERSION_MINOR_CHAR "\x08"
|
|
||||||
#define VERSION_PATCH_CHAR "\x00"
|
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
void show_halt(const char *line1, const char *line2);
|
void show_halt(const char *line1, const char *line2);
|
||||||
|
void show_unplug(const char *line1, const char *line2);
|
||||||
void layoutFirmwareFingerprint(const uint8_t *hash);
|
void layoutFirmwareFingerprint(const uint8_t *hash);
|
||||||
bool get_button_response(void);
|
bool get_button_response(void);
|
||||||
|
|
||||||
|
@ -42,7 +42,6 @@
|
|||||||
#include "winusb.h"
|
#include "winusb.h"
|
||||||
|
|
||||||
#include "usb_desc.h"
|
#include "usb_desc.h"
|
||||||
#include "usb_erase.h"
|
|
||||||
#include "usb_send.h"
|
#include "usb_send.h"
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
@ -61,6 +60,19 @@ static char flash_state = STATE_READY;
|
|||||||
static uint32_t FW_HEADER[FLASH_FWHEADER_LEN / sizeof(uint32_t)];
|
static uint32_t FW_HEADER[FLASH_FWHEADER_LEN / sizeof(uint32_t)];
|
||||||
static uint32_t FW_CHUNK[FW_CHUNK_SIZE / sizeof(uint32_t)];
|
static uint32_t FW_CHUNK[FW_CHUNK_SIZE / sizeof(uint32_t)];
|
||||||
|
|
||||||
|
static void flash_enter(void) {
|
||||||
|
flash_wait_for_last_operation();
|
||||||
|
flash_clear_status_flags();
|
||||||
|
flash_unlock();
|
||||||
|
}
|
||||||
|
|
||||||
|
static void flash_exit(void) {
|
||||||
|
flash_wait_for_last_operation();
|
||||||
|
flash_lock();
|
||||||
|
}
|
||||||
|
|
||||||
|
#include "usb_erase.h"
|
||||||
|
|
||||||
static void check_and_write_chunk(void) {
|
static void check_and_write_chunk(void) {
|
||||||
uint32_t offset = (chunk_idx == 0) ? FLASH_FWHEADER_LEN : 0;
|
uint32_t offset = (chunk_idx == 0) ? FLASH_FWHEADER_LEN : 0;
|
||||||
uint32_t chunk_pos = flash_pos % FW_CHUNK_SIZE;
|
uint32_t chunk_pos = flash_pos % FW_CHUNK_SIZE;
|
||||||
@ -89,17 +101,14 @@ static void check_and_write_chunk(void) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
flash_wait_for_last_operation();
|
flash_enter();
|
||||||
flash_clear_status_flags();
|
|
||||||
flash_unlock();
|
|
||||||
for (uint32_t i = offset / sizeof(uint32_t); i < chunk_pos / sizeof(uint32_t);
|
for (uint32_t i = offset / sizeof(uint32_t); i < chunk_pos / sizeof(uint32_t);
|
||||||
i++) {
|
i++) {
|
||||||
flash_program_word(
|
flash_program_word(
|
||||||
FLASH_FWHEADER_START + chunk_idx * FW_CHUNK_SIZE + i * sizeof(uint32_t),
|
FLASH_FWHEADER_START + chunk_idx * FW_CHUNK_SIZE + i * sizeof(uint32_t),
|
||||||
FW_CHUNK[i]);
|
FW_CHUNK[i]);
|
||||||
}
|
}
|
||||||
flash_wait_for_last_operation();
|
flash_exit();
|
||||||
flash_lock();
|
|
||||||
|
|
||||||
// all done
|
// all done
|
||||||
if (flash_len == flash_pos) {
|
if (flash_len == flash_pos) {
|
||||||
@ -192,15 +201,11 @@ static void rx_callback(usbd_device *dev, uint8_t ep) {
|
|||||||
if (but) {
|
if (but) {
|
||||||
erase_storage_code_progress();
|
erase_storage_code_progress();
|
||||||
flash_state = STATE_END;
|
flash_state = STATE_END;
|
||||||
layoutDialog(&bmp_icon_ok, NULL, NULL, NULL, "Device",
|
show_unplug("Device", "successfully wiped.");
|
||||||
"successfully wiped.", NULL, "You may now",
|
|
||||||
"unplug your Trezor.", NULL);
|
|
||||||
send_msg_success(dev);
|
send_msg_success(dev);
|
||||||
} else {
|
} else {
|
||||||
flash_state = STATE_END;
|
flash_state = STATE_END;
|
||||||
layoutDialog(&bmp_icon_warning, NULL, NULL, NULL, "Device wipe",
|
show_unplug("Device wipe", "aborted.");
|
||||||
"aborted.", NULL, "You may now", "unplug your Trezor.",
|
|
||||||
NULL);
|
|
||||||
send_msg_failure(dev);
|
send_msg_failure(dev);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -236,9 +241,7 @@ static void rx_callback(usbd_device *dev, uint8_t ep) {
|
|||||||
} else {
|
} else {
|
||||||
send_msg_failure(dev);
|
send_msg_failure(dev);
|
||||||
flash_state = STATE_END;
|
flash_state = STATE_END;
|
||||||
layoutDialog(&bmp_icon_warning, NULL, NULL, NULL,
|
show_unplug("Firmware installation", "aborted.");
|
||||||
"Firmware installation", "aborted.", NULL, "You may now",
|
|
||||||
"unplug your Trezor.", NULL);
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -258,27 +261,27 @@ static void rx_callback(usbd_device *dev, uint8_t ep) {
|
|||||||
if (readprotobufint(&p, &flash_len) != sectrue) { // integer too large
|
if (readprotobufint(&p, &flash_len) != sectrue) { // integer too large
|
||||||
send_msg_failure(dev);
|
send_msg_failure(dev);
|
||||||
flash_state = STATE_END;
|
flash_state = STATE_END;
|
||||||
show_halt("Firmware is too big.", NULL);
|
show_halt("Firmware is", "too big.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (flash_len <= FLASH_FWHEADER_LEN) { // firmware is too small
|
if (flash_len <= FLASH_FWHEADER_LEN) { // firmware is too small
|
||||||
send_msg_failure(dev);
|
send_msg_failure(dev);
|
||||||
flash_state = STATE_END;
|
flash_state = STATE_END;
|
||||||
show_halt("Firmware is too small.", NULL);
|
show_halt("Firmware is", "too small.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (flash_len >
|
if (flash_len >
|
||||||
FLASH_FWHEADER_LEN + FLASH_APP_LEN) { // firmware is too big
|
FLASH_FWHEADER_LEN + FLASH_APP_LEN) { // firmware is too big
|
||||||
send_msg_failure(dev);
|
send_msg_failure(dev);
|
||||||
flash_state = STATE_END;
|
flash_state = STATE_END;
|
||||||
show_halt("Firmware is too big.", NULL);
|
show_halt("Firmware is", "too big.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// check firmware magic
|
// check firmware magic
|
||||||
if (memcmp(p, &FIRMWARE_MAGIC_NEW, 4) != 0) {
|
if (memcmp(p, &FIRMWARE_MAGIC_NEW, 4) != 0) {
|
||||||
send_msg_failure(dev);
|
send_msg_failure(dev);
|
||||||
flash_state = STATE_END;
|
flash_state = STATE_END;
|
||||||
show_halt("Wrong firmware header.", NULL);
|
show_halt("Wrong firmware", "header.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
memzero(FW_HEADER, sizeof(FW_HEADER));
|
memzero(FW_HEADER, sizeof(FW_HEADER));
|
||||||
@ -395,9 +398,8 @@ static void rx_callback(usbd_device *dev, uint8_t ep) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
flash_wait_for_last_operation();
|
|
||||||
flash_clear_status_flags();
|
flash_enter();
|
||||||
flash_unlock();
|
|
||||||
// write firmware header only when hash was confirmed
|
// write firmware header only when hash was confirmed
|
||||||
if (hash_check_ok) {
|
if (hash_check_ok) {
|
||||||
for (size_t i = 0; i < FLASH_FWHEADER_LEN / sizeof(uint32_t); i++) {
|
for (size_t i = 0; i < FLASH_FWHEADER_LEN / sizeof(uint32_t); i++) {
|
||||||
@ -409,14 +411,11 @@ static void rx_callback(usbd_device *dev, uint8_t ep) {
|
|||||||
flash_program_word(FLASH_FWHEADER_START + i * sizeof(uint32_t), 0);
|
flash_program_word(FLASH_FWHEADER_START + i * sizeof(uint32_t), 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
flash_wait_for_last_operation();
|
flash_exit();
|
||||||
flash_lock();
|
|
||||||
|
|
||||||
flash_state = STATE_END;
|
flash_state = STATE_END;
|
||||||
if (hash_check_ok) {
|
if (hash_check_ok) {
|
||||||
layoutDialog(&bmp_icon_ok, NULL, NULL, NULL, "New firmware",
|
show_unplug("New firmware", "successfully installed.");
|
||||||
"successfully installed.", NULL, "You may now",
|
|
||||||
"unplug your Trezor.", NULL);
|
|
||||||
send_msg_success(dev);
|
send_msg_success(dev);
|
||||||
shutdown();
|
shutdown();
|
||||||
} else {
|
} else {
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
static void erase_storage_code_progress(void) {
|
static void erase_storage_code_progress(void) {
|
||||||
flash_wait_for_last_operation();
|
flash_enter();
|
||||||
flash_clear_status_flags();
|
|
||||||
flash_unlock();
|
|
||||||
// erase storage area
|
// erase storage area
|
||||||
for (int i = FLASH_STORAGE_SECTOR_FIRST; i <= FLASH_STORAGE_SECTOR_LAST;
|
for (int i = FLASH_STORAGE_SECTOR_FIRST; i <= FLASH_STORAGE_SECTOR_LAST;
|
||||||
i++) {
|
i++) {
|
||||||
@ -17,14 +15,11 @@ static void erase_storage_code_progress(void) {
|
|||||||
(FLASH_CODE_SECTOR_LAST - FLASH_STORAGE_SECTOR_FIRST));
|
(FLASH_CODE_SECTOR_LAST - FLASH_STORAGE_SECTOR_FIRST));
|
||||||
flash_erase_sector(i, FLASH_CR_PROGRAM_X32);
|
flash_erase_sector(i, FLASH_CR_PROGRAM_X32);
|
||||||
}
|
}
|
||||||
flash_wait_for_last_operation();
|
flash_exit();
|
||||||
flash_lock();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void erase_code_progress(void) {
|
static void erase_code_progress(void) {
|
||||||
flash_wait_for_last_operation();
|
flash_enter();
|
||||||
flash_clear_status_flags();
|
|
||||||
flash_unlock();
|
|
||||||
for (int i = FLASH_CODE_SECTOR_FIRST; i <= FLASH_CODE_SECTOR_LAST; i++) {
|
for (int i = FLASH_CODE_SECTOR_FIRST; i <= FLASH_CODE_SECTOR_LAST; i++) {
|
||||||
layoutProgress("PREPARING ... Please wait",
|
layoutProgress("PREPARING ... Please wait",
|
||||||
1000 * (i - FLASH_CODE_SECTOR_FIRST) /
|
1000 * (i - FLASH_CODE_SECTOR_FIRST) /
|
||||||
@ -32,18 +27,14 @@ static void erase_code_progress(void) {
|
|||||||
flash_erase_sector(i, FLASH_CR_PROGRAM_X32);
|
flash_erase_sector(i, FLASH_CR_PROGRAM_X32);
|
||||||
}
|
}
|
||||||
layoutProgress("INSTALLING ... Please wait", 0);
|
layoutProgress("INSTALLING ... Please wait", 0);
|
||||||
flash_wait_for_last_operation();
|
flash_exit();
|
||||||
flash_lock();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void erase_storage(void) {
|
static void erase_storage(void) {
|
||||||
flash_wait_for_last_operation();
|
flash_enter();
|
||||||
flash_clear_status_flags();
|
|
||||||
flash_unlock();
|
|
||||||
for (int i = FLASH_STORAGE_SECTOR_FIRST; i <= FLASH_STORAGE_SECTOR_LAST;
|
for (int i = FLASH_STORAGE_SECTOR_FIRST; i <= FLASH_STORAGE_SECTOR_LAST;
|
||||||
i++) {
|
i++) {
|
||||||
flash_erase_sector(i, FLASH_CR_PROGRAM_X32);
|
flash_erase_sector(i, FLASH_CR_PROGRAM_X32);
|
||||||
}
|
}
|
||||||
flash_wait_for_last_operation();
|
flash_exit();
|
||||||
flash_lock();
|
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
#define VERSION_MAJOR 1
|
#define VERSION_MAJOR 1
|
||||||
#define VERSION_MINOR 8
|
#define VERSION_MINOR 8
|
||||||
#define VERSION_PATCH 1
|
#define VERSION_PATCH 1
|
||||||
|
|
||||||
|
#define VERSION_MAJOR_CHAR "\x01"
|
||||||
|
#define VERSION_MINOR_CHAR "\x08"
|
||||||
|
#define VERSION_PATCH_CHAR "\x01"
|
||||||
|
@ -339,8 +339,8 @@ static void render_address_dialog(const CoinInfo *coin, const char *address,
|
|||||||
oledHLine(OLED_HEIGHT - 13);
|
oledHLine(OLED_HEIGHT - 13);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
layoutButtonNo(_("Cancel"));
|
layoutButtonNo(_("Cancel"), &bmp_btn_cancel);
|
||||||
layoutButtonYes(_("Confirm"));
|
layoutButtonYes(_("Confirm"), &bmp_btn_confirm);
|
||||||
oledRefresh();
|
oledRefresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -555,7 +555,7 @@ void layoutResetWord(const char *word, int pass, int word_pos, bool last) {
|
|||||||
// 30 is the maximum pixels used for a pixel row in the BIP39 word "abstract"
|
// 30 is the maximum pixels used for a pixel row in the BIP39 word "abstract"
|
||||||
oledSCA(4 * 9 - 3 - 2, 4 * 9 - 3 + 15 + 2, 30);
|
oledSCA(4 * 9 - 3 - 2, 4 * 9 - 3 + 15 + 2, 30);
|
||||||
oledInvert(0, 4 * 9 - 3 - 2, OLED_WIDTH - 1, 4 * 9 - 3 + 15 + 2);
|
oledInvert(0, 4 * 9 - 3 - 2, OLED_WIDTH - 1, 4 * 9 - 3 + 15 + 2);
|
||||||
layoutButtonYes(btnYes);
|
layoutButtonYes(btnYes, &bmp_btn_confirm);
|
||||||
oledRefresh();
|
oledRefresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -634,10 +634,10 @@ void layoutAddress(const char *address, const char *desc, bool qrcode,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!qrcode) {
|
if (!qrcode) {
|
||||||
layoutButtonNo(_("QR Code"));
|
layoutButtonNo(_("QR Code"), NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
layoutButtonYes(_("Continue"));
|
layoutButtonYes(_("Continue"), &bmp_btn_confirm);
|
||||||
oledRefresh();
|
oledRefresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,8 +83,8 @@ void reset_init(bool display_random, uint32_t _strength,
|
|||||||
oledDrawStringCenter(OLED_WIDTH / 2, 2 + 3 * 9, ent_str[2], 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);
|
oledDrawStringCenter(OLED_WIDTH / 2, 2 + 4 * 9, ent_str[3], FONT_FIXED);
|
||||||
oledHLine(OLED_HEIGHT - 13);
|
oledHLine(OLED_HEIGHT - 13);
|
||||||
layoutButtonNo(_("Cancel"));
|
layoutButtonNo(_("Cancel"), &bmp_btn_cancel);
|
||||||
layoutButtonYes(_("Continue"));
|
layoutButtonYes(_("Continue"), &bmp_btn_confirm);
|
||||||
// 40 is the maximum pixels used for a row
|
// 40 is the maximum pixels used for a row
|
||||||
oledSCA(2 + 1 * 9, 2 + 1 * 9 + 6, 40);
|
oledSCA(2 + 1 * 9, 2 + 1 * 9 + 6, 40);
|
||||||
oledSCA(2 + 2 * 9, 2 + 2 * 9 + 6, 40);
|
oledSCA(2 + 2 * 9, 2 + 2 * 9 + 6, 40);
|
||||||
|
@ -1792,13 +1792,7 @@ void stellar_layoutSigningDialog(const char *line1, const char *line2,
|
|||||||
offset_y += line_height;
|
offset_y += line_height;
|
||||||
|
|
||||||
// Cancel button
|
// Cancel button
|
||||||
oledDrawString(1, OLED_HEIGHT - 8, "\x15", FONT_STANDARD);
|
layoutButtonNo("Cancel", &bmp_btn_cancel);
|
||||||
oledDrawString(fontCharWidth(FONT_STANDARD, '\x15') + 3, OLED_HEIGHT - 8,
|
|
||||||
"Cancel", FONT_STANDARD);
|
|
||||||
oledInvert(0, OLED_HEIGHT - 9,
|
|
||||||
fontCharWidth(FONT_STANDARD, '\x15') +
|
|
||||||
oledStringWidth("Cancel", FONT_STANDARD) + 2,
|
|
||||||
OLED_HEIGHT - 1);
|
|
||||||
|
|
||||||
// Warnings (drawn centered between the buttons
|
// Warnings (drawn centered between the buttons
|
||||||
if (warning) {
|
if (warning) {
|
||||||
@ -1814,14 +1808,7 @@ void stellar_layoutSigningDialog(const char *line1, const char *line2,
|
|||||||
strlcpy(str_next_label, _("Next"), sizeof(str_next_label));
|
strlcpy(str_next_label, _("Next"), sizeof(str_next_label));
|
||||||
}
|
}
|
||||||
|
|
||||||
oledDrawString(OLED_WIDTH - fontCharWidth(FONT_STANDARD, '\x06') - 1,
|
layoutButtonYes(str_next_label, &bmp_btn_confirm);
|
||||||
OLED_HEIGHT - 8, "\x06", FONT_STANDARD);
|
|
||||||
oledDrawString(OLED_WIDTH - oledStringWidth(str_next_label, FONT_STANDARD) -
|
|
||||||
fontCharWidth(FONT_STANDARD, '\x06') - 3,
|
|
||||||
OLED_HEIGHT - 8, str_next_label, FONT_STANDARD);
|
|
||||||
oledInvert(OLED_WIDTH - oledStringWidth(str_next_label, FONT_STANDARD) -
|
|
||||||
fontCharWidth(FONT_STANDARD, '\x06') - 4,
|
|
||||||
OLED_HEIGHT - 9, OLED_WIDTH - 1, OLED_HEIGHT - 1);
|
|
||||||
|
|
||||||
oledRefresh();
|
oledRefresh();
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
// clang-format off
|
// clang-format off
|
||||||
#include "bitmaps.h"
|
#include "bitmaps.h"
|
||||||
|
|
||||||
|
const uint8_t bmp_btn_cancel_data[] = { 0x44, 0xee, 0x7c, 0x38, 0x7c, 0xee, 0x44, 0x00, };
|
||||||
|
const uint8_t bmp_btn_confirm_data[] = { 0x02, 0x04, 0x08, 0xd8, 0xf0, 0x60, 0x20, 0x00, };
|
||||||
const uint8_t bmp_digit0_data[] = { 0xff, 0xff, 0xf8, 0x1f, 0xf0, 0x0f, 0xe1, 0x87, 0xe1, 0x87, 0xe1, 0x87, 0xe1, 0x87, 0xe1, 0x87, 0xe1, 0x87, 0xe1, 0x87, 0xe1, 0x87, 0xe1, 0x87, 0xe1, 0x87, 0xf0, 0x0f, 0xf8, 0x1f, 0xff, 0xff, };
|
const uint8_t bmp_digit0_data[] = { 0xff, 0xff, 0xf8, 0x1f, 0xf0, 0x0f, 0xe1, 0x87, 0xe1, 0x87, 0xe1, 0x87, 0xe1, 0x87, 0xe1, 0x87, 0xe1, 0x87, 0xe1, 0x87, 0xe1, 0x87, 0xe1, 0x87, 0xe1, 0x87, 0xf0, 0x0f, 0xf8, 0x1f, 0xff, 0xff, };
|
||||||
const uint8_t bmp_digit1_data[] = { 0xff, 0xff, 0xfc, 0x3f, 0xf8, 0x3f, 0xf0, 0x3f, 0xf0, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xff, 0xff, };
|
const uint8_t bmp_digit1_data[] = { 0xff, 0xff, 0xfc, 0x3f, 0xf8, 0x3f, 0xf0, 0x3f, 0xf0, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xff, 0xff, };
|
||||||
const uint8_t bmp_digit2_data[] = { 0xff, 0xff, 0xe0, 0x1f, 0xe0, 0x0f, 0xff, 0x87, 0xff, 0x87, 0xff, 0x87, 0xff, 0x87, 0xf8, 0x0f, 0xf0, 0x1f, 0xe1, 0xff, 0xe1, 0xff, 0xe1, 0xff, 0xe1, 0xff, 0xe0, 0x07, 0xe0, 0x07, 0xff, 0xff, };
|
const uint8_t bmp_digit2_data[] = { 0xff, 0xff, 0xe0, 0x1f, 0xe0, 0x0f, 0xff, 0x87, 0xff, 0x87, 0xff, 0x87, 0xff, 0x87, 0xf8, 0x0f, 0xf0, 0x1f, 0xe1, 0xff, 0xe1, 0xff, 0xe1, 0xff, 0xe1, 0xff, 0xe0, 0x07, 0xe0, 0x07, 0xff, 0xff, };
|
||||||
@ -26,6 +28,8 @@ const uint8_t bmp_logo64_data[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x
|
|||||||
const uint8_t bmp_logo64_empty_data[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x70, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x04, 0x00, 0x00, 0x20, 0x00, 0x00, 0x08, 0x00, 0x00, 0x10, 0x00, 0x00, 0x08, 0x07, 0xe0, 0x10, 0x00, 0x00, 0x10, 0x08, 0x10, 0x08, 0x00, 0x00, 0x20, 0x10, 0x08, 0x04, 0x00, 0x00, 0x20, 0x20, 0x04, 0x04, 0x00, 0x00, 0x20, 0x40, 0x02, 0x04, 0x00, 0x00, 0x40, 0x80, 0x01, 0x02, 0x00, 0x00, 0x40, 0x80, 0x01, 0x02, 0x00, 0x00, 0x40, 0x80, 0x01, 0x02, 0x00, 0x00, 0x40, 0x80, 0x01, 0x02, 0x00, 0x00, 0x40, 0x80, 0x01, 0x02, 0x00, 0x00, 0x40, 0x80, 0x01, 0x02, 0x00, 0x00, 0x40, 0x80, 0x01, 0x02, 0x00, 0x00, 0x40, 0x80, 0x01, 0x02, 0x00, 0x1f, 0xc0, 0xff, 0xff, 0x03, 0xf8, 0x10, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x3f, 0xff, 0xff, 0xfc, 0x08, 0x10, 0x20, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x04, 0x08, 0x10, 0x18, 0x00, 0x00, 0x18, 0x08, 0x10, 0x06, 0x00, 0x00, 0x60, 0x08, 0x10, 0x01, 0x80, 0x01, 0x80, 0x08, 0x10, 0x00, 0x60, 0x06, 0x00, 0x08, 0x18, 0x00, 0x18, 0x18, 0x00, 0x18, 0x06, 0x00, 0x06, 0x60, 0x00, 0x60, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x00, 0x60, 0x00, 0x00, 0x06, 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x00, 0x06, 0x00, 0x00, 0x60, 0x00, 0x00, 0x01, 0x80, 0x01, 0x80, 0x00, 0x00, 0x00, 0x60, 0x06, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x06, 0x60, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, };
|
const uint8_t bmp_logo64_empty_data[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x70, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x04, 0x00, 0x00, 0x20, 0x00, 0x00, 0x08, 0x00, 0x00, 0x10, 0x00, 0x00, 0x08, 0x07, 0xe0, 0x10, 0x00, 0x00, 0x10, 0x08, 0x10, 0x08, 0x00, 0x00, 0x20, 0x10, 0x08, 0x04, 0x00, 0x00, 0x20, 0x20, 0x04, 0x04, 0x00, 0x00, 0x20, 0x40, 0x02, 0x04, 0x00, 0x00, 0x40, 0x80, 0x01, 0x02, 0x00, 0x00, 0x40, 0x80, 0x01, 0x02, 0x00, 0x00, 0x40, 0x80, 0x01, 0x02, 0x00, 0x00, 0x40, 0x80, 0x01, 0x02, 0x00, 0x00, 0x40, 0x80, 0x01, 0x02, 0x00, 0x00, 0x40, 0x80, 0x01, 0x02, 0x00, 0x00, 0x40, 0x80, 0x01, 0x02, 0x00, 0x00, 0x40, 0x80, 0x01, 0x02, 0x00, 0x1f, 0xc0, 0xff, 0xff, 0x03, 0xf8, 0x10, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x3f, 0xff, 0xff, 0xfc, 0x08, 0x10, 0x20, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x04, 0x08, 0x10, 0x18, 0x00, 0x00, 0x18, 0x08, 0x10, 0x06, 0x00, 0x00, 0x60, 0x08, 0x10, 0x01, 0x80, 0x01, 0x80, 0x08, 0x10, 0x00, 0x60, 0x06, 0x00, 0x08, 0x18, 0x00, 0x18, 0x18, 0x00, 0x18, 0x06, 0x00, 0x06, 0x60, 0x00, 0x60, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x00, 0x60, 0x00, 0x00, 0x06, 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x00, 0x06, 0x00, 0x00, 0x60, 0x00, 0x00, 0x01, 0x80, 0x01, 0x80, 0x00, 0x00, 0x00, 0x60, 0x06, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x06, 0x60, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, };
|
||||||
const uint8_t bmp_webauthn_data[] = { 0x00, 0x00, 0x1f, 0x80, 0x00, 0x00, 0x7f, 0xe0, 0x00, 0x01, 0xff, 0xf8, 0x00, 0x03, 0xfe, 0x1c, 0x00, 0x03, 0xfc, 0x0c, 0x00, 0x07, 0xf8, 0x06, 0x00, 0x07, 0xf8, 0x06, 0x00, 0x0f, 0xf8, 0x06, 0x00, 0x0f, 0xf8, 0x07, 0x00, 0x0f, 0xfc, 0x0f, 0x00, 0x0f, 0xfe, 0x1f, 0x00, 0x0f, 0xff, 0xff, 0x00, 0x0f, 0xff, 0xff, 0x00, 0x07, 0xff, 0xfe, 0x00, 0x0f, 0xff, 0xfe, 0x00, 0x1f, 0xff, 0xfc, 0x00, 0x3f, 0xff, 0xfc, 0x00, 0x7f, 0xff, 0xf8, 0x00, 0xff, 0xff, 0xe0, 0x01, 0xff, 0xdf, 0x80, 0x03, 0xff, 0x80, 0x00, 0x07, 0xff, 0x00, 0x00, 0x0f, 0xfe, 0x00, 0x00, 0x1f, 0xfc, 0x00, 0x00, 0x3f, 0xf8, 0x00, 0x00, 0x7f, 0x80, 0x00, 0x00, 0xff, 0x80, 0x00, 0x00, 0xff, 0x80, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, };
|
const uint8_t bmp_webauthn_data[] = { 0x00, 0x00, 0x1f, 0x80, 0x00, 0x00, 0x7f, 0xe0, 0x00, 0x01, 0xff, 0xf8, 0x00, 0x03, 0xfe, 0x1c, 0x00, 0x03, 0xfc, 0x0c, 0x00, 0x07, 0xf8, 0x06, 0x00, 0x07, 0xf8, 0x06, 0x00, 0x0f, 0xf8, 0x06, 0x00, 0x0f, 0xf8, 0x07, 0x00, 0x0f, 0xfc, 0x0f, 0x00, 0x0f, 0xfe, 0x1f, 0x00, 0x0f, 0xff, 0xff, 0x00, 0x0f, 0xff, 0xff, 0x00, 0x07, 0xff, 0xfe, 0x00, 0x0f, 0xff, 0xfe, 0x00, 0x1f, 0xff, 0xfc, 0x00, 0x3f, 0xff, 0xfc, 0x00, 0x7f, 0xff, 0xf8, 0x00, 0xff, 0xff, 0xe0, 0x01, 0xff, 0xdf, 0x80, 0x03, 0xff, 0x80, 0x00, 0x07, 0xff, 0x00, 0x00, 0x0f, 0xfe, 0x00, 0x00, 0x1f, 0xfc, 0x00, 0x00, 0x3f, 0xf8, 0x00, 0x00, 0x7f, 0x80, 0x00, 0x00, 0xff, 0x80, 0x00, 0x00, 0xff, 0x80, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, };
|
||||||
|
|
||||||
|
const BITMAP bmp_btn_cancel = {8, 8, bmp_btn_cancel_data};
|
||||||
|
const BITMAP bmp_btn_confirm = {8, 8, bmp_btn_confirm_data};
|
||||||
const BITMAP bmp_digit0 = {16, 16, bmp_digit0_data};
|
const BITMAP bmp_digit0 = {16, 16, bmp_digit0_data};
|
||||||
const BITMAP bmp_digit1 = {16, 16, bmp_digit1_data};
|
const BITMAP bmp_digit1 = {16, 16, bmp_digit1_data};
|
||||||
const BITMAP bmp_digit2 = {16, 16, bmp_digit2_data};
|
const BITMAP bmp_digit2 = {16, 16, bmp_digit2_data};
|
||||||
|
@ -8,6 +8,8 @@ typedef struct {
|
|||||||
const uint8_t *data;
|
const uint8_t *data;
|
||||||
} BITMAP;
|
} BITMAP;
|
||||||
|
|
||||||
|
extern const BITMAP bmp_btn_cancel;
|
||||||
|
extern const BITMAP bmp_btn_confirm;
|
||||||
extern const BITMAP bmp_digit0;
|
extern const BITMAP bmp_digit0;
|
||||||
extern const BITMAP bmp_digit1;
|
extern const BITMAP bmp_digit1;
|
||||||
extern const BITMAP bmp_digit2;
|
extern const BITMAP bmp_digit2;
|
||||||
|
BIN
legacy/gen/bitmaps/btn_cancel.png
Normal file
BIN
legacy/gen/bitmaps/btn_cancel.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 877 B |
BIN
legacy/gen/bitmaps/btn_confirm.png
Normal file
BIN
legacy/gen/bitmaps/btn_confirm.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 844 B |
@ -1,35 +1,3 @@
|
|||||||
/* 0x00 _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x01 _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x02 _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x03 _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x04 _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x05 _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x06 _ */ (uint8_t *)"\x07\x18\x1c\x0e\x18\x30\x40\x80",
|
|
||||||
/* 0x07 _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x08 _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x09 _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x0a _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x0b _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x0c _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x0d _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x0e _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x0f _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x10 _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x11 _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x12 _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x13 _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x14 _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x15 _ */ (uint8_t *)"\x07\x44\xee\x7c\x38\x7c\xee\x44",
|
|
||||||
/* 0x16 _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x17 _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x18 _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x19 _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x1a _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x1b _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x1c _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x1d _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x1e _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x1f _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x20 */ (uint8_t *)"\x01\x00",
|
/* 0x20 */ (uint8_t *)"\x01\x00",
|
||||||
/* 0x21 ! */ (uint8_t *)"\x02\xfa\xfa",
|
/* 0x21 ! */ (uint8_t *)"\x02\xfa\xfa",
|
||||||
/* 0x22 " */ (uint8_t *)"\x03\xc0\x00\xc0",
|
/* 0x22 " */ (uint8_t *)"\x03\xc0\x00\xc0",
|
||||||
|
@ -1,35 +1,3 @@
|
|||||||
/* 0x00 _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x01 _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x02 _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x03 _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x04 _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x05 _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x06 _ */ (uint8_t *)"\x07\x18\x1c\x0e\x18\x30\x40\x80",
|
|
||||||
/* 0x07 _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x08 _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x09 _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x0a _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x0b _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x0c _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x0d _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x0e _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x0f _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x10 _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x11 _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x12 _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x13 _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x14 _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x15 _ */ (uint8_t *)"\x07\x44\xee\x7c\x38\x7c\xee\x44",
|
|
||||||
/* 0x16 _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x17 _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x18 _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x19 _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x1a _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x1b _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x1c _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x1d _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x1e _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x1f _ */ (uint8_t *)"\x01\x00",
|
|
||||||
/* 0x20 */ (uint8_t *)"\x01\x00",
|
/* 0x20 */ (uint8_t *)"\x01\x00",
|
||||||
/* 0x21 ! */ (uint8_t *)"\x03\x60\xfa\x60",
|
/* 0x21 ! */ (uint8_t *)"\x03\x60\xfa\x60",
|
||||||
/* 0x22 " */ (uint8_t *)"\x05\x00\xe0\x00\xe0\x00",
|
/* 0x22 " */ (uint8_t *)"\x05\x00\xe0\x00\xe0\x00",
|
||||||
|
@ -1,16 +1,21 @@
|
|||||||
#include "fonts.h"
|
#include "fonts.h"
|
||||||
|
|
||||||
const uint8_t *const font_data[2][128] = {
|
const uint8_t *const font_data[FONTS][128 - 32] = {
|
||||||
{
|
{
|
||||||
#include "font.inc"
|
#include "font.inc"
|
||||||
},
|
},
|
||||||
|
#ifndef FONT_SKIP_FIXED
|
||||||
{
|
{
|
||||||
#include "fontfixed.inc"
|
#include "fontfixed.inc"
|
||||||
},
|
},
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
int fontCharWidth(int font, uint8_t c) { return font_data[font][c & 0x7f][0]; }
|
int fontCharWidth(uint8_t font, uint8_t c) {
|
||||||
|
return (c < 0x20 || c >= 0x80) ? 0 : font_data[font % FONTS][c - 32][0];
|
||||||
const uint8_t *fontCharData(int font, uint8_t c) {
|
}
|
||||||
return font_data[font][c & 0x7f] + 1;
|
|
||||||
|
const uint8_t *fontCharData(uint8_t font, uint8_t c) {
|
||||||
|
return (c < 0x20 || c >= 0x80) ? (const uint8_t *)""
|
||||||
|
: font_data[font % FONTS][c - 32] + 1;
|
||||||
}
|
}
|
||||||
|
@ -5,12 +5,19 @@
|
|||||||
|
|
||||||
#define FONT_HEIGHT 8
|
#define FONT_HEIGHT 8
|
||||||
#define FONT_STANDARD 0
|
#define FONT_STANDARD 0
|
||||||
|
|
||||||
|
#ifndef FONT_SKIP_FIXED
|
||||||
#define FONT_FIXED 1
|
#define FONT_FIXED 1
|
||||||
|
#define FONTS 2
|
||||||
|
#else
|
||||||
|
#define FONTS 1
|
||||||
|
#endif
|
||||||
|
|
||||||
#define FONT_DOUBLE 0x80
|
#define FONT_DOUBLE 0x80
|
||||||
|
|
||||||
extern const uint8_t *const font_data[2][128];
|
extern const uint8_t *const font_data[FONTS][128 - 32];
|
||||||
|
|
||||||
int fontCharWidth(int font, uint8_t c);
|
int fontCharWidth(uint8_t font, uint8_t c);
|
||||||
const uint8_t *fontCharData(int font, uint8_t c);
|
const uint8_t *fontCharData(uint8_t font, uint8_t c);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 11 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 9.3 KiB |
@ -23,7 +23,7 @@ def convert(imgfile, outfile):
|
|||||||
img = Img(imgfile)
|
img = Img(imgfile)
|
||||||
cur = ""
|
cur = ""
|
||||||
with open(outfile, "w") as f:
|
with open(outfile, "w") as f:
|
||||||
for i in range(128):
|
for i in range(128 - 32):
|
||||||
x = (i % 16) * 10
|
x = (i % 16) * 10
|
||||||
y = (i // 16) * 10
|
y = (i // 16) * 10
|
||||||
cur = ""
|
cur = ""
|
||||||
@ -32,7 +32,8 @@ def convert(imgfile, outfile):
|
|||||||
x += 1
|
x += 1
|
||||||
cur += "\\x%02x" % int(val, 2)
|
cur += "\\x%02x" % int(val, 2)
|
||||||
cur = "\\x%02x" % (len(cur) // 4) + cur
|
cur = "\\x%02x" % (len(cur) // 4) + cur
|
||||||
ch = chr(i) if i >= 32 and i <= 126 else "_"
|
i += 32
|
||||||
|
ch = "_" if (i == 127) else chr(i)
|
||||||
f.write('\t/* 0x%02x %c */ (uint8_t *)"%s",\n' % (i, ch, cur))
|
f.write('\t/* 0x%02x %c */ (uint8_t *)"%s",\n' % (i, ch, cur))
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,24 +22,29 @@
|
|||||||
#include "layout.h"
|
#include "layout.h"
|
||||||
#include "oled.h"
|
#include "oled.h"
|
||||||
|
|
||||||
void layoutButtonNo(const char *btnNo) {
|
void layoutButtonNo(const char *btnNo, const BITMAP *icon) {
|
||||||
oledDrawString(1, OLED_HEIGHT - 8, "\x15", FONT_STANDARD);
|
int icon_width = 0;
|
||||||
oledDrawString(fontCharWidth(FONT_STANDARD, '\x15') + 3, OLED_HEIGHT - 8,
|
if (icon) {
|
||||||
btnNo, FONT_STANDARD);
|
oledDrawBitmap(1, OLED_HEIGHT - 8, icon);
|
||||||
|
icon_width = icon->width;
|
||||||
|
}
|
||||||
|
oledDrawString(8 + 3, OLED_HEIGHT - icon_width, btnNo, FONT_STANDARD);
|
||||||
oledInvert(0, OLED_HEIGHT - 9,
|
oledInvert(0, OLED_HEIGHT - 9,
|
||||||
fontCharWidth(FONT_STANDARD, '\x15') +
|
icon_width + oledStringWidth(btnNo, FONT_STANDARD) + 2,
|
||||||
oledStringWidth(btnNo, FONT_STANDARD) + 2,
|
|
||||||
OLED_HEIGHT - 1);
|
OLED_HEIGHT - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void layoutButtonYes(const char *btnYes) {
|
void layoutButtonYes(const char *btnYes, const BITMAP *icon) {
|
||||||
oledDrawString(OLED_WIDTH - fontCharWidth(FONT_STANDARD, '\x06') - 1,
|
int icon_width = 0;
|
||||||
OLED_HEIGHT - 8, "\x06", FONT_STANDARD);
|
if (icon) {
|
||||||
oledDrawStringRight(OLED_WIDTH - fontCharWidth(FONT_STANDARD, '\x06') - 3,
|
oledDrawBitmap(OLED_WIDTH - 8 - 1, OLED_HEIGHT - 8, icon);
|
||||||
OLED_HEIGHT - 8, btnYes, FONT_STANDARD);
|
icon_width = icon->width;
|
||||||
oledInvert(OLED_WIDTH - oledStringWidth(btnYes, FONT_STANDARD) -
|
}
|
||||||
fontCharWidth(FONT_STANDARD, '\x06') - 4,
|
oledDrawStringRight(OLED_WIDTH - icon_width - 3, OLED_HEIGHT - 8, btnYes,
|
||||||
OLED_HEIGHT - 9, OLED_WIDTH - 1, OLED_HEIGHT - 1);
|
FONT_STANDARD);
|
||||||
|
oledInvert(
|
||||||
|
OLED_WIDTH - oledStringWidth(btnYes, FONT_STANDARD) - icon_width - 4,
|
||||||
|
OLED_HEIGHT - 9, OLED_WIDTH - 1, OLED_HEIGHT - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void layoutDialog(const BITMAP *icon, const char *btnNo, const char *btnYes,
|
void layoutDialog(const BITMAP *icon, const char *btnNo, const char *btnYes,
|
||||||
@ -70,10 +75,10 @@ void layoutDialog(const BITMAP *icon, const char *btnNo, const char *btnYes,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (btnNo) {
|
if (btnNo) {
|
||||||
layoutButtonNo(btnNo);
|
layoutButtonNo(btnNo, &bmp_btn_cancel);
|
||||||
}
|
}
|
||||||
if (btnYes) {
|
if (btnYes) {
|
||||||
layoutButtonYes(btnYes);
|
layoutButtonYes(btnYes, &bmp_btn_confirm);
|
||||||
}
|
}
|
||||||
oledRefresh();
|
oledRefresh();
|
||||||
}
|
}
|
||||||
|
@ -24,8 +24,8 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "bitmaps.h"
|
#include "bitmaps.h"
|
||||||
|
|
||||||
void layoutButtonNo(const char *btnNo);
|
void layoutButtonNo(const char *btnNo, const BITMAP *icon);
|
||||||
void layoutButtonYes(const char *btnYes);
|
void layoutButtonYes(const char *btnYes, const BITMAP *icon);
|
||||||
void layoutDialog(const BITMAP *icon, const char *btnNo, const char *btnYes,
|
void layoutDialog(const BITMAP *icon, const char *btnNo, const char *btnYes,
|
||||||
const char *desc, const char *line1, const char *line2,
|
const char *desc, const char *line1, const char *line2,
|
||||||
const char *line3, const char *line4, const char *line5,
|
const char *line3, const char *line4, const char *line5,
|
||||||
|
@ -241,7 +241,7 @@ void oledSetBuffer(uint8_t *buf) {
|
|||||||
memcpy(_oledbuffer, buf, sizeof(_oledbuffer));
|
memcpy(_oledbuffer, buf, sizeof(_oledbuffer));
|
||||||
}
|
}
|
||||||
|
|
||||||
void oledDrawChar(int x, int y, char c, int font) {
|
void oledDrawChar(int x, int y, char c, uint8_t font) {
|
||||||
if (x >= OLED_WIDTH || y >= OLED_HEIGHT || y <= -FONT_HEIGHT) {
|
if (x >= OLED_WIDTH || y >= OLED_HEIGHT || y <= -FONT_HEIGHT) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -304,7 +304,7 @@ static uint8_t convert_char(const char a) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int oledStringWidth(const char *text, int font) {
|
int oledStringWidth(const char *text, uint8_t font) {
|
||||||
if (!text) return 0;
|
if (!text) return 0;
|
||||||
int space = (font & FONT_DOUBLE) ? 2 : 1;
|
int space = (font & FONT_DOUBLE) ? 2 : 1;
|
||||||
int l = 0;
|
int l = 0;
|
||||||
@ -317,7 +317,7 @@ int oledStringWidth(const char *text, int font) {
|
|||||||
return l;
|
return l;
|
||||||
}
|
}
|
||||||
|
|
||||||
void oledDrawString(int x, int y, const char *text, int font) {
|
void oledDrawString(int x, int y, const char *text, uint8_t font) {
|
||||||
if (!text) return;
|
if (!text) return;
|
||||||
int l = 0;
|
int l = 0;
|
||||||
int space = (font & FONT_DOUBLE) ? 2 : 1;
|
int space = (font & FONT_DOUBLE) ? 2 : 1;
|
||||||
@ -330,12 +330,12 @@ void oledDrawString(int x, int y, const char *text, int font) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void oledDrawStringCenter(int x, int y, const char *text, int font) {
|
void oledDrawStringCenter(int x, int y, const char *text, uint8_t font) {
|
||||||
x = x - oledStringWidth(text, font) / 2;
|
x = x - oledStringWidth(text, font) / 2;
|
||||||
oledDrawString(x, y, text, font);
|
oledDrawString(x, y, text, font);
|
||||||
}
|
}
|
||||||
|
|
||||||
void oledDrawStringRight(int x, int y, const char *text, int font) {
|
void oledDrawStringRight(int x, int y, const char *text, uint8_t font) {
|
||||||
x -= oledStringWidth(text, font);
|
x -= oledStringWidth(text, font);
|
||||||
oledDrawString(x, y, text, font);
|
oledDrawString(x, y, text, font);
|
||||||
}
|
}
|
||||||
|
@ -43,12 +43,11 @@ bool oledGetPixel(int x, int y);
|
|||||||
void oledDrawPixel(int x, int y);
|
void oledDrawPixel(int x, int y);
|
||||||
void oledClearPixel(int x, int y);
|
void oledClearPixel(int x, int y);
|
||||||
void oledInvertPixel(int x, int y);
|
void oledInvertPixel(int x, int y);
|
||||||
void oledDrawChar(int x, int y, char c, int zoom);
|
void oledDrawChar(int x, int y, char c, uint8_t font);
|
||||||
int oledStringWidth(const char *text, int font);
|
int oledStringWidth(const char *text, uint8_t font);
|
||||||
|
void oledDrawString(int x, int y, const char *text, uint8_t font);
|
||||||
void oledDrawString(int x, int y, const char *text, int font);
|
void oledDrawStringCenter(int x, int y, const char *text, uint8_t font);
|
||||||
void oledDrawStringCenter(int x, int y, const char *text, int font);
|
void oledDrawStringRight(int x, int y, const char *text, uint8_t font);
|
||||||
void oledDrawStringRight(int x, int y, const char *text, int font);
|
|
||||||
void oledDrawBitmap(int x, int y, const BITMAP *bmp);
|
void oledDrawBitmap(int x, int y, const BITMAP *bmp);
|
||||||
void oledInvert(int x1, int y1, int x2, int y2);
|
void oledInvert(int x1, int y1, int x2, int y2);
|
||||||
void oledBox(int x1, int y1, int x2, int y2, bool set);
|
void oledBox(int x1, int y1, int x2, int y2, bool set);
|
||||||
|
@ -144,7 +144,7 @@ def parse_sell_ram(data):
|
|||||||
|
|
||||||
def parse_delegate(data):
|
def parse_delegate(data):
|
||||||
return messages.EosActionDelegate(
|
return messages.EosActionDelegate(
|
||||||
sender=name_to_number(data["sender"]),
|
sender=name_to_number(data["from"]),
|
||||||
receiver=name_to_number(data["receiver"]),
|
receiver=name_to_number(data["receiver"]),
|
||||||
net_quantity=parse_asset(data["stake_net_quantity"]),
|
net_quantity=parse_asset(data["stake_net_quantity"]),
|
||||||
cpu_quantity=parse_asset(data["stake_cpu_quantity"]),
|
cpu_quantity=parse_asset(data["stake_cpu_quantity"]),
|
||||||
@ -154,7 +154,7 @@ def parse_delegate(data):
|
|||||||
|
|
||||||
def parse_undelegate(data):
|
def parse_undelegate(data):
|
||||||
return messages.EosActionUndelegate(
|
return messages.EosActionUndelegate(
|
||||||
sender=name_to_number(data["sender"]),
|
sender=name_to_number(data["from"]),
|
||||||
receiver=name_to_number(data["receiver"]),
|
receiver=name_to_number(data["receiver"]),
|
||||||
net_quantity=parse_asset(data["unstake_net_quantity"]),
|
net_quantity=parse_asset(data["unstake_net_quantity"]),
|
||||||
cpu_quantity=parse_asset(data["unstake_cpu_quantity"]),
|
cpu_quantity=parse_asset(data["unstake_cpu_quantity"]),
|
||||||
|
5
tests/fido_tests/libfido2/.gitignore
vendored
Normal file
5
tests/fido_tests/libfido2/.gitignore
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
assert_param
|
||||||
|
cred
|
||||||
|
cred_param
|
||||||
|
hmac_assert
|
||||||
|
pubkey
|
22
tests/fido_tests/libfido2/cred-assert.sh
Executable file
22
tests/fido_tests/libfido2/cred-assert.sh
Executable file
@ -0,0 +1,22 @@
|
|||||||
|
DEVICE=$(fido2-token -L | cut -d : -f 1)
|
||||||
|
|
||||||
|
if [ -z "$DEVICE" ] ; then
|
||||||
|
echo "No FIDO2 token found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# taken from fido2-cred manpage
|
||||||
|
|
||||||
|
echo credential challenge | openssl sha256 -binary | base64 > cred_param
|
||||||
|
echo relying party >> cred_param
|
||||||
|
echo user name >> cred_param
|
||||||
|
dd if=/dev/urandom bs=1 count=32 | base64 >> cred_param
|
||||||
|
fido2-cred -M -i cred_param "$DEVICE" | fido2-cred -V -o cred
|
||||||
|
|
||||||
|
# taken from fido2-assert manpage
|
||||||
|
|
||||||
|
echo assertion challenge | openssl sha256 -binary | base64 > assert_param
|
||||||
|
echo relying party >> assert_param
|
||||||
|
head -1 cred >> assert_param
|
||||||
|
tail -n +2 cred > pubkey
|
||||||
|
fido2-assert -G -i assert_param "$DEVICE" | fido2-assert -V pubkey es256
|
25
tests/fido_tests/libfido2/hmac-secret.sh
Executable file
25
tests/fido_tests/libfido2/hmac-secret.sh
Executable file
@ -0,0 +1,25 @@
|
|||||||
|
DEVICE=$(fido2-token -L | cut -d : -f 1)
|
||||||
|
|
||||||
|
if [ -z "$DEVICE" ] ; then
|
||||||
|
echo "No FIDO2 token found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# taken from https://github.com/Yubico/libfido2/issues/58
|
||||||
|
|
||||||
|
echo credential challenge | openssl sha256 -binary | base64 > cred_param
|
||||||
|
echo relying party >> cred_param
|
||||||
|
echo user name >> cred_param
|
||||||
|
dd if=/dev/urandom bs=1 count=32 | base64 >> cred_param
|
||||||
|
fido2-cred -M -h -i cred_param "$DEVICE" | fido2-cred -V -h -o cred
|
||||||
|
|
||||||
|
# taken from https://github.com/Yubico/libfido2/issues/58
|
||||||
|
|
||||||
|
echo assertion challenge | openssl sha256 -binary | base64 > assert_param
|
||||||
|
echo relying party >> assert_param
|
||||||
|
head -1 cred >> assert_param
|
||||||
|
tail -n +2 cred > pubkey
|
||||||
|
dd if=/dev/urandom bs=1 count=64 | base64 -w0 >> assert_param # hmac salt
|
||||||
|
fido2-assert -G -h -i assert_param "$DEVICE" > hmac_assert
|
||||||
|
fido2-assert -V -h -i hmac_assert pubkey es256
|
||||||
|
tail -1 hmac_assert | base64 -d | xxd # hmac secret
|
Loading…
Reference in New Issue
Block a user