Main Page   Modules   Compound List   File List   Compound Members   File Members   Related Pages  

SIGNATURE.


Files

file  base64.c
file  digest.c
file  md5.c
 This code implements the MD5 message-digest algorithm.

file  md5sum.c
 Generate/check MD5 Message Digests.

file  rpmlib.h
file  signature.c
file  signature.h
 Generate and verify signatures.


RPMK

enum  rpmtagSignature {
  RPMSIGTAG_SIZE = 1000, RPMSIGTAG_LEMD5_1 = 1001, RPMSIGTAG_PGP = 1002, RPMSIGTAG_LEMD5_2 = 1003,
  RPMSIGTAG_MD5 = 1004, RPMSIGTAG_GPG = 1005, RPMSIGTAG_PGP5 = 1006, RPMTAG_PK_BASE = 512,
  RPMTAG_PK_RSA_ES = RPMTAG_PK_BASE+1, RPMTAG_PK_RSA_E = RPMTAG_PK_BASE+2, RPMTAG_PK_RSA_S = RPMTAG_PK_BASE+3, RPMTAG_PK_ELGAMAL_E = RPMTAG_PK_BASE+16,
  RPMTAG_PK_DSA = RPMTAG_PK_BASE+17, RPMTAG_PK_ELLIPTIC = RPMTAG_PK_BASE+18, RPMTAG_PK_ECDSA = RPMTAG_PK_BASE+19, RPMTAG_PK_ELGAMAL_ES = RPMTAG_PK_BASE+20,
  RPMTAG_PK_DH = RPMTAG_PK_BASE+21, RPMTAG_HASH_BASE = 512+64, RPMTAG_HASH_MD5 = RPMTAG_HASH_BASE+1, RPMTAG_HASH_SHA1 = RPMTAG_HASH_BASE+2,
  RPMTAG_HASH_RIPEMD160 = RPMTAG_HASH_BASE+3, RPMTAG_HASH_MD2 = RPMTAG_HASH_BASE+5, RPMTAG_HASH_TIGER192 = RPMTAG_HASH_BASE+6, RPMTAG_HASH_HAVAL_5_160 = RPMTAG_HASH_BASE+7
}
rpmVerifySignatureReturn rpmVerifySignature (const char *file, int_32 sigTag, const void *sig, int count, char *result)
void rpmFreeSignature (Header h)

Enumerations

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

Functions

Header rpmNewSignature (void)
int rpmReadSignature (FD_t fd, Header *header, short sig_type)
int rpmWriteSignature (FD_t fd, Header header)
int rpmAddSignature (Header header, 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 *pgpVersion)

Enumeration Type Documentation

enum pgpVersion_e
 

Identify PGP versions.

Note:
Greater than 0 is a valid PGP version.
Enumeration values:
PGP_NOTDETECTED  
PGP_UNKNOWN  
PGP_2  
PGP_5  

Definition at line 86 of file signature.h.

enum rpmtagSignature
 

Tags found in signature header from package.

Enumeration values:
RPMSIGTAG_SIZE   Size in bytes.
RPMSIGTAG_LEMD5_1   Broken MD5, take 1
RPMSIGTAG_PGP   PGP 2.6.3 signature.
RPMSIGTAG_LEMD5_2   Broken MD5, take 2
RPMSIGTAG_MD5   MD5 signature.
RPMSIGTAG_GPG   GnuPG signature.
RPMSIGTAG_PGP5   PGP5 signature
Deprecated:
legacy.
RPMTAG_PK_BASE  
Todo:
Implement.
RPMTAG_PK_RSA_ES   (unused
RPMTAG_PK_RSA_E   (unused)
RPMTAG_PK_RSA_S   (unused)
RPMTAG_PK_ELGAMAL_E   (unused)
RPMTAG_PK_DSA   (unused)
RPMTAG_PK_ELLIPTIC   (unused)
RPMTAG_PK_ECDSA   (unused)
RPMTAG_PK_ELGAMAL_ES   (unused)
RPMTAG_PK_DH   (unused)
RPMTAG_HASH_BASE  
Todo:
Implement.
RPMTAG_HASH_MD5   (unused)
RPMTAG_HASH_SHA1   (unused)
RPMTAG_HASH_RIPEMD160   (unused)
RPMTAG_HASH_MD2   (unused)
RPMTAG_HASH_TIGER192   (unused)
RPMTAG_HASH_HAVAL_5_160   (unused)

Definition at line 1425 of file rpmlib.h.


Function Documentation

int rpmAddSignature ( Header header,
const char * file,
int_32 sigTag,
const char * passPhrase )
 

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

Definition at line 392 of file signature.c.

Referenced by rpmReSign(), and writeRPM().

const char* rpmDetectPGPVersion ( pgpVersion * pgpVersion )
 

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

Definition at line 73 of file signature.c.

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

void rpmFreeSignature ( Header h )
 

Destroy signature header from package.

Definition at line 222 of file signature.c.

char* rpmGetPassPhrase ( const char * prompt,
const int sigTag )
 

Read a pass phrase from the user.

Definition at line 744 of file signature.c.

Referenced by main().

int rpmLookupSignatureType ( int action )
 

Return type of signature in effect for building.

Definition at line 35 of file signature.c.

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

Header rpmNewSignature ( void )
 

Return new, empty (signature) header instance.

Returns:
new

Definition at line 216 of file signature.c.

int rpmReadSignature ( FD_t fd,
Header * header,
short 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:
header   address of (signature) header
Parameters:
sig_type   type of signature header to read (from lead).
Returns:
0 on success, 1 on error

Definition at line 128 of file signature.c.

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

rpmVerifySignatureReturn rpmVerifySignature ( const char * file,
int_32 sigTag,
const void * sig,
int count,
char * result )
 

Verify a signature from a package.

Parameters:
file   file name of header+payload
sigTag   type of signature
sig   signature itself
count   no. of bytes in signature
Return values:
result   detailed text result of signature verification
Returns:
result of signature verification

Definition at line 791 of file signature.c.

int rpmWriteSignature ( FD_t fd,
Header header )
 

Write signature header.

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

Definition at line 195 of file signature.c.

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


Generated at Mon May 21 08:53:44 2001 for rpm by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001