Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

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

int manageFile (FD_t *fdp, const char **fnp, int flags, int rc)
int copyFile (FD_t *sfdp, const char **sfnp, FD_t *tfdp, const char **tfnp)
 Copy header+payload, calculating digest(s) on the fly.
int getSignid (Header sig, int sigtag, unsigned char *signid)
 Retrieve signer fingerprint from an OpenPGP signature tag.
int rpmReSign (rpmts ts, QVA_t qva, const char **argv)
rpmRC rpmcliImportPubkey (const rpmts ts, const unsigned char *pkt, ssize_t pktlen)
int rpmcliImportPubkeys (const rpmts ts, QVA_t qva, const char **argv)
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)

Variables

int _print_pkts = 0
unsigned char header_magic [8]


Detailed Description

Verify the signature of a package.

Definition in file rpmchecksig.c.


Function Documentation

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 _, FD_t, Fread(), Fstrerror(), Fwrite(), manageFile(), RPMERR_FREAD, RPMERR_FWRITE, and rpmError.

Referenced by rpmReSign().

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 136 of file rpmchecksig.c.

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

Referenced by rpmReSign().

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

Definition at line 30 of file rpmchecksig.c.

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

Referenced by copyFile(), and rpmReSign().

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

Todo:
If the GPG key was known available, the md5 digest could be skipped.

Definition at line 608 of file rpmchecksig.c.

References _, _FD_s::digests, FD_t, FDDIGEST_t, Fread(), Fstrerror(), _FDDIGEST_s::hashalgo, _FDDIGEST_s::hashctx, pgpDig_s::hdrsha1ctx, Header, header_magic, HEADER_MAGIC_YES, headerFree(), headerFreeData(), headerGetEntry(), headerIsEntry(), headerRead(), headerSizeof(), int_32, pgpDig_s::md5ctx, pgpDig_s::nbytes, _FD_s::ndigests, pgpDig, PGPHASHALGO_SHA1, RPMDIGEST_NONE, rpmDigestInit(), rpmDigestUpdate(), RPMERR_FREAD, rpmError, RPMTAG_HEADERIMMUTABLE, and pgpDig_s::sha1ctx.

Referenced by rpmVerifySignatures().

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

Check package and header signatures.

Parameters:
qva parsed query/verify options
ts transaction set
fd package file handle
fn package file name
Returns:
0 on success, 1 on failure

Definition at line 680 of file rpmchecksig.c.

References _, _free(), _print_pkts, FD_t, fdInitDigest(), Header, headerFreeIterator(), headerInitIterator(), headerIsEntry(), HeaderIterator, headerNextIterator(), int_32, pgpCleanDig(), pgpDig, pgpDigParams, PGPHASHALGO_MD5, PGPHASHALGO_SHA1, pgpPrtPkts(), rpmQVKArguments_s::qva_flags, QVA_t, readFile(), readLead(), RPMERR_BADSIGTYPE, RPMERR_READLEAD, RPMERR_SIGGEN, RPMERR_SIGVFY, rpmError, rpmFreeSignature(), rpmIsDebug, rpmIsVerbose, rpmRC, RPMRC_NOKEY, RPMRC_NOTTRUSTED, RPMRC_OK, rpmReadSignature(), RPMSIGTAG_DSA, RPMSIGTAG_GPG, RPMSIGTAG_LEMD5_1, RPMSIGTAG_LEMD5_2, RPMSIGTAG_MD5, RPMSIGTAG_PGP, RPMSIGTAG_PGP5, RPMSIGTAG_RSA, RPMSIGTAG_SHA1, RPMSIGTAG_SIZE, rpmtsCleanDig(), rpmtsDig(), rpmtsSetSig(), rpmtsSignature(), rpmVerifySignature(), stpcpy(), stpncpy(), and pgpDigParams_s::version.

Referenced by rpmcliSign().


Variable Documentation

int _print_pkts = 0
 

Definition at line 25 of file rpmchecksig.c.

Referenced by rpmVerifySignatures().

unsigned char header_magic[8] [static]
 

Initial value:

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

Definition at line 601 of file rpmchecksig.c.

Referenced by readFile().


Generated on Fri Jul 29 02:38:05 2005 for rpm by  doxygen 1.3.9.1