rpm  5.4.15
Data Structures | Macros | Functions | Variables
rpmns.c File Reference
#include "system.h"
#include <rpmiotypes.h>
#include <rpmio.h>
#include <rpmhkp.h>
#include <rpmmacro.h>
#include <rpmcb.h>
#include <rpmpgp.h>
#include <rpmtypes.h>
#include <rpmtag.h>
#include <rpmevr.h>
#include <rpmns.h>
#include <rpmdb.h>
#include <rpmps.h>
#include <rpmts.h>
#include "debug.h"
Include dependency graph for rpmns.c:

Go to the source code of this file.

Data Structures

struct  _rpmnsProbes_s
 

Macros

#define _RPMIOB_INTERNAL   /* XXX rpmiobSlurp */
 
#define _RPMHKP_INTERNAL
 
#define _RPMPGP_INTERNAL
 
#define _RPMEVR_INTERNAL
 
#define _RPMNS_INTERNAL
 
#define _RPMTS_INTERNAL   /* XXX ts->hkp */
 
#define SPEW(_list)
 
#define _ENTRY(_s, _type)   { #_s, sizeof(#_s)-1, _type }
 Dependency probe table (must be sorted). More...
 

Functions

nsType rpmnsArch (const char *str)
 Is string a known arch suffix? More...
 
nsType rpmnsProbe (const char *s, size_t slen)
 Is string a known probe namespace? More...
 
nsType rpmnsClassify (const char *s, size_t slen)
 Classify a string as a dependency type. More...
 
int rpmnsParse (const char *s, rpmns ns)
 Expand and split NS(N).A string into namespace, name and arch components. More...
 
static unsigned char nibble (char c)
 Convert hex to binary nibble. More...
 
rpmRC rpmnsProbeSignature (void *_ts, const char *fn, const char *sigfn, const char *pubfn, const char *pubid, int flags)
 Verify OpenPGP signature on a file. More...
 

Variables

int _rpmns_debug
 
const char * _rpmns_N_at_A = "."
 
static const char * rpmnsArches []
 
static struct _rpmnsProbes_s rpmnsProbes []
 
static size_t rpmnsProbesCount = sizeof(rpmnsProbes)/sizeof(rpmnsProbes[0])
 

Macro Definition Documentation

#define _ENTRY (   _s,
  _type 
)    { #_s, sizeof(#_s)-1, _type }

Dependency probe table (must be sorted).

Definition at line 113 of file rpmns.c.

#define _RPMEVR_INTERNAL

Definition at line 19 of file rpmns.c.

#define _RPMHKP_INTERNAL

Definition at line 9 of file rpmns.c.

#define _RPMIOB_INTERNAL   /* XXX rpmiobSlurp */

Definition at line 6 of file rpmns.c.

#define _RPMNS_INTERNAL

Definition at line 21 of file rpmns.c.

#define _RPMPGP_INTERNAL

Definition at line 14 of file rpmns.c.

#define _RPMTS_INTERNAL   /* XXX ts->hkp */

Definition at line 26 of file rpmns.c.

#define SPEW (   _list)

Definition at line 45 of file rpmns.c.

Referenced by rpmnsProbeSignature().

Function Documentation

static unsigned char nibble ( char  c)
inlinestatic

Convert hex to binary nibble.

Parameters
chex character
Returns
binary nibble

Definition at line 317 of file rpmns.c.

Referenced by rpmnsProbeSignature().

nsType rpmnsArch ( const char *  str)

Is string a known arch suffix?

Parameters
strstring
Returns
RPMNS_TYPE_ARCH if known arch, else RPMNS_TYPE_UNKNOWN

Definition at line 76 of file rpmns.c.

References _free(), rpmExpand(), RPMNS_TYPE_ARCH, RPMNS_TYPE_UNKNOWN, and xisspace().

Referenced by rpmnsClassify().

nsType rpmnsClassify ( const char *  s,
size_t  slen 
)

Classify a string as a dependency type.

Parameters
sstring like "bing(bang).boom"
slenstring length (0 uses strlen(s))
Returns
dependency type

Definition at line 203 of file rpmns.c.

References RPMNS_TYPE_ARCH, RPMNS_TYPE_COMPOUND, RPMNS_TYPE_DSO, RPMNS_TYPE_FUNCTION, RPMNS_TYPE_NAMESPACE, RPMNS_TYPE_PATH, RPMNS_TYPE_STRING, RPMNS_TYPE_UNKNOWN, RPMNS_TYPE_VERSION, rpmnsArch(), rpmnsProbe(), _rpmnsProbes_s::Type, and xisdigit().

Referenced by rpmnsParse().

int rpmnsParse ( const char *  str,
rpmns  ns 
)
nsType rpmnsProbe ( const char *  s,
size_t  slen 
)

Is string a known probe namespace?

Parameters
sstring
slenstring length (0 uses strlen(s))
Returns
nsType if known probe, else RPMNS_TYPE_UNKNOWN

Definition at line 176 of file rpmns.c.

References i, _rpmnsProbes_s::NS, _rpmnsProbes_s::NSlen, RPMNS_TYPE_UNKNOWN, rpmnsProbes, rpmnsProbesCount, and _rpmnsProbes_s::Type.

Referenced by rpmnsClassify().

rpmRC rpmnsProbeSignature ( void *  _ts,
const char *  fn,
const char *  sigfn,
const char *  pubfn,
const char *  pubid,
int  flags 
)

Verify OpenPGP signature on a file.

Parameters
_tstransaction set
fnplaintext (or clearsign) file
sigfnbinary/pem encoded signature file (NULL iff clearsign)
pubfnbinary/pem encoded pubkey file (NULL uses rpmdb keyring)
pubidpubkey fingerprint hex string (NULL disables check)
flags(unused)
Returns
RPMRC_OK if verified, RPMRC_FAIL if not verified

Definition at line 329 of file rpmns.c.

References _free(), _rpmhkpDumpDig(), alloca(), i, nibble(), ns, PGPARMOR_PUBKEY, PGPARMOR_SIGNATURE, pgpFindPubkey(), pgpGetPubkey(), pgpGetSignature(), pgpGrab(), pgpGrabPkts(), pgpImplSetDSA(), pgpImplSetECDSA(), pgpImplSetRSA(), pgpImplVerify(), pgpPktLen(), pgpPrtPkts(), PGPPUBKEYALGO_DSA, PGPPUBKEYALGO_ECDSA, PGPPUBKEYALGO_RSA, pgpPubkeyFingerprint(), pgpReadPkts(), RPMDIGEST_NONE, rpmDigestInit(), rpmDigestUpdate(), rpmExpand(), rpmhkpFindKey(), rpmhkpFree(), rpmhkpLink(), rpmhkpLoadSignature(), rpmhkpNew(), rpmhkpValidate(), rpmiobFree(), rpmiobSlurp(), RPMRC_FAIL, RPMRC_NOKEY, RPMRC_NOTFOUND, RPMRC_NOTTRUSTED, RPMRC_OK, rpmtsCleanDig(), rpmtsDig(), SPEW, and ts.

Referenced by unsatisfiedDepend().

Variable Documentation

int _rpmns_debug

Definition at line 44 of file rpmns.c.

const char* _rpmns_N_at_A = "."

Definition at line 49 of file rpmns.c.

Referenced by rpmdsNewDNEVR().

const char* rpmnsArches[]
static
Initial value:
= {
"i386", "i486", "i586", "i686", "athlon", "pentium3", "pentium4",
"x86_64", "amd64", "ia32e",
"alpha", "alphaev5", "alphaev56", "alphapca56", "alphaev6", "alphaev67",
"sparc", "sun4", "sun4m", "sun4c", "sun4d", "sparcv8",
"sparcv9", "sparcv9b", "sparcv9v", "sparcv9v2",
"sparc64", "sun4u", "sparc64v",
"mips", "mipsel", "IP",
"ppc", "ppciseries", "ppcpseries",
"ppc64", "ppc64iseries", "ppc64pseries",
"m68k",
"rs6000",
"ia64",
"armv3l", "armv4b", "armv4l",
"armv5teb", "armv5tel", "armv5tejl",
"armv6l",
"s390", "i370", "s390x",
"sh", "sh3", "sh4", "sh4a", "xtensa",
"noarch", "fat",
NULL,
}

Definition at line 53 of file rpmns.c.

struct _rpmnsProbes_s rpmnsProbes[]
static

Referenced by rpmnsProbe().

size_t rpmnsProbesCount = sizeof(rpmnsProbes)/sizeof(rpmnsProbes[0])
static

Definition at line 174 of file rpmns.c.

Referenced by rpmnsProbe().