aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Marochko <Andrey.Marochko@microsoft.com>2017-07-24 18:16:24 -0700
committerAndrey Marochko <Andrey.Marochko@microsoft.com>2017-07-24 18:16:24 -0700
commitd81005bd9067b1b620678f2f8d69ae1d4fd9d882 (patch)
tree99fb5f1465ff193b7197786d8f39162ed8d71120
parent2e4dca102e1f0aefcb621cc528e8bab72811b5c1 (diff)
downloadms-tpm-20-ref-d81005bd9067b1b620678f2f8d69ae1d4fd9d882.tar.gz
Added support for OpenSSL 1.1
-rw-r--r--README.md22
-rw-r--r--TPMCmd/tpm/include/ossl/TpmToOsslMath.h3
2 files changed, 18 insertions, 7 deletions
diff --git a/README.md b/README.md
index e4cad76..c0f7747 100644
--- a/README.md
+++ b/README.md
@@ -1,14 +1,22 @@
-This is a Microsoft Visual Studio solution that contains reference implementation of the TPM 2.0 Specification by TCG (https://trustedcomputinggroup.org/tpm-library-specification/).
+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 TPMCmd/tpm/include/TpmTypes.h for the exact revision/date of the TPM 2.0 specification issue, which the given source tree snapshot corresponds to.
+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.
Before building the solution:
-1) Create TPMCmd/lib folder and place a static OpenSSL library (libeay32.lib) there. Recommended version is 1.0.2d or higher.
-
-2) Create TPMCmd/OsslInclude/openssl folder and copy there the contents of the include/openssl folder of the OpenSSL source tree used to build the static library used on the step 1).
-
-3) Uncomment and update the definitions of the following macros in the TPMCmd/tpm/include/VendorString.h header:
+1) Uncomment and update the definitions of the following macros in the TPMCmd/tpm/include/VendorString.h header:
- MANUFACTURER
- VENDOR_STRING_1
- FIRMWARE_V1 and FIRMWARE_V2
+
+2) 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.
+
+3) 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:
+ - Copy the openssl/crypto/bn/bn_lcl.h header to the TPMCmd/OsslInclude/openssl folder;
+ - Create TPMCmd/OsslInclude/openssl/internal folder and copy there the contents of the openssl/crypto/include/internal folder (do not confuse it with the openssl/include/internal folder that need not be copied).
diff --git a/TPMCmd/tpm/include/ossl/TpmToOsslMath.h b/TPMCmd/tpm/include/ossl/TpmToOsslMath.h
index 213295d..f1fba4b 100644
--- a/TPMCmd/tpm/include/ossl/TpmToOsslMath.h
+++ b/TPMCmd/tpm/include/ossl/TpmToOsslMath.h
@@ -47,6 +47,9 @@
#include <openssl/evp.h>
#include <openssl/ec.h>
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
+#include <openssl/bn_lcl.h>
+#endif
#include <openssl/bn.h>
//** Macros and Defines