mirror of
https://github.com/stefanberger/libtpms
synced 2026-08-09 21:28:16 +00:00
Object: clear out sensitive area if on load if not provided
When an object is later marshalled in TPM2_ContextSave, the publicOnly attribute isn't taken into account and therefore potentially stale sensitive information can be marshalled, which is a problem if the buffer sizes it contains have values that are too large - this triggers assertion failures. Avoid this by clearing out the sensitive area upon ObjectLoad if not provided, making the behaviour consistent with when a fresh, unused, object entry is used. Signed-off-by: Rob Shearman <rob@graphiant.com>
This commit is contained in:
parent
0293264228
commit
e2b5c4f5a8
@ -460,7 +460,10 @@ ObjectLoad(
|
||||
object->publicArea = *publicArea;
|
||||
// If there is a sensitive area, load it
|
||||
if(sensitive == NULL)
|
||||
object->attributes.publicOnly = SET;
|
||||
{ // libtpms changed begin
|
||||
object->attributes.publicOnly = SET;
|
||||
MemorySet(&object->sensitive, 0, sizeof(object->sensitive)); // needed for libtpms.
|
||||
} // libtpms changed end
|
||||
else
|
||||
{
|
||||
object->sensitive = *sensitive;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user