memory usage: move the call to webservice out of infinite loop and set unused objects as null.
Signed-off-by: Emily <lijuan.zhang@intel.com>
Fix NIARL_TPM_Module to be compatible with tpm_takeownership -z

tpm_takeownership -z will set the SRK auth value as TSS_WELL_KNOWN_SECRET(20-byte 0’s), but NIARL module always use sha1(TSS_WELL_KNOWN_SECRET) as the auth value for SRK. So client provisoning will always failed after tpm ownership was taken by tpm_takeownership -z(tpm-tools).

Update the NIARL_TPM_Module code to be aligned with tpm-tools on how to specify well-known-secret.

Signed-off-by: Gang Wei <gang.wei@intel.com>
HisAppraiser: Fixed bug in reports comparison

This patch fixes a bug in function comparePreviousReport() of
class HisReportValidator. The function is part of report validation
process and compares PCRs in the current report with PCRs of last
report received from the same host.

The function comparePreviousReport() generates an error message
when some PCR in the current report are not found in or differ from
PCRs in the previous report. The function didn't treat the case
of a PCR previously present and not found in the current report.
HisAppraiser: Fixed bug in writing field reportErrors

This patch fixes the generation of string to be written in
field reportErrors of table AuditLog. The string is obtained
from a list filled by HisReportValidator constructor, but the
generation process uses an object StringBuffer for all errors
except the first one.

The bug occurs when the list of errors contains at least 2
elements: in this case, the first error is copied to the
final string, but later it is overwritten by the concatenation
of subsequent errors.
HisAppraiser: Fixed wrong checks in submitReport() function

This patch fixes two wrong checks. At first, the check on
'latestPolledRequest' variable is replaced with
'latestPolledRequest.getId()'. The reason why the original check
is wrong (the correct code appears also in the lines below) is
that 'latestPolledRequest' is always not null because the function
getLatestPolledRequest() returns a new object 'AttestRequest' in
case of request not found.

Then the check on result of 'latestPolledRequest' is removed, because
the function getLatestPolledRequest() always selects an attestation
request whose result field is null.
HisAppraiser: PCR validation avoided if report validation fails

In case of error in report validation OAT continued with
comparison of PCRs with the white list. The patch avoids
this behaviour and returns UN_TRUSTED if report validation fails.
Merge pull request #10 from nbarresi/devel-1.6-bugfixes

Devel 1.6 bugfixes