lib/rpmchecksig.c File Reference

Verify the signature of a package. More...

#include "system.h"
#include "rpmio_internal.h"
#include <rpmcli.h>
#include "rpmdb.h"
#include "rpmts.h"
#include "rpmlead.h"
#include "signature.h"
#include "misc.h"
#include "debug.h"

Go to the source code of this file.

Functions

static int manageFile (FD_t *fdp, const char **fnp, int flags, int rc)
static int copyFile (FD_t *sfdp, const char **sfnp, FD_t *tfdp, const char **tfnp)
 Copy header+payload, calculating digest(s) on the fly.
static int getSignid (Header sig, int sigtag, unsigned char *signid)
 Retrieve signer fingerprint from an OpenPGP signature tag.
static int rpmReSign (rpmts ts, QVA_t qva, const char **argv)
 Create/modify elements in signature header.
rpmRC rpmcliImportPubkey (const rpmts ts, const unsigned char *pkt, ssize_t pktlen)
 Import public key packet(s).
static int rpmcliImportPubkeys (const rpmts ts, QVA_t qva, const char **argv)
 Import public key(s).
static int readFile (FD_t fd, const char *fn, pgpDig dig)
int rpmVerifySignatures (QVA_t qva, rpmts ts, FD_t fd, const char *fn)
 Check package and header signatures.
int rpmcliSign (rpmts ts, QVA_t qva, const char **argv)
 Create/Modify/Check elements from signature header.

Variables

int _print_pkts = 0
static unsigned char header_magic [8]


Detailed Description

Verify the signature of a package.

Definition in file rpmchecksig.c.


Function Documentation

static int copyFile ( FD_t sfdp,
const char **  sfnp,
FD_t tfdp,
const char **  tfnp 
) [static]

Copy header+payload, calculating digest(s) on the fly.

Definition at line 91 of file rpmchecksig.c.

References _, Fflush(), Fread(), Fstrerror(), Fwrite(), manageFile(), RPMERR_FREAD, RPMERR_FWRITE, and rpmError.

Referenced by rpmReSign().

static int getSignid ( Header  sig,
int  sigtag,
unsigned char *  signid 
) [static]

Retrieve signer fingerprint from an OpenPGP signature tag.

Parameters:
sig signature header
sigtag signature tag
Return values:
signid signer fingerprint
Returns:
0 on success

Definition at line 140 of file rpmchecksig.c.

References headerFreeData(), headerGetEntry(), pgpFreeDig(), pgpNewDig(), pgpPrtPkts(), pgpDig_s::signature, and pgpDigParams_s::signid.

Referenced by rpmReSign().

static int manageFile ( FD_t fdp,
const char **  fnp,
int  flags,
int  rc 
) [static]

Definition at line 30 of file rpmchecksig.c.

References _, Fclose(), fdFree, fdLink, Ferror(), Fopen(), Fstrerror(), makeTempFile(), RPMERR_MAKETEMP, RPMERR_OPEN, and rpmError.

Referenced by copyFile(), and rpmReSign().

static int readFile ( FD_t  fd,
const char *  fn,
pgpDig  dig 
) [static]

int rpmVerifySignatures ( QVA_t  qva,
rpmts  ts,
FD_t  fd,
const char *  fn 
)


Variable Documentation

int _print_pkts = 0

Definition at line 25 of file rpmchecksig.c.

unsigned char header_magic[8] [static]

Initial value:

 {
        0x8e, 0xad, 0xe8, 0x01, 0x00, 0x00, 0x00, 0x00
}

Definition at line 641 of file rpmchecksig.c.


Generated on Fri Dec 12 13:02:10 2008 for rpm by  doxygen 1.5.6