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
32 changes: 16 additions & 16 deletions PCPTool.v11/dll/AttestationApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ TpmAttiComputeSoftPCRs(
goto Cleanup;
}

if (FAILED(hr = WbclApiInitIterator(pbEventLog,
if (FAILED(hr = WbclApiInitIteratorX(pbEventLog,
cbEventLog,
&wbclIterator)))
{
Expand Down Expand Up @@ -453,9 +453,9 @@ TpmAttiComputeSoftPCRs(
}

for (; hr == S_OK;
hr = WbclApiMoveToNextElement(&wbclIterator))
hr = WbclApiMoveToNextElementX(&wbclIterator))
{
hr = WbclApiGetCurrentElement(
hr = WbclApiGetCurrentElementX(
&wbclIterator,
&PcrIndex,
&EventType,
Expand Down Expand Up @@ -632,7 +632,7 @@ TpmAttiFilterLog(
// Make OACR happy
*pcbResult = 0;

if (FAILED(hr = WbclApiInitIterator(pbEventLog,
if (FAILED(hr = WbclApiInitIteratorX(pbEventLog,
cbEventLog,
&wbclIterator)))
{
Expand All @@ -650,9 +650,9 @@ TpmAttiFilterLog(

// 1st pass to find out how much space we will need
for (; hr == S_OK;
hr = WbclApiMoveToNextElement(&wbclIterator))
hr = WbclApiMoveToNextElementX(&wbclIterator))
{
hr = WbclApiGetCurrentElement(
hr = WbclApiGetCurrentElementX(
&wbclIterator,
&pcrIndex,
&eventType,
Expand Down Expand Up @@ -694,7 +694,7 @@ TpmAttiFilterLog(
goto Cleanup;
}

if (FAILED(hr = WbclApiInitIterator(pbEventLog,
if (FAILED(hr = WbclApiInitIteratorX(pbEventLog,
cbEventLog,
&wbclIterator)))
{
Expand Down Expand Up @@ -723,9 +723,9 @@ TpmAttiFilterLog(

// 2nd pass to copy the entries
for (; hr == S_OK;
hr = WbclApiMoveToNextElement(&wbclIterator))
hr = WbclApiMoveToNextElementX(&wbclIterator))
{
hr = WbclApiGetCurrentElement(
hr = WbclApiGetCurrentElementX(
&wbclIterator,
&pcrIndex,
&eventType,
Expand Down Expand Up @@ -1119,7 +1119,7 @@ TpmAttGeneratePlatformAttestation(
goto Cleanup;
}

if (FAILED(hr = WbclApiInitIterator(pbLog, cbLog, &wbclIterator)))
if (FAILED(hr = WbclApiInitIteratorX(pbLog, cbLog, &wbclIterator)))
{
goto Cleanup;
}
Expand Down Expand Up @@ -2039,7 +2039,7 @@ TpmAttCreateAttestationfromLog(
goto Cleanup;
}

if (FAILED(hr = WbclApiInitIterator(pbLog,
if (FAILED(hr = WbclApiInitIteratorX(pbLog,
cbLog,
&wbclIterator)))
{
Expand All @@ -2048,9 +2048,9 @@ TpmAttCreateAttestationfromLog(

// parse the log
for (; hr == S_OK;
hr = WbclApiMoveToNextElement(&wbclIterator))
hr = WbclApiMoveToNextElementX(&wbclIterator))
{
hr = WbclApiGetCurrentElement(
hr = WbclApiGetCurrentElementX(
&wbclIterator,
&pcrIndex,
&eventType,
Expand Down Expand Up @@ -2399,7 +2399,7 @@ TpmAttGetPlatformAttestationProperties(
pAttestation->cbSignature];
cbPlatformLog = pAttestation->cbLog;

if (FAILED(hr = WbclApiInitIterator(pbPlatformLog,
if (FAILED(hr = WbclApiInitIteratorX(pbPlatformLog,
cbPlatformLog,
&wbclIterator)))
{
Expand All @@ -2417,9 +2417,9 @@ TpmAttGetPlatformAttestationProperties(

// 2nd pass to copy the entries
for (; hr == S_OK;
hr = WbclApiMoveToNextElement(&wbclIterator))
hr = WbclApiMoveToNextElementX(&wbclIterator))
{
hr = WbclApiGetCurrentElement(
hr = WbclApiGetCurrentElementX(
&wbclIterator,
&pcrIndex,
&eventType,
Expand Down
10 changes: 5 additions & 5 deletions PCPTool.v11/dll/PCPWbcl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ Return value:
//

HRESULT
WbclApiInitIterator(
WbclApiInitIteratorX(
_In_bytecount_(logSize) PVOID pLogBuffer,
_In_ UINT32 logSize,
_Out_ WBCL_Iterator* pWbclIterator
Expand Down Expand Up @@ -589,7 +589,7 @@ Return value:
//
// Extract information for the first event in the log.
//
hr = WbclApiGetCurrentElement(pWbclIterator,
hr = WbclApiGetCurrentElementX(pWbclIterator,
&pcrIndex,
&eventType,
NULL,
Expand Down Expand Up @@ -696,7 +696,7 @@ Return value:
// Move to the first log entry after the descriptor.
// WbclApiMoveToNextElement() does boundary checks.
//
hr = WbclApiMoveToNextElement(pWbclIterator);
hr = WbclApiMoveToNextElementX(pWbclIterator);
if (hr != S_OK)
{
hr = HRESULT_FROM_WIN32(ERROR_INVALID_DATA);
Expand All @@ -710,7 +710,7 @@ Return value:
}

HRESULT
WbclApiGetCurrentElement(
WbclApiGetCurrentElementX(
_In_ WBCL_Iterator* pWbclIterator,
_Out_ UINT32* pcrIndex,
_Out_ UINT32* eventType,
Expand Down Expand Up @@ -787,7 +787,7 @@ Return value:
}

HRESULT
WbclApiMoveToNextElement(
WbclApiMoveToNextElementX(
_In_ WBCL_Iterator* pWbclIterator)
/*++

Expand Down
8 changes: 4 additions & 4 deletions PCPTool.v11/dll/dll.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,26 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
Expand Down
5 changes: 5 additions & 0 deletions PCPTool.v11/exe/PCPTool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ PcpToolGetHelp(
wprintf(L" ExportKey [key name] [migrationAuth] {key file}\n");
wprintf(L" ChangeKeyUsageAuth [key name] [usageAuth] [newUsageAuth]\n");
wprintf(L" DeleteKey [key name]\n");
wprintf(L" DeleteKeys [key name regex]\n");
wprintf(L" GetPubKey [key name] {key File}\n");
wprintf(L" Encrypt [pubkey file] [data] {blob file}\n");
wprintf(L" Decrypt [key name] [blob file] {usageAuth}\n");
Expand Down Expand Up @@ -204,6 +205,10 @@ int __cdecl wmain(_In_ int argc,
{
hr = PcpToolDeleteKey(argc, argv);
}
else if (!_wcsicmp(command, L"deletekeys"))
{
hr = PcpToolDeleteKeys(argc, argv);
}
else if(!_wcsicmp(command, L"getpubkey"))
{
hr = PcpToolGetPubKey(argc, argv);
Expand Down
8 changes: 7 additions & 1 deletion PCPTool.v11/exe/PCPTool.h
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,13 @@ HRESULT
PcpToolDeleteKey(
int argc,
_In_reads_(argc) WCHAR* argv[]
);
);

HRESULT
PcpToolDeleteKeys(
int argc,
_In_reads_(argc) WCHAR* argv[]
);

HRESULT
PcpToolGetPubKey(
Expand Down
Loading