Improve the printing of the capabilities vendor firmware number. Spelling fixes.

pull/194/head
David Garske 2021-10-05 08:00:57 -07:00
parent 05d5a0b715
commit 4adbbc560a
2 changed files with 3 additions and 3 deletions

View File

@ -184,7 +184,7 @@ int TPM2_Wrapper_TestArgs(void* userCtx, int argc, char *argv[])
rc = wolfTPM2_GetCapabilities(&dev, &caps);
if (rc != 0) goto exit;
printf("Mfg %s (%d), Vendor %s, Fw %u.%u (%u), "
printf("Mfg %s (%d), Vendor %s, Fw %u.%u (0x%x), "
"FIPS 140-2 %d, CC-EAL4 %d\n",
caps.mfgStr, caps.mfg, caps.vendorStr, caps.fwVerMajor,
caps.fwVerMinor, caps.fwVerVendor, caps.fips140_2, caps.cc_eal4);

View File

@ -306,7 +306,7 @@ static int wolfTPM2_ParseCapabilities(WOLFTPM2_CAPS* caps,
caps->fwVerMinor = val & 0xFFFF;
break;
case TPM_PT_FIRMWARE_VERSION_2:
if (caps->mfg == TPM_MFG_INFINEON || caps->mfg == TPM_MFG_NUVOTON) {
if (caps->mfg == TPM_MFG_INFINEON) {
caps->fwVerVendor = val >> 8;
caps->cc_eal4 = (val & 0x00000002) ? 0 : 1;
}
@ -3190,7 +3190,7 @@ int wolfTPM2_GetRandom(WOLFTPM2_DEV* dev, byte* buf, word32 len)
return BAD_FUNC_ARG;
while (pos < len) {
/* caclulate size to get */
/* calculate size to get */
sz = len - pos;
if (sz > MAX_RNG_REQ_SIZE)
sz = MAX_RNG_REQ_SIZE;