[PLUG] Final test release of rpm-4.1

Paul Heinlein heinlein at attbi.com
Wed Aug 28 13:17:28 UTC 2002


I thought some of you might be interested in this. I'll be interested 
to see how the new dependency tracking/suggestion stuff works out.

--Paul Heinlein <heinlein at attbi.com>


---------- Forwarded message ----------
Date: Tue, 27 Aug 2002 19:00:34 -0400
From: Jeff Johnson <jbj at redhat.com>
Reply-To: rpm-list at redhat.com
To: rpm-list at redhat.com
Subject: Final test release of rpm-4.1 ...


There's a complete version of rpm-4.1-1.01 available for testing at

	ftp://ftp.rpm.org/pub/rpm/test-4.1

I've included source and binary packages compiled for all Red Hat platforms.
All the packages are signed with the BETA-GPG-KEY, also present at the
above URL.

AFAIK, this *is* rpm-4.1, but there's always something that needs fixing
at the last minute.

If you have the time to install and try out rpm-4.1, I'd appreciate any
bug reports at

	http://bugzilla.redhat.com

Here's a short summary (again) of features that have been added. See the
CHANGES file in the src rpm for more details.

1) Header signatures and digests can (if configured) be verified when
   retrieved from the rpm database. See /usr/lib/rpm/macros for comments
   about how to configure %_vsflags_install et al macros.

   Note: this is only mechanism, a better/configurable security policy
   is gonna be needed in rpm somewhen soon. Suggestions/patches/audits are
   very much appreciated.

2) The rpm database permits concurrent access. That means that it is now
   possible to run rpm in %post scriptlets.

   Note: What still remains is to find out whether there are deadlocks
   (there are), and whether the deadlocks can be avoided or otherwise
   handled gracefully. I'd really like to support (at least read)
   concurrent access to the rpm database, but it's gonna take a lot
   of careful (i.e. reproducible) testing to achieve that goal. Any
   and all help is appreciated. What's very promising is that the
   problems are deadlocks, not segfaults, but reproducing deadlocks
   is gonna be quite challenging.

3) The rpmdb-redhat package (which contains an "everything" rpm database),
   if installed, will be used to provide suggested solutions for unresolved
   dependencies. Try installing the rpmdb-redhat package from Raw Hide if
   interested.

4) /usr/lib/rpm/rpmcache has been added to the rpm-devel package. rpmcache
   can be used to create a custom rpm database to provide suggested solutions
   for unresolved dependencies. See rpmcache(8) for some hints about how to
   use.

5) /usr/bin/rpmgraph has been added to the rpm-devel package. rpmgrapgh
   will generate dependsnecy graphs of packages for display by graphwiz.
   See rpmgraph(8) for details. If nowhere else, there's a graphvix source
   rpm that can be compiled to display the output at
	ftp://people.redhat.com/jbj/graphviz-1.7.14-1.src.rpm

There are several goals in rpm-4.1:

1) new, header-only, digital signatures and digests for packages.

2) verifying header signatures/digests when the header is read.

3) replacing the internal representation of headers with smaller data
   structures to reduce memory footprint.

4) enriching and stabilizing the rpmlib API.

Both 3) and 4) are gonna be quite painful for developers, as the
entire rpmlib API has changed. What's good is that I can now expose
more of the internals of rpmlib more or less opaquely.

What's bad is that everything has changed. I'll be happy to answer questions
or help with porting (assuming time available) as needed.

Below is a short description of the signature changes.
==========================================================================
DSA/RSA signature verification using RFC-2440 OpenPGP V3
packets is now implemented directly in rpm. The signature,
if available, is always verified when reading a package, and failures
are always reported.

Signing is done with gpg/pgp helpers as always, and both a new,
header-only, as well as the Good Old header+payload signature
are generated. In fact, all of Red Hat 7.3 was signed with rpm-4.1,
so both signatures should be present in 7.3 packages.

What's also new is pubkey management using --import. Basically
	rpm --import RPM-GPG-KEY
(or any ascii armored OpenPGP pubkey) will wrap the binary OpenPGP
packet in a header, and install much like any other package.

Here's what you see if you have not yet imported the correct pubkey(s):

bash$ sudo rpm -Uvh /B/7.3/rpm/4.0.4-7x.18/i386/*
warning: /B/7.3/rpm/4.0.4-7x.18/i386/popt-1.6.4-7x.18.i386.rpm: Header V3 DSA signature: NOKEY, key ID db42a60e
...

Here's what the Red Hat pubkeys look like when imported:
==========================================================================
bash$ rpm -qa | grep pubkey
gpg-pubkey-0352860f-3c3cb5e4
gpg-pubkey-db42a60e-37ea5438

bash$ rpm -qi gpg-pubkey-db42a60e
Name        : gpg-pubkey                   Relocations: (not relocateable)
Version     : db42a60e                          Vendor: (none)
Release     : 37ea5438                      Build Date: Sat 16 Mar 2002 10:47:53 AM EST
Install date: Sat 16 Mar 2002 10:47:53 AM EST      Build Host: localhost
Group       : Public Keys                   Source RPM: (none)
Size        : 0                                License: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coYoIhHJ2oIO8ujQItvvNaU88j/s/izQv5e7MXOgVSjKe/WX3s2Jt
B/tW7utpy12wh1J+JsFdbLV/t8CozUTpJgx5mVA3RKlxjTA+On+1IEUWioB+iVfT7Ov/0kcA
zwADBQf9E4SKCWRand8K0XloMYgmipxMhJNnWDMLkokvbMNTUoNpSfRoQJ9EheXDxwMpTPwK
ti/PYrrL2J11P2ed0x7zm8v3gLrY0cue1iSba+8glY+p31ZPOr5ogaJw7ZARgoS8BwjyRymX
Qp+8Dete0TELKOL2/itDOPGHW07SsVWOR6cmX4VlRRcWB5KejaNvdrE54XFtOd04NMgWI63u
qZc4zkRa+kwEZtmbz3tHSdRCCE+Y7YVP6IUf/w6YPQFQriWYFiA6fD10eB+BlIUqIw80Vgjs
BKmCwvKkn4jg8kibXgj4/TzQSx77uYokw1EqQ2wkOZoaEtcubsNMquuLCMWijYhGBBgRAgAG
BQI36lRyAAoJECGRgM3bQqYOhyYAnj7hVDY/FJAGqmtZpwVp9IlitW5tAJ4xQApr/jNFZCTk
snI+4O1765F7tA==
=3AHZ
-----END PGP PUBLIC KEY BLOCK-----
==========================================================================

For the extremely security conscious and the overly curious, I note the
following limitations:

	1) there's no attempt (yet) to verify the signature on the
	pubkey before verifying the package signature.

	2) there's no attempt (yet) to implement any trust model using
	OpenPGP packets. All imported keys are considered trusted.

	3) only V3 signatures are implemented ATM.

If that's not to your taste, then you can export the signature from a
package and verify using gpg outside of rpm. For example, here's a
short script that verifies good old header+payload signatures of
a package using gpg:

==========================================================================
#!/bin/sh

for pkg in $*
do
    if [ "$pkg" = "" -o ! -e "$pkg" ]; then
	echo "no package supplied" 1>&2
	exit 1
    fi

    plaintext=`mktemp $0-$$.XXXXXX`
    detached=`mktemp $0-$$.XXXXXX`

# --- Extract detached signature
    rpm -qp -vv --qf '%{siggpg:armor}' $pkg > $detached

# --- Figger the offset of header+payload in the package
    leadsize=96
    o=`expr $leadsize + 8`

    set `od -j $o -N 8 -t u1 $pkg`
    il=`expr 256 \* \( 256 \* \( 256 \* $2 + $3 \) + $4 \) + $5`
    dl=`expr 256 \* \( 256 \* \( 256 \* $6 + $7 \) + $8 \) + $9`

    sigsize=`expr 8 + 16 \* $il + $dl`
    o=`expr $o + $sigsize + \( 8 - \( $sigsize \% 8 \) \) \% 8`

# --- Extract header+payload
    dd if=$pkg ibs=$o skip=1 2>/dev/null > $plaintext

# --- Verify DSA signature using gpg
    gpg --batch -vv --debug 0xfc02 --verify $detached $plaintext

# --- Clean up
    rm -f $detached $plaintext
done
==========================================================================
-- 
Jeff Johnson	ARS N3NPQ
jbj at redhat.com (jbj at jbj.org)
Chapel Hill, NC



_______________________________________________
Rpm-list mailing list
Rpm-list at redhat.com
https://listman.redhat.com/mailman/listinfo/rpm-list





More information about the PLUG mailing list