mirror of
https://github.com/stefanberger/libtpms
synced 2026-08-08 17:11:53 +00:00
Sync: Add more buffer size checks to CryptParameterDecryption
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
parent
de08e7e954
commit
fdd6b34a79
@ -68,6 +68,8 @@
|
||||
#include "Tpm.h"
|
||||
#include "Marshal.h"
|
||||
|
||||
#include "tpm_library_intern.h" // libtpms added
|
||||
|
||||
//****************************************************************************/
|
||||
//** Hash/HMAC Functions
|
||||
//****************************************************************************/
|
||||
@ -1052,7 +1054,8 @@ CryptParameterDecryption(
|
||||
return TPM_RC_INSUFFICIENT;
|
||||
}
|
||||
|
||||
if(cipherSize > bufferSize)
|
||||
if(cipherSize > MAX_COMMAND_SIZE || bufferSize <= 0
|
||||
|| (UINT32)cipherSize > (UINT32)bufferSize)
|
||||
{
|
||||
return TPM_RC_SIZE;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user