mirror of
https://github.com/stefanberger/libtpms
synced 2026-08-11 21:50:09 +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
9d2ab05d82
commit
767972759d
@ -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