rpm
4.5
|
Verify the signature of a package. More...
#include "system.h"
#include "rpmio_internal.h"
#include <rpmcli.h>
#include <rpmevr.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.
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 sig, int 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 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. More... | |
int | rpmcliSign (rpmts ts, QVA_t qva, const char **argv) |
Create/Modify/Check elements from signature header. More... | |
Variables | |
int | _print_pkts = 0 |
static unsigned char | header_magic [8] |
Verify the signature of a package.
Definition in file rpmchecksig.c.
#define _RPMEVR_INTERNAL /* XXX RPMSENSE_KEYRING */ |
Definition at line 10 of file rpmchecksig.c.
Copy header+payload, calculating digest(s) on the fly.
Definition at line 93 of file rpmchecksig.c.
References _, Fflush(), Fread(), Fstrerror(), Fwrite(), manageFile(), RPMERR_FREAD, RPMERR_FWRITE, and rpmError.
Referenced by rpmReSign().
|
static |
Retrieve signer fingerprint from an OpenPGP signature tag.
sig | signature header |
sigtag | signature tag |
signid | signer fingerprint |
Definition at line 143 of file rpmchecksig.c.
References headerFreeData(), headerGetEntry(), pgpFreeDig(), pgpNewDig(), pgpPrtPkts(), pgpDig_s::signature, and pgpDigParams_s::signid.
Referenced by rpmReSign().
|
static |
Definition at line 32 of file rpmchecksig.c.
References _, Fclose(), fdFree(), fdLink(), Ferror(), Fopen(), Fstrerror(), makeTempFile(), RPMERR_MAKETEMP, RPMERR_OPEN, and rpmError.
Referenced by copyFile(), and rpmReSign().
Definition at line 643 of file rpmchecksig.c.
References _, _FD_s::digests, Fread(), Fstrerror(), pgpDigParams_s::hash_algo, _FDDIGEST_s::hashalgo, _FDDIGEST_s::hashctx, pgpDig_s::hdrmd5ctx, pgpDig_s::hdrsha1ctx, header_magic, HEADER_MAGIC_YES, headerFree(), headerFreeData(), headerGetEntry(), headerIsEntry(), headerRead(), headerSizeof(), pgpDig_s::md5ctx, pgpDig_s::nbytes, _FD_s::ndigests, PGPHASHALGO_MD5, PGPHASHALGO_RIPEMD160, PGPHASHALGO_SHA1, PGPHASHALGO_SHA256, PGPHASHALGO_SHA384, PGPHASHALGO_SHA512, RPMDIGEST_NONE, rpmDigestInit(), rpmDigestUpdate(), RPMERR_FREAD, rpmError, RPMTAG_HEADERIMMUTABLE, pgpDig_s::sha1ctx, and pgpDig_s::signature.
Referenced by rpmVerifySignatures().
Check package and header signatures.
qva | parsed query/verify options |
ts | transaction set |
fd | package file handle |
fn | package file name |
Definition at line 725 of file rpmchecksig.c.
References _, _free(), _print_pkts, fdInitDigest(), pgpDigParams_s::hash_algo, headerFreeData(), headerFreeIterator(), headerGetEntry(), headerInitIterator(), headerIsEntry(), headerNextIterator(), rpmlead::major, pgpCleanDig(), PGPHASHALGO_MD5, PGPHASHALGO_SHA1, pgpPrtPkts(), rpmQVKArguments_s::qva_flags, readFile(), readLead(), RPMERR_BADSIGTYPE, RPMERR_READLEAD, RPMERR_SIGGEN, RPMERR_SIGVFY, rpmError, rpmFreeSignature(), rpmIsDebug, rpmIsVerbose, 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(), pgpDig_s::signature, rpmlead::signature_type, stpcpy(), stpncpy(), VERIFY_DIGEST, VERIFY_SIGNATURE, and pgpDigParams_s::version.
Referenced by rpmcliSign().
int _print_pkts = 0 |
Definition at line 27 of file rpmchecksig.c.
|
static |
Definition at line 636 of file rpmchecksig.c.
Referenced by readFile().