Commit Graph

21 Commits

Author SHA1 Message Date
Stefan Berger
676e481180 CHANGES: Updated CHANGES document for 0.9.7
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2025-06-10 11:32:28 -04:00
Stefan Berger
1034c0e2d7 CHANGES: Update CHANGES document for 0.9.7 after revert
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2023-08-21 19:15:08 -04:00
Stefan Berger
c9385bbec0 CHANGES: Updated CHANGES document for 0.9.7
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2023-08-14 10:53:27 -04:00
Stefan Berger
c4d875e74d CHANGES: Updated CHANGES document for 0.9.6
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2023-02-28 15:57:55 -05:00
Stefan Berger
e93c0082be CHANGES: Updated CHANGES document for 0.9.5
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2022-07-01 11:36:16 -04:00
Stefan Berger
b6dc4fa924 CHANGES: Updated CHANGES document for 0.9.4
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2022-04-25 14:17:25 -04:00
Stefan Berger
472bc355ef CHANGES: Updated CHANGES document for 0.9.3
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2022-03-07 12:07:25 -05:00
Stefan Berger
259c1310ff CHANGES: Updated CHANGES document for 0.9.1
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2022-01-05 08:07:18 -05:00
Stefan Berger
1ff6fe1f43 CHANGES: Updated CHANGES document for 0.9.1
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2021-11-24 09:54:47 -05:00
Stefan Berger
ab25f924d1 CHANGES: Updated CHANGES document for 0.9.0
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2021-09-28 16:55:28 -04:00
Stefan Berger
d78e6e3879 tpm2: Add more compile-time constants to array
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2021-09-06 13:42:06 -04:00
Stefan Berger
5e97c2e78d tpm2: Make exp. size of compile-time constants dependent on header version
Make the expected array size of compile-time constants dependent on
the version of the header. This way we can add elements to the array
while bumping up the version of the header.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2021-09-06 13:42:06 -04:00
Stefan Berger
be5fabf155 tpm2: Consume padding bytes in TPM2_ContextLoad() (Win2k19, issue #217)
Windows 2019 Server padds the TPM_ContextLoad() command with additional
bytes up to TPM_PT_MAX_OBJECT_CONTEXT for the TPMS_CONTEXT part. Since
libtpms does not use an OBJECT to serialize the keys (anymore) it now
uses less bytes than the MAXimum of TPM_PT_MAX_OBJECT_CONTEXT bytes and
the padding leaves some unconsumed bytes that end up failing the command
since no left-over bytes are allowed in any command.

When unconsumed bytes are left in TPMS_CONTEXT_Unmarshal() we check that
the original passed in size was that of TPM_PT_MAX_OBJECT_CONTEXT and
only then consume the additional padding bytes. Luckily only one command
calls TPMS_CONTEXT_Unmarshal() so that no unwanted side effects should
occur anywhere else, such as no bytes left for unmarshalling the next
structure.

The wisdom behind the padding is not quite clear but it feels like
ill-fixing the code to work around a Windows 2019 server bug...

This patch fixes issed #217

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2021-06-01 06:39:35 -04:00
Stefan Berger
db1fd5948b tpm2: Switch to UINT16 for CONTEXT_SLOT and 64k context gap
This patch addresses issue #209.

The context gap for libtpms is currently only 0xff due to the CONTEXT_SLOT
being a UINT8. To extend this to 0xffff, we need to define the CONTEXT_SLOT
as UINT16 and introduce a global variable s_ContextArrayMask that takes on
two valid values, 0xff for simulating the CONTEXT_SLOT when it was UINT8
and 0xffff for usage with the new CONTEXT_SLOT of type UINT16. All
occurrences of casts to CONTEXT_SLOT are replaced with a macro
CONTEXT_SLOT_MASKED that applies this mask to a value instead of using the
cast. We also use it for some calculations to avoid spilling over from
1 byte into 2 bytes for example. The cast with the new code is the same as
applying the mask 0xffff, and using the 0xff mask we can simulate the old
CONTEXT_SLOT (1 byte), which we need for seamlessly resuming old state. We
switch from the 0xff mask to the 0xffff mask when the TPM is reset.

There's one place where the s_ContextArrayMask is initialized to 0xff, and
this is when we resume 'old' STATE_RESET_DATA. The places where it is
intialized to 0xffff are in TPM_Manufacture() and
TPM_SessionStartup(SU_CLEAR), both of which are not called after resuming
state.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2021-05-13 08:53:26 -04:00
Nicolas Iooss
bbd7b75d71 Fix many misspellings
When testing downgrading from libtpms 0.8 to 0.7 (which is not
possible), the error message which is reported is:

    libtpms/tpm2: Unexpect value for MAX_RSA_KEY_BITS; its value 3072 is
    not = 2048; (version: 2).

codespell (https://github.com/codespell-project/codespell) reports a
misspelling for "Unexpect", which should be "Unexpected". As the project
contains many more misspellings in comments, error messages and
documentation, fix all misspellings reported by codespell.

Signed-off-by: Nicolas Iooss <nicolas.iooss@ledger.fr>
2021-03-02 08:20:25 -05:00
Stefan Berger
f66a719eda CHANGES: Updated CHANGES document for 0.8.0
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2021-02-22 12:10:54 -05:00
Stefan Berger
c762ca4aa6 CHANGES: Update CHANGES file for 0.8.0
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-06-02 09:00:46 -04:00
Stefan Berger
b19d7f6aca CHANGES: Add entry about changes for 0.8.0 so far
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-04-14 16:03:45 -04:00
Stefan Berger
39b1301d64 CHANGES: Add entry about significant changes for 0.7
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-07-19 12:03:52 -04:00
Stefan Berger
0b60a44790 Extend CHANGES file with what is new in v0.6.0
Mention support for TPM 2 (up to rev 150) and new API calls.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-01-14 08:50:41 -05:00
Corey Bryant
a0098eda2d Initial import of project
This is the initial import of the libtpms library.  The libtpms library
provides software emulation of a Trusted Platform Module (TPM).  It is
intended to be used by applications when a hardware TPM is not adequate.
For example, a hypervisor can use libtpms to emulate an independent TPM
for each of it's virtual machine guests.  The library provides a high-
level API for developers to integrate the emulated TPM support into
their application.

The code was originally written by Kenneth Goldman <kgoldman@us.ibm.com>
and Stefan Berger <stefanb@us.ibm.com>.

The code is licensed under the Modified BSD License.

Signed-off-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
2013-10-31 15:33:22 -05:00