Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -229,3 +229,6 @@ FakesAssemblies/
/Tpm2Tester/TestSuite/Properties/launchSettings.json
*.map
*.json

# Rust
target/
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ All flavors of TPM 2.0 devices mentioned in the previous section communicate wit

In order to facilitate the development of applications and services using TPM 2.0, Microsoft has developed a series of TSS implementations for different programming languages. All these implementations provide complete representation of the TPM 2.0 API (commands, data structures, enumerations, unions) using the means of the corresponding languages, and some of them - additional functionality that greatly simplifies communications with TPM 2.0. All TSS.MSR implementations provide abstraction for Windows/Linux/Simulator TPM 2.0 devices.

### [TSS.Net] and [TSS.CPP]
### [TSS.Net], [TSS.CPP] and [TSS.Rust]

TSS.Net and TSS.CPP are written in C# and C++ correspondingly, and are the richest TSS implementations in this collection. Besides complete abstraction of the TPM 2.0 interface, they implement additional functionality, such as:
TSS.Net, TSS.CPP and TSS.Rust are written in C#, C++ and Rust correspondingly, and are the richest TSS implementations in this collection. Besides complete abstraction of the TPM 2.0 interface, they implement additional functionality, such as:

* automatic handling of HMAC and policy sessions;
* expected audit, policy and cpHashes computation;
Expand All @@ -48,6 +48,8 @@ Along with it comes a [sample test suite][TestSuite] that not only demonstrates

TSS.Net is a cross-platform .NET Standard library and requires Visual Studio 2017 or above to build it. It can target one of the following .NET framework flavors: .NET 4.7.2, .NET Core 2.1 (for both Windows and Linux), .NET Standard 2.0, and .NET UWP 10.0. You can download the latest versions of the .NET Framework [here](https://www.microsoft.com/net/download/windows).

TSS.Rust requires Rust 1.70 or above and uses Cargo as its build system.

TSS.Java uses Java SE 8 or above, TSS.JS requires Node.js 4.8.4 or higher, and TSS.Py supports Python 2.7 and 3.5+.

## Platform Crypto Provider Toolkit
Expand All @@ -70,6 +72,7 @@ For private feedback please use tssdotnet@microsoft.com (for all managed languag

[TSS.Net]: ./TSS.NET
[TSS.CPP]: ./TSS.CPP
[TSS.Rust]: ./TSS.Rust
[TSS.Java]: ./TSS.Java
[TSS.JS]: ./TSS.JS
[TSS.Py]: ./TSS.Py
Expand Down
2 changes: 1 addition & 1 deletion TSS.CPP/Src/TpmExtensions.cpp.snips
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ static vector<TPMS_PCR_SELECTION> GetSelectionArray(TPM_ALG_ID hashAlg, UINT32 p
/// <summary> Is the PCR with index _pcr selected in this TPMS_PCR_SELECTION. </summary>
bool PcrIsSelected(UINT32 pcr)
{
return pcrSelect[pcr / 8] = (1 << (pcr % 8)) != 0;
return (pcrSelect[pcr / 8] >> (pcr % 8)) & 1;
}

/// <summary> Return the current PCR-selection as a UINT32 array. </summary>
Expand Down
2 changes: 1 addition & 1 deletion TSS.CPP/include/TpmTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -3653,7 +3653,7 @@ class _DLLEXP_ TPMS_PCR_SELECTION : public TpmStructure
/// <summary> Is the PCR with index _pcr selected in this TPMS_PCR_SELECTION. </summary>
bool PcrIsSelected(UINT32 pcr)
{
return pcrSelect[pcr / 8] = (1 << (pcr % 8)) != 0;
return (pcrSelect[pcr / 8] >> (pcr % 8)) & 1;
}

/// <summary> Return the current PCR-selection as a UINT32 array. </summary>
Expand Down
2 changes: 1 addition & 1 deletion TSS.JS/src/TpmBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ export class TpmBase
{
// If the caller has not provided a session for a handle that requires authorization,
// a password session is automatically created.
if (this.sessions == null)
if (this.sessions == null)
this.sessions = new Array<Session>(numAuthHandles);
else if (this.sessions.length < numAuthHandles)
this.sessions = this.sessions.concat(new Array<Session>(numAuthHandles - this.sessions.length));
Expand Down
12 changes: 6 additions & 6 deletions TSS.Java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
<dependencies>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.67</version>
<artifactId>bcprov-jdk18on</artifactId>
<version>1.78</version>
</dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>4.4.0</version>
<version>5.14.0</version>
</dependency>
</dependencies>
<build>
Expand All @@ -53,7 +53,7 @@
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<version>3.12.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
Expand Down Expand Up @@ -95,11 +95,11 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.0-M1</version>
<version>3.6.3</version>
<configuration>
<!-- needed to build with JDK 11/12/13 -->
<source>8</source>
<additionalparam>-Xdoclint:none</additionalparam>
<doclint>all,-missing</doclint>
</configuration>
<executions>
<execution>
Expand Down
Loading