There is no need to recalculate digests during signing.
Digests are not signatures even if they reside in "signature" header, and signing a package must not affect the digests. So recalculating digests on signing is not just wasteful, but also conceptually plain wrong. Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
This commit is contained in:
parent
175521cc54
commit
1019fa396d
|
@ -465,20 +465,6 @@ static int rpmSign(const char *rpm, int deleting, const char *passPhrase)
|
|||
headerFree(nh);
|
||||
}
|
||||
|
||||
/* Toss and recalculate header+payload size and digests. */
|
||||
{
|
||||
rpmTagVal const sigs[] = { RPMSIGTAG_SIZE,
|
||||
RPMSIGTAG_MD5,
|
||||
RPMSIGTAG_SHA1,
|
||||
};
|
||||
int nsigs = sizeof(sigs) / sizeof(rpmTagVal);
|
||||
for (int i = 0; i < nsigs; i++) {
|
||||
(void) headerDel(sigh, sigs[i]);
|
||||
if (rpmGenDigest(sigh, sigtarget, sigs[i]))
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
|
||||
if (deleting) { /* Nuke all the signature tags. */
|
||||
deleteSigs(sigh);
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue