tpm12: Fix yet some more -O3 compilation errors (Trusty)

This patch addresses the following false positives on Ubuntu Trusty
on x86_64:

tpm12/tpm_process.c: In function ?TPM_Process_GetCapability?:
tpm12/tpm_process.c:3521:35: error: ?transportEncrypt? may be used uninitialized in this function [-Werror=maybe-uninitialized]
      returnCode = TPM_ProcessAudit(tpm_state,
                                   ^

tpm12/tpm_counter.c: In function ?TPM_Process_IncrementCounter?:
tpm12/tpm_counter.c:421:27: error: ?counterValue? may be used uninitialized in this function [-Werror=maybe-uninitialized]
  rc = TPM_Sbuffer_Append32(sbuffer, tpm_counter_value->counter);
                           ^
tpm12/tpm_counter.c:791:24: note: ?counterValue? was declared here
     TPM_COUNTER_VALUE *counterValue; /* The counter value */
                        ^

tpm12/tpm_key.c: In function ?TPM_KeyParms_CheckProperties?:
tpm12/tpm_key.c:1959:42: error: ?tpm_rsa_key_parms? may be used uninitialized in this function [-Werror=maybe-uninitialized]
   rc = TPM_KeyParams_CheckDefaultExponent(&(tpm_rsa_key_parms->exponent));

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
Stefan Berger 2020-01-30 08:15:29 -05:00 committed by Stefan Berger
parent 49f3b55de9
commit 6de06a596c
3 changed files with 3 additions and 3 deletions

View File

@ -788,7 +788,7 @@ TPM_RESULT TPM_Process_IncrementCounter(tpm_state_t *tpm_state,
uint32_t outParamStart; /* starting point of outParam's */
uint32_t outParamEnd; /* ending point of outParam's */
TPM_DIGEST outParamDigest;
TPM_COUNTER_VALUE *counterValue; /* The counter value */
TPM_COUNTER_VALUE *counterValue = NULL; /* The counter value */
printf("TPM_Process_IncrementCounter: Ordinal Entry\n");
/*

View File

@ -1732,7 +1732,7 @@ TPM_RESULT TPM_KeyParms_CheckProperties(TPM_KEY_PARMS *tpm_key_parms,
TPM_BOOL FIPS)
{
TPM_RESULT rc = 0;
TPM_RSA_KEY_PARMS *tpm_rsa_key_parms; /* used if algorithmID indicates RSA */
TPM_RSA_KEY_PARMS *tpm_rsa_key_parms = NULL;/* used if algorithmID indicates RSA */
printf(" TPM_KeyParms_CheckProperties: keyUsage %04hx\n", tpm_key_usage);
printf(" TPM_KeyParms_CheckProperties: sigScheme %04hx\n", tpm_key_parms->sigScheme);

View File

@ -3381,7 +3381,7 @@ TPM_RESULT TPM_Process_GetCapability(tpm_state_t *tpm_state,
unsigned char * inParamEnd; /* ending point of inParam's */
TPM_DIGEST inParamDigest;
TPM_BOOL auditStatus; /* audit the ordinal */
TPM_BOOL transportEncrypt; /* wrapped in encrypted transport session */
TPM_BOOL transportEncrypt = FALSE;/* wrapped in encrypted transport session */
uint16_t subCap16 = 0; /* the subCap as a uint16_t */
uint32_t subCap32 = 0; /* the subCap as a uint32_t */
TPM_STORE_BUFFER capabilityResponse; /* response */