rpm  5.4.15
Macros | Functions | Variables
rpmbc.c File Reference
#include "system.h"
#include <rpmbc.h>
#include "debug.h"
Include dependency graph for rpmbc.c:

Go to the source code of this file.

Macros

#define _RPMBC_INTERNAL
 
#define _RPMPGP_INTERNAL
 
#define SPEW(_t, _rc, _dig)
 
#define _spewMPB(_N, _MPB)
 
#define _spewMPN(_N, _MPN)
 

Functions

static unsigned char nibble (char c)
 Convert hex to binary nibble. More...
 
static int rpmbcSetRSA (DIGEST_CTX ctx, pgpDig dig, pgpDigParams sigp)
 
static int rpmbcSetDSA (DIGEST_CTX ctx, pgpDig dig, pgpDigParams sigp)
 
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 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
 

Macro Definition Documentation

#define _RPMBC_INTERNAL

Definition at line 6 of file rpmbc.c.

#define _RPMPGP_INTERNAL

Definition at line 7 of file rpmbc.c.

#define _spewMPB (   _N,
  _MPB 
)
Value:
{ mpbarrett * mpb = &(_MPB); \
fprintf(stderr, " " _N " = [%4u]: ", (unsigned)mpbits(mpb->size, mpb->modl)); mpfprintln(stderr, mpb->size, mpb->modl); \
}

Definition at line 49 of file rpmbc.c.

Referenced by rpmbcMpiItem().

#define _spewMPN (   _N,
  _MPN 
)
Value:
{ mpnumber * mpn = &(_MPN); \
fprintf(stderr, " " _N " = [%4u]: ", (unsigned)mpbits(mpn->size, mpn->data)); mpfprintln(stderr, mpn->size, mpn->data); \
}

Definition at line 54 of file rpmbc.c.

Referenced by rpmbcMpiItem().

#define SPEW (   _t,
  _rc,
  _dig 
)
Value:
{ if ((_t) || _rpmbc_debug || _pgp_debug < 0) \
fprintf(stderr, "<-- %s(%p) %s\t%s/%s\n", __FUNCTION__, (_dig), \
((_rc) ? "OK" : "BAD"), (_dig)->pubkey_algoN, (_dig)->hash_algoN); \
}
static int _rpmbc_debug
Definition: rpmbc.c:23
int _pgp_debug
Definition: rpmpgp.c:42

Definition at line 25 of file rpmbc.c.

Referenced by rpmbcExportPubkey(), rpmbcExportSignature(), rpmbcGenerate(), rpmbcSetDSA(), rpmbcSetECDSA(), rpmbcSetELG(), rpmbcSetRSA(), rpmbcSign(), and rpmbcVerify().

Function Documentation

static unsigned char nibble ( char  c)
static

Convert hex to binary nibble.

Parameters
chex character
Returns
binary nibble

Definition at line 37 of file rpmbc.c.

Referenced by rpmbcExportPubkey(), and rpmbcSetRSA().

static int rpmbcAvailableCipher ( pgpDig  dig,
int  algo 
)
static

Definition at line 343 of file rpmbc.c.

References PGPHASHALGO_MD5.

static int rpmbcAvailableDigest ( pgpDig  dig,
int  algo 
)
static

Definition at line 353 of file rpmbc.c.

References PGPHASHALGO_MD5.

static int rpmbcAvailablePubkey ( pgpDig  dig,
int  algo 
)
static

Definition at line 363 of file rpmbc.c.

static void rpmbcClean ( void *  impl)
static

Definition at line 641 of file rpmbc.c.

References _free().

Referenced by rpmbcFree().

static int rpmbcErrChk ( pgpDig  dig,
const char *  msg,
int  rc,
unsigned  expected 
)
static

Definition at line 328 of file rpmbc.c.

References fail.

int rpmbcExportPubkey ( pgpDig  dig)
int rpmbcExportSignature ( pgpDig  dig,
DIGEST_CTX  ctx 
)
static void* rpmbcFree ( void *  impl)
static

Definition at line 679 of file rpmbc.c.

References _free(), and rpmbcClean().

static int rpmbcGenerate ( pgpDig  dig)
static
static void* rpmbcInit ( void  )
static

Definition at line 688 of file rpmbc.c.

References xcalloc().

static int rpmbcMpiItem ( const char *  pre,
pgpDig  dig,
int  itemno,
const rpmuint8_t p,
const rpmuint8_t pend 
)
static

Definition at line 542 of file rpmbc.c.

References _free(), _pgp_debug, _pgp_print, _spewMPB, _spewMPN, pgpHexStr(), pgpMpiBits(), pgpMpiLen(), and xstrdup().

static int rpmbcSetDSA ( DIGEST_CTX  ctx,
pgpDig  dig,
pgpDigParams  sigp 
)
static
static int rpmbcSetECDSA ( DIGEST_CTX  ctx,
pgpDig  dig,
pgpDigParams  sigp 
)
static
static int rpmbcSetELG ( DIGEST_CTX  ctx,
pgpDig  dig,
pgpDigParams  sigp 
)
static
static int rpmbcSetRSA ( DIGEST_CTX  ctx,
pgpDig  dig,
pgpDigParams  sigp 
)
static
static int rpmbcSign ( pgpDig  dig)
static
static int rpmbcVerify ( pgpDig  dig)
static

Variable Documentation

int _pgp_debug

Definition at line 42 of file rpmpgp.c.

Referenced by rpmbcMpiItem().

int _pgp_print

Definition at line 45 of file rpmpgp.c.

Referenced by rpmbcMpiItem().

int _rpmbc_debug
static

Definition at line 23 of file rpmbc.c.

struct pgpImplVecs_s rpmbcImplVecs
Initial value:
= {
"BeeCrypt 4.2.1",
}
static void * rpmbcFree(void *impl)
Definition: rpmbc.c:679
static int rpmbcSetECDSA(DIGEST_CTX ctx, pgpDig dig, pgpDigParams sigp)
Definition: rpmbc.c:303
static int rpmbcSign(pgpDig dig)
Definition: rpmbc.c:407
static int rpmbcSetRSA(DIGEST_CTX ctx, pgpDig dig, pgpDigParams sigp)
Definition: rpmbc.c:99
static int rpmbcErrChk(pgpDig dig, const char *msg, int rc, unsigned expected)
Definition: rpmbc.c:328
static int rpmbcAvailableCipher(pgpDig dig, int algo)
Definition: rpmbc.c:343
static int rpmbcAvailableDigest(pgpDig dig, int algo)
Definition: rpmbc.c:353
static void rpmbcClean(void *impl)
Definition: rpmbc.c:641
static int rpmbcGenerate(pgpDig dig)
Definition: rpmbc.c:469
static int rpmbcSetDSA(DIGEST_CTX ctx, pgpDig dig, pgpDigParams sigp)
Definition: rpmbc.c:166
static int rpmbcSetELG(DIGEST_CTX ctx, pgpDig dig, pgpDigParams sigp)
Definition: rpmbc.c:198
static void * rpmbcInit(void)
Definition: rpmbc.c:688
static int rpmbcVerify(pgpDig dig)
Definition: rpmbc.c:372
static int rpmbcMpiItem(const char *pre, pgpDig dig, int itemno, const rpmuint8_t *p, const rpmuint8_t *pend)
Definition: rpmbc.c:542
static int rpmbcAvailablePubkey(pgpDig dig, int algo)
Definition: rpmbc.c:363

Definition at line 695 of file rpmbc.c.

Referenced by pgpExportPubkey(), pgpExportSignature(), and rpmioAllArgCallback().