rpm 5.3.7
|
Go to the source code of this file.
Defines | |
#define | _RPMBC_INTERNAL |
#define | _RPMPGP_INTERNAL |
#define | SPEW(_t, _rc, _dig) |
#define | _spewMPB(_N, _MPB) |
#define | _spewMPN(_N, _MPN) |
Functions | |
static const char * | _pgpHashAlgo2Name (uint32_t algo) |
static const char * | _pgpPubkeyAlgo2Name (uint32_t algo) |
static unsigned char | nibble (char c) |
Convert hex to binary nibble. | |
static int | rpmbcSetRSA (DIGEST_CTX ctx, pgpDig dig, pgpDigParams sigp) |
static int | rpmbcVerifyRSA (pgpDig dig) |
static int | rpmbcSignRSA (pgpDig dig) |
static int | rpmbcGenerateRSA (pgpDig dig) |
static int | rpmbcSetDSA (DIGEST_CTX ctx, pgpDig dig, pgpDigParams sigp) |
static int | rpmbcVerifyDSA (pgpDig dig) |
static int | rpmbcSignDSA (pgpDig dig) |
static int | rpmbcGenerateDSA (pgpDig dig) |
static int | rpmbcSetELG (DIGEST_CTX ctx, pgpDig dig, pgpDigParams sigp) |
static int | rpmbcSetECDSA (DIGEST_CTX ctx, pgpDig dig, pgpDigParams sigp) |
static int | rpmbcErrChk (pgpDig dig, const char *msg, int rc, unsigned expected) |
static int | rpmbcAvailableCipher (pgpDig dig, int algo) |
static int | rpmbcAvailableDigest (pgpDig dig, int algo) |
static int | rpmbcAvailablePubkey (pgpDig dig, int algo) |
static int | rpmbcVerify (pgpDig dig) |
static int | rpmbcSign (pgpDig dig) |
static int | rpmbcGenerate (pgpDig dig) |
static char * | pgpMpiHex (const rpmuint8_t *p) |
static int | pgpMpiSet (const char *pre, unsigned int lbits, void *dest, const rpmuint8_t *p, const rpmuint8_t *pend) |
static int | rpmbcMpiItem (const char *pre, pgpDig dig, int itemno, const rpmuint8_t *p, const rpmuint8_t *pend) |
static void | rpmbcClean (void *impl) |
static void * | rpmbcFree (void *impl) |
static void * | rpmbcInit (void) |
int | rpmbcExportPubkey (pgpDig dig) |
int | rpmbcExportSignature (pgpDig dig, DIGEST_CTX ctx) |
Variables | |
int | _pgp_debug |
int | _pgp_print |
static int | _rpmbc_debug |
struct pgpImplVecs_s | rpmbcImplVecs |
Definition in file rpmbc.c.
#define _spewMPB | ( | _N, | |
_MPB | |||
) |
{ mpbarrett * mpb = &(_MPB); \ fprintf(stderr, "\t" _N ": "); mpfprintln(stderr, mpb->size, mpb->modl); \ }
Definition at line 59 of file rpmbc.c.
Referenced by rpmbcMpiItem().
#define _spewMPN | ( | _N, | |
_MPN | |||
) |
{ mpnumber * mpn = &(_MPN); \ fprintf(stderr, "\t" _N ": "); mpfprintln(stderr, mpn->size, mpn->data); \ }
Definition at line 64 of file rpmbc.c.
Referenced by rpmbcMpiItem().
#define SPEW | ( | _t, | |
_rc, | |||
_dig | |||
) |
{ if ((_t) || _rpmbc_debug || _pgp_debug < 0) \ fprintf(stderr, "<-- %s(%p) %s\t%s\n", __FUNCTION__, (_dig), \ ((_rc) ? "OK" : "BAD"), (_dig)->pubkey_algoN); \ }
Definition at line 25 of file rpmbc.c.
Referenced by rpmbcGenerate(), rpmbcGenerateDSA(), rpmbcGenerateRSA(), rpmbcSetDSA(), rpmbcSetECDSA(), rpmbcSetELG(), rpmbcSetRSA(), rpmbcSign(), rpmbcSignDSA(), rpmbcSignRSA(), rpmbcVerify(), rpmbcVerifyDSA(), and rpmbcVerifyRSA().
static const char* _pgpHashAlgo2Name | ( | uint32_t | algo | ) | [static] |
Definition at line 31 of file rpmbc.c.
References pgpHashTbl, and pgpValStr().
Referenced by rpmbcGenerate(), rpmbcSetDSA(), rpmbcSetECDSA(), rpmbcSetELG(), rpmbcSetRSA(), rpmbcSign(), and rpmbcVerify().
static const char* _pgpPubkeyAlgo2Name | ( | uint32_t | algo | ) | [static] |
Definition at line 36 of file rpmbc.c.
References pgpPubkeyTbl, and pgpValStr().
Referenced by rpmbcGenerate(), rpmbcSetDSA(), rpmbcSetECDSA(), rpmbcSetELG(), rpmbcSetRSA(), rpmbcSign(), and rpmbcVerify().
static unsigned char nibble | ( | char | c | ) | [static] |
Convert hex to binary nibble.
c | hex character |
Definition at line 47 of file rpmbc.c.
Referenced by rpmbcSetRSA().
static char* pgpMpiHex | ( | const rpmuint8_t * | p | ) | [static] |
Definition at line 677 of file rpmbc.c.
References pgpHexCvt(), pgpMpiLen(), and xmalloc().
Referenced by pgpMpiSet(), and rpmbcMpiItem().
static int pgpMpiSet | ( | const char * | pre, |
unsigned int | lbits, | ||
void * | dest, | ||
const rpmuint8_t * | p, | ||
const rpmuint8_t * | pend | ||
) | [static] |
Definition at line 690 of file rpmbc.c.
References _free(), _pgp_debug, pgpMpiBits(), pgpMpiHex(), and xmalloc().
Referenced by rpmbcMpiItem().
static int rpmbcAvailableCipher | ( | pgpDig | dig, |
int | algo | ||
) | [static] |
Definition at line 555 of file rpmbc.c.
References PGPHASHALGO_MD5.
static int rpmbcAvailableDigest | ( | pgpDig | dig, |
int | algo | ||
) | [static] |
Definition at line 565 of file rpmbc.c.
References PGPHASHALGO_MD5.
static int rpmbcAvailablePubkey | ( | pgpDig | dig, |
int | algo | ||
) | [static] |
static void rpmbcClean | ( | void * | impl | ) | [static] |
static int rpmbcErrChk | ( | pgpDig | dig, |
const char * | msg, | ||
int | rc, | ||
unsigned | expected | ||
) | [static] |
int rpmbcExportPubkey | ( | pgpDig | dig | ) |
Definition at line 860 of file rpmbc.c.
References pgpGetPubkey(), pgpPubkeyFingerprint(), PGPTAG_PUBLIC_KEY, and xmalloc().
Referenced by pgpDigNew().
int rpmbcExportSignature | ( | pgpDig | dig, |
DIGEST_CTX | ctx | ||
) |
Definition at line 919 of file rpmbc.c.
References pgpGetPubkey(), pgpGetSignature(), pgpImplSetDSA(), pgpImplSign(), PGPSIGTYPE_BINARY, PGPSUBTYPE_EXPORTABLE_CERT, PGPSUBTYPE_ISSUER_KEYID, PGPSUBTYPE_REVOCABLE, PGPSUBTYPE_SIG_CREATE_TIME, PGPSUBTYPE_SIG_EXPIRE_TIME, PGPTAG_SIGNATURE, rpmDigestUpdate(), and xmalloc().
Referenced by writeRPM().
static void* rpmbcFree | ( | void * | impl | ) | [static] |
Definition at line 830 of file rpmbc.c.
References _free(), and rpmbcClean().
static int rpmbcGenerate | ( | pgpDig | dig | ) | [static] |
Definition at line 644 of file rpmbc.c.
References _pgpHashAlgo2Name(), _pgpPubkeyAlgo2Name(), pgpGetPubkey(), pgpGetSignature(), PGPPUBKEYALGO_DSA, PGPPUBKEYALGO_ECDSA, PGPPUBKEYALGO_ELGAMAL, PGPPUBKEYALGO_RSA, rpmbcGenerateDSA(), rpmbcGenerateRSA(), and SPEW.
static int rpmbcGenerateDSA | ( | pgpDig | dig | ) | [static] |
static int rpmbcGenerateRSA | ( | pgpDig | dig | ) | [static] |
static void* rpmbcInit | ( | void | ) | [static] |
static int rpmbcMpiItem | ( | const char * | pre, |
pgpDig | dig, | ||
int | itemno, | ||
const rpmuint8_t * | p, | ||
const rpmuint8_t * | pend | ||
) | [static] |
Definition at line 729 of file rpmbc.c.
References _free(), _pgp_debug, _pgp_print, _spewMPB, _spewMPN, pgpMpiHex(), and pgpMpiSet().
static int rpmbcSetDSA | ( | DIGEST_CTX | ctx, |
pgpDig | dig, | ||
pgpDigParams | sigp | ||
) | [static] |
Definition at line 244 of file rpmbc.c.
References _free(), _pgpHashAlgo2Name(), _pgpPubkeyAlgo2Name(), pgpGetPubkey(), rpmDigestAlgo(), rpmDigestFinal(), and SPEW.
static int rpmbcSetECDSA | ( | DIGEST_CTX | ctx, |
pgpDig | dig, | ||
pgpDigParams | sigp | ||
) | [static] |
Definition at line 478 of file rpmbc.c.
References _pgpHashAlgo2Name(), _pgpPubkeyAlgo2Name(), pgpGetPubkey(), rpmDigestAlgo(), rpmDigestFinal(), and SPEW.
static int rpmbcSetELG | ( | DIGEST_CTX | ctx, |
pgpDig | dig, | ||
pgpDigParams | sigp | ||
) | [static] |
Definition at line 338 of file rpmbc.c.
References _pgpHashAlgo2Name(), _pgpPubkeyAlgo2Name(), pgpGetPubkey(), rpmDigestAlgo(), rpmDigestFinal(), and SPEW.
static int rpmbcSetRSA | ( | DIGEST_CTX | ctx, |
pgpDig | dig, | ||
pgpDigParams | sigp | ||
) | [static] |
Definition at line 109 of file rpmbc.c.
References _free(), _pgpHashAlgo2Name(), _pgpPubkeyAlgo2Name(), nibble(), pgpGetPubkey(), rpmDigestAlgo(), rpmDigestASN1(), rpmDigestFinal(), SPEW, stpcpy(), and xmalloc().
static int rpmbcSign | ( | pgpDig | dig | ) | [static] |
Definition at line 614 of file rpmbc.c.
References _pgpHashAlgo2Name(), _pgpPubkeyAlgo2Name(), pgpGetPubkey(), pgpGetSignature(), PGPPUBKEYALGO_DSA, PGPPUBKEYALGO_ECDSA, PGPPUBKEYALGO_ELGAMAL, PGPPUBKEYALGO_RSA, rpmbcSignDSA(), rpmbcSignRSA(), and SPEW.
static int rpmbcSignDSA | ( | pgpDig | dig | ) | [static] |
static int rpmbcSignRSA | ( | pgpDig | dig | ) | [static] |
static int rpmbcVerify | ( | pgpDig | dig | ) | [static] |
Definition at line 584 of file rpmbc.c.
References _pgpHashAlgo2Name(), _pgpPubkeyAlgo2Name(), pgpGetPubkey(), pgpGetSignature(), PGPPUBKEYALGO_DSA, PGPPUBKEYALGO_ECDSA, PGPPUBKEYALGO_ELGAMAL, PGPPUBKEYALGO_RSA, rpmbcVerifyDSA(), rpmbcVerifyRSA(), and SPEW.
static int rpmbcVerifyDSA | ( | pgpDig | dig | ) | [static] |
static int rpmbcVerifyRSA | ( | pgpDig | dig | ) | [static] |
int _pgp_debug |
int _pgp_print |
int _rpmbc_debug [static] |
struct pgpImplVecs_s rpmbcImplVecs |
{ rpmbcSetRSA, rpmbcSetDSA, rpmbcSetELG, rpmbcSetECDSA, rpmbcErrChk, rpmbcAvailableCipher, rpmbcAvailableDigest, rpmbcAvailablePubkey, rpmbcVerify, rpmbcSign, rpmbcGenerate, rpmbcMpiItem, rpmbcClean, rpmbcFree, rpmbcInit }
Definition at line 846 of file rpmbc.c.
Referenced by pgpDigNew(), and rpmioAllArgCallback().