# lib/rpmns.c File Reference

`#include "system.h"`
`#include <rpmio_internal.h>`
`#include <rpmmacro.h>`
`#include <rpmpgp.h>`
`#include <rpmlib.h>`
`#include <rpmevr.h>`
`#include <rpmns.h>`
`#include <rpmcb.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
| Dependency probe table. More...
## Defines
#define | _RPMPGP_INTERNAL
#define | _RPMEVR_INTERNAL
#define | _RPMNS_INTERNAL
#define | _RPMTS_INTERNAL
## Functions
nsType | rpmnsArch (const char *str)
| Is string a known arch suffix?
nsType | rpmnsProbe (const char *str)
| Is string a known probe namespace?
nsType | rpmnsClassify (const char *str)
| Classify a string as a dependency type.
int | rpmnsParse (const char *str, rpmns ns)
| Split NS string into namespace, name and arch components.
static unsigned char | nibble (char c)
| Convert hex to binary nibble.
rpmRC | rpmnsProbeSignature (void *_ts, const char *fn, const char *sigfn, const char *pubfn, const char *pubid, int flags)
| Verify OpenPGP signature on a file.
## Variables
int | _rpmns_debug = 0
const char * | _rpmns_N_at_A = "."
static const char * | rpmnsArches []
static struct _rpmnsProbes_s | rpmnsProbes []
| Dependency probe table.

## Detailed Description

Definition in file rpmns.c.

## Define Documentation

#define _RPMEVR_INTERNAL

Definition at line 13 of file rpmns.c.

#define _RPMNS_INTERNAL

Definition at line 15 of file rpmns.c.

#define _RPMPGP_INTERNAL

Definition at line 9 of file rpmns.c.

#define _RPMTS_INTERNAL

Definition at line 21 of file rpmns.c.

## Function Documentation

static unsigned char nibble | ( | char | c | ) | `[inline, static]`

Convert hex to binary nibble.

Parameters:

  | c | hex character

Returns:
  binary nibble

Definition at line 247 of file rpmns.c.

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:

  | _ts | transaction set
  | fn | plaintext (or clearsign) file
  | sigfn | binary/pem encoded signature file (NULL iff clearsign)
  | pubfn | binary/pem encoded pubkey file (NULL uses rpmdb keyring)
  | pubid | pubkey fingerprint hex string (NULL disables check)
  | flags | (unused)

Returns:
  RPMRC_OK if verified, RPMRC_FAIL if not verified

Definition at line 259 of file rpmns.c.

References _free(), _rpmns_debug, alloca(), nibble(), PGPARMOR_PUBKEY, PGPARMOR_SIGNATURE, pgpFindPubkey(), pgpGetPubkey(), pgpGetSignature(), pgpGrab(), pgpImplSetDSA(), pgpImplSetRSA(), pgpImplVerifyDSA(), pgpImplVerifyRSA(), pgpPrtPkts(), PGPPUBKEYALGO_DSA, PGPPUBKEYALGO_RSA, pgpReadPkts(), RPMDIGEST_NONE, rpmDigestInit(), rpmDigestUpdate(), rpmExpand(), rpmioSlurp(), RPMRC_FAIL, RPMRC_NOKEY, RPMRC_OK, rpmtsCleanDig(), and rpmtsDig().

Referenced by unsatisfiedDepend().

## Variable Documentation

int _rpmns_debug = 0

Definition at line 27 of file rpmns.c.

Referenced by rpmnsProbeSignature().

const char* _rpmns_N_at_A = "."

Definition at line 30 of file rpmns.c.

Referenced by rpmdsNewDNEVR(), rpmnsClassify(), and rpmnsParse().

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", "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", "xtensa",
        "noarch", "fat",
        NULL,
    }

Definition at line 34 of file rpmns.c.

Referenced by rpmnsArch().

struct _rpmnsProbes_s rpmnsProbes[]`[static]`

Dependency probe table.

Referenced by rpmnsProbe().