QubesOS / qubes-rpm-oxide

Rust libraries for processing RPM packages
4 stars 4 forks source link

Always produce new-format packets #6

Closed DemiMarie closed 3 years ago

DemiMarie commented 3 years ago

This is RECOMMENDED by RFC4880 and should be supported by all versions of RPM, as they use the same code for parsing new-format packets that they use for parsing v4 signature subpackets.

This also fixes a nasty bug in the new-format packet generation code: if the packet was longer than 8383 bytes, the second byte of the new packet (0xFF) would be omitted, causing a corrupt packet to be produced. This would have been misinterpreted by RPM. Add a test case to ensure that this does not happen. Since signatures normally are nowhere near this long, this bug could have escaped into the wild.

marmarek commented 3 years ago

PipelineRetry

marmarek commented 3 years ago

This fails to build for R4.0:

DEBUG:    Compiling rpm-writer v0.2.2 (file:///builddir/build/BUILD/qubes-rpm-oxide-0.2.2/rpm-writer)
DEBUG: error: invalid lifetime name `'_`
DEBUG:    --> openpgp-parser/src/signature.rs:360:47
DEBUG:     |
DEBUG: 360 |     let check_sig_type = |reader: &mut Reader<'_>| {
DEBUG:     |                                               ^^
DEBUG: error[E0261]: use of undeclared lifetime name `'_`
DEBUG:    --> openpgp-parser/src/signature.rs:360:47
DEBUG:     |
DEBUG: 360 |     let check_sig_type = |reader: &mut Reader<'_>| {
DEBUG:     |                                               ^^ undeclared lifetime
DEBUG: error: aborting due to 2 previous errors
DEBUG: error: Could not compile `openpgp-parser`.
DemiMarie commented 3 years ago

This fails to build for R4.0:

DEBUG:    Compiling rpm-writer v0.2.2 (file:///builddir/build/BUILD/qubes-rpm-oxide-0.2.2/rpm-writer)
DEBUG: error: invalid lifetime name `'_`
DEBUG:    --> openpgp-parser/src/signature.rs:360:47
DEBUG:     |
DEBUG: 360 |     let check_sig_type = |reader: &mut Reader<'_>| {
DEBUG:     |                                               ^^
DEBUG: error[E0261]: use of undeclared lifetime name `'_`
DEBUG:    --> openpgp-parser/src/signature.rs:360:47
DEBUG:     |
DEBUG: 360 |     let check_sig_type = |reader: &mut Reader<'_>| {
DEBUG:     |                                               ^^ undeclared lifetime
DEBUG: error: aborting due to 2 previous errors
DEBUG: error: Could not compile `openpgp-parser`.

I saw; fix coming.

DemiMarie commented 3 years ago

R4.0 build problems fixed. Good to merge @marmarek?