#include "system.h"
#include "rpmio_internal.h"
#include <rpmlib.h>
#include <rpmmacro.h>
#include "rpmdb.h"
#include "rpmts.h"
#include "misc.h"
#include "legacy.h"
#include "rpmlead.h"
#include "signature.h"
#include "header_internal.h"
#include "debug.h"
Go to the source code of this file.
Functions | |
int | rpmLookupSignatureType (int action) |
const char * | rpmDetectPGPVersion (pgpVersion *pgpVer) |
rpmRC | printSize (FD_t fd, int siglen, int pad, int datalen) |
Print package size. More... | |
rpmRC | rpmReadSignature (FD_t fd, Header *sighp, sigType sig_type) |
int | rpmWriteSignature (FD_t fd, Header h) |
Header | rpmNewSignature (void) |
Header | rpmFreeSignature (Header h) |
int | makePGPSignature (const char *file, byte **pkt, int_32 *pktlen, const char *passPhrase) |
Generate PGP (aka RSA/MD5) signature(s) for a header+payload file. More... | |
int | makeGPGSignature (const char *file, byte **pkt, int_32 *pktlen, const char *passPhrase) |
Generate GPG (aka DSA) signature(s) for a header+payload file. More... | |
int | makeHDRSignature (Header sig, const char *file, int_32 sigTag, const char *passPhrase) |
Generate header only signature(s) from a header+payload file. More... | |
int | rpmAddSignature (Header sig, const char *file, int_32 sigTag, const char *passPhrase) |
int | checkPassPhrase (const char *passPhrase, const int sigTag) |
char * | rpmGetPassPhrase (const char *prompt, const int sigTag) |
const char * | rpmSigString (rpmRC res) |
rpmRC | verifySizeSignature (const rpmts ts, char *t) |
rpmRC | verifyMD5Signature (const rpmts ts, char *t, DIGEST_CTX md5ctx) |
rpmRC | verifySHA1Signature (const rpmts ts, char *t, DIGEST_CTX sha1ctx) |
Verify header immutable region SHA1 digest. More... | |
unsigned char | nibble (char c) |
Convert hex to binary nibble. More... | |
rpmRC | verifyPGPSignature (rpmts ts, char *t, DIGEST_CTX md5ctx) |
Verify PGP (aka RSA/MD5) signature. More... | |
rpmRC | verifyGPGSignature (rpmts ts, char *t, DIGEST_CTX sha1ctx) |
Verify GPG (aka DSA) signature. More... | |
rpmRC | rpmVerifySignature (const rpmts ts, char *result) |
Variables | |
char ** | environ = NULL |
unsigned char | header_magic [8] |
Definition in file signature.c.
|
Definition at line 668 of file signature.c. References _, dosetenv, environ, errno, PGP_2, PGP_5, PGP_NOTDETECTED, PGP_UNKNOWN, pgpVersion, poptParseArgvString, rpmDetectPGPVersion, rpmExpand, strerror, and unsetenv. Referenced by rpmGetPassPhrase. |
|
Generate GPG (aka DSA) signature(s) for a header+payload file.
Definition at line 396 of file signature.c. References _, _free, addMacro, alloca, delMacro, dosetenv, environ, errno, Fclose, Ferror, Fopen, int_32, poptParseArgvString, rpmExpand, stpcpy, strerror, timedRead, unsetenv, and xmalloc. Referenced by makeHDRSignature, and rpmAddSignature. |
|
Generate header only signature(s) from a header+payload file.
Definition at line 511 of file signature.c. References _free, Fclose, Ferror, Fopen, header_magic, HEADER_MAGIC_YES, headerAddEntry, headerFree, headerFreeData, headerGetEntry, headerIsEntry, headerRead, headerWrite, int_32, makeGPGSignature, makePGPSignature, makeTempFile, PGPHASHALGO_SHA1, RPM_BIN_TYPE, RPM_STRING_TYPE, RPMDIGEST_NONE, rpmDigestFinal, rpmDigestInit, rpmDigestUpdate, and RPMTAG_HEADERIMMUTABLE. Referenced by rpmAddSignature. |
|
Generate PGP (aka RSA/MD5) signature(s) for a header+payload file.
Definition at line 261 of file signature.c. References _, _free, addMacro, alloca, delMacro, dosetenv, environ, errno, Fclose, Ferror, Fopen, int_32, PGP_2, PGP_5, PGP_NOTDETECTED, PGP_UNKNOWN, pgpVersion, poptParseArgvString, rpmDetectPGPVersion, rpmExpand, stpcpy, strerror, timedRead, unsetenv, and xmalloc. Referenced by makeHDRSignature, and rpmAddSignature. |
|
Convert hex to binary nibble.
Definition at line 993 of file signature.c. |
|
Print package size.
Definition at line 120 of file signature.c. References _, Fileno, rpmRC, RPMRC_FAIL, and RPMRC_OK. Referenced by rpmReadSignature. |
|
Definition at line 248 of file signature.c. References headerFree. Referenced by rpmReadPackageFile, rpmReSign, rpmVerifySignatures, and writeRPM. |
|
Definition at line 833 of file signature.c. References rpmRC, RPMRC_FAIL, RPMRC_NOKEY, RPMRC_NOTFOUND, RPMRC_NOTTRUSTED, and RPMRC_OK. Referenced by verifyGPGSignature, verifyMD5Signature, verifyPGPSignature, verifySHA1Signature, and verifySizeSignature. |
|
Definition at line 1218 of file signature.c. References _, pgpDig_s::hdrsha1ctx, int_32, pgpDig_s::md5ctx, rpmRC, RPMRC_NOTFOUND, rpmts, rpmtsDig, rpmtsSig, rpmtsSiglen, rpmtsSigtag, pgpDig_s::sha1ctx, verifyGPGSignature, verifyMD5Signature, verifyPGPSignature, verifySHA1Signature, and verifySizeSignature. Referenced by headerCheck, rpmReadPackageFile, and rpmVerifySignatures. |
|
Verify GPG (aka DSA) signature.
Definition at line 1130 of file signature.c. References _, mp32number::data, pgpDig_s::g, pgpDigParams_s::hash, pgpDigParams_s::hash_algo, pgpDigParams_s::hashlen, pgpDig_s::hdrsha1ctx, pgpDig_s::hm, int_32, mp32nsethex, mp32nzero, pgpDig_s::nbytes, pgpDig_s::p, PGPHASHALGO_SHA1, pgpHexCvt, PGPPUBKEYALGO_DSA, pgpDigParams_s::pubkey_algo, pgpDig_s::q, pgpDig_s::r, rpmDigestDup, rpmDigestFinal, rpmDigestUpdate, rpmRC, RPMRC_FAIL, RPMRC_NOKEY, RPMRC_OK, rpmSigString, rpmts, rpmtsDig, rpmtsFindPubkey, rpmtsSig, rpmtsSiglen, rpmtsSignature, rpmtsSigtag, pgpDig_s::s, pgpDig_s::sha1, pgpDig_s::sha1len, pgpDigParams_s::signhash16, pgpDigParams_s::signid, pgpDigParams_s::sigtype, stpcpy, and pgpDig_s::y. Referenced by rpmVerifySignature. |
|
Definition at line 887 of file signature.c. References _, _free, int_32, pgpHexCvt, rpmDigestDup, rpmDigestFinal, rpmRC, RPMRC_FAIL, RPMRC_NOKEY, RPMRC_OK, rpmSigString, rpmts, rpmtsDig, rpmtsSig, rpmtsSiglen, and stpcpy. Referenced by rpmVerifySignature. |
|
Verify PGP (aka RSA/MD5) signature.
Definition at line 1014 of file signature.c. References _, _free, pgpDig_s::c, pgpDigParams_s::hash, pgpDigParams_s::hash_algo, pgpDigParams_s::hashlen, int_32, pgpDig_s::md5, pgpDig_s::md5len, mp32nsethex, mp32nzero, pgpDig_s::nbytes, nibble, PGPHASHALGO_MD5, pgpHexCvt, PGPPUBKEYALGO_RSA, pgpDigParams_s::pubkey_algo, rpmDigestDup, rpmDigestFinal, rpmDigestUpdate, rpmRC, RPMRC_FAIL, RPMRC_NOKEY, RPMRC_OK, rpmSigString, rpmts, rpmtsDig, rpmtsFindPubkey, rpmtsSig, rpmtsSiglen, rpmtsSignature, rpmtsSigtag, pgpDig_s::rsa_pk, pgpDig_s::rsahm, rsavrfy, pgpDigParams_s::signhash16, pgpDigParams_s::signid, pgpDigParams_s::sigtype, stpcpy, and xmalloc. Referenced by rpmVerifySignature. |
|
Verify header immutable region SHA1 digest.
Definition at line 942 of file signature.c. References _, _free, int_32, rpmDigestDup, rpmDigestFinal, rpmRC, RPMRC_FAIL, RPMRC_NOKEY, RPMRC_OK, rpmSigString, rpmts, rpmtsDig, rpmtsSig, rpmtsSiglen, and stpcpy. Referenced by rpmVerifySignature. |
|
Definition at line 850 of file signature.c. References _, int_32, pgpDig_s::nbytes, rpmRC, RPMRC_FAIL, RPMRC_NOKEY, RPMRC_OK, rpmSigString, rpmts, rpmtsDig, rpmtsSig, and stpcpy. Referenced by rpmVerifySignature. |
|
Definition at line 28 of file signature.c. Referenced by checkPassPhrase, main, makeGPGSignature, makePGPSignature, open_dso, and xcalloc. |
|
Initial value: { 0x8e, 0xad, 0xe8, 0x01, 0x00, 0x00, 0x00, 0x00 } Definition at line 142 of file signature.c. Referenced by makeHDRSignature, and rpmReadSignature. |