[Rpm-maint] [PATCH v9 09/13] Add file signature support to package signing

Thierry Vignaud thierry.vignaud at gmail.com
Wed May 11 20:35:52 UTC 2016

On 21 July 2015 at 19:00, Fionnuala Gunter <fionnuala.gunter at gmail.com> wrote:
> From: "fin at linux.vnet.ibm.com" <fin at linux.vnet.ibm.com>
> This patch modifies rpmSign to include file signatures in the header.
> Since the header is altered, the package digest and package+archive
> digest need to be recalculated and updated in the signature header.
> Defer resigning the header digests to replaceSignature().
> Changelog:
> - remAdd file signature support to package signing

The following change makes perl-RPM4's testsuite to fail due to segfault:
(see attached gdb trace)

> @@ -720,5 +878,5 @@ int rpmPkgSign(const char *path, const struct rpmSignArgs * args)
>  int rpmPkgDelSign(const char *path)
>  {
> -    return rpmSign(path, 1);
> +    return rpmSign(path, 1, 0);
>  }

The attached patch fixes that.
It's against the 4.13.x branch but should apply on master too.

Please apply
-------------- next part --------------
[tv at localhost RPM4-0.35]$ PERL5DIR=`pwd`/src/blib/arch  PERL_DL_NONLAZY=1 gdb -q --args perl  "-MExtUtils::Command::MM" "-MTest::Harness" t/06sign.t
Reading symbols from perl...Reading symbols from /usr/lib/debug/usr/bin/perl5.22.2.debug...done.
(gdb) r
Starting program: /usr/bin/perl -MExtUtils::Command::MM -MTest::Harness t/06sign.t
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
rpmPkgSign (path=path at entry=0x61f560 "/tmp/6QmUdYmV8k/test-rpm-1.0-1mdk.noarch.rpm", args=args at entry=0x0) at rpmgensig.c:873
873         rc = rpmSign(path, 0, args->signfiles);
Missing separate debuginfos, use: debuginfo-install lib64bzip2_1-1.0.6-9.mga6.x86_64 lib64db5.3-5.3.28-10.mga6.x86_64 lib64elfutils1-0.166-1.mga6.x86_64 lib64icu56-56.1-3.mga6.x86_64 lib64lua5.2-5.2.3-9.mga6.x86_64 lib64lzma5-5.2.2-3.mga6.x86_64 lib64magic1-5.25-4.mga6.x86_64 lib64ncurses6-6.0-5.mga6.x86_64 lib64ncursesw6-6.0-5.mga6.x86_64 lib64nspr4-4.12-1.mga6.x86_64 lib64nss3-3.23.0-1.mga6.x86_64 lib64nss-mdns2-0.10-16.mga6.x86_64 lib64popt0-1.16-13.mga6.x86_64 lib64readline6-6.3-9.mga6.x86_64 lib64rpmconstant0-0.1.4-7.mga6.x86_64 lib64sqlite3_0-3.12.2-1.mga6.x86_64 lib64zlib1-1.2.8-9.mga6.x86_64 libgcc1-5.3.1-0.20160503.1.mga6.x86_64 libstdc++6-5.3.1-0.20160503.1.mga6.x86_64 perl-Digest-SHA1-2.130.0-18.mga6.x86_64
(gdb) bt
#0  rpmPkgSign (path=path at entry=0x61f560 "/tmp/6QmUdYmV8k/test-rpm-1.0-1mdk.noarch.rpm", args=args at entry=0x0) at rpmgensig.c:873
#1  0x00007ffff0f2c1da in rpmsign (passphrase=passphrase at entry=0xcbec00 "RPM4", rpm=rpm at entry=0x61f560 "/tmp/6QmUdYmV8k/test-rpm-1.0-1mdk.noarch.rpm") at RPM4.xs:475
#2  0x00007ffff0f2c30a in XS_RPM4_rpmresign (my_perl=<optimized out>, cv=<optimized out>) at RPM4.xs:862
#3  0x00000031564d4bda in Perl_pp_entersub (my_perl=0x603010) at pp_hot.c:3272
#4  0x00000031564cdb46 in Perl_runops_standard (my_perl=0x603010) at run.c:41
#5  0x000000315645b0d9 in S_run_body (oldscope=1, my_perl=0x603010) at perl.c:2448
#6  perl_run (my_perl=0x603010) at perl.c:2371
#7  0x0000000000400e29 in main (argc=4, argv=0x7fffffffd9a8, env=0x7fffffffd9d0) at perlmain.c:116

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-fix-segfault-when-calling-with-args-NULL.patch
Type: application/binary
Size: 910 bytes
Desc: not available
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20160511/51266ff9/attachment.bin>

More information about the Rpm-maint mailing list