rpm 5.3.12
|
Routines to handle RFC-2440 detached signatures. More...
#include "system.h"
#include <rpmiotypes.h>
#include <rpmio.h>
#include <rpmbc.h>
#include "debug.h"
Go to the source code of this file.
Defines | |
#define | _RPMIOB_INTERNAL |
#define | _RPMPGP_INTERNAL |
#define | TOKEQ(_s, _tok) (!strncmp((_s), (_tok), sizeof(_tok)-1)) |
Functions | |
static void | pgpPrtNL (void) |
static void | pgpPrtInt (const char *pre, int i) |
static void | pgpPrtStr (const char *pre, const char *s) |
static void | pgpPrtHex (const char *pre, const rpmuint8_t *p, size_t plen) |
void | pgpPrtVal (const char *pre, pgpValTbl vs, rpmuint8_t val) |
Print an OpenPGP value. | |
int | pgpPrtSubType (const rpmuint8_t *h, size_t hlen, pgpSigType sigtype) |
int | pgpPrtSigParams (pgpDig dig, const pgpPkt pp, pgpPubkeyAlgo pubkey_algo, pgpSigType sigtype, const rpmuint8_t *p) |
int | pgpPrtSig (const pgpPkt pp) |
const rpmuint8_t * | pgpPrtPubkeyParams (pgpDig dig, const pgpPkt pp, pgpPubkeyAlgo pubkey_algo, const rpmuint8_t *p) |
static const rpmuint8_t * | pgpPrtSeckeyParams (const pgpPkt pp, rpmuint8_t pubkey_algo, const rpmuint8_t *p) |
int | pgpPrtKey (const pgpPkt pp) |
int | pgpPrtUserID (const pgpPkt pp) |
int | pgpPrtComment (const pgpPkt pp) |
int | pgpPktLen (const rpmuint8_t *pkt, size_t pleft, pgpPkt pp) |
int | pgpPubkeyFingerprint (const rpmuint8_t *pkt, size_t pktlen, rpmuint8_t *keyid) |
Print/parse an OpenPGP subtype packet. | |
int | pgpExtractPubkeyFingerprint (const char *b64pkt, rpmuint8_t *keyid) |
Extract OpenPGP public key fingerprint from base64 encoded packet. | |
int | pgpPrtPkt (const rpmuint8_t *pkt, size_t pleft) |
Return lenth of a OpenPGP packet. | |
void | pgpDigClean (pgpDig dig) |
Release (malloc'd) data from container. | |
static void | pgpDigFini (void *__dig) |
static pgpDig | digGetPool (rpmioPool pool) |
pgpDig | pgpDigNew (pgpVSFlags vsflags, pgpPubkeyAlgo pubkey_algo) |
Create a container for parsed OpenPGP packates. | |
pgpDigParams | pgpGetSignature (pgpDig dig) |
Return OpenPGP signature parameters. | |
pgpDigParams | pgpGetPubkey (pgpDig dig) |
Return OpenPGP pubkey parameters. | |
rpmuint32_t | pgpGetSigtag (pgpDig dig) |
Get signature tag. | |
rpmuint32_t | pgpGetSigtype (pgpDig dig) |
Get signature tag type. | |
const void * | pgpGetSig (pgpDig dig) |
Get signature tag data, i.e. | |
rpmuint32_t | pgpGetSiglen (pgpDig dig) |
Get signature tag data length, i.e. | |
int | pgpSetSig (pgpDig dig, rpmuint32_t sigtag, rpmuint32_t sigtype, const void *sig, rpmuint32_t siglen) |
Set signature tag info, i.e. | |
void * | pgpStatsAccumulator (pgpDig dig, int opx) |
Return pgpDig container accumulator structure. | |
int | pgpSetFindPubkey (pgpDig dig, int(*findPubkey)(void *ts, void *dig), void *_ts) |
Set find pubkey vector. | |
int | pgpFindPubkey (pgpDig dig) |
Call find pubkey vector. | |
int | pgpGrabPkts (const rpmuint8_t *pkts, size_t pktlen, rpmuint8_t ***pppkts, int *pnpkts) |
Return array of packet pointers. | |
int | pgpPrtPkts (const rpmuint8_t *pkts, size_t pktlen, pgpDig dig, int printing) |
Print/parse a OpenPGP packet(s). | |
pgpArmor | pgpArmorUnwrap (rpmiob iob, rpmuint8_t **pkt, size_t *pktlen) |
Parse armored OpenPGP packets from an iob. | |
pgpArmor | pgpReadPkts (const char *fn, rpmuint8_t **pkt, size_t *pktlen) |
Parse armored OpenPGP packets from a file. | |
char * | pgpArmorWrap (rpmuint8_t atype, const unsigned char *s, size_t ns) |
Wrap a OpenPGP packets in ascii armor for transport. | |
pgpHashAlgo | pgpHashAlgoStringToNumber (const char *name, size_t name_len) |
Convert a hash algorithm "foo" to the internal PGPHASHALGO_FOO number. | |
Variables | |
int | _pgp_debug |
int | _pgp_print |
int | _pgp_error_count |
pgpImplVecs_t * | pgpImplVecs |
static pgpDigParams | _digp = NULL |
struct pgpValTbl_s | pgpSigTypeTbl [] |
struct pgpValTbl_s | pgpPubkeyTbl [] |
struct pgpValTbl_s | pgpSymkeyTbl [] |
Symmetric key (string, value) pairs. | |
struct pgpValTbl_s | pgpCompressionTbl [] |
Compression (string, value) pairs. | |
struct pgpValTbl_s | pgpHashTbl [] |
Hash (string, value) pairs. | |
struct pgpValTbl_s | pgpKeyServerPrefsTbl [] |
struct pgpValTbl_s | pgpSubTypeTbl [] |
Subtype (string, value) pairs. | |
struct pgpValTbl_s | pgpTagTbl [] |
struct pgpValTbl_s | pgpArmorTbl [] |
Armor (string, value) pairs. | |
struct pgpValTbl_s | pgpArmorKeyTbl [] |
Armor key (string, value) pairs. | |
static const char * | pgpSigRSA [] |
static const char * | pgpSigDSA [] |
static const char * | pgpSigECDSA [] |
static const char * | pgpPublicRSA [] |
static const char * | pgpPublicDSA [] |
static const char * | pgpPublicECDSA [] |
static const char * | pgpPublicELGAMAL [] |
pgpVSFlags | pgpDigVSFlags |
Disabler bits(s) for signature/digest checking. | |
rpmioPool | _digPool |
Routines to handle RFC-2440 detached signatures.
Definition in file rpmpgp.c.
#define TOKEQ | ( | _s, | |
_tok | |||
) | (!strncmp((_s), (_tok), sizeof(_tok)-1)) |
Referenced by pgpArmorUnwrap().
Definition at line 1186 of file rpmpgp.c.
References _digPool, _pgp_debug, pgpDigFini(), rpmioGetPool(), and rpmioNewPool().
Referenced by pgpDigNew().
static void pgpDigFini | ( | void * | __dig | ) | [static] |
Definition at line 1136 of file rpmpgp.c.
References _free(), pgpDigClean(), pgpImplFree(), and rpmDigestFinal().
Referenced by digGetPool().
int pgpPktLen | ( | const rpmuint8_t * | pkt, |
size_t | pleft, | ||
pgpPkt | pp | ||
) |
Definition at line 937 of file rpmpgp.c.
References pgpGrab(), pgpLen(), and pgpValTbl_s::val.
Referenced by getSignid(), headerCheck(), pgpArmorUnwrap(), pgpGrabPkts(), pgpPrtPkt(), pgpPrtPkts(), pgpPubkeyFingerprint(), rpmcliImportPubkey(), rpmnsProbeSignature(), rpmReadPackageFile(), and rpmVerifySignatures().
int pgpPrtComment | ( | const pgpPkt | pp | ) |
Definition at line 908 of file rpmpgp.c.
References _pgp_print, pgpPrtHex(), pgpPrtNL(), and pgpPrtVal().
Referenced by pgpPrtPkt().
static void pgpPrtHex | ( | const char * | pre, |
const rpmuint8_t * | p, | ||
size_t | plen | ||
) | [static] |
Definition at line 277 of file rpmpgp.c.
References _pgp_print, and pgpHexStr().
Referenced by pgpPrtComment(), pgpPrtPkt(), pgpPrtPubkeyParams(), pgpPrtSeckeyParams(), pgpPrtSig(), and pgpPrtSubType().
static void pgpPrtInt | ( | const char * | pre, |
int | i | ||
) | [static] |
int pgpPrtKey | ( | const pgpPkt | pp | ) |
Definition at line 830 of file rpmpgp.c.
References _digp, _pgp_print, pgpGrab(), pgpPrtNL(), pgpPrtPubkeyParams(), pgpPrtSeckeyParams(), pgpPrtVal(), PGPTAG_PUBLIC_KEY, PGPTAG_PUBLIC_SUBKEY, pgpPktKeyV4_s::pubkey_algo, pgpPktKeyV3_s::pubkey_algo, pgpPktKeyV4_s::time, pgpPktKeyV3_s::time, pgpPktKeyV3_s::valid, pgpPktKeyV4_s::version, and pgpPktKeyV3_s::version.
Referenced by pgpPrtPkt().
static void pgpPrtNL | ( | void | ) | [static] |
Definition at line 249 of file rpmpgp.c.
References _pgp_print.
Referenced by pgpPrtComment(), pgpPrtKey(), pgpPrtPkt(), pgpPrtPubkeyParams(), pgpPrtSeckeyParams(), pgpPrtSig(), pgpPrtSigParams(), pgpPrtSubType(), and pgpPrtUserID().
const rpmuint8_t* pgpPrtPubkeyParams | ( | pgpDig | dig, |
const pgpPkt | pp, | ||
pgpPubkeyAlgo | pubkey_algo, | ||
const rpmuint8_t * | p | ||
) |
Definition at line 679 of file rpmpgp.c.
References _pgp_print, pgpImplMpiItem(), pgpMpiLen(), pgpMpiStr(), pgpPrtHex(), pgpPrtNL(), pgpPrtStr(), PGPPUBKEYALGO_DSA, PGPPUBKEYALGO_ECDSA, PGPPUBKEYALGO_ELGAMAL_ENCRYPT, PGPPUBKEYALGO_RSA, pgpPublicDSA, pgpPublicECDSA, pgpPublicELGAMAL, and pgpPublicRSA.
Referenced by pgpPrtKey().
static const rpmuint8_t* pgpPrtSeckeyParams | ( | const pgpPkt | pp, |
rpmuint8_t | pubkey_algo, | ||
const rpmuint8_t * | p | ||
) | [static] |
Definition at line 754 of file rpmpgp.c.
References _pgp_print, pgpMpiLen(), pgpMpiStr(), pgpPrtHex(), pgpPrtInt(), pgpPrtNL(), pgpPrtStr(), pgpPrtVal(), PGPPUBKEYALGO_DSA, PGPPUBKEYALGO_ECDSA, PGPPUBKEYALGO_ELGAMAL_ENCRYPT, and PGPPUBKEYALGO_RSA.
Referenced by pgpPrtKey().
int pgpPrtSig | ( | const pgpPkt | pp | ) |
Definition at line 503 of file rpmpgp.c.
References _digp, _pgp_debug, _pgp_print, pgpPktSigV4_s::hash_algo, pgpPktSigV3_s::hash_algo, pgpPktSigV4_s::hashlen, pgpPktSigV3_s::hashlen, pgpGrab(), pgpHexStr(), pgpPrtHex(), pgpPrtNL(), pgpPrtSigParams(), pgpPrtSubType(), pgpPrtVal(), pgpPktSigV4_s::pubkey_algo, pgpPktSigV3_s::pubkey_algo, pgpPktSigV3_s::signhash16, pgpPktSigV3_s::signid, pgpPktSigV4_s::sigtype, pgpPktSigV3_s::sigtype, pgpPktSigV3_s::time, pgpPktSigV4_s::version, and pgpPktSigV3_s::version.
Referenced by pgpPrtPkt().
int pgpPrtSigParams | ( | pgpDig | dig, |
const pgpPkt | pp, | ||
pgpPubkeyAlgo | pubkey_algo, | ||
pgpSigType | sigtype, | ||
const rpmuint8_t * | p | ||
) |
Definition at line 427 of file rpmpgp.c.
References _pgp_print, pgpImplMpiItem(), pgpMpiLen(), pgpMpiStr(), pgpPrtNL(), pgpPrtStr(), PGPPUBKEYALGO_DSA, PGPPUBKEYALGO_ECDSA, PGPPUBKEYALGO_RSA, pgpSigDSA, pgpSigECDSA, pgpSigRSA, PGPSIGTYPE_BINARY, and PGPSIGTYPE_TEXT.
Referenced by pgpPrtSig().
static void pgpPrtStr | ( | const char * | pre, |
const char * | s | ||
) | [static] |
Definition at line 267 of file rpmpgp.c.
References _pgp_print.
Referenced by pgpPrtPubkeyParams(), pgpPrtSeckeyParams(), and pgpPrtSigParams().
int pgpPrtSubType | ( | const rpmuint8_t * | h, |
size_t | hlen, | ||
pgpSigType | sigtype | ||
) |
Definition at line 297 of file rpmpgp.c.
References _digp, _pgp_print, pgpGrab(), pgpLen(), pgpPrtHex(), pgpPrtNL(), pgpPrtVal(), PGPSIGTYPE_BINARY, PGPSIGTYPE_POSITIVE_CERT, PGPSIGTYPE_STANDALONE, PGPSIGTYPE_TEXT, PGPSUBTYPE_ARR, PGPSUBTYPE_CRITICAL, PGPSUBTYPE_EMBEDDED_SIG, PGPSUBTYPE_EXPORTABLE_CERT, PGPSUBTYPE_FEATURES, PGPSUBTYPE_INTERNAL_100, PGPSUBTYPE_INTERNAL_101, PGPSUBTYPE_INTERNAL_102, PGPSUBTYPE_INTERNAL_103, PGPSUBTYPE_INTERNAL_104, PGPSUBTYPE_INTERNAL_105, PGPSUBTYPE_INTERNAL_106, PGPSUBTYPE_INTERNAL_107, PGPSUBTYPE_INTERNAL_108, PGPSUBTYPE_INTERNAL_109, PGPSUBTYPE_INTERNAL_110, PGPSUBTYPE_ISSUER_KEYID, PGPSUBTYPE_KEY_EXPIRE_TIME, PGPSUBTYPE_KEY_FLAGS, PGPSUBTYPE_KEYSERVER_PREFERS, PGPSUBTYPE_NOTATION, PGPSUBTYPE_POLICY_URL, PGPSUBTYPE_PREFER_COMPRESS, PGPSUBTYPE_PREFER_HASH, PGPSUBTYPE_PREFER_KEYSERVER, PGPSUBTYPE_PREFER_SYMKEY, PGPSUBTYPE_PRIMARY_USERID, PGPSUBTYPE_REGEX, PGPSUBTYPE_REVOCABLE, PGPSUBTYPE_REVOKE_KEY, PGPSUBTYPE_REVOKE_REASON, PGPSUBTYPE_SIG_CREATE_TIME, PGPSUBTYPE_SIG_EXPIRE_TIME, PGPSUBTYPE_SIG_TARGET, PGPSUBTYPE_SIGNER_USERID, and PGPSUBTYPE_TRUST_SIG.
Referenced by pgpPrtSig().
int pgpPrtUserID | ( | const pgpPkt | pp | ) |
Definition at line 891 of file rpmpgp.c.
References _digp, _free(), _pgp_print, pgpPrtNL(), pgpPrtVal(), and xmalloc().
Referenced by pgpPrtPkt().
pgpDigParams _digp = NULL [static] |
Definition at line 70 of file rpmpgp.c.
Referenced by pgpPrtKey(), pgpPrtPkt(), pgpPrtPkts(), pgpPrtSig(), pgpPrtSubType(), and pgpPrtUserID().
Definition at line 1184 of file rpmpgp.c.
Referenced by digGetPool(), and rpmioClean().
int _pgp_debug |
Definition at line 26 of file rpmpgp.c.
Referenced by digGetPool(), pgpMpiSet(), pgpPrtSig(), and rpmbcMpiItem().
int _pgp_error_count |
int _pgp_print |
Definition at line 29 of file rpmpgp.c.
Referenced by pgpPrtComment(), pgpPrtHex(), pgpPrtInt(), pgpPrtKey(), pgpPrtNL(), pgpPrtPkts(), pgpPrtPubkeyParams(), pgpPrtSeckeyParams(), pgpPrtSig(), pgpPrtSigParams(), pgpPrtStr(), pgpPrtSubType(), pgpPrtUserID(), pgpPrtVal(), and rpmbcMpiItem().
Disabler bits(s) for signature/digest checking.
Definition at line 1102 of file rpmpgp.c.
Referenced by headerCheck(), pgpDigNew(), rpmcliAllArgCallback(), rpmReadPackageFile(), rpmtsSetVSFlags(), and rpmtsVSFlags().
Definition at line 35 of file rpmpgp.c.
Referenced by rpmioAllArgCallback().
struct pgpValTbl_s pgpKeyServerPrefsTbl[] |
const char* pgpPublicDSA[] [static] |
{ " p =", " q =", " g =", " y =", NULL, }
Definition at line 632 of file rpmpgp.c.
Referenced by pgpPrtPubkeyParams().
const char* pgpPublicECDSA[] [static] |
{
" Q =",
NULL,
}
Definition at line 649 of file rpmpgp.c.
Referenced by pgpPrtPubkeyParams().
const char* pgpPublicELGAMAL[] [static] |
{ " p =", " g =", " y =", NULL, }
Definition at line 663 of file rpmpgp.c.
Referenced by pgpPrtPubkeyParams().
const char* pgpPublicRSA[] [static] |
{ " n =", " e =", NULL, }
Definition at line 614 of file rpmpgp.c.
Referenced by pgpPrtPubkeyParams().
const char* pgpSigDSA[] [static] |
{ " r =", " s =", NULL, }
Definition at line 413 of file rpmpgp.c.
Referenced by pgpPrtSigParams().
const char* pgpSigECDSA[] [static] |
{ " r =", " s =", NULL, }
Definition at line 420 of file rpmpgp.c.
Referenced by pgpPrtSigParams().
const char* pgpSigRSA[] [static] |
{
" m**d =",
NULL,
}
Definition at line 407 of file rpmpgp.c.
Referenced by pgpPrtSigParams().