Skip to content

Commit

Permalink
Lint and fix error with sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
fbeutin-ledger committed Oct 13, 2023
1 parent fd16ee1 commit 1ec0147
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 14 deletions.
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ DEFINES += HAVE_IO_USB HAVE_L4_USBLIB IO_USB_MAX_ENDPOINTS=4 IO_HID_EP_LENGTH=
DEFINES += USB_SEGMENT_SIZE=64
DEFINES += BLE_SEGMENT_SIZE=32 #max MTU, min 20

DEFINES += UNUSED\(x\)=\(void\)x

ifeq ($(TARGET_NAME),$(filter $(TARGET_NAME),TARGET_NANOX TARGET_STAX))
DEFINES += HAVE_BLE BLE_COMMAND_TIMEOUT_MS=2000 HAVE_BLE_APDU
endif
Expand Down
5 changes: 1 addition & 4 deletions src/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@ bool parse_to_sized_buffer(uint8_t *in_buffer,
// param[in] <in_size> the total size of the buffer to parse
// param[out] <out> the int read from in_buffer at offset
// param[in/out] <offset> the current offset at wich we are in <in_buffer>
bool pop_uint8_from_buffer(uint8_t *in_buffer,
uint16_t in_size,
uint8_t *out,
uint16_t *offset) {
bool pop_uint8_from_buffer(uint8_t *in_buffer, uint16_t in_size, uint8_t *out, uint16_t *offset) {
if (*offset + 1 > in_size) {
PRINTF("Failed to read the uint, only %d bytes available\n", in_size);
return false;
Expand Down
5 changes: 1 addition & 4 deletions src/buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,4 @@ bool parse_to_sized_buffer(uint8_t *in_buffer,
buf_t *out,
uint16_t *offset);

bool pop_uint8_from_buffer(uint8_t *in_buffer,
uint16_t in_size,
uint8_t *out,
uint16_t *offset);
bool pop_uint8_from_buffer(uint8_t *in_buffer, uint16_t in_size, uint8_t *out, uint16_t *offset);
4 changes: 2 additions & 2 deletions src/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
#define MAX_DER_SIGNATURE_LENGTH 72U

#define CURVE_SECP256K1 0x00
#define CURVE_256R1 0x01
#define CURVE_256R1 0x01

#define ENCODING_BYTES_ARRAY 0x00
#define ENCODING_BASE_64_URL 0x01

#define DER_FORMAT_SIGNATURE 0x00
#define R_S_FORMAT_SIGNATURE 0x01

#define SIGNATURE_COMPUTED_ON_TX 0x00
#define SIGNATURE_COMPUTED_ON_TX 0x00
#define SIGNATURE_COMPUTED_ON_DOT_PREFIXED_TX 0x01

#define TICKER_MIN_SIZE_B 2
Expand Down
11 changes: 9 additions & 2 deletions src/process_transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ static bool calculate_sha256_digest(buf_t payload) {
return true;
}

static bool deserialize_protobuf_payload(buf_t payload, subcommand_e subcommand, bool needs_base64_decoding) {
static bool deserialize_protobuf_payload(buf_t payload,
subcommand_e subcommand,
bool needs_base64_decoding) {
pb_istream_t stream;
const pb_field_t *fields;
void *dest_struct;
Expand Down Expand Up @@ -310,7 +312,12 @@ int process_transaction(const command_t *cmd) {
buf_t fees;
buf_t payload;
bool needs_base64_decoding;
if (!parse_transaction(data, cmd->data.size, cmd->subcommand, &payload, &fees, &needs_base64_decoding)) {
if (!parse_transaction(data,
cmd->data.size,
cmd->subcommand,
&payload,
&fees,
&needs_base64_decoding)) {
return reply_error(INCORRECT_COMMAND_DATA);
}

Expand Down

0 comments on commit 1ec0147

Please sign in to comment.