rpmsign.c File Reference
`#include "system.h"`
`#include <errno.h>`
`#include <sys/wait.h>`
`#include <popt.h>`
`#include <rpm/rpmcli.h>`
`#include <rpm/rpmsign.h>`
`#include "cliutils.h"`
`#include "lib/rpmsignfiles.h"`
`#include "debug.h"`
Include dependency graph for rpmsign.c:

Go to the source code of this file.

## Enumerations

enum

modes {
MODE_BUILD = (1 << 4), MODE_REBUILD = (1 << 5), MODE_RECOMPILE = (1 << 8), MODE_TARBUILD = (1 << 11),
MODE_INITDB = (1 << 0), MODE_REBUILDDB = (1 << 1), MODE_VERIFYDB = (1 << 2), MODE_EXPORTDB = (1 << 3),
MODE_IMPORTDB = (1 << 4), MODE_CHECKSIG = (1 << 0), MODE_IMPORTKEY = (1 << 1), MODE_DELKEY = (1 << 2),
MODE_LISTKEY = (1 << 3), MODE_QUERY = (1 << 0), MODE_VERIFY = (1 << 3), MODE_INSTALL = (1 << 1),
MODE_ERASE = (1 << 2), MODE_UNKNOWN = 0, MODE_ADDSIGN = (1 << 0), MODE_RESIGN = (1 << 1),
MODE_DELSIGN = (1 << 2), MODE_UNKNOWN = 0, MODE_QUERY = (1 << 0), MODE_PARSE = (1 << 1)
}

## Functions

static int | doSign (poptContext optCon)
int | main (int argc, char *argv[])

## Variables

char ** | environ = NULL
static int | mode = 0
static int | signfiles = 0
static int | fskpass = 0
static char * | fileSigningKey = NULL
static char * | fileSigningKeyPassword = NULL
static struct poptOption | signOptsTable []
static struct poptOption | optionsTable []

## Enumeration Type Documentation

enum modes

Enumerator
MODE_BUILD |
MODE_REBUILD |
MODE_RECOMPILE |
MODE_TARBUILD |
MODE_INITDB |
MODE_REBUILDDB |
MODE_VERIFYDB |
MODE_EXPORTDB |
MODE_IMPORTDB |
MODE_CHECKSIG |
MODE_IMPORTKEY |
MODE_DELKEY |
MODE_LISTKEY |
MODE_QUERY |
MODE_VERIFY |
MODE_INSTALL |
MODE_ERASE |
MODE_UNKNOWN |
MODE_ADDSIGN |
MODE_RESIGN |
MODE_DELSIGN |
MODE_UNKNOWN |
MODE_QUERY |
MODE_PARSE |

Definition at line 16 of file rpmsign.c.

## Function Documentation

static int doSign | ( | poptContext | optCon | ) |

static

Definition at line 57 of file rpmsign.c.

References _, addMacro(), argerror(), fskpass, RMIL_CMDLINE, RMIL_GLOBAL, rpmExpand(), rpmPkgSign(), rstreq(), and rpmSignArgs::signfiles.

Referenced by main().

int main | ( | int | argc,
|  | char * | argv[]
| ) |  |

Definition at line 110 of file rpmsign.c.

References _, argerror(), doSign(), MODE_ADDSIGN, MODE_DELSIGN, MODE_RESIGN, printUsage(), rpmcliFini(), rpmcliInit(), and rpmPkgDelSign().

## Variable Documentation

char** environ = NULL

Definition at line 13 of file rpmsign.c.

char* fileSigningKey = NULL

static

Definition at line 25 of file rpmsign.c.

char* fileSigningKeyPassword = NULL

static

Definition at line 26 of file rpmsign.c.

int fskpass = 0

static

Definition at line 24 of file rpmsign.c.

Referenced by doSign().

int mode = 0

static

Definition at line 22 of file rpmsign.c.

struct poptOption optionsTable[]

static

Initial value:
= {
{ NULL, '\0', POPT_ARG_INCLUDE_TABLE, signOptsTable, 0,
"Signature options:" , NULL },
{ NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmcliAllPoptTable, 0,
"Common options for all rpm modes and executables:" , NULL },
POPT_AUTOALIAS
POPT_AUTOHELP
POPT_TABLEEND
}
signOptsTable
static struct poptOption signOptsTable[]
Definition: rpmsign.c:28
rpmcliAllPoptTable
struct poptOption rpmcliAllPoptTable[]
Popt option table for options shared by all modes and executables.

Definition at line 45 of file rpmsign.c.

int signfiles = 0

static

Definition at line 24 of file rpmsign.c.

struct poptOption signOptsTable[]

static

Initial value:
= {
{ "addsign", '\0', (POPT_ARG_VAL|POPT_ARGFLAG_OR), &mode, MODE_ADDSIGN,
"sign package(s)" , NULL },
{ "resign", '\0', (POPT_ARG_VAL|POPT_ARGFLAG_OR), &mode, MODE_RESIGN,
"sign package(s) (identical to --addsign)" , NULL },
{ "delsign", '\0', (POPT_ARG_VAL|POPT_ARGFLAG_OR), &mode, MODE_DELSIGN,
"delete package signatures" , NULL },
{ "signfiles", '\0', POPT_ARG_NONE, &signfiles, 0,
"sign package(s) files" , NULL},
{ "fskpath", '\0', POPT_ARG_STRING, &fileSigningKey, 0,
"use file signing key <key>" ,
"<key>" },
{ "fskpass", '\0', POPT_ARG_NONE, &fskpass, 0,
"prompt for file signing key password" , NULL},
POPT_TABLEEND
}
MODE_DELSIGN
Definition: rpmsign.c:19
mode
static int mode
Definition: rpmsign.c:22
signfiles
static int signfiles
Definition: rpmsign.c:24
MODE_ADDSIGN
Definition: rpmsign.c:17
fskpass
static int fskpass
Definition: rpmsign.c:24
MODE_RESIGN
Definition: rpmsign.c:18
fileSigningKey
static char * fileSigningKey
Definition: rpmsign.c:25

Definition at line 28 of file rpmsign.c.