[Rpm-metadata] Re: Invalid checksums in repodata

Jeff Johnson n3npq at mac.com
Wed Oct 11 14:41:06 UTC 2006


On Oct 11, 2006, at 10:00 AM, Mark McLoughlin wrote:

> On Wed, 2006-10-11 at 09:48 -0400, Jeff Johnson wrote:
>
>> Use a digest on the *.rpm is you truly want to detect any change
>> whatsoever to the package file.
>
> 	Right, but this is a cache of that digest :-)
>

So what is needed is a unique key (based on repo and header metadata,  
not package content) to
retrieve the package file digest from cache that is guaranteed to  
change when the
package file digest changes?

That's more like a tie-breaking, collision avoidance problem then.

I'd generate a key from a digest of constant (not variable as in the  
original patch) set of tag values
from metadata. I.e. hash *all* of
	RPMTAG_SIG*
substituting constant default values for tags that are not present. A  
constant algorithm with missing
data substituted is more appealing (to me) than a variable algorithm  
with variable data, but I 'spose
It Doesn't Really Matter.

A possibly cheap (as in invariant to the details of signature header  
constituent tag values)
way to achieve the above would be to hash the concatenation of  
RPMTAG_PKGID + the offset
of the metadata header.

A hash of  RPMTAG_PKGID+offset will miss certain resigning events  
(and possibly not trigger downloads) but
will catch newly signed packages because the additional signature  
will move the header origin.

> 	(Not disagreeing with anything you've said - i.e. we can fix the  
> cache
> key to use the signature, thereby avoiding cache mis-hits from  
> packages
> using different signatures, but whatever we do will just be a
> heurisitic)
>

Keying off possibly missing signature tags was where this problem  
started.

73 de Jeff




More information about the Rpm-metadata mailing list