tpm2-tss-engine icon indicating copy to clipboard operation
tpm2-tss-engine copied to clipboard

Compile for windows

Open naaeef opened this issue 5 years ago • 9 comments

Hello, is it possible to compile this project for windows? I tried it with cygwin with no success.

Thank you for your help.

naaeef avatar Nov 26 '19 11:11 naaeef

You will probably have to create a VS project and include all the files, I assume. Sorry, but I'm not an expert here; i.e. no Windows compile box.

AndreasFuchsTPM avatar Nov 27 '19 10:11 AndreasFuchsTPM

@naaeef Any update?

paulduongemail avatar Aug 24 '20 18:08 paulduongemail

We managed to get the project running on windows on an experimental basis. For compiling the tmp2-tss-engine we created a new Visual Studio Solution using Visual Studio 2019. In the solution, we created two projects with different build targets. One for the genkey Tool (for generating private keys in the TPM) with an executable file as a target and one with a DLL as a target. Furthermore, we had to replace the function calls to sscanf with calls to sscanf_s. Also, we removed the header getopt.h and parsed the command line arguments manually. In some header files, we also had to change the initialization of structs from {} to 0, because the syntax was not accepted by the compiler.

naaeef avatar Sep 01 '20 07:09 naaeef

@naaeef Pretty cool. Would you mind turning this into a PR ?

AndreasFuchsTPM avatar Sep 01 '20 07:09 AndreasFuchsTPM

@naaeef Yes, if you'd like to create PR it will be very helpful and meaningful! Thanks!

paulduongemail avatar Sep 08 '20 17:09 paulduongemail

I can't create a pull request because we did it on a very experimental base, and I currently do not have enough time to convert the code to a stable version.

naaeef avatar Sep 09 '20 06:09 naaeef

I can't create a pull request because we did it on a very experimental base, and I currently do not have enough time to convert the code to a stable version.

Just upload it so its available, and then someone else can run with this.

williamcroberts avatar Sep 09 '20 13:09 williamcroberts

@naaeef Yes, please. Even though you just upload it, it could be a great reference for me. I was stuck for weeks.

paulduongemail avatar Sep 09 '20 20:09 paulduongemail

Wanted to pitch an alternative engine for windows for reference, openssl-cng-engine. It uses the Windows Cryptography API: Next Generation (CNG)

I am planning to try and compile the tpm2 version on windows as well.

madaster97 avatar Jul 23 '22 01:07 madaster97