Skip to content

Commit

Permalink
- Disable HWM checks while signing when HWM settings is off.
Browse files Browse the repository at this point in the history
  • Loading branch information
ajinkyaraj-23 committed Apr 2, 2024
1 parent e2939ee commit e25ea20
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/apdu_sign.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,9 @@ static int perform_signature(bool const send_hash) {

TZ_ASSERT(os_global_pin_is_validated() == BOLOS_UX_OK, EXC_SECURITY);

TZ_ASSERT(write_high_water_mark(&G.parsed_baking_data), EXC_MEMORY_ERROR);
if (!N_data.hwm_disabled) {
TZ_ASSERT(write_high_water_mark(&G.parsed_baking_data), EXC_MEMORY_ERROR);
}

uint8_t resp[SIGN_HASH_SIZE + MAX_SIGNATURE_SIZE] = {0};
size_t offset = 0;
Expand Down
4 changes: 4 additions & 0 deletions src/baking_auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ static bool is_level_authorized(parsed_baking_data_t const *const baking_info) {
return false;
}

if (N_data.hwm_disabled) {
return true;
}

high_watermark_t volatile const *const hwm =
select_hwm_by_chain(baking_info->chain_id, &N_data);
if (hwm == NULL) {
Expand Down

0 comments on commit e25ea20

Please sign in to comment.