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 auditor feedback on audit fix #4

Open
wants to merge 4 commits into
base: chore/update-icons
Choose a base branch
from
Open
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
5 changes: 5 additions & 0 deletions src/handle_finalize.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ void handle_finalize(ethPluginFinalize_t *msg) {
case KILN_V2_MULTICLAIM:
case KILN_V2_CLAIM:
msg->numScreens = 1;
if (context->next_param != 0) {
PRINTF("Parser did not complete\n");
msg->result = ETH_PLUGIN_RESULT_ERROR;
return;
}
msg->result = ETH_PLUGIN_RESULT_OK;
break;

Expand Down
17 changes: 17 additions & 0 deletions src/kiln_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ typedef enum {
KILN_V2_CLAIM,
} selector_t;

// ****************************************************************************
// * UTILS
// ****************************************************************************

typedef struct {
uint8_t prev_checksum[CX_KECCAK_256_SIZE];
uint32_t new_offset;
} checksum_offset_params_t;

// ****************************************************************************
// * GLOBALS
// ****************************************************************************
Expand Down Expand Up @@ -104,11 +113,19 @@ typedef struct {

typedef struct {
// -- utils
uint16_t cask_ids_offset;

uint16_t current_item_count;
} v2_claim_t;

typedef struct {
// -- utils
uint16_t ticket_ids_offset;
uint16_t cask_ids_offset;
uint8_t checksum_preview[CX_KECCAK_256_SIZE];
uint8_t checksum_value[CX_KECCAK_256_SIZE];
uint32_t cached_offset;

uint16_t parent_item_count;
uint16_t current_item_count;
} v2_multiclaim_t;
Expand Down
Loading
Loading