diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2005-05-02 10:41:42 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2005-05-02 10:41:42 +0000 |
commit | 2c1f1c71ce8b27dad83463d921823802460f3708 (patch) | |
tree | 69e17665ed5a2cafc40ba691db7be414beeb53bf | |
parent | c3a8e35b917c7b3515b279d963696b162d1ea7c5 (diff) | |
download | perl-URPM-2c1f1c71ce8b27dad83463d921823802460f3708.tar perl-URPM-2c1f1c71ce8b27dad83463d921823802460f3708.tar.gz perl-URPM-2c1f1c71ce8b27dad83463d921823802460f3708.tar.bz2 perl-URPM-2c1f1c71ce8b27dad83463d921823802460f3708.tar.xz perl-URPM-2c1f1c71ce8b27dad83463d921823802460f3708.zip |
Remove dead code
-rw-r--r-- | URPM.xs | 73 |
1 files changed, 0 insertions, 73 deletions
@@ -266,79 +266,6 @@ void fdInitDigest(FD_t fd, pgpHashAlgo hashalgo, int flags) /* end of incoporated rpmio_internal.h */ -static unsigned char header_magic[8] = { - 0x8e, 0xad, 0xe8, 0x01, 0x00, 0x00, 0x00, 0x00 -}; -static int readFile(FD_t fd, const char * fn, pgpDig dig) -{ - unsigned char buf[4*BUFSIZ]; - ssize_t count; - int rc = 1; - int i; - - dig->nbytes = 0; - - /* Read the header from the package. */ - { Header h = headerRead(fd, HEADER_MAGIC_YES); - if (h == NULL) { - rpmError(RPMERR_FREAD, _("%s: headerRead failed\n"), fn); - goto exit; - } - - dig->nbytes += headerSizeof(h, HEADER_MAGIC_YES); - - if (headerIsEntry(h, RPMTAG_HEADERIMMUTABLE)) { - void * uh; - int_32 uht, uhc; - - if (!headerGetEntry(h, RPMTAG_HEADERIMMUTABLE, &uht, &uh, &uhc) - || uh == NULL) - { - h = headerFree(h); - rpmError(RPMERR_FREAD, _("%s: headerGetEntry failed\n"), fn); - goto exit; - } - dig->hdrsha1ctx = rpmDigestInit(PGPHASHALGO_SHA1, RPMDIGEST_NONE); - (void) rpmDigestUpdate(dig->hdrsha1ctx, header_magic, sizeof(header_magic)); - (void) rpmDigestUpdate(dig->hdrsha1ctx, uh, uhc); - uh = headerFreeData(uh, uht); - } - h = headerFree(h); - } - - /* Read the payload from the package. */ - while ((count = Fread(buf, sizeof(buf[0]), sizeof(buf), fd)) > 0) - dig->nbytes += count; - if (count < 0) { - rpmError(RPMERR_FREAD, _("%s: Fread failed: %s\n"), fn, Fstrerror(fd)); - goto exit; - } - - /* XXX Steal the digest-in-progress from the file handle. */ - for (i = fd->ndigests - 1; i >= 0; i--) { - FDDIGEST_t fddig = fd->digests + i; - if (fddig->hashctx == NULL) - continue; - if (fddig->hashalgo == PGPHASHALGO_MD5) { -assert(dig->md5ctx == NULL); - dig->md5ctx = fddig->hashctx; - fddig->hashctx = NULL; - continue; - } - if (fddig->hashalgo == PGPHASHALGO_SHA1) { -assert(dig->sha1ctx == NULL); - dig->sha1ctx = fddig->hashctx; - fddig->hashctx = NULL; - continue; - } - } - - rc = 0; - -exit: - return rc; -} - int rpmReadSignature(FD_t fd, Header *header, short sig_type, const char **msg); /* needed for importing keys (from rpmio) */ |