/*******************************************************************************
* Copyright (C) 2004-2008 Intel Corp. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
*
* - Neither the name of Intel Corp. nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL Intel Corp. OR THE CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*******************************************************************************/
//----------------------------------------------------------------------------
//
// File: PTHICommand.cpp
//
//----------------------------------------------------------------------------
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <cstdio>
#include <cstdlib>
#include "PTHICommand.h"
{
}
PTHICommand::~PTHICommand(void)
{
}
AMT_STATUS PTHICommand::_call(const unsigned char *command, UINT32 command_size, UINT8 **readBuffer, UINT32 rcmd, unsigned int expSize)
{
if (NULL == *readBuffer)
{
return PTSDK_STATUS_RESOURCES;
}
{
return AMT_STATUS_INTERNAL_ERROR;
}
if (0 == outBuffSize)
{
return PTHI_STATUS_EMPTY_RESPONSE;
}
if (status != AMT_STATUS_SUCCESS)
{
return status;
}
status = _verifyResponseHeader(rcmd, ((PTHI_RESPONSE_MESSAGE_HEADER *)*readBuffer)->Header, outBuffSize);
if (status != AMT_STATUS_SUCCESS)
{
return status;
}
{
return PTSDK_STATUS_INTERNAL_ERROR;
}
return AMT_STATUS_SUCCESS;
}
/*
* Confirms the correctness of the response message header
* and the response message size
* Arguments:
* command - appropriate Host interface command
* response_header - reference to the response message header
* response_size - value that holds the actual size of the
* response message
* expected_size - value that holds the expected size of the
* response message
* Return values:
* AMT_STATUS_SUCCESS - on success
* PTSDK_STATUS_INTERNAL_ERROR - on failure
*/
{
if (response_size < sizeof(PTHI_RESPONSE_MESSAGE_HEADER)) {
} else if (response_header.Reserved != 0) {
}
return status;
}
/*
* Confirms the correctness of the GetCodeVersions response message
* Arguments:
* response - reference to the response message
* Return values:
* AMT_STATUS_SUCCESS - on success
* PTSDK_STATUS_INTERNAL_ERROR - on failure
*/
{
UINT32 i;
do {
ptVerTypeCount = codeVerLen - sizeof(response.CodeVersions.BiosVersion)- sizeof(response.CodeVersions.VersionsCount);
{
break;
}
{
if (len > UNICODE_STRING_LEN)
{
break;
}
{
break;
}
}
} while (0);
return status;
}
/*
* GetVersions response message PTHI command
* Arguments:
* response - reference to the CODE_VERSIONS struct
* Return values:
* AMT_STATUS_SUCCESS - on success
* AMT_STATUS_INTERNAL_ERROR - on failure
*/
{
do {
if (status != AMT_STATUS_SUCCESS)
{
break;
}
if (status != AMT_STATUS_SUCCESS)
{
break;
}
} while (0);
if (readBuffer != NULL)
{
}
return status;
}
/*
* Calls to GetProvisioningMode Host interface command
* Arguments:
* mode - reference to the pre-allocated structure
* which will hold the result
* Return values:
* AMT_STATUS_SUCCESS - on success
* appropriate error value defined in StatusCodeDefinitions.h - on failure
*/
{
AMT_STATUS status = _call(command, command_size, &readBuffer, PROVISIONING_MODE_RESPONSE, sizeof(CFG_GET_PROVISIONING_MODE_RESPONSE));
do {
if (status != AMT_STATUS_SUCCESS)
{
break;
}
CFG_GET_PROVISIONING_MODE_RESPONSE *tmp_response = (CFG_GET_PROVISIONING_MODE_RESPONSE *)readBuffer;
} while (0);
if (readBuffer != NULL)
{
}
return status;
}
{
AMT_STATUS status = _call(command, command_size, &readBuffer, PROVISIONING_MODE_RESPONSE, sizeof(CFG_GET_PROVISIONING_MODE_RESPONSE));
do {
if (status != AMT_STATUS_SUCCESS)
{
break;
}
CFG_GET_PROVISIONING_MODE_RESPONSE *tmp_response = (CFG_GET_PROVISIONING_MODE_RESPONSE *)readBuffer;
} while (0);
if (readBuffer != NULL)
{
}
return status;
}
/*
* Calls to GetProvisioningState Host interface command
* Arguments:
* state - reference to the pre-allocated structure
* which will hold the result
* Return values:
* AMT_STATUS_SUCCESS - on success
* appropriate error value defined in StatusCodeDefinitions.h - on failure
*/
{
AMT_STATUS status = _call(command, command_size, &readBuffer, PROVISIONING_STATE_RESPONSE, sizeof(CFG_GET_PROVISIONING_STATE_RESPONSE));
do {
if (status != AMT_STATUS_SUCCESS)
{
break;
}
CFG_GET_PROVISIONING_STATE_RESPONSE *tmp_response = (CFG_GET_PROVISIONING_STATE_RESPONSE *)readBuffer;
} while (0);
if (readBuffer != NULL)
{
}
return status;
}
/*
* Calls to GetFeatureState Host interface command
* Arguments:
* requestID Indicates what feature status to query:
* 0 Redirection Sessions Status
* 1 System Defense Status
* 2 WebUI Status
* requestStatus The requested feature state(the size depand on the requestID).(OUT)
*
* Return values:
* AMT_STATUS_SUCCESS - on success
* appropriate error value defined in StatusCodeDefinitions.h - on failure
*/
{
AMT_STATUS status = _call(command, command_size, &readBuffer, GET_FEATURES_STATE_RESPONSE, sizeof(CFG_GET_FEATURES_STATE_RESPONSE));
do {
if (status != AMT_STATUS_SUCCESS)
{
break;
}
switch (requestID)
{
case REDIRECTION_SESSION:
break;
case SYSTEM_DEFENSE:
break;
case WEB_UI:
break;
}
} while (0);
if (readBuffer != NULL)
{
}
return status;
}
/*
* Calls to GetLastHostResetReason Host interface command
* Arguments:
* reason Indicates whether the last host reason was because of remote control operation(0)
* or other reason(1). (OUT)
* remoteControlTimeStamp In case the reason was due to remote control then this field
* indicates the timestamp of when the remote control command has been executed.
* (The timestamp is the number of seconds since 1/1/1970)
*
* Return values:
* AMT_STATUS_SUCCESS - on success
* appropriate error value defined in StatusCodeDefinitions.h - on failure
*/
{
AMT_STATUS status = _call(command, command_size, &readBuffer, GET_LAST_HOST_RESET_REASON_RESPONSE, sizeof(CFG_GET_LAST_HOST_RESET_REASON_RESPONSE));
do {
if (status != AMT_STATUS_SUCCESS)
{
break;
}
CFG_GET_LAST_HOST_RESET_REASON_RESPONSE *tmp_response = (CFG_GET_LAST_HOST_RESET_REASON_RESPONSE *)readBuffer;
} while (0);
if (readBuffer != NULL)
{
}
return status;
}
/*
* Calls to GetCurrentPowerPolicy Host interface command
* Arguments:
* policyName The power policy name. (OUT)
* Return values:
* AMT_STATUS_SUCCESS - on success
* appropriate error value defined in StatusCodeDefinitions.h - on failure
*/
{
AMT_STATUS status = _call(command, command_size, &readBuffer, GET_CURRENT_POWER_POLICY_RESPONSE, 0);
do {
if (status != AMT_STATUS_SUCCESS)
{
break;
}
CFG_GET_CURRENT_POWER_POLICY_RESPONSE *tmp_response = (CFG_GET_CURRENT_POWER_POLICY_RESPONSE *)readBuffer;
if (status != AMT_STATUS_SUCCESS)
{
break;
}
} else {
}
} while (0);
if (readBuffer != NULL)
{
}
return status;
}
/*
* Confirms the correctness of the GetCurrentPowerPolicy response message
* Arguments:
* response - reference to the response message
* Return values:
* AMT_STATUS_SUCCESS - on success
* PTSDK_STATUS_INTERNAL_ERROR - on failure
*/
AMT_STATUS PTHICommand::_verifyCurrentPowerPolicy(const CFG_GET_CURRENT_POWER_POLICY_RESPONSE &response)
{
if (ByteCount != (sizeof(CFG_GET_CURRENT_POWER_POLICY_RESPONSE)
- sizeof(PTHI_MESSAGE_HEADER) - sizeof(CHAR *)
{
return PTSDK_STATUS_INTERNAL_ERROR;
}
return AMT_STATUS_SUCCESS;
}
/*
* Calls to GetLanInterfaceSttings Host interface command
* Arguments:
* interfaceSettings The interface to get the settings for.
* lanSettings reference to a pre allocated struct which will hold the lan settings. (OUT)
* Return values:
* AMT_STATUS_SUCCESS - on success
* appropriate error value defined in StatusCodeDefinitions.h - on failure
*/
AMT_STATUS PTHICommand::GetLanInterfaceSettings(UINT32 interfaceSettings, LAN_SETTINGS &lanSettings)
{
&(interfaceSettings), sizeof(UINT32));
AMT_STATUS status = _call(command, command_size, &readBuffer, GET_LAN_INTERFACE_SETTINGS_RESPONSE, sizeof(CFG_GET_LAN_INTERFACE_SETTINGS_RESPONSE));
do {
if (status != AMT_STATUS_SUCCESS)
{
break;
}
CFG_GET_LAN_INTERFACE_SETTINGS_RESPONSE *tmp_response = (CFG_GET_LAN_INTERFACE_SETTINGS_RESPONSE *)readBuffer;
} while (0);
if (readBuffer != NULL)
{
}
return status;
}
/**
* Gets the HECI driver version
* Arguments:
* heciVersion - pointewr to HECI_VERSION struct (out)
* Return values:
* AMT_STATUS_SUCCESS - on success
* PTSDK_STATUS_INVALID_PARAM - on failure
*/
{
return AMT_STATUS_SUCCESS;
}
return AMT_STATUS_INTERNAL_ERROR;
}
/*
* Calls to GetSecurityParameters Host interface command
* Arguments:
* tlsEnabled true if AMT on TLS mode. (OUT)
* Return values:
* AMT_STATUS_SUCCESS - on success
* appropriate error value defined in StatusCodeDefinitions.h - on failure
*/
{
AMT_STATUS status = _call(command, command_size, &readBuffer, GET_SECURITY_PARAMETERS_RESPONSE, sizeof(CFG_GET_SECURITY_PARAMETERS_RESPONSE));
do {
if (status != AMT_STATUS_SUCCESS)
{
break;
}
CFG_GET_SECURITY_PARAMETERS_RESPONSE *tmp_response = (CFG_GET_SECURITY_PARAMETERS_RESPONSE *)readBuffer;
} while (0);
if (readBuffer != NULL)
{
}
return status;
}
/*
* Calls to GetDNSSuffixList Host interface command
* Arguments:
* dnsSuffixList reference to list of DNS suffix strings. (OUT)
* Return values:
* AMT_STATUS_SUCCESS - on success
* appropriate error value defined in StatusCodeDefinitions.h - on failure
*/
{
do {
if (status != AMT_STATUS_SUCCESS)
{
break;
}
if (status != AMT_STATUS_SUCCESS)
{
break;
}
{
{
break;
}
{
}
}
} while (0);
if (readBuffer != NULL)
{
}
return status;
}
/*
* Confirms the correctness of the GetDNSSuffixList response message
* Arguments:
* response - reference to the response message
* Return values:
* AMT_STATUS_SUCCESS - on success
* PTSDK_STATUS_INTERNAL_ERROR - on failure
*/
{
if (ByteCount != (sizeof(CFG_GET_DNS_SUFFIX_LIST_RESPONSE)
- sizeof(PTHI_MESSAGE_HEADER)
+ response.DataLength))
{
return PTSDK_STATUS_INTERNAL_ERROR;
}
return AMT_STATUS_SUCCESS;
}
/*
* Calls to SetEnterpriseAccess Host interface command
* Arguments:
* Flags flags
* HostIPAddress host IP address for enterprise access
* EnterpriseAccess enterprise access mode
* Return values:
* AMT_STATUS_SUCCESS - on success
* appropriate error value defined in StatusCodeDefinitions.h - on failure
*/
AMT_STATUS PTHICommand::SetEnterpriseAccess(UINT8 Flags, UINT8 HostIPAddress[16], UINT8 EnterpriseAccess)
{
memcpy(command + sizeof(SET_ENTERPRISE_ACCESS_HEADER) + sizeof(UINT8), HostIPAddress, sizeof(HostIPAddress));
memcpy(command + sizeof(SET_ENTERPRISE_ACCESS_HEADER) + sizeof(UINT8) + sizeof(HostIPAddress), &(EnterpriseAccess), sizeof(UINT8));
AMT_STATUS status = _call(command, command_size, &readBuffer, SET_ENTERPRISE_ACCESS_RESPONSE, sizeof(CFG_SET_ENTERPRISE_ACCESS_RESPONSE));
if (readBuffer != NULL)
{
}
return status;
}
/*
* Get FW last reset reason
* Arguments:
* reason - last FW reason
* Return values:
* AMT_STATUS_SUCCESS - on success
* appropriate error value defined in StatusCodeDefinitions.h - on failure
*/
{
AMT_STATUS status = _call(command, command_size, &readBuffer, GET_AMT_STATE_RESPONSE, sizeof(STATE_GET_AMT_STATE_RESPONSE));
do {
if (status != AMT_STATUS_SUCCESS)
{
break;
}
} while (0);
if (readBuffer != NULL)
{
}
return status;
}
/* Calls to OpenUserInitiatedConnection Host interface command
* Return values:
* AMT_STATUS_SUCCESS - on success
* appropriate error value defined in StatusCodeDefinitions.h - on failure
*/
{
memcpy(command, &(OPEN_USER_INITIATED_CONNECTION_HEADER), sizeof(OPEN_USER_INITIATED_CONNECTION_HEADER));
AMT_STATUS status = _call(command, command_size, &readBuffer, OPEN_USER_INITIATED_CONNECTION_RESPONSE, sizeof(CFG_OPEN_USER_INITIATED_CONNECTION_RESPONSE));
if (readBuffer != NULL)
{
}
return status;
}
/* Calls to CloseUserInitiatedConnection Host interface command
* Return values:
* AMT_STATUS_SUCCESS - on success
* appropriate error value defined in StatusCodeDefinitions.h - on failure
*/
{
memcpy(command, &(CLOSE_USER_INITIATED_CONNECTION_HEADER), sizeof(CLOSE_USER_INITIATED_CONNECTION_HEADER));
AMT_STATUS status = _call(command, command_size, &readBuffer, CLOSE_USER_INITIATED_CONNECTION_RESPONSE, sizeof(CFG_CLOSE_USER_INITIATED_CONNECTION_RESPONSE));
if (readBuffer != NULL)
{
}
return status;
}
/* Calls to GetRemoteAccessConnectionStatus Host interface command
* Return values:
* AMT_STATUS_SUCCESS - on success
* appropriate error value defined in StatusCodeDefinitions.h - on failure
*/
{
memcpy(command, &(GET_REMOTE_ACCESS_CONNECTION_STATUS_HEADER), sizeof(GET_REMOTE_ACCESS_CONNECTION_STATUS_HEADER));
AMT_STATUS status = _call(command, command_size, &readBuffer, GET_REMOTE_ACCESS_CONNECTION_STATUS_RESPONSE, 0);
do {
if (status != AMT_STATUS_SUCCESS)
{
break;
}
CFG_GET_REMOTE_ACCESS_CONNECTION_STATUS_RESPONSE *tmp_response = (CFG_GET_REMOTE_ACCESS_CONNECTION_STATUS_RESPONSE *)readBuffer;
if (status != AMT_STATUS_SUCCESS)
{
break;
}
remoteAccessStatus.MpsHostname.Buffer = (CHAR *)malloc(remoteAccessStatus.MpsHostname.Length * sizeof(CHAR));
} else {
}
} while (0);
if (readBuffer != NULL)
{
}
return status;
}
/*
* Confirms the correctness of the GetRemoteAccessConnectionStatus response message
* Arguments:
* response - reference to the response message
* Return values:
* AMT_STATUS_SUCCESS - on success
* PTSDK_STATUS_INTERNAL_ERROR - on failure
*/
AMT_STATUS PTHICommand::_verifyRemoteAccessConnectionStatus(const CFG_GET_REMOTE_ACCESS_CONNECTION_STATUS_RESPONSE &response)
{
if (ByteCount != (sizeof(CFG_GET_REMOTE_ACCESS_CONNECTION_STATUS_RESPONSE)
- sizeof(PTHI_MESSAGE_HEADER) - sizeof(CHAR *)
{
return PTSDK_STATUS_INTERNAL_ERROR;
}
return AMT_STATUS_SUCCESS;
}
/*
* Calls to GenerateRngKey Host interface command
* Arguments:
* None
* Return values:
* AMT_STATUS_SUCCESS - or AMT_STATUS_IN_PROGRESS on success
* appropriate error value defined in StatusCodeDefinitions.h - on failure
*/
{
AMT_STATUS status = _call(command, command_size, &readBuffer, GENERATE_RNG_SEED_RESPONSE, sizeof(CFG_GENERATE_RNG_SEED_RESPONSE));
if (readBuffer != NULL)
{
}
return status;
}
/*
* Calls to GetRngSeedStatus Host interface command
* Arguments:
* rngStatus - reference to the pre-allocated structure
* which will hold the result
* Return values:
* AMT_STATUS_SUCCESS - on success
* appropriate error value defined in StatusCodeDefinitions.h - on failure
*/
{
AMT_STATUS status = _call(command, command_size, &readBuffer, GET_RNG_SEED_STATUS_RESPONSE, sizeof(CFG_GET_RNG_SEED_STATUS_RESPONSE));
if (readBuffer != NULL)
{
}
return status;
}
/*
* Calls to ZeroTouchEnabled Host interface command
* Arguments:
* zeroTouchEnabled - reference to the pre-allocated structure
* which will hold the result
* Return values:
* AMT_STATUS_SUCCESS - on success
* appropriate error value defined in StatusCodeDefinitions.h - on failure
*/
{
AMT_STATUS status = _call(command, command_size, &readBuffer, GET_ZERO_TOUCH_ENABLED_RESPONSE, sizeof(CFG_GET_ZERO_TOUCH_ENABLED_RESPONSE));
CFG_GET_ZERO_TOUCH_ENABLED_RESPONSE *tmp_response = (CFG_GET_ZERO_TOUCH_ENABLED_RESPONSE *)readBuffer;
if (readBuffer != NULL)
{
}
return status;
}
/*
* Calls to GetProvisioningTlsMode Host interface command
* Arguments:
* provisioningTlsMode - reference to the pre-allocated structure
* which will hold the result
* Return values:
* AMT_STATUS_SUCCESS - on success
* appropriate error value defined in StatusCodeDefinitions.h - on failure
*/
{
AMT_STATUS status = _call(command, command_size, &readBuffer, GET_PROVISIONING_TLS_MODE_RESPONSE, sizeof(CFG_GET_PROVISIONING_TLS_MODE_RESPONSE));
CFG_GET_PROVISIONING_TLS_MODE_RESPONSE *tmp_response = (CFG_GET_PROVISIONING_TLS_MODE_RESPONSE *)readBuffer;
if (readBuffer != NULL)
{
}
return status;
}
/*
* Calls to StartConfiguration Host interface command
* Arguments:
* None
* Return values:
* AMT_STATUS_SUCCESS - or AMT_STATUS_CERTIFICATE_NOT_READY on success
* appropriate error value defined in StatusCodeDefinitions.h - on failure
*/
{
AMT_STATUS status = _call(command, command_size, &readBuffer, START_CONFIGURATION_RESPONSE, sizeof(CFG_START_CONFIGURATION_RESPONSE));
if (readBuffer != NULL)
{
}
return status;
}
/*
* Calls to SetProvisioningServerOTP Host interface command
* Arguments:
* passwordOTP AMT_ANSI_STRING structure of OTP password
* Return values:
* AMT_STATUS_SUCCESS - on success
* appropriate error value defined in StatusCodeDefinitions.h - on failure
*/
{
{
return PTSDK_STATUS_INVALID_PARAM;
}
};
unsigned char *command;
{
return PTSDK_STATUS_INTERNAL_ERROR;
}
memcpy(command + sizeof(SET_PROVISIONING_SERVER_OTP_HEADER), &(passwordOTP.Length), sizeof(passwordOTP.Length));
AMT_STATUS status = _call(command, command_size, &readBuffer, SET_PROVISIONING_SERVER_OTP_RESPONSE, sizeof(CFG_SET_PROVISIONING_SERVER_OTP_RESPONSE));
{
}
if (readBuffer != NULL)
{
}
return status;
}
/*
* Calls to SetDnsSuffix Host interface command
* Arguments:
* dnsSuffix AMT_ANSI_STRING structure of DNS suffix
* Return values:
* AMT_STATUS_SUCCESS - on success
* appropriate error value defined in StatusCodeDefinitions.h - on failure
*/
{
{
return PTSDK_STATUS_INVALID_PARAM;
}
};
unsigned char *command;
{
return PTSDK_STATUS_INTERNAL_ERROR;
}
memcpy(command + sizeof(SET_DNS_SUFFIX_HEADER) + sizeof(dnsSuffix.Length), dnsSuffix.Buffer, dnsSuffix.Length);
AMT_STATUS status = _call(command, command_size, &readBuffer, SET_DNS_SUFFIX_RESPONSE, sizeof(CFG_SET_DNS_SUFFIX_RESPONSE));
{
}
if (readBuffer != NULL)
{
}
return status;
}
/*
* Calls to EnumerateHashHandles Host interface command
* Arguments:
* hashHandles - reference to the pre-allocated structure
* which will hold the result
* Return values:
* AMT_STATUS_SUCCESS - on success
* appropriate error value defined in StatusCodeDefinitions.h - on failure
*/
{
do {
if (status != AMT_STATUS_SUCCESS)
{
break;
}
if (status != AMT_STATUS_SUCCESS)
{
break;
}
{
break;
}
memcpy(hashHandles.Handles, tmp_response->HashHandles.Handles, sizeof(UINT32) * hashHandles.Length);
} while (0);
if (readBuffer != NULL)
{
}
return status;
}
/*
* Confirms the correctness of the EnumerateHashHandles response message
* Arguments:
* response - reference to the response message
* Return values:
* AMT_STATUS_SUCCESS - on success
* PTSDK_STATUS_INTERNAL_ERROR - on failure
*/
{
if (ByteCount !=
sizeof(AMT_STATUS) + sizeof(response.HashHandles.Length) + (sizeof(UINT32) * response.HashHandles.Length))
{
return PTSDK_STATUS_INTERNAL_ERROR;
}
return AMT_STATUS_SUCCESS;
}
/*
* Calls to GetCertificateHashEntry Host interface command
* Arguments:
* passwordOTP AMT_ANSI_STRING structure of DNS suffix
* Return values:
* AMT_STATUS_SUCCESS - on success
* appropriate error value defined in StatusCodeDefinitions.h - on failure
*/
{
do {
if (status != AMT_STATUS_SUCCESS)
{
break;
}
if (status != AMT_STATUS_SUCCESS)
{
break;
}
memcpy(hashEntry.CertificateHash, tmp_response->Hash.CertificateHash, sizeof(tmp_response->Hash.CertificateHash));
{
break;
}
memcpy(hashEntry.Name.Buffer, &(tmp_response->Hash.Name.Buffer), hashEntry.Name.Length * sizeof(CHAR));
} while (0);
if (readBuffer != NULL)
{
}
return status;
}
/*
* Confirms the correctness of the GetCertificateHashEntry response message
* Arguments:
* response - reference to the response message
* Return values:
* AMT_STATUS_SUCCESS - on success
* PTSDK_STATUS_INTERNAL_ERROR - on failure
*/
AMT_STATUS PTHICommand::_verifyGetCertificateHashEntry(const CFG_GET_CERTHASH_ENTRY_RESPONSE &response)
{
if (ByteCount !=
(sizeof(CFG_GET_CERTHASH_ENTRY_RESPONSE) - sizeof(PTHI_MESSAGE_HEADER)
{
return PTSDK_STATUS_INTERNAL_ERROR;
}
return AMT_STATUS_SUCCESS;
}
/*
* Calls to GetDnsSuffix Host interface command
* Arguments:
* dnsSuffix - reference to the pre-allocated structure
* which will hold the result
* Return values:
* AMT_STATUS_SUCCESS - on success
* appropriate error value defined in StatusCodeDefinitions.h - on failure
*/
{
do {
if (status != AMT_STATUS_SUCCESS)
{
break;
}
if (status != AMT_STATUS_SUCCESS)
{
break;
}
{
break;
}
} while (0);
if (readBuffer != NULL)
{
}
return status;
}
/*
* Confirms the correctness of the GetDnsSuffix response message
* Arguments:
* response - reference to the response message
* Return values:
* AMT_STATUS_SUCCESS - on success
* PTSDK_STATUS_INTERNAL_ERROR - on failure
*/
{
if (ByteCount !=
{
return PTSDK_STATUS_INTERNAL_ERROR;
}
return AMT_STATUS_SUCCESS;
}