Skip to content

Commit 671b702

Browse files
committed
Allow extend with RSA or ECC.
1 parent 580b3a7 commit 671b702

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

examples/nvram/extend.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,14 @@ int TPM2_NVRAM_Extend_Example(void* userCtx, int argc, char *argv[])
173173
goto exit;
174174
}
175175

176-
/* 1: Create EK RSA 2048-bit */
177-
rc = wolfTPM2_CreateEK(&dev, &endorse, TPM_ALG_RSA);
176+
/* 1: Create EK (RSA or ECC) */
177+
rc = wolfTPM2_CreateEK(&dev, &endorse,
178+
#ifndef NO_RSA
179+
TPM_ALG_RSA
180+
#else
181+
TPM_ALG_ECC
182+
#endif
183+
);
178184
if (rc != 0) {
179185
printf("Create EK RSA failed!\n");
180186
goto exit;

0 commit comments

Comments
 (0)