Skip to content

Commit f35dbbb

Browse files
committed
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.
1 parent 2d14cd2 commit f35dbbb

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

configure.ac

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,13 +241,17 @@ then
241241
fi
242242

243243
# Windows TBS device Support
244+
AC_ARG_ENABLE([wintbs],,
245+
[ ENABLED_WINTBS=$enableval ],
246+
[ ENABLED_WINTBS=no ]
247+
)
244248
AC_ARG_ENABLE([winapi],
245249
[AS_HELP_STRING([--enable-winapi],[Enable use of TPM through Windows driver (default: disabled)])],
246250
[ ENABLED_WINAPI=$enableval ],
247251
[ ENABLED_WINAPI=no ]
248252
)
249253

250-
if test "x$ENABLED_WINAPI" = "xyes"
254+
if test "x$ENABLED_WINAPI" = "xyes" || test "x$ENABLED_WINTBS" = "xyes"
251255
then
252256
if test "x$ENABLED_DEVTPM" = "xyes" -o "x$ENABLED_SWTPM" = "xyes"
253257
then

src/tpm2_wrap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3306,7 +3306,7 @@ int wolfTPM2_NVStoreKey(WOLFTPM2_DEV* dev, TPM_HANDLE primaryHandle,
33063306
printf("TPM2_EvictControl (storing key to NV) not allowed on "
33073307
"Windows TBS (err 0x%x)\n", rc);
33083308
#endif
3309-
rc = TPM_RC_NV_UNAVAILABLE;
3309+
rc = TPM_RC_COMMAND_CODE;
33103310
}
33113311
#endif
33123312

0 commit comments

Comments
 (0)