<p>(The source hash is an interesting and not-unrelated problem, but there's some other stuff to figure out before that can get done correctly - like how to make a sufficiently-unique but also human-meaningful identifier for the environment the package was built in, or the flags used to build it, etc..)</p>
<blockquote>
<p>Somehow permitting the payload bits to differ from what was created at build-time would be a pretty significant change for rpm, but I agree there's a point in it: ultimately it's the authenticity of delivered bits that matter, not the delivery box (of compression).</p>
</blockquote>
<p>Yeah, that's it exactly - as a general principle, the digest/signature should cover some <em>canonical form</em> of the data. That way other people can transform/store/etc. the data however they want, as long as there's a way to reliably transform it <em>back</em> to the canonical form it can always be verified as authentic.</p>
<p>In other words: If you sign <em>uncompressed</em> data, it's possible to verify <em>any</em> compressed data, because every compression algorithm guarantees that it can recover the original data</p>
<p>Similarly: if you sign the data with a well-known ordering - like, say, signing a hash of the sorted list of individual file digests - then you can verify the data regardless of what order you examine the individual parts. (Which is kind of like the source file hash you're talking about, but connecting source and binaries is tricky, so let's not get into that yet...)</p>
<p>As an optimization, it definitely makes sense to include a digest (or multiple digests!) of uncompressed and compressed/archived data, so you can more quickly verify the integrity of common payload formats.  (Solaris IPS does something like this - they have "hash" and "chash" keys/tags in their package metadata, so you can check the <code>chash</code> if you have compressed data, or uncompress it and you can check <code>hash</code>..)</p>
<p>Anyway, my interest here is more about compatibility between RPM and external tools, especially new repo/package formats. Generally: if I have some data store that contains (or can rebuild) a complete, intact RPM header, and I have all the files listed in that RPM header - and all their digests match, so I know I have the right files - what's the easiest way for me to get RPM to install/update/verify that package header and those files?</p>
<p>It turns out that given <em>just</em> the RPM header and the file contents you can reconstruct the original RPM lead and uncompressed payload of nearly all modern RPMs - all the data in the lead and CPIO headers is also in the RPM headers, and the payload file ordering <em>almost</em> always match the header order. But I still can't convince RPM that I have authentic data, because I'm using a slightly different version of xz, or I didn't store the original timestamp, or the payload file order sometimes doesn't match the RPM header file ordering, or whatever.</p>
<p>So: any solution that means that I can get RPM to accept that the uncompressed files are, in fact, the same as the compressed ones, would be pretty great.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/rpm-software-management/rpm/issues/861?email_source=notifications&email_token=ADLPZUZU5VNTSY3PKXRDP5TQL3O4XA5CNFSM4I2DY54KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD72Q3CA#issuecomment-536153480">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ADLPZUYXTNUBJ73O7CY3SWLQL3O4XANCNFSM4I2DY54A">mute the thread</a>.<img src="https://github.com/notifications/beacon/ADLPZU5ERL4JXGQ5QQLBVHDQL3O4XA5CNFSM4I2DY54KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD72Q3CA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/rpm-software-management/rpm/issues/861?email_source=notifications\u0026email_token=ADLPZUZU5VNTSY3PKXRDP5TQL3O4XA5CNFSM4I2DY54KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD72Q3CA#issuecomment-536153480",
"url": "https://github.com/rpm-software-management/rpm/issues/861?email_source=notifications\u0026email_token=ADLPZUZU5VNTSY3PKXRDP5TQL3O4XA5CNFSM4I2DY54KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD72Q3CA#issuecomment-536153480",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>