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
#define RPMLOOKUPSIG_DISABLE   1
#define RPMLOOKUPSIG_ENABLE   2

Typedefs

typedef enum sigType_e sigType
typedef enum pgpVersion_e pgpVersion

Enumerations

enum  sigType_e {
  RPMSIGTYPE_NONE = 0, RPMSIGTYPE_PGP262_1024 = 1, RPMSIGTYPE_BAD = 2, RPMSIGTYPE_MD5 = 3,
  RPMSIGTYPE_MD5_PGP = 4, RPMSIGTYPE_HEADERSIG = 5, RPMSIGTYPE_DISABLE = 6
}
enum  pgpVersion_e { PGP_NOTDETECTED = -1, PGP_UNKNOWN = 0, PGP_2 = 2, PGP_5 = 5 }

Functions

rpmRC rpmReadSignature (FD_t fd, Header *headerp, sigType sig_type)
int rpmWriteSignature (FD_t fd, Header h)
int rpmAddSignature (Header h, 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)

Variables

Header rpmNewSignature (void)


Detailed Description

Generate and verify signatures.

Definition in file signature.h.


Define Documentation

#define RPMLOOKUPSIG_DISABLE   1
 

Definition at line 81 of file signature.h.

Referenced by main(), and rpmLookupSignatureType().

#define RPMLOOKUPSIG_ENABLE   2
 

Definition at line 82 of file signature.h.

Referenced by rpmLookupSignatureType().

#define RPMLOOKUPSIG_QUERY   0
 

Definition at line 80 of file signature.h.

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


Function Documentation

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

Generate a signature of data in file, insert in header.

Definition at line 446 of file signature.c.

References _, headerAddEntry(), int_32, makeGPGSignature(), makePGPSignature(), mdbinfile(), RPM_BIN_TYPE, RPM_INT32_TYPE, RPMMESS_VERBOSE, rpmMessage, RPMSIGTAG_GPG, RPMSIGTAG_MD5, RPMSIGTAG_PGP, RPMSIGTAG_PGP5, and RPMSIGTAG_SIZE.

Referenced by rpmReSign(), and writeRPM().

const char* rpmDetectPGPVersion pgpVersion   pgpVer
 

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

Definition at line 68 of file signature.c.

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

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

char* rpmGetPassPhrase const char *    prompt,
const int    sigTag
 

Read a pass phrase from the user.

Definition at line 926 of file signature.c.

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

Referenced by main().

int rpmLookupSignatureType int    action
 

Return type of signature in effect for building.

Definition at line 31 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().

rpmRC rpmReadSignature FD_t    fd,
Header   headerp,
sigType    sig_type
 

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

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

Definition at line 150 of file signature.c.

References _, checkSize(), HEADER_MAGIC_YES, headerAddEntry(), headerFree(), headerGetEntry(), headerNew(), headerRead(), headerSizeof(), int_32, RPM_BIN_TYPE, RPMERR_BADSIGTYPE, rpmError, RPMMESS_DEBUG, rpmMessage, rpmRC, RPMRC_FAIL, RPMRC_OK, RPMRC_SHORTREAD, RPMSIGTAG_PGP, RPMSIGTAG_SIZE, RPMSIGTYPE_DISABLE, RPMSIGTYPE_HEADERSIG, RPMSIGTYPE_MD5, RPMSIGTYPE_MD5_PGP, RPMSIGTYPE_NONE, RPMSIGTYPE_PGP262_1024, sigType, and timedRead.

Referenced by main(), readPackageHeaders(), rpmCheckSig(), and rpmReSign().

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 214 of file signature.c.

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

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


Generated on Sun Feb 2 23:32:10 2003 for rpm by doxygen1.2.18