Skip to content

keyOut buffer reused without re-zeroing in whTest_KeyCache #303

@Jpgig

Description

@Jpgig

Summary
In whTest_KeyCache the keyOut buffer is zero-initialized only at declaration and then reused across multiple calls to whTest_CacheExportKey / whTest_CacheExportKeyDma. The helper export functions call wh_Client_KeyExport* without zeroing keyOut (or labelOut) immediately before each call and without strictly validating the returned length before memcmp comparisons. That allows stale bytes from a previous call (or stack) to remain in keyOut if an export writes fewer bytes than expected or fails to overwrite the buffer. This can cause false test results and minor information-leak risk.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions