Some of the defines are used in JSON strings and to have them properly
formatted, remove the surrounding '()' from numbers.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
The function has been tested to show that the PCRs are initialized
with the same values as before.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Since none of the authValuesGroup'd and policyAuthGroup's are != 0,
the two functions will now always return false even though they
returned TRUE before for 20 <= PCR <= 22.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Disable some PCR functions that are not needed in this step, use
other ones and adjust call sites.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Replace _plat__IsNvAvailable with _plat__GetNvReadyState and use #define's
as return values. Adjust call sites.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Replace _plat__ClockAdjustRate with _plat__ClockRateAdjust and use its
new #defines at the call sites.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Add platform_public_interface.h from upstream and disable some prototypes
and #defines for functions that are not needed or not needed yet. Remove
prototypes in other header files to avoid duplicates.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Add a simplified version of HierarchyNormalizeHandle that simply returns
the passed handle and sync the callers with upstream.
HierarchyNormalizeHandle will be extended at some later point.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Since HierarchyGetPrimarySeedCompatLevel may in the future be called with
some other hierachies than the currently existing ones, return the value
SEED_COMPAT_LEVEL_LAST in this case instead of causing an internal
failure.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Add compiler dependencies files for gcc and msvc and remove some of
the existing #define from CompilerDependencies.h
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Like OpenSSL use the Carmichael function for the RSA private exponent D
when an RSA key has >= 2048 bits and public exponent e uses more than
2 bytes. Otherwise use the Euler totient function.
The main difference is that by TPM 2 using the Carmichael function OpenSSL
now behaves the same way as when it is used by other programs that for
example load keys from PEM files where the private exponent D was
calculated with this function. The difference is seen when for example
blobs cannot be decrypted where newer versions of OpenSSL (with implicit
rejection enabled) returned results of 48 bytes every time rather than a
deterministic (for same input blob) but varying number of bytes (Euler
totient).
Switching to the Carmichael function does not have any negative impact
on interoperatibility with OpenSSL nor does it affect interoperability
between versions of TPM 2 code that did not use it. This means that
data encrypted or signed by OpenSSL or TPM 2 can be decrypted or verified
by TPM 2 or OpenSSL and that data encrypted or signed with either new
or old code in TPM 2 can be decrypted or verified with either old or
new code in TPM 2.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>