Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/ldg 445audit fix #7

Merged
merged 3 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/Makefile.version
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ APPVERSION_M=2
# This is the `spec_version` field of `Runtime`
APPVERSION_N=3
# This is the patch version of this release
APPVERSION_P=1
APPVERSION_P=2
Binary file removed app/cosmos.png
Binary file not shown.
Binary file modified app/glyphs/icon_stax_32.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/glyphs/icon_stax_64.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/nanos_icon.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/nanox_icon.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 0 additions & 20 deletions app/src/json/json_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,6 @@ parser_error_t array_get_nth_element(const parsed_json_t *json,
uint16_t array_token_index,
uint16_t element_index,
uint16_t *token_index) {
if (array_token_index < 0 || array_token_index > json->numberOfTokens) {
return parser_no_data;
}

jsmntok_t array_token = json->tokens[array_token_index];
*token_index = array_token_index;

Expand Down Expand Up @@ -147,10 +143,6 @@ parser_error_t object_get_element_count(const parsed_json_t *json,
uint16_t object_token_index,
uint16_t *element_count) {
*element_count = 0;
if (object_token_index < 0 || object_token_index > json->numberOfTokens) {
return parser_no_data;
}

jsmntok_t object_token = json->tokens[object_token_index];
uint16_t token_index = object_token_index;
uint16_t prev_element_end = object_token.start;
Expand Down Expand Up @@ -179,10 +171,6 @@ parser_error_t object_get_nth_key(const parsed_json_t *json,
uint16_t object_element_index,
uint16_t *token_index) {
*token_index = object_token_index;
if (object_token_index < 0 || object_token_index > json->numberOfTokens) {
return parser_no_data;
}

jsmntok_t object_token = json->tokens[object_token_index];
uint16_t element_count = 0;
uint16_t prev_element_end = object_token.start;
Expand Down Expand Up @@ -214,10 +202,6 @@ parser_error_t object_get_nth_value(const parsed_json_t *json,
uint16_t object_token_index,
uint16_t object_element_index,
uint16_t *key_index) {
if (object_token_index < 0 || object_token_index > json->numberOfTokens) {
return parser_no_data;
}

CHECK_PARSER_ERR(object_get_nth_key(json, object_token_index, object_element_index, key_index))
(*key_index)++;

Expand All @@ -228,10 +212,6 @@ parser_error_t object_get_value(const parsed_json_t *json,
uint16_t object_token_index,
const char *key_name,
uint16_t *token_index) {
if (object_token_index < 0 || object_token_index > json->numberOfTokens) {
return parser_no_data;
}

const jsmntok_t object_token = json->tokens[object_token_index];

*token_index = object_token_index;
Expand Down
2 changes: 0 additions & 2 deletions app/src/tx_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
********************************************************************************/
#ifdef __cplusplus
#pragma clang diagnostic push
#pragma ide diagnostic ignored "misc-no-recursion"
#endif

#include "coin.h"
Expand Down Expand Up @@ -58,7 +57,6 @@ const char *get_required_root_item(root_item_e i) {

#ifdef __cplusplus
#pragma clang diagnostic push
#pragma ide diagnostic ignored "bugprone-branch-clone"
#endif

__Z_INLINE uint8_t get_root_max_level(root_item_e i) {
Expand Down
1 change: 0 additions & 1 deletion app/src/tx_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

#ifdef __cplusplus
#pragma clang diagnostic push
#pragma ide diagnostic ignored "modernize-deprecated-headers"
#endif

#include "json/json_parser.h"
Expand Down
10 changes: 8 additions & 2 deletions app/src/tx_validate.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ int8_t is_space(char c) {

int8_t contains_whitespace(parsed_json_t *json) {
if (json == NULL){
return 1;
return 2;
}

int start = 0;
Expand Down Expand Up @@ -132,10 +132,16 @@ int8_t dictionaries_sorted(parsed_json_t *json) {
}

parser_error_t tx_validate(parsed_json_t *json) {
if (contains_whitespace(json) == 1) {
int8_t whitespace_check = contains_whitespace(json);

if (whitespace_check == 1) {
return parser_json_contains_whitespace;
}

if (whitespace_check == 2) {
return parser_json_unexpected_error;
}

if (dictionaries_sorted(json) != 1) {
return parser_json_is_not_sorted;
}
Expand Down
Binary file added app/thorchain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/st-sign_msgDeposit/00000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/st-sign_msgDeposit/00003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/st-sign_msgDeposit/00004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/st-sign_msgSend/00000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/st-sign_msgSend/00003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/st-sign_msgSend/00004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading