dig = pgpNewDig();
if (dig == NULL)
goto verifyinfo_exit;
- dig->nbytes = 0;
sigtd.tag = info.tag;
sigtd.type = info.type;
b = (unsigned char *) rpm_header_magic;
nb = sizeof(rpm_header_magic);
(void) rpmDigestUpdate(ctx, b, nb);
- dig->nbytes += nb;
b = (unsigned char *) ildl;
nb = sizeof(ildl);
(void) rpmDigestUpdate(ctx, b, nb);
- dig->nbytes += nb;
b = (unsigned char *) pe;
nb = (htonl(ildl[0]) * sizeof(*pe));
(void) rpmDigestUpdate(ctx, b, nb);
- dig->nbytes += nb;
b = (unsigned char *) dataStart;
nb = htonl(ildl[1]);
(void) rpmDigestUpdate(ctx, b, nb);
- dig->nbytes += nb;
} break;
default:
sigtd.data = _free(sigtd.data); /* Hmm...? */
Header sigh = NULL;
rpmSigTag sigtag;
struct rpmtd_s sigtd;
- size_t nb;
Header h = NULL;
char * msg;
rpmRC rc = RPMRC_FAIL; /* assume failure */
h = NULL;
msg = NULL;
- nb = -fd->stats->ops[FDSTAT_READ].bytes;
rc = rpmpkgReadHeader(keyring, vsflags, fd, &h, &msg);
- nb += fd->stats->ops[FDSTAT_READ].bytes;
if (rc != RPMRC_OK || h == NULL) {
rpmlog(RPMLOG_ERR, _("%s: headerRead failed: %s"), fn,
rc = RPMRC_FAIL;
goto exit;
}
- dig->nbytes = 0;
/* Retrieve the tag parameters from the signature header. */
if (!headerGet(sigh, sigtag, &sigtd, hgeflags)) {
break;
ctx = rpmDigestInit(hashalgo, RPMDIGEST_NONE);
(void) rpmDigestUpdate(ctx, rpm_header_magic, sizeof(rpm_header_magic));
- dig->nbytes += sizeof(rpm_header_magic);
(void) rpmDigestUpdate(ctx, utd.data, utd.count);
- dig->nbytes += utd.count;
rpmtdFreeData(&utd);
} break;
case RPMSIGTAG_GPG:
/* fallthrough */
case RPMSIGTAG_MD5:
/* Legacy signatures need the compressed payload in the digest too. */
- while ((count = Fread(buf, sizeof(buf[0]), sizeof(buf), fd)) > 0)
- dig->nbytes += count;
- dig->nbytes += nb; /* XXX include size of header blob. */
+ while ((count = Fread(buf, sizeof(buf[0]), sizeof(buf), fd)) > 0) {}
if (count < 0) {
rpmlog(RPMLOG_ERR, _("%s: Fread failed: %s\n"),
fn, Fstrerror(fd));
int rc = 1;
Header h = NULL;
- dig->nbytes = 0;
/* Read the header from the package. */
if ((h = headerRead(fd, HEADER_MAGIC_YES)) == NULL) {
rpmlog(RPMLOG_ERR, _("%s: headerRead failed\n"), fn);
goto exit;
}
- dig->nbytes += headerSizeof(h, HEADER_MAGIC_YES);
-
if (headerIsEntry(h, RPMTAG_HEADERIMMUTABLE)) {
struct rpmtd_s utd;
}
/* Read the payload from the package. */
- while ((count = Fread(buf, sizeof(buf[0]), sizeof(buf), fd)) > 0)
- dig->nbytes += count;
+ while ((count = Fread(buf, sizeof(buf[0]), sizeof(buf), fd)) > 0) {}
if (count < 0) {
rpmlog(RPMLOG_ERR, _("%s: Fread failed: %s\n"), fn, Fstrerror(fd));
goto exit;