mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-01 20:32:35 +00:00
simplifications
This commit is contained in:
parent
1e47c461f9
commit
9f86f6e852
@ -463,7 +463,7 @@ program_pkg = env.Command(
|
|||||||
target='ble_firmware.zip',
|
target='ble_firmware.zip',
|
||||||
source=program_hex,
|
source=program_hex,
|
||||||
action=[
|
action=[
|
||||||
f'python ../../pc-nrfutil/nordicsemi/ pkg generate --hw-version 52 --sd-req=0x100 --application $SOURCE --key-file ./embed/ble_bootloader/priv.pem $TARGET --application-version-string {tools.get_version("embed/ble_firmware/version.h")} --sd-id=0x100 --softdevice ./embed/sdk/nrf52/components/softdevice/s140/hex/s140_nrf52_7.2.0_softdevice.hex '
|
f'python ../../pc-nrfutil/nordicsemi/ pkg generate --hw-version 52 --sd-req=0x100 --application $SOURCE --key-file ./embed/ble_bootloader/priv.pem $TARGET --application-version-string {tools.get_version("embed/ble_firmware/version.h")}'
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -28,4 +28,3 @@ PB_BIND(dfu_Packet, dfu_Packet, 2)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -30,13 +30,6 @@ typedef enum _dfu_OpCode {
|
|||||||
dfu_OpCode_INIT = 1
|
dfu_OpCode_INIT = 1
|
||||||
} dfu_OpCode;
|
} dfu_OpCode;
|
||||||
|
|
||||||
typedef enum _dfu_ValidationType {
|
|
||||||
dfu_ValidationType_NO_VALIDATION = 0,
|
|
||||||
dfu_ValidationType_VALIDATE_GENERATED_CRC = 1,
|
|
||||||
dfu_ValidationType_VALIDATE_SHA256 = 2,
|
|
||||||
dfu_ValidationType_VALIDATE_ECDSA_P256_SHA256 = 3
|
|
||||||
} dfu_ValidationType;
|
|
||||||
|
|
||||||
/* Struct definitions */
|
/* Struct definitions */
|
||||||
typedef PB_BYTES_ARRAY_T(64) dfu_BootValidation_bytes_t;
|
typedef PB_BYTES_ARRAY_T(64) dfu_BootValidation_bytes_t;
|
||||||
typedef struct _dfu_BootValidation {
|
typedef struct _dfu_BootValidation {
|
||||||
@ -111,10 +104,6 @@ typedef struct _dfu_Packet {
|
|||||||
#define _dfu_OpCode_MAX dfu_OpCode_INIT
|
#define _dfu_OpCode_MAX dfu_OpCode_INIT
|
||||||
#define _dfu_OpCode_ARRAYSIZE ((dfu_OpCode)(dfu_OpCode_INIT+1))
|
#define _dfu_OpCode_ARRAYSIZE ((dfu_OpCode)(dfu_OpCode_INIT+1))
|
||||||
|
|
||||||
#define _dfu_ValidationType_MIN dfu_ValidationType_NO_VALIDATION
|
|
||||||
#define _dfu_ValidationType_MAX dfu_ValidationType_VALIDATE_ECDSA_P256_SHA256
|
|
||||||
#define _dfu_ValidationType_ARRAYSIZE ((dfu_ValidationType)(dfu_ValidationType_VALIDATE_ECDSA_P256_SHA256+1))
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
@ -22,13 +22,6 @@ enum OpCode {
|
|||||||
INIT = 1;
|
INIT = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum ValidationType {
|
|
||||||
NO_VALIDATION = 0;
|
|
||||||
VALIDATE_GENERATED_CRC = 1;
|
|
||||||
VALIDATE_SHA256 = 2;
|
|
||||||
VALIDATE_ECDSA_P256_SHA256 = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message Hash {
|
message Hash {
|
||||||
required HashType hash_type = 1;
|
required HashType hash_type = 1;
|
||||||
required bytes hash = 2;
|
required bytes hash = 2;
|
||||||
|
@ -166,7 +166,7 @@ static bool stored_init_cmd_decode(void)
|
|||||||
//TODO: this is where signed init command is stored, but is it guaranteed to be there always?
|
//TODO: this is where signed init command is stored, but is it guaranteed to be there always?
|
||||||
// pb_decoding_callback was meant to find it, how to do that without nanopb modifications?
|
// pb_decoding_callback was meant to find it, how to do that without nanopb modifications?
|
||||||
m_init_packet_data_ptr = &s_dfu_settings.init_command[11];
|
m_init_packet_data_ptr = &s_dfu_settings.init_command[11];
|
||||||
m_init_packet_data_len = 128;
|
m_init_packet_data_len = s_dfu_settings.progress.command_size-(64+4+11); // signature, sigmask
|
||||||
m_init_packet_valid = true;
|
m_init_packet_valid = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user