mirror of
https://github.com/stefanberger/libtpms
synced 2026-08-10 04:57:38 +00:00
tpm2: Initialize keyschedule before AES_set_encrypt_key (overity)
Coverity complains that the *output* variable passed to AES_set_encrypt_key contains uninitialized bytes, so we initialize the variables now. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
parent
25223a2d0e
commit
f19282b243
@ -121,6 +121,7 @@ CryptCmacData(
|
||||
tpmCryptKeySchedule_t keySchedule;
|
||||
TpmCryptSetSymKeyCall_t encrypt;
|
||||
//
|
||||
memset(&keySchedule, 0, sizeof(keySchedule)); /* libtpms added: coverity */
|
||||
SELECT(ENCRYPT);
|
||||
while(size > 0)
|
||||
{
|
||||
@ -157,6 +158,7 @@ CryptCmacEnd(
|
||||
TPM2B_IV subkey = {{0, {0}}};
|
||||
BOOL xorVal;
|
||||
UINT16 i;
|
||||
memset(&keySchedule, 0, sizeof(keySchedule)); /* libtpms added: coverity */
|
||||
subkey.t.size = cState->iv.t.size;
|
||||
// Encrypt a block of zero
|
||||
SELECT(ENCRYPT);
|
||||
|
||||
@ -358,6 +358,7 @@ DRBG_Update(
|
||||
DRBG_KEY *key = pDRBG_KEY(&drbgState->seed);
|
||||
DRBG_IV *iv = pDRBG_IV(&drbgState->seed);
|
||||
DRBG_KEY_SCHEDULE localKeySchedule;
|
||||
memset(&localKeySchedule, 0, sizeof(localKeySchedule)); /* libtpms added: coverity */
|
||||
//
|
||||
pAssert(drbgState->magic == DRBG_MAGIC);
|
||||
// If an key schedule was not provided, make one
|
||||
@ -745,6 +746,7 @@ DRBG_Generate(
|
||||
DRBG_STATE *drbgState = (DRBG_STATE *)state;
|
||||
DRBG_KEY_SCHEDULE keySchedule;
|
||||
DRBG_SEED *seed = &drbgState->seed;
|
||||
memset(&keySchedule, 0, sizeof(keySchedule)); /* libtpms added: coverity */
|
||||
if(drbgState->reseedCounter >= CTR_DRBG_MAX_REQUESTS_PER_RESEED)
|
||||
{
|
||||
if(drbgState == &drbgDefault)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user