Fixes for using Windows TBS API. The `wolfTPM2_NVStoreKey` should return `TPM_RC_COMMAND_CODE` or `TPM_E_COMMAND_BLOCKED` for the `WOLFTPM_IS_COMMAND_UNAVAILABLE` macro. Add better enable option name `--enable-wintbs` (currently is `--enable-winapi`.

pull/306/head
David Garske 2023-10-30 10:05:47 -07:00
parent 2d14cd2297
commit f35dbbbb30
2 changed files with 6 additions and 2 deletions

View File

@ -241,13 +241,17 @@ then
fi
# Windows TBS device Support
AC_ARG_ENABLE([wintbs],,
[ ENABLED_WINTBS=$enableval ],
[ ENABLED_WINTBS=no ]
)
AC_ARG_ENABLE([winapi],
[AS_HELP_STRING([--enable-winapi],[Enable use of TPM through Windows driver (default: disabled)])],
[ ENABLED_WINAPI=$enableval ],
[ ENABLED_WINAPI=no ]
)
if test "x$ENABLED_WINAPI" = "xyes"
if test "x$ENABLED_WINAPI" = "xyes" || test "x$ENABLED_WINTBS" = "xyes"
then
if test "x$ENABLED_DEVTPM" = "xyes" -o "x$ENABLED_SWTPM" = "xyes"
then

View File

@ -3306,7 +3306,7 @@ int wolfTPM2_NVStoreKey(WOLFTPM2_DEV* dev, TPM_HANDLE primaryHandle,
printf("TPM2_EvictControl (storing key to NV) not allowed on "
"Windows TBS (err 0x%x)\n", rc);
#endif
rc = TPM_RC_NV_UNAVAILABLE;
rc = TPM_RC_COMMAND_CODE;
}
#endif