rpm/tests
Panu Matilainen a79d7ae0f0 Fix IMA signature lengths assumed constant (#1833, RhBug:2018937)
At least ECDSA and RSA signatures can vary in length, but the IMA code
assumes constant lengths and thus may either place invalid signatures on
disk from either truncating or overshooting, and segfault if the stars are
just so.

Luckily the signatures are stored as strings so we can calculate the
actual lengths at runtime and ignore the stored constant length info.
Extend hex2bin() to optionally calculate the lengths and maximum,
and use these for returning IMA data from the rpmfi(les) API.

Additionally update the signing code to store the largest IMA signature
length rather than what happened to be last to be on the safe side.
We can't rely on this value due to invalid packages being out there,
but then we need to calculate the lengths on rpmfiles populate so there's
not a lot to gain anyhow.

Fixes: #1833
2021-12-13 10:38:36 +02:00
..
data Fix IMA signature lengths assumed constant (#1833, RhBug:2018937) 2021-12-13 10:38:36 +02:00
Makefile.am Fix IMA signature lengths assumed constant (#1833, RhBug:2018937) 2021-12-13 10:38:36 +02:00
README.md test/README: Improve wording, convert to markdown (#1662) 2021-04-29 13:25:55 +02:00
atlocal.in Use external debuginfo tooling 2021-06-21 12:52:39 +03:00
local.at Disable implicit database creation on read-only handle 2020-11-24 07:18:20 +02:00
rpmbuild.at %autopatch: Fix patch number parameters 2021-09-17 09:44:23 +03:00
rpmbuildid.at Use external debuginfo tooling 2021-06-21 12:52:39 +03:00
rpmconfig.at Merge %config tests sharing built content into common groups 2020-06-15 11:59:40 +02:00
rpmconfig2.at Merge %config symlink tests sharing built content into common groups 2020-06-15 11:59:40 +02:00
rpmconfig3.at Merge config filetype change tests sharing built content into common groups 2020-06-15 11:59:40 +02:00
rpmconflict.at Remove now redundant TOPDIR removals from tests 2020-06-12 13:18:56 +03:00
rpmdb.at Revert back to implicit database creation for now 2021-04-26 11:30:00 +03:00
rpmdepmatch.at Rearrange test-suite python helper macros a bit 2011-06-09 13:19:14 +03:00
rpmdeps.at Unbreak checking of installed rich dependencies 2021-06-10 09:28:11 +03:00
rpmgeneral.at Bump libtool version info in preparation of 4.17.x branch 2021-06-21 14:42:42 +03:00
rpmi.at Allow an optional "override clock" for deterministic timestamps 2021-11-23 10:53:04 +02:00
rpmio.at Merge RPMDB_CLEAR into RPMDB_INIT, they're never used separately 2020-06-12 13:18:56 +03:00
rpmmacro.at Fix off-by-one error in rpm_call 2021-11-22 16:35:56 +02:00
rpmorder.at Merge RPMDB_CLEAR into RPMDB_INIT, they're never used separately 2020-06-12 13:18:56 +03:00
rpmpgp.at Add test for OpenPGP packet parsing bug 2021-11-01 13:39:11 +02:00
rpmpgpcheck.c Add test for OpenPGP packet parsing bug 2021-11-01 13:39:11 +02:00
rpmpython.at Fix IMA signature lengths assumed constant (#1833, RhBug:2018937) 2021-12-13 10:38:36 +02:00
rpmquery.at Add support for RPMDBI_BASENAMES on file queries 2021-09-13 16:24:20 +03:00
rpmreplace.at Make Lua a hard requirement for rpm 2021-02-09 13:57:27 +02:00
rpmscript.at Make Lua a hard requirement for rpm 2021-02-09 13:57:27 +02:00
rpmsigdig.at Validate and require subkey binding signatures on PGP public keys 2021-10-19 09:41:10 +03:00
rpmspec.at Add NEVR provides for all packages that would be built into source rpms 2020-01-15 13:55:28 +02:00
rpmtests.at Use external debuginfo tooling 2021-06-21 12:52:39 +03:00
rpmvercmp.at Make Lua a hard requirement for rpm 2021-02-09 13:57:27 +02:00
rpmverify.at Make Lua a hard requirement for rpm 2021-02-09 13:57:27 +02:00
rpmvfylevel.at Remove now redundant TOPDIR removals from tests 2020-06-12 13:18:56 +03:00

README.md

To run these tests, you need at least these dependencies on the host:

  1. fakechroot
  2. gdb
  3. gnupg >= 2.0

Then run the command

make check

The number of tests performed depends on features enabled at configure time, at least --with-/--without-lua and --enable-/--disable-python. See also the INSTALL file for more information.

To run single tests, you can run the commands:

make populate_testing && ./rpmtests $NNN $MMM ...

where NNN and MMM are the numbers of the tests to be run.

To get the list of available tests, use the command:

  ./rpmtests -l

You can also select tests by keywords used in their description by using the command:

 ./rpmtests -k $KEYWORD

Use multiple -k parameters to have tests with different keywords run. Use -k $KEYWORD1,$KEYWORD2 to execute tests matching both KEYWORD1 and KEYWORD2.

See the output of the command:

./rpmtests --help

for more options. But be aware some (like -j) need not work properly with the test suite unless a very restricted set of test is run.