diff --git a/Makefile b/Makefile index c774b8ac..fb885af7 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/src/buffer.c b/src/buffer.c index 20c58b85..2c4a98bd 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -56,10 +56,7 @@ bool parse_to_sized_buffer(uint8_t *in_buffer, // param[in] the total size of the buffer to parse // param[out] the int read from in_buffer at offset // param[in/out] the current offset at wich we are in -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; diff --git a/src/buffer.h b/src/buffer.h index cc48b938..a93dc91a 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -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); diff --git a/src/globals.h b/src/globals.h index b257fa26..2f6d1b27 100644 --- a/src/globals.h +++ b/src/globals.h @@ -14,7 +14,7 @@ #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 @@ -22,7 +22,7 @@ #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 diff --git a/src/process_transaction.c b/src/process_transaction.c index eb5b061e..002d88e7 100644 --- a/src/process_transaction.c +++ b/src/process_transaction.c @@ -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; @@ -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); }