rpm
5.4.15
|
#include "system.h"
#include <rpmhkp.h>
#include <rpmpgp.h>
#include <rpmlog.h>
#include <rpmmacro.h>
#include "debug.h"
Go to the source code of this file.
Data Structures | |
struct | _Astats_s |
struct | _BAstats_s |
Macros | |
#define | _RPMHKP_INTERNAL |
#define | _RPMPGP_INTERNAL |
#define | SUM _rpmhkp_stats |
#define | SPEW(_list) if (_rpmhkp_spew) fprintf _list |
#define | DESPEW(_list) SPEW(_list) |
#define | HKPDEBUG(_list) if (_rpmhkp_debug) fprintf _list |
Typedefs | |
typedef struct _Astats_s | _Astats |
typedef struct _BAstats_s | _BAstats |
Functions | |
static rpmhkp | rpmhkpI (void) |
static void | rpmhkpFini (void *_hkp) |
static rpmhkp | rpmhkpGetPool (rpmioPool pool) |
rpmhkp | rpmhkpNew (const rpmuint8_t *keyid, uint32_t flags) |
Create a new hkp handle. More... | |
static const rpmuint8_t * | pgpGrabSubTagVal (const rpmuint8_t *h, size_t hlen, rpmuint8_t subtag, size_t *tlenp) |
static const rpmuint8_t * | ppSigHash (pgpPkt pp, size_t *plen) |
static const rpmuint8_t * | ppSigUnhash (pgpPkt pp, size_t *plen) |
static const rpmuint8_t * | ppSignid (pgpPkt pp) |
static rpmuint32_t | ppSigTime (pgpPkt pp) |
static rpmuint8_t | ppSigType (pgpPkt pp) |
static const char * | rpmhkpEscape (const char *keyname) |
rpmhkp | rpmhkpLookup (const char *keyname) |
Retrieve a pubkey from a SKS server. More... | |
int | rpmhkpLoadKey (rpmhkp hkp, pgpDig dig, int keyx, rpmuint8_t pubkey_algo) |
int | rpmhkpFindKey (rpmhkp hkp, pgpDig dig, const rpmuint8_t *signid, rpmuint8_t pubkey_algo) |
int | rpmhkpLoadSignature (rpmhkp hkp, pgpDig dig, pgpPkt pp) |
int | rpmhkpUpdate (DIGEST_CTX ctx, const void *data, size_t len) |
static DIGEST_CTX | rpmhkpHashKey (rpmhkp hkp, int ix, pgpHashAlgo dalgo) |
static DIGEST_CTX | rpmhkpHashUid (rpmhkp hkp, int ix, pgpHashAlgo dalgo) |
static DIGEST_CTX | rpmhkpHashSubkey (rpmhkp hkp, int ix, pgpHashAlgo dalgo) |
static DIGEST_CTX | rpmhkpHash (rpmhkp hkp, int keyx, pgpSigType sigtype, pgpHashAlgo dalgo) |
static int | rpmhkpVerifyHash (rpmhkp hkp, pgpDig dig, DIGEST_CTX ctx) |
static int | rpmhkpVerifySignature (rpmhkp hkp, pgpDig dig, DIGEST_CTX ctx) |
static int | rpmhkpVerify (rpmhkp hkp, pgpPkt pp) |
rpmRC | rpmhkpValidate (rpmhkp hkp, const char *keyname) |
Retrieve/Validate binding and certification signatures on a pubkey. More... | |
void | _rpmhkpPrintStats (FILE *fp) |
Display hkp usage statistics. More... | |
void | _rpmhkpDumpDigParams (const char *msg, pgpDigParams sigp, FILE *fp) |
void | _rpmhkpDumpDig (const char *msg, pgpDig dig, FILE *fp) |
Variables | |
int | _rpmhkp_debug |
rpmhkp | _rpmhkpI = NULL |
struct _filter_s | _rpmhkp_awol = {} |
struct _filter_s | _rpmhkp_crl = {} |
_BAstats | _rpmhkp_stats |
int | _rpmhkp_spew |
int | _rpmhkp_lvl = RPMLOG_DEBUG |
rpmioPool | _rpmhkpPool |
#define DESPEW | ( | _list | ) | SPEW(_list) |
Definition at line 61 of file rpmhkp.c.
Referenced by rpmhkpFindKey(), and rpmhkpVerifySignature().
#define HKPDEBUG | ( | _list | ) | if (_rpmhkp_debug) fprintf _list |
Definition at line 63 of file rpmhkp.c.
Referenced by rpmhkpFindKey(), rpmhkpHash(), rpmhkpHashKey(), rpmhkpHashSubkey(), rpmhkpHashUid(), rpmhkpLoadKey(), rpmhkpLoadSignature(), rpmhkpLookup(), rpmhkpValidate(), rpmhkpVerify(), rpmhkpVerifyHash(), and rpmhkpVerifySignature().
#define SPEW | ( | _list | ) | if (_rpmhkp_spew) fprintf _list |
Definition at line 57 of file rpmhkp.c.
Referenced by pgpGrabSubTagVal(), rpmhkpUpdate(), rpmhkpValidate(), and rpmhkpVerifyHash().
#define SUM _rpmhkp_stats |
Definition at line 54 of file rpmhkp.c.
Referenced by _rpmhkpPrintStats(), rpmhkpFindKey(), rpmhkpLookup(), rpmhkpValidate(), rpmhkpVerify(), rpmhkpVerifyHash(), and rpmhkpVerifySignature().
typedef struct _BAstats_s _BAstats |
void _rpmhkpDumpDig | ( | const char * | msg, |
pgpDig | dig, | ||
FILE * | fp | ||
) |
Definition at line 1164 of file rpmhkp.c.
References _rpmhkpDumpDigParams(), pgpGetPubkey(), and pgpGetSignature().
Referenced by rpmcliImportPubkey(), rpmnsProbeSignature(), and rpmtsFindPubkey().
void _rpmhkpDumpDigParams | ( | const char * | msg, |
pgpDigParams | sigp, | ||
FILE * | fp | ||
) |
Definition at line 1141 of file rpmhkp.c.
References _pgpHashAlgo2Name(), _pgpPubkeyAlgo2Name(), _pgpSigType2Name(), and pgpGrab().
Referenced by _rpmhkpDumpDig().
void _rpmhkpPrintStats | ( | FILE * | fp | ) |
|
static |
Definition at line 181 of file rpmhkp.c.
References len, pgpHexStr(), pgpLen(), PGPSUBTYPE_CRITICAL, and SPEW.
Referenced by ppSignid(), ppSigTime(), and rpmhkpLoadSignature().
|
static |
Definition at line 210 of file rpmhkp.c.
References pgpGrab(), and PGPTAG_SIGNATURE.
Referenced by ppSigTime().
|
static |
Definition at line 240 of file rpmhkp.c.
References pgpGrabSubTagVal(), PGPSUBTYPE_ISSUER_KEYID, PGPTAG_SIGNATURE, and ppSigUnhash().
Referenced by rpmhkpValidate().
|
static |
Definition at line 259 of file rpmhkp.c.
References pgpGrab(), pgpGrabSubTagVal(), PGPSUBTYPE_SIG_CREATE_TIME, PGPTAG_SIGNATURE, and ppSigHash().
Referenced by rpmhkpValidate().
|
static |
Definition at line 279 of file rpmhkp.c.
References PGPTAG_SIGNATURE.
Referenced by rpmhkpValidate().
|
static |
Definition at line 224 of file rpmhkp.c.
References pgpGrab(), and PGPTAG_SIGNATURE.
Referenced by ppSignid().
|
static |
int rpmhkpFindKey | ( | rpmhkp | hkp, |
pgpDig | dig, | ||
const rpmuint8_t * | signid, | ||
rpmuint8_t | pubkey_algo | ||
) |
Definition at line 404 of file rpmhkp.c.
References _free(), DESPEW, HKPDEBUG, pgpGetSignature(), pgpHexStr(), rpmbfAdd(), rpmbfChk(), rpmExpand(), rpmhkpFree(), rpmhkpLoadKey(), rpmhkpLookup(), and SUM.
Referenced by rpmhkpVerify(), rpmnsProbeSignature(), and rpmtsFindPubkey().
|
static |
Definition at line 78 of file rpmhkp.c.
References _free(), and rpmbfFree().
Referenced by rpmhkpGetPool().
Definition at line 96 of file rpmhkp.c.
References _rpmhkpPool, rpmhkpFini(), rpmioGetPool(), and rpmioNewPool().
Referenced by rpmhkpNew().
|
static |
Definition at line 640 of file rpmhkp.c.
References HKPDEBUG, PGPSIGTYPE_BINARY, PGPSIGTYPE_CASUAL_CERT, PGPSIGTYPE_CERT_REVOKE, PGPSIGTYPE_CONFIRM, PGPSIGTYPE_GENERIC_CERT, PGPSIGTYPE_KEY_BINDING, PGPSIGTYPE_KEY_REVOKE, PGPSIGTYPE_PERSONA_CERT, PGPSIGTYPE_POSITIVE_CERT, PGPSIGTYPE_SIGNED_KEY, PGPSIGTYPE_STANDALONE, PGPSIGTYPE_SUBKEY_BINDING, PGPSIGTYPE_SUBKEY_REVOKE, PGPSIGTYPE_TEXT, PGPSIGTYPE_TIMESTAMP, rpmhkpHashKey(), rpmhkpHashSubkey(), and rpmhkpHashUid().
Referenced by rpmhkpVerify().
|
static |
Definition at line 569 of file rpmhkp.c.
References alloca(), HKPDEBUG, pgpPktLen(), RPMDIGEST_NONE, rpmDigestInit(), and rpmhkpUpdate().
Referenced by rpmhkpHash(), rpmhkpHashSubkey(), and rpmhkpHashUid().
|
static |
Definition at line 617 of file rpmhkp.c.
References alloca(), HKPDEBUG, pgpPktLen(), rpmhkpHashKey(), and rpmhkpUpdate().
Referenced by rpmhkpHash().
|
static |
Definition at line 592 of file rpmhkp.c.
References alloca(), HKPDEBUG, pgpPktLen(), rpmhkpHashKey(), and rpmhkpUpdate().
Referenced by rpmhkpHash().
|
static |
Definition at line 69 of file rpmhkp.c.
References _rpmhkpI, and rpmhkpNew().
Referenced by rpmhkpNew().
int rpmhkpLoadKey | ( | rpmhkp | hkp, |
pgpDig | dig, | ||
int | keyx, | ||
rpmuint8_t | pubkey_algo | ||
) |
Definition at line 363 of file rpmhkp.c.
References alloca(), HKPDEBUG, len, pgpGetPubkey(), pgpPktLen(), and pgpPrtPubkeyParams().
Referenced by rpmcliImportPubkey(), and rpmhkpFindKey().
Definition at line 461 of file rpmhkp.c.
References HKPDEBUG, pgpGetSignature(), pgpGrab(), pgpGrabSubTagVal(), pgpHexStr(), pgpPrtSigParams(), PGPSUBTYPE_EMBEDDED_SIG, PGPSUBTYPE_ISSUER_KEYID, PGPSUBTYPE_KEY_EXPIRE_TIME, PGPSUBTYPE_REVOKE_KEY, PGPSUBTYPE_REVOKE_REASON, PGPSUBTYPE_SIG_CREATE_TIME, PGPSUBTYPE_SIG_EXPIRE_TIME, and PGPSUBTYPE_SIG_TARGET.
Referenced by getSignid(), headerCheck(), rpmhkpVerify(), rpmnsProbeSignature(), rpmReadPackageFile(), and rpmVerifySignatures().
rpmhkp rpmhkpLookup | ( | const char * | keyname | ) |
Retrieve a pubkey from a SKS server.
keyname | pubkey query string |
Definition at line 318 of file rpmhkp.c.
References _free(), HKPDEBUG, PGPARMOR_ERROR, PGPARMOR_NONE, pgpGrabPkts(), pgpPubkeyFingerprint(), pgpReadPkts(), rpmExpand(), rpmhkpEscape(), rpmhkpFree(), rpmhkpNew(), and SUM.
Referenced by rpmhkpFindKey(), and rpmhkpValidate().
rpmhkp rpmhkpNew | ( | const rpmuint8_t * | keyid, |
uint32_t | flags | ||
) |
Create a new hkp handle.
keyid | pubkey fingerprint (or NULL) |
flags | hkp handle flags ((1<<31): use global handle) |
Definition at line 112 of file rpmhkp.c.
References rpmbfLink(), rpmbfNew(), rpmbfParams(), rpmhkpGetPool(), rpmhkpI(), and rpmhkpLink().
Referenced by rpmcliImportPubkey(), rpmhkpI(), rpmhkpLookup(), rpmnsProbeSignature(), and rpmtsFindPubkey().
int rpmhkpUpdate | ( | DIGEST_CTX | ctx, |
const void * | data, | ||
size_t | len | ||
) |
Definition at line 562 of file rpmhkp.c.
References pgpHexStr(), rpmDigestUpdate(), and SPEW.
Referenced by rpmhkpHashKey(), rpmhkpHashSubkey(), rpmhkpHashUid(), and rpmhkpVerify().
Retrieve/Validate binding and certification signatures on a pubkey.
hkp | hkp handle |
keyname | pubkey query string |
Definition at line 901 of file rpmhkp.c.
References _pgpPubkeyAlgo2Name(), _pgpTag2Name(), alloca(), HKPDEBUG, i, pgpGrab(), pgpHexStr(), pgpPktLen(), pgpPubkeyFingerprint(), PGPSIGTYPE_BINARY, PGPSIGTYPE_CASUAL_CERT, PGPSIGTYPE_CERT_REVOKE, PGPSIGTYPE_CONFIRM, PGPSIGTYPE_GENERIC_CERT, PGPSIGTYPE_KEY_BINDING, PGPSIGTYPE_KEY_REVOKE, PGPSIGTYPE_PERSONA_CERT, PGPSIGTYPE_POSITIVE_CERT, PGPSIGTYPE_SIGNED_KEY, PGPSIGTYPE_STANDALONE, PGPSIGTYPE_SUBKEY_BINDING, PGPSIGTYPE_SUBKEY_REVOKE, PGPSIGTYPE_TEXT, PGPSIGTYPE_TIMESTAMP, PGPTAG_PUBLIC_KEY, PGPTAG_PUBLIC_SUBKEY, PGPTAG_SIGNATURE, PGPTAG_USER_ID, ppSignid(), ppSigTime(), ppSigType(), rpmbfAdd(), rpmhkpFree(), rpmhkpLink(), rpmhkpLookup(), rpmhkpVerify(), rpmlog(), RPMRC_FAIL, RPMRC_NOKEY, RPMRC_NOTFOUND, RPMRC_NOTTRUSTED, RPMRC_OK, SPEW, SUM, time, user, and pgpPktUid_s::userid.
Referenced by rpmcliImportPubkey(), rpmnsProbeSignature(), and rpmtsFindPubkey().
Definition at line 801 of file rpmhkp.c.
References _pgpHashAlgo2Name(), _pgpPubkeyAlgo2Name(), _pgpSigType2Name(), HKPDEBUG, pgpDigFree(), pgpDigNew(), pgpGetPubkey(), pgpGetSignature(), pgpGrab(), PGPPUBKEYALGO_DSA, PGPPUBKEYALGO_ECDSA, PGPPUBKEYALGO_RSA, rpmbfChk(), rpmhkpFindKey(), rpmhkpHash(), rpmhkpLoadSignature(), rpmhkpUpdate(), rpmhkpVerifyHash(), rpmhkpVerifySignature(), rpmlog(), RPMVSF_DEFAULT, SUM, and time.
Referenced by rpmhkpValidate().
|
static |
Definition at line 694 of file rpmhkp.c.
References _free(), HKPDEBUG, pgpGetSignature(), pgpHexStr(), rpmDigestFinal(), rpmDigestName(), SPEW, SUM, and xstrdup().
Referenced by rpmhkpVerify().
|
static |
Definition at line 723 of file rpmhkp.c.
References _pgpHashAlgo2Name(), _pgpPubkeyAlgo2Name(), DESPEW, HKPDEBUG, pgpGetSignature(), pgpHexStr(), pgpImplSetDSA(), pgpImplSetECDSA(), pgpImplSetRSA(), pgpImplVerify(), PGPPUBKEYALGO_DSA, PGPPUBKEYALGO_ECDSA, PGPPUBKEYALGO_RSA, and SUM.
Referenced by rpmhkpVerify().
struct _filter_s _rpmhkp_awol = {} |
Definition at line 24 of file rpmhkp.c.
Referenced by rpmioClean().
struct _filter_s _rpmhkp_crl = {} |
Definition at line 25 of file rpmhkp.c.
Referenced by rpmioClean().
int _rpmhkp_debug |
Definition at line 19 of file rpmhkp.c.
Referenced by rpmtsFindPubkey(), rpmVerifySignature(), verifyDSA(), verifyECDSA(), and verifyRSA().
int _rpmhkp_lvl = RPMLOG_DEBUG |
rpmhkp _rpmhkpI = NULL |
Definition at line 22 of file rpmhkp.c.
Referenced by rpmhkpI(), and rpmioClean().
rpmioPool _rpmhkpPool |
Definition at line 94 of file rpmhkp.c.
Referenced by rpmhkpGetPool(), and rpmioClean().