rpm  5.4.10
Macros | Functions | Variables
package.c File Reference
#include "system.h"
#include <netinet/in.h>
#include <rpmio_internal.h>
#include <rpmcb.h>
#include <rpmhkp.h>
#include <rpmtag.h>
#include <rpmtypes.h>
#include <pkgio.h>
#include "signature.h"
#include "rpmts.h"
#include "debug.h"
Include dependency graph for package.c:

Go to the source code of this file.

Macros

#define _RPMHKP_INTERNAL   /* XXX internal prototypes. */
#define alloca_strdup(_s)   strcpy(alloca(strlen(_s)+1), (_s))
#define _chk(_mask)   (she->tag == 0 && !(vsflags & (_mask)))

Functions

static int pgpStashKeyid (pgpDig dig)
 Remember current key id.
rpmRC rpmReadPackageFile (rpmts ts, FD_t fd, const char *fn, Header *hdrp)
 Return package header from file handle, verifying digests/signatures.

Variables

unsigned int * keyids = NULL
static unsigned int nkeyids_max = 256
static unsigned int nkeyids = 0
static unsigned int nextkeyid = 0

Macro Definition Documentation

#define _chk (   _mask)    (she->tag == 0 && !(vsflags & (_mask)))

Referenced by rpmReadPackageFile().

#define _RPMHKP_INTERNAL   /* XXX internal prototypes. */

Definition at line 12 of file package.c.

#define alloca_strdup (   _s)    strcpy(alloca(strlen(_s)+1), (_s))

Definition at line 24 of file package.c.

Function Documentation

static int pgpStashKeyid ( pgpDig  dig)
static

Remember current key id.

Parameters
digcontainer
Returns
0 if new keyid, otherwise 1

Definition at line 47 of file package.c.

References keyids, nextkeyid, nkeyids, nkeyids_max, pgpGetSig(), pgpGetSignature(), pgpGrab(), and xrealloc.

Referenced by rpmReadPackageFile().

rpmRC rpmReadPackageFile ( rpmts  ts,
FD_t  fd,
const char *  fn,
Header hdrp 
)

Return package header from file handle, verifying digests/signatures.

Todo:
The rpmts either needs to become void *, or changed to -lrpmdb scope.
Parameters
tstransaction set
fdfile handle
fnfile name
Return values
hdrpaddress of header (or NULL)
Returns
RPMRC_OK on success
Todo:
Implement disable/enable/warn/error/anal policy.

Definition at line 83 of file package.c.

References _, _chk, _free(), alloca(), rpmDataType_u::argv, _HE_s::c, rpmop_s::count, fdInitDigest(), fdSetDig(), fdstat_op(), FDSTAT_READ, fdStealDigest(), Fread(), Fstrerror(), headerFree(), headerGet(), headerGetMagic(), headerIsEntry(), headerLink(), headerMergeLegacySigs(), _HE_s::p, PGPARMOR_PUBKEY, pgpArmorUnwrap(), pgpDigVSFlags, pgpGetSigtag(), PGPHASHALGO_MD5, PGPHASHALGO_SHA1, pgpPktLen(), pgpSetSig(), pgpStashKeyid(), pgpStatsAccumulator(), rpmDataType_u::ptr, RPM_STRING_ARRAY_TYPE, RPMDIGEST_NONE, rpmDigestInit(), rpmDigestUpdate(), rpmiobAppend(), rpmiobFree(), rpmiobNew(), rpmlog(), RPMLOG_DEBUG, RPMLOG_ERR, RPMLOG_WARNING, rpmpkgRead(), RPMRC_FAIL, RPMRC_NOKEY, RPMRC_NOSIG, RPMRC_NOTFOUND, RPMRC_NOTTRUSTED, RPMRC_OK, RPMSIGTAG_DSA, RPMSIGTAG_MD5, RPMSIGTAG_RSA, RPMSIGTAG_SHA1, rpmswAdd(), rpmswEnter(), rpmswExit(), rpmswSub(), RPMTAG_HEADERIMMUTABLE, RPMTAG_PUBKEYS, RPMTS_OP_DIGEST, RPMTS_OP_READHDR, rpmtsCleanDig(), rpmtsDig(), rpmtsOp(), rpmVerifySignature(), RPMVSF_NEEDPAYLOAD, RPMVSF_NODSAHEADER, RPMVSF_NOMD5, RPMVSF_NORSAHEADER, RPMVSF_NOSHA1HEADER, _FD_s::stats, _HE_s::t, _HE_s::tag, rpmDataType_u::ui8p, and vsflags.

Referenced by IDTXglob(), main(), rpmgiReadHeader(), rpmInstallSourcePackage(), rpmrepoReadHeader(), rpmteFDHeader(), rpmts_HdrFromFdno(), and rpmtsSolve().

Variable Documentation

unsigned int* keyids = NULL

Definition at line 32 of file package.c.

Referenced by pgpStashKeyid().

unsigned int nextkeyid = 0
static

Definition at line 40 of file package.c.

Referenced by pgpStashKeyid().

unsigned int nkeyids = 0
static

Definition at line 38 of file package.c.

Referenced by pgpStashKeyid().

unsigned int nkeyids_max = 256
static

Definition at line 36 of file package.c.

Referenced by pgpStashKeyid().