Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages  

lib/signature.h File Reference

Generate and verify signatures. More...

#include <header.h>

Go to the source code of this file.

Defines

#define RPMLOOKUPSIG_QUERY   0
 Possible actions for rpmLookupSignatureType().

#define RPMLOOKUPSIG_DISABLE   1
#define RPMLOOKUPSIG_ENABLE   2

Typedefs

typedef enum sigType_e sigType
typedef enum pgpVersion_e pgpVersion

Enumerations

enum  sigType_e { RPMSIGTYPE_HEADERSIG = 5 }
enum  pgpVersion_e { PGP_NOTDETECTED = -1, PGP_UNKNOWN = 0, PGP_2 = 2, PGP_5 = 5 }

Functions

Header rpmNewSignature (void)
rpmRC rpmReadSignature (FD_t fd, Header *sighp, sigType sig_type, const char **msg)
int rpmWriteSignature (FD_t fd, Header h)
int rpmAddSignature (Header sig, const char *file, int_32 sigTag, const char *passPhrase)
int rpmLookupSignatureType (int action)
char * rpmGetPassPhrase (const char *prompt, const int sigTag)
const char * rpmDetectPGPVersion (pgpVersion *pgpVer)


Detailed Description

Generate and verify signatures.

Definition in file signature.h.


Define Documentation

#define RPMLOOKUPSIG_DISABLE   1
 

Disable (--sign was not given)

Definition at line 83 of file signature.h.

Referenced by main(), and rpmLookupSignatureType().

#define RPMLOOKUPSIG_ENABLE   2
 

Re-enable _signature

Definition at line 84 of file signature.h.

Referenced by rpmLookupSignatureType().

#define RPMLOOKUPSIG_QUERY   0
 

Possible actions for rpmLookupSignatureType().

Lookup type in effect

Definition at line 82 of file signature.h.

Referenced by main(), rpmLookupSignatureType(), rpmReSign(), and writeRPM().


Function Documentation

int rpmAddSignature Header    sig,
const char *    file,
int_32    sigTag,
const char *    passPhrase
 

Generate signature(s) from a header+payload file, save in signature header.

Parameters:
sig  signature header
file  header+payload file name
sigTag  type of signature(s) to add
passPhrase  private key pass phrase
Returns:
0 on success, -1 on failure

Definition at line 731 of file signature.c.

References byte, domd5(), headerAddEntry(), int_32, makeGPGSignature(), makeHDRSignature(), makePGPSignature(), RPM_BIN_TYPE, RPM_INT32_TYPE, RPMSIGTAG_DSA, RPMSIGTAG_GPG, RPMSIGTAG_MD5, RPMSIGTAG_PGP, RPMSIGTAG_PGP5, RPMSIGTAG_RSA, RPMSIGTAG_SHA1, RPMSIGTAG_SIZE, and xcalloc().

Referenced by rpmReSign(), and writeRPM().

const char* rpmDetectPGPVersion pgpVersion   pgpVer
 

Return path to pgp executable of given type, or NULL when not found.

Return values:
pgpVer  pgp version
Returns:
path to pgp executable

Definition at line 73 of file signature.c.

References _free(), alloca(), PGP_2, PGP_5, PGP_NOTDETECTED, PGP_UNKNOWN, pgpVersion, rpmGetPath(), and stpcpy().

Referenced by checkPassPhrase(), main(), and makePGPSignature().

char* rpmGetPassPhrase const char *    prompt,
const int    sigTag
 

Read a pass phrase using getpass(3), confirm with gpg/pgp helper binaries.

Parameters:
prompt  user prompt
sigTag  signature type/tag
Returns:
pass phrase

Definition at line 895 of file signature.c.

References _, _free(), checkPassPhrase(), RPMERR_SIGGEN, rpmError, rpmExpand(), RPMSIGTAG_DSA, RPMSIGTAG_GPG, RPMSIGTAG_PGP, RPMSIGTAG_PGP5, and RPMSIGTAG_RSA.

Referenced by main().

int rpmLookupSignatureType int    action
 

Return type of signature needed for signing/building.

Parameters:
action  enable/disable/query action
Returns:
sigTag to use, 0 if none, -1 on error

Definition at line 33 of file signature.c.

References _free(), rpmExpand(), RPMLOOKUPSIG_DISABLE, RPMLOOKUPSIG_ENABLE, RPMLOOKUPSIG_QUERY, RPMSIGTAG_GPG, RPMSIGTAG_PGP, and xstrcasecmp().

Referenced by main(), rpmReSign(), and writeRPM().

Header rpmNewSignature void   
 

Return new, empty (signature) header instance.

Returns:
signature header

Definition at line 358 of file signature.c.

References headerNew().

Referenced by headerRegenSigHeader(), and writeRPM().

rpmRC rpmReadSignature FD_t    fd,
Header   sighp,
sigType    sig_type,
const char **    msg
 

Read (and verify header+payload size) signature header. If an old-style signature is found, we emulate a new style one.

Parameters:
fd  file handle
Return values:
sighp  address of (signature) header (or NULL)
Parameters:
sig_type  type of signature header to read (from lead)
Return values:
msg  failure msg
Returns:
rpmRC return code

Definition at line 148 of file signature.c.

References _, alloca(), entryInfo_s::count, headerToken_s::flags, header_magic, HEADER_MAGIC_YES, HEADERFLAG_ALLOCATED, headerFree(), headerGetEntry(), headerLink(), headerLoad(), headerSizeof(), headerVerifyInfo(), indexEntry_s::info, int_32, entryInfo_s::offset, printSize(), REGION_TAG_COUNT, RPM_BIN_TYPE, rpmRC, RPMRC_FAIL, RPMRC_OK, RPMSIGTAG_SIZE, RPMSIGTYPE_HEADERSIG, RPMTAG_HEADERSIGNATURES, sigType, snprintf(), entryInfo_s::tag, timedRead, entryInfo_s::type, xmalloc(), and xstrdup().

Referenced by main(), rpmReadPackageFile(), rpmReSign(), and rpmVerifySignatures().

int rpmWriteSignature FD_t    fd,
Header    h
 

Write signature header.

Parameters:
fd  file handle
h  (signature) header
Returns:
0 on success, 1 on error

Definition at line 336 of file signature.c.

References _, byte, Fwrite(), HEADER_MAGIC_YES, headerSizeof(), headerWrite(), RPMMESS_DEBUG, and rpmMessage.

Referenced by main(), rpmpsmStage(), rpmReSign(), and writeRPM().


Generated on Sun Oct 26 13:02:06 2003 for rpm by doxygen1.2.18