Commit Graph

21 Commits

Author SHA1 Message Date
Stefan Berger
42cbf67ebe WIP: tests: Add test case for KDFa replacement by OpenSSL 'KBKDF'
Implement a KDFa replacement using OpenSSL's KBKDF function. The resulting
implementation has a few restrictions compared to the original one.
For example, it cannot accept a counter value to be passed in to resume
the KDFa as the reference implementation could -- OSSL does not support
providing the counter in this becomes problematic with DRBG_Generate
where it seems to want to resume with a counter over the long-term.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2024-07-17 12:29:21 -04:00
Stefan Berger
66ab2cb549 tests: Add KDFe replacement by OpenSSL 'SSKDF' and test case
Implement a KDFe replacement using OpenSSL's SSKDF and add a test
case that compares the current implementation against the one based
on the OpenSSL SSKDF.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2024-07-16 13:15:40 -04:00
Stefan Berger
bda457104e tests: Add test case for TPMLIB_SetProfile()
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2024-07-15 11:51:38 -04:00
Stefan Berger
bb4dafb1e7 tpm2: NVMarshal: Introduce MAX_MARSHALLED_OBJECT_SIZE
Introduce the #define MAX_MARSHALLED_OBJECT_SIZE to be used for a size of
a byte buffer that is supposed to hold a marshalled OBJECT. The number
is not exact but provides for a 'safe' size of a buffer.

Add a test case to check that MAX_MARSHALLED_OBJECT_SIZE is sufficient.
The test case needs access to ANY_OBJECT_Marshal, which is only available
when -static can be used for linking since otherwise the function is
private to the library. Static linking the test case does not work when
test-coverage is enabled, therefore disable statically linked test cases
in when test-coverage is enabled and give control to the user to disable
statically linked test cases in other cases as well.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2024-03-05 21:13:57 -05:00
Stefan Berger
6e95c68503 tests: Add test cases for CVE-2023-1017 and CVE-2023-1018
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2023-03-02 09:32:38 -05:00
Stefan Berger
1d99fa711e git: Fix erroneous gitignore entries
Fix erroneous gitignore entries that previously showed with the
following command line:

git ls-files -i --exclude-standard -c

Resolves #249.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2021-09-02 13:50:24 -04:00
Nick Chevsky
a1a7748e0b Improvements to .gitignore
- Add auto-generated files *.gch, debian/autoreconf.*, tests/NVChip
- Add .pc/ (temporary directory used by Quilt for patch management)
- Remove *.patch (Quilt requires these under debian/patches/)
- Change incorrect debian/libtpms/ to debian/libtpms0/

Signed-off-by: Nick Chevsky <nchevsky@users.noreply.github.com>
2021-07-20 18:10:32 -04:00
Stefan Berger
921d6dc92e man: Remove generated man pages
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-10-12 19:51:10 -04:00
Stefan Berger
a171839cab gitignore: Ignore .dirstamp files
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-04-14 16:03:45 -04:00
Stefan Berger
bd7dc396e1 tests: Add a test program to run the TPM 2 self tests
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-05-07 16:01:48 -04:00
Stefan Berger
8f99250251 gitignore: Ignore coverage related files
Ignore files related to gcov.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-04-01 16:41:21 -04:00
Stefan Berger
db5af63392 gitignore: Ignore corpus of test cases and auto-created files
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-03-26 10:24:41 -04:00
Stefan Berger
4b4c3e4ee0 tests: Add test case for testing permanent state restore
Add a test case that test the restoring of the permanent
state that must have a persisted key.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-03-26 10:24:41 -04:00
Stefan Berger
399a07e3cd tests: Extend PCR and read again after restart of TPM with restored state
Extend the existing test case with extending PCR 10 and reading back
the result, then storing the state blobs and setting them and checking
the value of PCR 10 again.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-03-26 10:24:41 -04:00
Stefan Berger
eed97cf008 tpm2: adapt NVRAM offsets and check structure sizes
Make sure that the NVRAM offsets and structure sizes are the same
on all architectures so that we can fill up the NVRAM on one system
and migrate the state to another architecture and it will fit into
the NVRAM space there.

We leave some space for the first few data structures in the NVRAM to
grow. We do this by rounding up the NV_INDEX_RAM_DATA location to the
next kb boundary. This moves it from offset 4356 to 5120 on x86_64 and
from offset 4332 to 5120 on i386. This now leaves us with the same
amount of space for user dynamic NVRAM, which starts beyond offset 5120.

We also pad the OBJECT structure with 4 bytes so that it is the same
size on 32 and 64 bit architectures. This is a data structure that
is used in user dynamic NVRAM and should be the same size on all
architectures so that a full NVRAM always fits.

Also test the size of the NV_INDEX structure, which already has the
same size on all tested architectures (x86_64, i386, arm32, ppc64).

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2018-06-15 18:07:49 -04:00
Marc-André Lureau
48dabdbdef tests: add fuzz test
See README for details on how to use.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2018-06-15 18:07:49 -04:00
Stefan Berger
8128367045 Ignore a few more files and delete depcomp
Ignore *.log and *.trs files from the test suite.
Ignore compile and the 'missing' file.
Remove the depcomp file.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2017-04-06 14:21:18 -04:00
Stefan Berger
7c51a9cfed build: Enable building of Debian package
Add debian build files to enable building of Debian package using for example

debuild -b   or   dpkg-buildpackage -us -uc

Extend the .gitignore.

The debhelper checks show warnings and errors that will need to be addressed
some other time. For some I don't know how to solve them at the moment.

Signed-off-by: Stefan Berger <stefanb@linux.watson.ibm.com>
2016-01-12 16:30:31 -05:00
Stefan Berger
35ff4b3cba adding some more files to be ignored 2014-07-23 14:37:15 -04:00
Corey Bryant
087cd91991 Ignore patch files in gitignore
Signed-off-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
Acked-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2014-01-13 20:49:32 -05:00
Stefan Berger
9cb84e249c Add .gitignore
Add .gitignore file to ignore certain files in the repository.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Acked-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
2014-01-13 16:40:01 -05:00