Topic: Using wolftpm on Windows 10

I trying to do some use cases with wolftpm on windows 10 using visual studio in c++ but i only receive bad args i using the commands wolftpm2_GetRandom, I don't know if I forgot some configuration but the command wolftpm_init its working.


[img]img1.png[/img]

Post's attachments

img1.png
img1.png 231.03 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

Share

Re: Using wolftpm on Windows 10

Hi luizg473,

Are you building with `--enable-winapi` or setting `#define WOLFTPM_WINAPI`? This will enable using the Window TBS layer for communicating with the TPM. If you are building with winapi then the TPM2_Init IO callback can be NULL. Also you should use wolfTPM2_Init if you are using wrapper API's.

Let me know if that doesn't work.

Thanks,
David Garske, wolfSSL

Share

Re: Using wolftpm on Windows 10

Sorry but can you share a link with this step to active '--enable-winapi', because I was able to install with vcpkg, I didn't have to enable anything in the windows terminal.

Share

Re: Using wolftpm on Windows 10

Hi Luizg473,

I think your issue is not using `wolfTPM2_Init` and `wolfTPM2_Cleanup`. Have you tried that?

wolfTPM should have the WinAPI option enabled by default for windows: https://github.com/wolfSSL/wolfTPM/blob … ts.txt#L86

You can use `WOLFTPM_INTERFACE=WINAPI` to force it.

The build settings for wolfTPM come from here: https://github.com/microsoft/vcpkg/blob … file.cmake

Thanks,
David Garske, wolfSSL

Share

Re: Using wolftpm on Windows 10

yes i tried with the wrapper but the tpm didn't even initialize

Share