1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-26 09:28:13 +00:00

fix whitespace

This commit is contained in:
Pavol Rusnak 2019-02-19 18:01:10 +01:00
parent a00c7f9720
commit 44bb5864d4
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
6 changed files with 241 additions and 241 deletions

View File

@ -24,56 +24,56 @@
#include "messages-management.pb.h" #include "messages-management.pb.h"
#define STORAGE_FIELD(TYPE, NAME) \ #define STORAGE_FIELD(TYPE, NAME) \
bool has_##NAME; \ bool has_##NAME; \
TYPE NAME; TYPE NAME;
#define STORAGE_STRING(NAME, SIZE) \ #define STORAGE_STRING(NAME, SIZE) \
bool has_##NAME; \ bool has_##NAME; \
char NAME[SIZE]; char NAME[SIZE];
#define STORAGE_BYTES(NAME, SIZE) \ #define STORAGE_BYTES(NAME, SIZE) \
bool has_##NAME; \ bool has_##NAME; \
struct { \ struct { \
uint32_t size; \ uint32_t size; \
uint8_t bytes[SIZE]; \ uint8_t bytes[SIZE]; \
} NAME; } NAME;
#define STORAGE_BOOL(NAME) STORAGE_FIELD(bool, NAME) #define STORAGE_BOOL(NAME) STORAGE_FIELD(bool, NAME)
#define STORAGE_NODE(NAME) STORAGE_FIELD(StorageHDNode, NAME) #define STORAGE_NODE(NAME) STORAGE_FIELD(StorageHDNode, NAME)
#define STORAGE_UINT32(NAME) STORAGE_FIELD(uint32_t, NAME) #define STORAGE_UINT32(NAME) STORAGE_FIELD(uint32_t, NAME)
typedef struct { typedef struct {
uint32_t depth; uint32_t depth;
uint32_t fingerprint; uint32_t fingerprint;
uint32_t child_num; uint32_t child_num;
struct { struct {
uint32_t size; uint32_t size;
uint8_t bytes[32]; uint8_t bytes[32];
} chain_code; } chain_code;
STORAGE_BYTES(private_key, 32); STORAGE_BYTES(private_key, 32);
STORAGE_BYTES(public_key, 33); STORAGE_BYTES(public_key, 33);
} StorageHDNode; } StorageHDNode;
typedef struct _Storage { typedef struct _Storage {
uint32_t version; uint32_t version;
STORAGE_NODE (node) STORAGE_NODE (node)
STORAGE_STRING (mnemonic, 241) STORAGE_STRING (mnemonic, 241)
STORAGE_BOOL (passphrase_protection) STORAGE_BOOL (passphrase_protection)
STORAGE_UINT32 (pin_failed_attempts) STORAGE_UINT32 (pin_failed_attempts)
STORAGE_STRING (pin, 10) STORAGE_STRING (pin, 10)
STORAGE_STRING (language, 17) STORAGE_STRING (language, 17)
STORAGE_STRING (label, 33) STORAGE_STRING (label, 33)
STORAGE_BOOL (imported) STORAGE_BOOL (imported)
STORAGE_BYTES (homescreen, 1024) STORAGE_BYTES (homescreen, 1024)
STORAGE_UINT32 (u2f_counter) STORAGE_UINT32 (u2f_counter)
STORAGE_BOOL (needs_backup) STORAGE_BOOL (needs_backup)
STORAGE_UINT32 (flags) STORAGE_UINT32 (flags)
STORAGE_NODE (u2froot) STORAGE_NODE (u2froot)
STORAGE_BOOL (unfinished_backup) STORAGE_BOOL (unfinished_backup)
STORAGE_UINT32 (auto_lock_delay_ms) STORAGE_UINT32 (auto_lock_delay_ms)
STORAGE_BOOL (no_backup) STORAGE_BOOL (no_backup)
} Storage; } Storage;
extern Storage configUpdate; extern Storage configUpdate;

View File

@ -10,10 +10,10 @@
#define TOKENS_COUNT ${len(erc20_list)} #define TOKENS_COUNT ${len(erc20_list)}
typedef struct { typedef struct {
uint32_t chain_id; uint32_t chain_id;
const char * const address; const char * const address;
const char * const ticker; const char * const ticker;
int decimals; int decimals;
} TokenType; } TokenType;
extern const TokenType tokens[TOKENS_COUNT]; extern const TokenType tokens[TOKENS_COUNT];

View File

@ -55,7 +55,7 @@ void fsm_msgGetFeatures(const GetFeatures *msg)
resp->has_bootloader_hash = true; resp->bootloader_hash.size = memory_bootloader_hash(resp->bootloader_hash.bytes); resp->has_bootloader_hash = true; resp->bootloader_hash.size = memory_bootloader_hash(resp->bootloader_hash.bytes);
resp->has_language = config_getLanguage(resp->language, sizeof(resp->language)); resp->has_language = config_getLanguage(resp->language, sizeof(resp->language));
resp->has_label = config_getLabel(resp->label, sizeof(resp->label)); resp->has_label = config_getLabel(resp->label, sizeof(resp->label));
resp->has_initialized = true; resp->initialized = config_isInitialized(); resp->has_initialized = true; resp->initialized = config_isInitialized();
resp->has_imported = config_getImported(&(resp->imported)); resp->has_imported = config_getImported(&(resp->imported));
resp->has_pin_cached = true; resp->pin_cached = session_isUnlocked() && config_hasPin(); resp->has_pin_cached = true; resp->pin_cached = session_isUnlocked() && config_hasPin();
@ -124,13 +124,13 @@ void fsm_msgChangePin(const ChangePin *msg)
return; return;
} }
if (protectChangePin(removal)) { if (protectChangePin(removal)) {
if (removal) { if (removal) {
fsm_sendSuccess(_("PIN removed")); fsm_sendSuccess(_("PIN removed"));
} else { } else {
fsm_sendSuccess(_("PIN changed")); fsm_sendSuccess(_("PIN changed"));
} }
} }
layoutHome(); layoutHome();
} }
@ -174,7 +174,7 @@ void fsm_msgGetEntropy(const GetEntropy *msg)
void fsm_msgLoadDevice(const LoadDevice *msg) void fsm_msgLoadDevice(const LoadDevice *msg)
{ {
CHECK_PIN CHECK_PIN
CHECK_NOT_INITIALIZED CHECK_NOT_INITIALIZED
@ -200,7 +200,7 @@ void fsm_msgLoadDevice(const LoadDevice *msg)
void fsm_msgResetDevice(const ResetDevice *msg) void fsm_msgResetDevice(const ResetDevice *msg)
{ {
CHECK_PIN CHECK_PIN
CHECK_NOT_INITIALIZED CHECK_NOT_INITIALIZED
@ -235,11 +235,11 @@ void fsm_msgBackupDevice(const BackupDevice *msg)
CHECK_PIN_UNCACHED CHECK_PIN_UNCACHED
(void)msg; (void)msg;
char mnemonic[MAX_MNEMONIC_LEN + 1]; char mnemonic[MAX_MNEMONIC_LEN + 1];
if (config_getMnemonic(mnemonic, sizeof(mnemonic))) { if (config_getMnemonic(mnemonic, sizeof(mnemonic))) {
reset_backup(true, mnemonic); reset_backup(true, mnemonic);
} }
memzero(mnemonic, sizeof(mnemonic)); memzero(mnemonic, sizeof(mnemonic));
} }
void fsm_msgCancel(const Cancel *msg) void fsm_msgCancel(const Cancel *msg)
@ -329,7 +329,7 @@ void fsm_msgApplySettings(const ApplySettings *msg)
void fsm_msgApplyFlags(const ApplyFlags *msg) void fsm_msgApplyFlags(const ApplyFlags *msg)
{ {
CHECK_PIN CHECK_PIN
if (msg->has_flags) { if (msg->has_flags) {
config_applyFlags(msg->flags); config_applyFlags(msg->flags);

View File

@ -19,269 +19,269 @@
void fsm_msgStellarGetAddress(const StellarGetAddress *msg) void fsm_msgStellarGetAddress(const StellarGetAddress *msg)
{ {
RESP_INIT(StellarAddress); RESP_INIT(StellarAddress);
CHECK_INITIALIZED CHECK_INITIALIZED
CHECK_PIN CHECK_PIN
const HDNode *node = stellar_deriveNode(msg->address_n, msg->address_n_count); const HDNode *node = stellar_deriveNode(msg->address_n, msg->address_n_count);
if (!node) { if (!node) {
fsm_sendFailure(FailureType_Failure_ProcessError, _("Failed to derive private key")); fsm_sendFailure(FailureType_Failure_ProcessError, _("Failed to derive private key"));
return; return;
} }
if (msg->has_show_display && msg->show_display) { if (msg->has_show_display && msg->show_display) {
const char **str_addr_rows = stellar_lineBreakAddress(node->public_key + 1); const char **str_addr_rows = stellar_lineBreakAddress(node->public_key + 1);
layoutDialogSwipe(&bmp_icon_question, _("Cancel"), _("Confirm"), _("Share public account ID?"), layoutDialogSwipe(&bmp_icon_question, _("Cancel"), _("Confirm"), _("Share public account ID?"),
str_addr_rows[0], str_addr_rows[0],
str_addr_rows[1], str_addr_rows[1],
str_addr_rows[2], str_addr_rows[2],
NULL, NULL,
NULL, NULL NULL, NULL
); );
if (!protectButton(ButtonRequestType_ButtonRequest_ProtectCall, false)) { if (!protectButton(ButtonRequestType_ButtonRequest_ProtectCall, false)) {
fsm_sendFailure(FailureType_Failure_ActionCancelled, NULL); fsm_sendFailure(FailureType_Failure_ActionCancelled, NULL);
layoutHome(); layoutHome();
return; return;
} }
} }
resp->has_address = true; resp->has_address = true;
stellar_publicAddressAsStr(node->public_key + 1, resp->address, sizeof(resp->address)); stellar_publicAddressAsStr(node->public_key + 1, resp->address, sizeof(resp->address));
msg_write(MessageType_MessageType_StellarAddress, resp); msg_write(MessageType_MessageType_StellarAddress, resp);
layoutHome(); layoutHome();
} }
void fsm_msgStellarSignTx(const StellarSignTx *msg) void fsm_msgStellarSignTx(const StellarSignTx *msg)
{ {
CHECK_INITIALIZED CHECK_INITIALIZED
CHECK_PIN CHECK_PIN
if (!stellar_signingInit(msg)) { if (!stellar_signingInit(msg)) {
fsm_sendFailure(FailureType_Failure_ProcessError, _("Failed to derive private key")); fsm_sendFailure(FailureType_Failure_ProcessError, _("Failed to derive private key"));
layoutHome(); layoutHome();
return; return;
} }
// Confirm transaction basics // Confirm transaction basics
stellar_layoutTransactionSummary(msg); stellar_layoutTransactionSummary(msg);
// Respond with a request for the first operation // Respond with a request for the first operation
RESP_INIT(StellarTxOpRequest); RESP_INIT(StellarTxOpRequest);
msg_write(MessageType_MessageType_StellarTxOpRequest, resp); msg_write(MessageType_MessageType_StellarTxOpRequest, resp);
} }
void fsm_msgStellarCreateAccountOp(const StellarCreateAccountOp *msg) void fsm_msgStellarCreateAccountOp(const StellarCreateAccountOp *msg)
{ {
if (!stellar_confirmCreateAccountOp(msg)) return; if (!stellar_confirmCreateAccountOp(msg)) return;
if (stellar_allOperationsConfirmed()) { if (stellar_allOperationsConfirmed()) {
RESP_INIT(StellarSignedTx); RESP_INIT(StellarSignedTx);
stellar_fillSignedTx(resp); stellar_fillSignedTx(resp);
msg_write(MessageType_MessageType_StellarSignedTx, resp); msg_write(MessageType_MessageType_StellarSignedTx, resp);
layoutHome(); layoutHome();
} }
// Request the next operation to sign // Request the next operation to sign
else { else {
RESP_INIT(StellarTxOpRequest); RESP_INIT(StellarTxOpRequest);
msg_write(MessageType_MessageType_StellarTxOpRequest, resp); msg_write(MessageType_MessageType_StellarTxOpRequest, resp);
} }
} }
void fsm_msgStellarPaymentOp(const StellarPaymentOp *msg) void fsm_msgStellarPaymentOp(const StellarPaymentOp *msg)
{ {
// This will display additional dialogs to the user // This will display additional dialogs to the user
if (!stellar_confirmPaymentOp(msg)) return; if (!stellar_confirmPaymentOp(msg)) return;
// Last operation was confirmed, send a StellarSignedTx // Last operation was confirmed, send a StellarSignedTx
if (stellar_allOperationsConfirmed()) { if (stellar_allOperationsConfirmed()) {
RESP_INIT(StellarSignedTx); RESP_INIT(StellarSignedTx);
stellar_fillSignedTx(resp); stellar_fillSignedTx(resp);
msg_write(MessageType_MessageType_StellarSignedTx, resp); msg_write(MessageType_MessageType_StellarSignedTx, resp);
layoutHome(); layoutHome();
} }
// Request the next operation to sign // Request the next operation to sign
else { else {
RESP_INIT(StellarTxOpRequest); RESP_INIT(StellarTxOpRequest);
msg_write(MessageType_MessageType_StellarTxOpRequest, resp); msg_write(MessageType_MessageType_StellarTxOpRequest, resp);
} }
} }
void fsm_msgStellarPathPaymentOp(const StellarPathPaymentOp *msg) void fsm_msgStellarPathPaymentOp(const StellarPathPaymentOp *msg)
{ {
if (!stellar_confirmPathPaymentOp(msg)) return; if (!stellar_confirmPathPaymentOp(msg)) return;
if (stellar_allOperationsConfirmed()) { if (stellar_allOperationsConfirmed()) {
RESP_INIT(StellarSignedTx); RESP_INIT(StellarSignedTx);
stellar_fillSignedTx(resp); stellar_fillSignedTx(resp);
msg_write(MessageType_MessageType_StellarSignedTx, resp); msg_write(MessageType_MessageType_StellarSignedTx, resp);
layoutHome(); layoutHome();
} }
// Request the next operation to sign // Request the next operation to sign
else { else {
RESP_INIT(StellarTxOpRequest); RESP_INIT(StellarTxOpRequest);
msg_write(MessageType_MessageType_StellarTxOpRequest, resp); msg_write(MessageType_MessageType_StellarTxOpRequest, resp);
} }
} }
void fsm_msgStellarManageOfferOp(const StellarManageOfferOp *msg) void fsm_msgStellarManageOfferOp(const StellarManageOfferOp *msg)
{ {
if (!stellar_confirmManageOfferOp(msg)) return; if (!stellar_confirmManageOfferOp(msg)) return;
if (stellar_allOperationsConfirmed()) { if (stellar_allOperationsConfirmed()) {
RESP_INIT(StellarSignedTx); RESP_INIT(StellarSignedTx);
stellar_fillSignedTx(resp); stellar_fillSignedTx(resp);
msg_write(MessageType_MessageType_StellarSignedTx, resp); msg_write(MessageType_MessageType_StellarSignedTx, resp);
layoutHome(); layoutHome();
} }
// Request the next operation to sign // Request the next operation to sign
else { else {
RESP_INIT(StellarTxOpRequest); RESP_INIT(StellarTxOpRequest);
msg_write(MessageType_MessageType_StellarTxOpRequest, resp); msg_write(MessageType_MessageType_StellarTxOpRequest, resp);
} }
} }
void fsm_msgStellarCreatePassiveOfferOp(const StellarCreatePassiveOfferOp *msg) void fsm_msgStellarCreatePassiveOfferOp(const StellarCreatePassiveOfferOp *msg)
{ {
if (!stellar_confirmCreatePassiveOfferOp(msg)) return; if (!stellar_confirmCreatePassiveOfferOp(msg)) return;
if (stellar_allOperationsConfirmed()) { if (stellar_allOperationsConfirmed()) {
RESP_INIT(StellarSignedTx); RESP_INIT(StellarSignedTx);
stellar_fillSignedTx(resp); stellar_fillSignedTx(resp);
msg_write(MessageType_MessageType_StellarSignedTx, resp); msg_write(MessageType_MessageType_StellarSignedTx, resp);
layoutHome(); layoutHome();
} }
// Request the next operation to sign // Request the next operation to sign
else { else {
RESP_INIT(StellarTxOpRequest); RESP_INIT(StellarTxOpRequest);
msg_write(MessageType_MessageType_StellarTxOpRequest, resp); msg_write(MessageType_MessageType_StellarTxOpRequest, resp);
} }
} }
void fsm_msgStellarSetOptionsOp(const StellarSetOptionsOp *msg) void fsm_msgStellarSetOptionsOp(const StellarSetOptionsOp *msg)
{ {
if (!stellar_confirmSetOptionsOp(msg)) return; if (!stellar_confirmSetOptionsOp(msg)) return;
if (stellar_allOperationsConfirmed()) { if (stellar_allOperationsConfirmed()) {
RESP_INIT(StellarSignedTx); RESP_INIT(StellarSignedTx);
stellar_fillSignedTx(resp); stellar_fillSignedTx(resp);
msg_write(MessageType_MessageType_StellarSignedTx, resp); msg_write(MessageType_MessageType_StellarSignedTx, resp);
layoutHome(); layoutHome();
} }
// Request the next operation to sign // Request the next operation to sign
else { else {
RESP_INIT(StellarTxOpRequest); RESP_INIT(StellarTxOpRequest);
msg_write(MessageType_MessageType_StellarTxOpRequest, resp); msg_write(MessageType_MessageType_StellarTxOpRequest, resp);
} }
} }
void fsm_msgStellarChangeTrustOp(const StellarChangeTrustOp *msg) void fsm_msgStellarChangeTrustOp(const StellarChangeTrustOp *msg)
{ {
if (!stellar_confirmChangeTrustOp(msg)) return; if (!stellar_confirmChangeTrustOp(msg)) return;
if (stellar_allOperationsConfirmed()) { if (stellar_allOperationsConfirmed()) {
RESP_INIT(StellarSignedTx); RESP_INIT(StellarSignedTx);
stellar_fillSignedTx(resp); stellar_fillSignedTx(resp);
msg_write(MessageType_MessageType_StellarSignedTx, resp); msg_write(MessageType_MessageType_StellarSignedTx, resp);
layoutHome(); layoutHome();
} }
// Request the next operation to sign // Request the next operation to sign
else { else {
RESP_INIT(StellarTxOpRequest); RESP_INIT(StellarTxOpRequest);
msg_write(MessageType_MessageType_StellarTxOpRequest, resp); msg_write(MessageType_MessageType_StellarTxOpRequest, resp);
} }
} }
void fsm_msgStellarAllowTrustOp(const StellarAllowTrustOp *msg) void fsm_msgStellarAllowTrustOp(const StellarAllowTrustOp *msg)
{ {
if (!stellar_confirmAllowTrustOp(msg)) return; if (!stellar_confirmAllowTrustOp(msg)) return;
if (stellar_allOperationsConfirmed()) { if (stellar_allOperationsConfirmed()) {
RESP_INIT(StellarSignedTx); RESP_INIT(StellarSignedTx);
stellar_fillSignedTx(resp); stellar_fillSignedTx(resp);
msg_write(MessageType_MessageType_StellarSignedTx, resp); msg_write(MessageType_MessageType_StellarSignedTx, resp);
layoutHome(); layoutHome();
} }
// Request the next operation to sign // Request the next operation to sign
else { else {
RESP_INIT(StellarTxOpRequest); RESP_INIT(StellarTxOpRequest);
msg_write(MessageType_MessageType_StellarTxOpRequest, resp); msg_write(MessageType_MessageType_StellarTxOpRequest, resp);
} }
} }
void fsm_msgStellarAccountMergeOp(const StellarAccountMergeOp *msg) void fsm_msgStellarAccountMergeOp(const StellarAccountMergeOp *msg)
{ {
if (!stellar_confirmAccountMergeOp(msg)) return; if (!stellar_confirmAccountMergeOp(msg)) return;
if (stellar_allOperationsConfirmed()) { if (stellar_allOperationsConfirmed()) {
RESP_INIT(StellarSignedTx); RESP_INIT(StellarSignedTx);
stellar_fillSignedTx(resp); stellar_fillSignedTx(resp);
msg_write(MessageType_MessageType_StellarSignedTx, resp); msg_write(MessageType_MessageType_StellarSignedTx, resp);
layoutHome(); layoutHome();
} }
// Request the next operation to sign // Request the next operation to sign
else { else {
RESP_INIT(StellarTxOpRequest); RESP_INIT(StellarTxOpRequest);
msg_write(MessageType_MessageType_StellarTxOpRequest, resp); msg_write(MessageType_MessageType_StellarTxOpRequest, resp);
} }
} }
void fsm_msgStellarManageDataOp(const StellarManageDataOp *msg) void fsm_msgStellarManageDataOp(const StellarManageDataOp *msg)
{ {
if (!stellar_confirmManageDataOp(msg)) return; if (!stellar_confirmManageDataOp(msg)) return;
if (stellar_allOperationsConfirmed()) { if (stellar_allOperationsConfirmed()) {
RESP_INIT(StellarSignedTx); RESP_INIT(StellarSignedTx);
stellar_fillSignedTx(resp); stellar_fillSignedTx(resp);
msg_write(MessageType_MessageType_StellarSignedTx, resp); msg_write(MessageType_MessageType_StellarSignedTx, resp);
layoutHome(); layoutHome();
} }
// Request the next operation to sign // Request the next operation to sign
else { else {
RESP_INIT(StellarTxOpRequest); RESP_INIT(StellarTxOpRequest);
msg_write(MessageType_MessageType_StellarTxOpRequest, resp); msg_write(MessageType_MessageType_StellarTxOpRequest, resp);
} }
} }
void fsm_msgStellarBumpSequenceOp(const StellarBumpSequenceOp *msg) void fsm_msgStellarBumpSequenceOp(const StellarBumpSequenceOp *msg)
{ {
if (!stellar_confirmBumpSequenceOp(msg)) return; if (!stellar_confirmBumpSequenceOp(msg)) return;
if (stellar_allOperationsConfirmed()) { if (stellar_allOperationsConfirmed()) {
RESP_INIT(StellarSignedTx); RESP_INIT(StellarSignedTx);
stellar_fillSignedTx(resp); stellar_fillSignedTx(resp);
msg_write(MessageType_MessageType_StellarSignedTx, resp); msg_write(MessageType_MessageType_StellarSignedTx, resp);
layoutHome(); layoutHome();
} }
// Request the next operation to sign // Request the next operation to sign
else { else {
RESP_INIT(StellarTxOpRequest); RESP_INIT(StellarTxOpRequest);
msg_write(MessageType_MessageType_StellarTxOpRequest, resp); msg_write(MessageType_MessageType_StellarTxOpRequest, resp);
} }
} }

View File

@ -35,21 +35,21 @@
#define STELLAR_KEY_SIZE 32 #define STELLAR_KEY_SIZE 32
typedef struct { typedef struct {
// BIP32 path to the address being used for signing // BIP32 path to the address being used for signing
uint32_t address_n[10]; uint32_t address_n[10];
size_t address_n_count; size_t address_n_count;
uint8_t signing_pubkey[32]; uint8_t signing_pubkey[32];
// 1 - public network, 2 - official testnet, 3 - other private network // 1 - public network, 2 - official testnet, 3 - other private network
uint8_t network_type; uint8_t network_type;
// Total number of operations expected // Total number of operations expected
uint32_t num_operations; uint32_t num_operations;
// Number that have been confirmed by the user // Number that have been confirmed by the user
uint32_t confirmed_operations; uint32_t confirmed_operations;
// sha256 context that will eventually be signed // sha256 context that will eventually be signed
SHA256_CTX sha256_ctx; SHA256_CTX sha256_ctx;
} StellarTransaction; } StellarTransaction;
// Signing process // Signing process

View File

@ -34,6 +34,7 @@ void memory_protect(void)
if (((FLASH_OPTION_BYTES_1 & 0xFFEC) == 0xCCEC) && ((FLASH_OPTION_BYTES_2 & 0xFFF) == 0xFFC) && (FLASH_OPTCR == 0x0FFCCCED)) { if (((FLASH_OPTION_BYTES_1 & 0xFFEC) == 0xCCEC) && ((FLASH_OPTION_BYTES_2 & 0xFFF) == 0xFFC) && (FLASH_OPTCR == 0x0FFCCCED)) {
return; // already set up correctly - bail out return; // already set up correctly - bail out
} }
flash_unlock_option_bytes(); flash_unlock_option_bytes();
// Section 2.8.6 Flash option control register (FLASH_OPTCR) // Section 2.8.6 Flash option control register (FLASH_OPTCR)
// Bits 31:28 Reserved, must be kept cleared. // Bits 31:28 Reserved, must be kept cleared.
@ -67,7 +68,6 @@ void memory_write_unlock(void)
} }
int memory_bootloader_hash(uint8_t *hash) int memory_bootloader_hash(uint8_t *hash)
{ {
sha256_Raw(FLASH_PTR(FLASH_BOOT_START), FLASH_BOOT_LEN, hash); sha256_Raw(FLASH_PTR(FLASH_BOOT_START), FLASH_BOOT_LEN, hash);
sha256_Raw(hash, 32, hash); sha256_Raw(hash, 32, hash);