rpm 5.2.1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

Macros | Functions | Variables
rpmchecksig.c File Reference
RPMCLI.

Verify the signature of a package. More...

`#include "system.h"`
`#include <rpmio_internal.h>`
`#include <poptIO.h>`
`#include <rpmbc.h>`
`#include <rpmtag.h>`
`#include <rpmtypes.h>`
`#include <rpmevr.h>`
`#include <rpmdb.h>`
`#include <rpmxar.h>`
`#include <pkgio.h>`
`#include "signature.h"`
`#include <rpmts.h>`
`#include "rpmgi.h"`
`#include <rpmversion.h>`
`#include <rpmcli.h>`
`#include "debug.h"`
Include dependency graph for rpmchecksig.c:

Go to the source code of this file.

## Macros
#define | _RPMEVR_INTERNAL /* XXX RPMSENSE_KEYRING */

## 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. More...
static int | getSignid (Header sigh, rpmSigTag sigtag, unsigned char *signid)
| Retrieve signer fingerprint from an OpenPGP signature tag. More...
static int | rpmReSign (rpmts ts, QVA_t qva, const char **argv)
| Create/modify elements in signature header. More...
rpmRC | rpmcliImportPubkey (const rpmts ts, const unsigned char *pkt, ssize_t pktlen)
| Import public key packet(s). More...
static int | rpmcliImportPubkeys (const rpmts ts, QVA_t qva, const char **argv)
| Import public key(s). More...
static rpmRC | readFile (FD_t fd, const char *fn)
int | rpmVerifySignatures (QVA_t qva, rpmts ts, void *_fd, const char *fn)
| Check package and header signatures. More...
int | rpmcliSign (rpmts ts, QVA_t qva, const char **argv)
| Create/Modify/Check elements from signature header. More...

## Variables
int | _print_pkts = 0

## Detailed Description

Verify the signature of a package.

Definition in file rpmchecksig.c.

## Macro Definition Documentation

#define _RPMEVR_INTERNAL /* XXX RPMSENSE_KEYRING */

Definition at line 13 of 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 98 of file rpmchecksig.c.

References _, Fflush(), Fread(), Fstrerror(), Fwrite(), manageFile(), rpmlog(), and RPMLOG_ERR.

Referenced by rpmReSign().

static int getSignid | ( | Header | sigh,
|  | rpmSigTag | sigtag,
|  | unsigned char * | signid
| ) |  |
| static

Retrieve signer fingerprint from an OpenPGP signature tag.

Parameters

  sigh | signature header
  sigtag | signature tag

Return values

  signid | signer fingerprint

Returns
  0 on success

Definition at line 147 of file rpmchecksig.c.

References _free(), alloca(), _HE_s::c, headerGet(), _HE_s::p, pgpDigFree(), pgpDigNew(), pgpPrtPkts(), rpmDataType_u::ptr, and _HE_s::tag.

Referenced by rpmReSign().

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

Definition at line 39 of file rpmchecksig.c.

References _, Fclose(), fdFree(), fdLink(), Ferror(), Fopen(), Fstrerror(), rpmlog(), RPMLOG_ERR, and rpmTempFile().

Referenced by copyFile(), and rpmReSign().

static rpmRC readFile | ( | FD_t | fd,
|  | const char * | fn
| ) |  |
| static

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

Definition at line 798 of file rpmchecksig.c.

References _, _free(), alloca(), _HE_s::c, fdGetDig(), fdGetXAR(), fdStealDigest(), Ferror(), Fread(), Fstrerror(), headerFree(), headerGet(), headerGetMagic(), headerIsEntry(), headerSizeof(), _HE_s::p, PGPHASHALGO_SHA1, rpmDataType_u::ptr, RPMDIGEST_NONE, rpmDigestInit(), rpmDigestUpdate(), rpmlog(), RPMLOG_ERR, rpmpkgRead(), RPMRC_FAIL, RPMRC_NOTFOUND, RPMRC_OK, RPMTAG_HEADERIMMUTABLE, rpmxarNext(), rpmxarPull(), and _HE_s::tag.

Referenced by rpmVerifySignatures().

int rpmVerifySignatures | ( | QVA_t | qva,
|  | rpmts | ts,
|  | void * | _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 883 of file rpmchecksig.c.

References _, _free(), _print_pkts, alloca(), _HE_s::c, fdInitDigest(), fdSetDig(), headerFini(), headerFree(), headerGet(), headerInit(), headerIsEntry(), headerNext(), _HE_s::p, pgpDigClean(), pgpGetSignature(), PGPHASHALGO_MD5, pgpPrtPkts(), pgpSetSig(), rpmDataType_u::ptr, rpmQVKArguments_s::qva_flags, readFile(), rpmIsDebug, rpmIsVerbose, rpmlog(), RPMLOG_ERR, RPMLOG_NOTICE, rpmpkgRead(), RPMRC_OK, RPMSIGTAG_DSA, RPMSIGTAG_MD5, RPMSIGTAG_RSA, RPMSIGTAG_SHA1, RPMSIGTAG_SIZE, rpmtsCleanDig(), rpmtsDig(), rpmVerifySignature(), stpcpy(), _HE_s::t, _HE_s::tag, VERIFY_DIGEST, and VERIFY_SIGNATURE.

Referenced by rpmcliSign().

## Variable Documentation

int _print_pkts = 0

Definition at line 35 of file rpmchecksig.c.