rpm  5.4.14
Macros | Functions | Variables

Routines to handle RFC-2440 detached signatures. More...

#include "system.h"
#include <rpmiotypes.h>
#include <rpmio.h>
#include <rpmbc.h>
#include "debug.h"
Include dependency graph for rpmpgp.c:

Go to the source code of this file.

Macros

#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. More...
 
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_tpgpPrtPubkeyParams (pgpDig dig, const pgpPkt pp, pgpPubkeyAlgo pubkey_algo, const rpmuint8_t *p)
 
static const rpmuint8_tpgpPrtSeckeyParams (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. More...
 
int pgpExtractPubkeyFingerprint (const char *b64pkt, rpmuint8_t *keyid)
 Extract OpenPGP public key fingerprint from base64 encoded packet. More...
 
int pgpPrtPkt (const rpmuint8_t *pkt, size_t pleft)
 Return lenth of a OpenPGP packet. More...
 
void pgpDigClean (pgpDig dig)
 Release (malloc'd) data from container. More...
 
static void pgpDigFini (void *__dig)
 
static pgpDig digGetPool (rpmioPool pool)
 
pgpDig pgpDigNew (pgpVSFlags vsflags, pgpPubkeyAlgo pubkey_algo)
 Create a container for parsed OpenPGP packates. More...
 
pgpDigParams pgpGetSignature (pgpDig dig)
 Return OpenPGP signature parameters. More...
 
pgpDigParams pgpGetPubkey (pgpDig dig)
 Return OpenPGP pubkey parameters. More...
 
rpmuint32_t pgpGetSigtag (pgpDig dig)
 Get signature tag. More...
 
rpmuint32_t pgpGetSigtype (pgpDig dig)
 Get signature tag type. More...
 
const voidpgpGetSig (pgpDig dig)
 Get signature tag data, i.e. More...
 
rpmuint32_t pgpGetSiglen (pgpDig dig)
 Get signature tag data length, i.e. More...
 
int pgpSetSig (pgpDig dig, rpmuint32_t sigtag, rpmuint32_t sigtype, const void *sig, rpmuint32_t siglen)
 Set signature tag info, i.e. More...
 
voidpgpStatsAccumulator (pgpDig dig, int opx)
 Return pgpDig container accumulator structure. More...
 
int pgpSetFindPubkey (pgpDig dig, int(*findPubkey)(void *ts, void *dig), void *_ts)
 Set find pubkey vector. More...
 
int pgpFindPubkey (pgpDig dig)
 Call find pubkey vector. More...
 
int pgpGrabPkts (const rpmuint8_t *pkts, size_t pktlen, rpmuint8_t ***pppkts, int *pnpkts)
 Return array of packet pointers. More...
 
int pgpPrtPkts (const rpmuint8_t *pkts, size_t pktlen, pgpDig dig, int printing)
 Print/parse a OpenPGP packet(s). More...
 
pgpArmor pgpArmorUnwrap (rpmiob iob, rpmuint8_t **pkt, size_t *pktlen)
 Parse armored OpenPGP packets from an iob. More...
 
pgpArmor pgpReadPkts (const char *fn, rpmuint8_t **pkt, size_t *pktlen)
 Parse armored OpenPGP packets from a file. More...
 
char * pgpArmorWrap (rpmuint8_t atype, const unsigned char *s, size_t ns)
 Wrap a OpenPGP packets in ascii armor for transport. More...
 
pgpHashAlgo pgpHashAlgoStringToNumber (const char *name, size_t name_len)
 Convert a hash algorithm "foo" to the internal PGPHASHALGO_FOO number. More...
 

Variables

int _pgp_debug
 
int _pgp_print
 
int _pgp_error_count
 
pgpImplVecs_tpgpImplVecs
 
static pgpDigParams _digp = NULL
 
struct pgpValTbl_s pgpSigTypeTbl []
 
struct pgpValTbl_s pgpPubkeyTbl []
 
struct pgpValTbl_s pgpSymkeyTbl []
 Symmetric key (string, value) pairs. More...
 
struct pgpValTbl_s pgpCompressionTbl []
 Compression (string, value) pairs. More...
 
struct pgpValTbl_s pgpHashTbl []
 Hash (string, value) pairs. More...
 
struct pgpValTbl_s pgpKeyServerPrefsTbl []
 
struct pgpValTbl_s pgpSubTypeTbl []
 Subtype (string, value) pairs. More...
 
struct pgpValTbl_s pgpTagTbl []
 
struct pgpValTbl_s pgpArmorTbl []
 Armor (string, value) pairs. More...
 
struct pgpValTbl_s pgpArmorKeyTbl []
 Armor key (string, value) pairs. More...
 
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. More...
 
rpmioPool _digPool
 

Detailed Description

Routines to handle RFC-2440 detached signatures.

Definition in file rpmpgp.c.

Macro Definition Documentation

#define _RPMIOB_INTERNAL

Definition at line 8 of file rpmpgp.c.

#define _RPMPGP_INTERNAL

Definition at line 13 of file rpmpgp.c.

#define TOKEQ (   _s,
  _tok 
)    (!strncmp((_s), (_tok), sizeof(_tok)-1))

Referenced by pgpArmorUnwrap().

Function Documentation

static pgpDig digGetPool ( rpmioPool  pool)
static

Definition at line 1188 of file rpmpgp.c.

References _digPool, dig, memset(), NULL, pgpDigFini(), rpmioGetPool(), and rpmioNewPool().

Referenced by pgpDigNew().

static void pgpDigFini ( void __dig)
static

Definition at line 1138 of file rpmpgp.c.

References _free(), dig, NULL, pgpDigClean(), pgpImplFree(), rpmDigestFinal(), and void.

Referenced by digGetPool().

int pgpPktLen ( const rpmuint8_t pkt,
size_t  pleft,
pgpPkt  pp 
)
int pgpPrtComment ( const pgpPkt  pp)

Definition at line 910 of file rpmpgp.c.

References fprintf(), h, i, j, pgpPrtHex(), pgpPrtNL(), and pgpPrtVal().

Referenced by pgpPrtPkt().

static void pgpPrtHex ( const char *  pre,
const rpmuint8_t p,
size_t  plen 
)
static
static void pgpPrtInt ( const char *  pre,
int  i 
)
static

Definition at line 259 of file rpmpgp.c.

References fprintf().

Referenced by pgpPrtSeckeyParams().

int pgpPrtKey ( const pgpPkt  pp)
static void pgpPrtNL ( void  )
static
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 
)
static
int pgpPrtSig ( const pgpPkt  pp)
int pgpPrtSigParams ( pgpDig  dig,
const pgpPkt  pp,
pgpPubkeyAlgo  pubkey_algo,
pgpSigType  sigtype,
const rpmuint8_t p 
)
static void pgpPrtStr ( const char *  pre,
const char *  s 
)
static

Definition at line 269 of file rpmpgp.c.

References fprintf().

Referenced by pgpPrtPubkeyParams(), pgpPrtSeckeyParams(), and pgpPrtSigParams().

int pgpPrtSubType ( const rpmuint8_t h,
size_t  hlen,
pgpSigType  sigtype 
)
int pgpPrtUserID ( const pgpPkt  pp)

Definition at line 893 of file rpmpgp.c.

References _free(), fprintf(), pgpPrtNL(), pgpPrtVal(), t, and xmalloc.

Referenced by pgpPrtPkt().

Variable Documentation

pgpDigParams _digp = NULL
static

Definition at line 73 of file rpmpgp.c.

rpmioPool _digPool

Definition at line 1186 of file rpmpgp.c.

Referenced by digGetPool(), and rpmioClean().

int _pgp_debug

Definition at line 29 of file rpmpgp.c.

Referenced by pgpMpiSet(), and rpmbcMpiItem().

int _pgp_error_count

Definition at line 35 of file rpmpgp.c.

int _pgp_print

Definition at line 32 of file rpmpgp.c.

Referenced by rpmbcMpiItem().

pgpVSFlags pgpDigVSFlags

Disabler bits(s) for signature/digest checking.

Definition at line 1104 of file rpmpgp.c.

Referenced by headerCheck(), pgpDigNew(), rpmcliAllArgCallback(), rpmReadPackageFile(), rpmtsSetVSFlags(), and rpmtsVSFlags().

pgpImplVecs_t* pgpImplVecs

Definition at line 38 of file rpmpgp.c.

Referenced by rpmioAllArgCallback().

struct pgpValTbl_s pgpKeyServerPrefsTbl[]
Initial value:
= {
{ 0x80, "No-modify" },
{ -1, "Unknown key server preference" },
}

Definition at line 159 of file rpmpgp.c.

const char* pgpPublicDSA[]
static
Initial value:
= {
" p =",
" q =",
" g =",
" y =",
}
return NULL
Definition: poptALL.c:613

Definition at line 634 of file rpmpgp.c.

const char* pgpPublicECDSA[]
static
Initial value:
= {
" Q =",
}
return NULL
Definition: poptALL.c:613

Definition at line 651 of file rpmpgp.c.

const char* pgpPublicELGAMAL[]
static
Initial value:
= {
" p =",
" g =",
" y =",
}
return NULL
Definition: poptALL.c:613

Definition at line 665 of file rpmpgp.c.

const char* pgpPublicRSA[]
static
Initial value:
= {
" n =",
" e =",
}
return NULL
Definition: poptALL.c:613

Definition at line 616 of file rpmpgp.c.

const char* pgpSigDSA[]
static
Initial value:
= {
" r =",
" s =",
}
return NULL
Definition: poptALL.c:613

Definition at line 415 of file rpmpgp.c.

const char* pgpSigECDSA[]
static
Initial value:
= {
" r =",
" s =",
}
return NULL
Definition: poptALL.c:613

Definition at line 422 of file rpmpgp.c.

const char* pgpSigRSA[]
static
Initial value:
= {
" m**d =",
}
return NULL
Definition: poptALL.c:613

Definition at line 409 of file rpmpgp.c.