Skip to content

Commit

Permalink
Minor cleanups.
Browse files Browse the repository at this point in the history
  • Loading branch information
dgarske committed Jul 19, 2023
1 parent d808fba commit 3a6d7b1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
9 changes: 6 additions & 3 deletions examples/boot/secure_rot.c
Expand Up @@ -94,8 +94,10 @@ int TPM2_Boot_SecureROT_Example(void* userCtx, int argc, char *argv[])
WOLFTPM2_HANDLE parent;
WOLFTPM2_NV nv;
word32 nvAttributes;
int paramEncAlg = TPM_ALG_CFB; /* always use AES CFB parameter encryption */
TPMI_RH_NV_AUTH authHandle = TPM_RH_PLATFORM; /* use platform handle to prevent TPM2_Clear from removing */
/* always use AES CFB parameter encryption */
int paramEncAlg = TPM_ALG_CFB;
/* use platform handle to prevent TPM2_Clear from removing */
TPMI_RH_NV_AUTH authHandle = TPM_RH_PLATFORM;
const char* filename = TPM2_SECURE_ROT_EXAMPLE_PUB_KEY;
word32 nvIndex = TPM2_DEMO_NV_SECURE_ROT_INDEX;
int doWrite = 0, doLock = 0;
Expand Down Expand Up @@ -171,7 +173,8 @@ int TPM2_Boot_SecureROT_Example(void* userCtx, int argc, char *argv[])
TPM2_PrintBin(authBuf, sizeof(authBuf));

/* Start TPM session for parameter encryption */
printf("Parameter Encryption: Enabled. (AES CFB)\n\n");
printf("Parameter Encryption: Enabled %s and HMAC\n\n",
TPM2_GetAlgName(paramEncAlg));
rc = wolfTPM2_StartSession(&dev, &tpmSession, NULL, NULL,
TPM_SE_HMAC, paramEncAlg);
if (rc != 0) goto exit;
Expand Down
10 changes: 5 additions & 5 deletions src/tpm2.c
Expand Up @@ -5808,15 +5808,15 @@ const char* TPM2_GetAlgName(TPM_ALG_ID alg)
case TPM_ALG_SYMCIPHER:
return "SYMCIPHER";
case TPM_ALG_CTR:
return "CTR";
return "AES-CTR";
case TPM_ALG_OFB:
return "OFB";
return "AES-OFB";
case TPM_ALG_CBC:
return "CBC";
return "AES-CBC";
case TPM_ALG_CFB:
return "CFB";
return "AES-CFB";
case TPM_ALG_ECB:
return "ECB";
return "AES-ECB";
default:
break;
}
Expand Down

0 comments on commit 3a6d7b1

Please sign in to comment.