summaryrefslogtreecommitdiff
path: root/lib/package.c
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2002-03-06 23:17:31 +0000
committerjbj <devnull@localhost>2002-03-06 23:17:31 +0000
commitc6449e9c4439b7f2cf6c620a78d464b10a6c75b1 (patch)
treeedf6be712b9caa5fd00671f1798dec7399746b78 /lib/package.c
parent2e2d1cad39b9bf8af73ec7b2c584236aabcdad14 (diff)
downloadrpm-c6449e9c4439b7f2cf6c620a78d464b10a6c75b1.tar.gz
rpm-c6449e9c4439b7f2cf6c620a78d464b10a6c75b1.tar.bz2
rpm-c6449e9c4439b7f2cf6c620a78d464b10a6c75b1.zip
- add header DSA signature.
CVS patchset: 5345 CVS date: 2002/03/06 23:17:31
Diffstat (limited to 'lib/package.c')
-rw-r--r--lib/package.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/package.c b/lib/package.c
index 3d79c2b9a..f30c374a9 100644
--- a/lib/package.c
+++ b/lib/package.c
@@ -210,6 +210,11 @@ static rpmRC readPackageHeaders(FD_t fd,
}
#endif
+/*@unchecked@*/
+static unsigned char header_magic[8] = {
+ 0x8e, 0xad, 0xe8, 0x01, 0x00, 0x00, 0x00, 0x00
+};
+
int rpmReadPackageFile(rpmTransactionSet ts, FD_t fd,
const char * fn, Header * hdrp)
{
@@ -326,6 +331,7 @@ int rpmReadPackageFile(rpmTransactionSet ts, FD_t fd,
switch (ts->sigtag) {
case RPMSIGTAG_DSA:
/* Parse the parameters from the OpenPGP packets that will be needed. */
+rpmMessage(RPMMESS_DEBUG, _("========== Header DSA signature\n"));
xx = pgpPrtPkts(ts->sig, ts->siglen, ts->dig, rpmIsDebug());
/*@fallthrough@*/
case RPMSIGTAG_SHA1:
@@ -335,8 +341,10 @@ int rpmReadPackageFile(rpmTransactionSet ts, FD_t fd,
/*@-branchstate@*/
if (headerGetEntry(h, RPMTAG_HEADERIMMUTABLE, &uht, &uh, &uhc)) {
- ts->dig->sha1ctx = rpmDigestInit(PGPHASHALGO_SHA1, RPMDIGEST_NONE);
- (void) rpmDigestUpdate(ts->dig->sha1ctx, uh, uhc);
+ ts->dig->hdrsha1ctx = rpmDigestInit(PGPHASHALGO_SHA1, RPMDIGEST_NONE);
+ (void) rpmDigestUpdate(ts->dig->hdrsha1ctx, header_magic, sizeof(header_magic));
+ ts->dig->nbytes += sizeof(header_magic);
+ (void) rpmDigestUpdate(ts->dig->hdrsha1ctx, uh, uhc);
ts->dig->nbytes += uhc;
uh = headerFreeData(uh, uht);
}
@@ -346,6 +354,7 @@ int rpmReadPackageFile(rpmTransactionSet ts, FD_t fd,
case RPMSIGTAG_PGP5: /* XXX legacy */
case RPMSIGTAG_PGP:
/* Parse the parameters from the OpenPGP packets that will be needed. */
+rpmMessage(RPMMESS_DEBUG, _("========== Package DSA/RSA signature\n"));
xx = pgpPrtPkts(ts->sig, ts->siglen, ts->dig, rpmIsDebug());
/*@fallthrough@*/
case RPMSIGTAG_MD5: