commit | 2140b7523faf89ccb0503fb40ca339855347e2f3 | [log] [tgz] |
---|---|---|
author | Philip Tricca <philip.b.tricca@intel.com> | Wed Jun 06 11:01:51 2018 -0700 |
committer | Philip Tricca <philip.b.tricca@intel.com> | Sun Dec 09 19:12:37 2018 -0800 |
tree | 4a0b1a46ac3909139b22d1e3dab77e611c6217c3 | |
parent | 65b65354c6cce3212d9c512ec3ae2e23fe37c94d [diff] |
tpm: Use compiler environment to determine proper RADIX_BITS. Expecting users to change code in order to build for 64bit environments isn't very user friendly. In the case of the RADIX_BITS we can make this easier on users (and automated builds) by using the compiler environment to do the detection for us. Currently the implementation is limited to the __x86_64__ / __i386__ and _WIN64 / _WIN32 macros from linux / windows compilers respectively. An alternative implementation may have used the OpenSSL bn_ops values to determine 32 vs 64bit. This ends up being awkward since Implementation.h is included by other modules and they then end up depending on the openssl headers. Signed-off-by: Philip Tricca <philip.b.tricca@intel.com>
This is a Microsoft Visual Studio solution that contains reference implementation of the TPM 2.0 Specification by TCG available at https://trustedcomputinggroup.org/tpm-library-specification.
See the TPMCmd/tpm/include/TpmTypes.h header for the exact revision/date of the TPM 2.0 specification issue, which the given source tree snapshot corresponds to.
Create TPMCmd/lib folder and place a static OpenSSL library (libeay32.lib or libcrypto.lib) there. This may be either complete static library, or import library accompanying the corresponding DLL. In the latter case you'll need to copy the OpenSSL DLL into the standard Windows search path, so that it was available when you run the simulator executable (e.g. copy it into the same folder where simulator.exe is located).
If you use libcrypto.lib, you'll need to either update “Linker|Input|Additional Dependencies” property of the Tpm project in the simulator solution or, alternatively, rename libcrypto.lib to libeay32.lib.
Recommended version of OpenSSL is 1.0.2d or higher.
Create TPMCmd/OsslInclude/openssl folder and copy there the contents of the openssl/include/openssl folder of the OpenSSL source tree used to build the static library used on the step 2).
If you use OpenSSL 1.1, you'll additionally need to:
WolfSSL is included as a submodule. Initialize and update the submodule to fetch the project and checkout the appropriate commit.
> git submodule init > git submodule update
The current commit will point the minimum recommended version of wolfSSL. Moving to a more recent tag or commit should also be supported but might not be tested.
Build the solution with either WolfDebug or WolfRelease as the active configuration, either from inside the Visual Studio or with the following command line:
> msbuild TPMCmd\simulator.sln /p:Configuration=WolfDebug