mirror of
https://github.com/stefanberger/libtpms
synced 2026-08-12 23:13:02 +00:00
tpm2: Fix size check in CryptSecretDecrypt
Check the secret size against the size of the buffer, not the size member that has not been set yet. Reported by Coverity. Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
This commit is contained in:
parent
6728aada47
commit
78a27cf0c3
@ -732,7 +732,7 @@ CryptSecretDecrypt(
|
||||
nonceCaller->t.size);
|
||||
}
|
||||
// make sure secret will fit
|
||||
if(secret->t.size > data->t.size)
|
||||
if(secret->t.size > sizeof(data->t.buffer))
|
||||
return TPM_RC_FAILURE;
|
||||
data->t.size = secret->t.size;
|
||||
// CFB decrypt, using nonceCaller as iv
|
||||
|
||||
Loading…
Reference in New Issue
Block a user