Skip to content

Commit

Permalink
Fuzzer: Fix rebase discrepancy
Browse files Browse the repository at this point in the history
  • Loading branch information
aveenismail committed Sep 24, 2024
1 parent 85dfd6e commit 5bb639b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions lib/yubihsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -451,9 +451,9 @@ static yh_rc send_encrypted_msg(Scp_ctx *session, yh_cmd cmd,
}

// Outer command { cmd | cmd_len | sid | encrypted payload | mac }
if (3 + 1 + len + SCP_MAC_LEN > SCP_MSG_BUF_SIZE) {
DBG_ERR("%s: %u", yh_strerror(YHR_BUFFER_TOO_SMALL),
3 + 1 + len + SCP_MAC_LEN);
if (3 + 1 + len + SCP_MAC_LEN > max_message_size) {
DBG_ERR("%s (%u > %u)", yh_strerror(YHR_BUFFER_TOO_SMALL),
3 + 1 + len + SCP_MAC_LEN, max_message_size);
return YHR_BUFFER_TOO_SMALL;
}

Expand Down
7 changes: 3 additions & 4 deletions pkcs11/fuzz/fuzz_get_attribute_value.cc
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ void populate_attribute_template(CK_ATTRIBUTE_PTR *attribute_array,
uint8_t ulValueLen = fdp->ConsumeIntegral<uint8_t>();

new_array[i].type = fdp->ConsumeIntegral<CK_ATTRIBUTE_TYPE>();
new_array[i].pValue = new uint8_t[ulValueLen]; // TODO populate pValue from
// fuzzer generated data?
new_array[i].pValue = new uint8_t[ulValueLen];
new_array[i].ulValueLen = ulValueLen;
}

Expand All @@ -126,8 +125,8 @@ void populate_derived_ecdh_key_template(CK_ATTRIBUTE_PTR *attribute_array,

new_array[1].type = CKA_LABEL;
new_array[1].ulValueLen = label_len;
new_array[1].pValue = new uint8_t[label_len]; // TODO populate pValue from
// fuzzer generated data?
new_array[1].pValue = new uint8_t[label_len];

*attribute_array = new_array;
}

Expand Down

0 comments on commit 5bb639b

Please sign in to comment.