parallaxsecond / parallaxsecond/rust-tss-esapi

Non sized buffers are not checked for exact size.

Open
#485 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug enhancement
Dominant language
Rust
Stars
135
Forks
80
Avg merge
1d 17h
Merged PRs (30d)
5

Description

The sized buffers are TPM2B types which can contain data of different length (such as TPM2B_NAME or TPM2B_DIGEST). The current macro handles them well by checking that when the native type is created the size of the data does not exceed the maximum size.

But for other buffer types (such as TPM2B_SENSITIVE_DATA) they usually have a fixed size so the macro that creates them should probably behave differently by checking that the size of the data equals the expected size and if it does not it is an error.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the macro that creates TPM2B native types and compare its existing sized-buffer validation with the non-sized buffer cases described here. Done means non-sized buffers require the data length to equal the expected size and return an error for mismatches; add or update tests for both matching and mismatching lengths.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.