Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile for windows #154

Open
naaeef opened this issue Nov 26, 2019 · 9 comments
Open

Compile for windows #154

naaeef opened this issue Nov 26, 2019 · 9 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@naaeef
Copy link

naaeef commented Nov 26, 2019

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

Thank you for your help.

@AndreasFuchsTPM
Copy link
Member

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 AndreasFuchsTPM added enhancement New feature or request help wanted Extra attention is needed labels Nov 27, 2019
@paulduongemail
Copy link

@naaeef Any update?

@naaeef
Copy link
Author

naaeef commented Sep 1, 2020

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.

@AndreasFuchsTPM
Copy link
Member

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

@paulduongemail
Copy link

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

@naaeef
Copy link
Author

naaeef commented Sep 9, 2020

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.

@williamcroberts
Copy link
Member

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.

@paulduongemail
Copy link

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

@madaster97
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants