rpm  5.4.14
Files | Typedefs | Enumerations | Functions
SIGNATURE.
Collaboration diagram for SIGNATURE.:

Files

file  rpmlib.h
 In Memoriam: Steve Taylor stayl.nosp@m.or@r.nosp@m.edhat.nosp@m..com was here, now he's not.
 
file  signature.c
 
file  signature.h
 Generate and verify rpm package signatures.
 
file  crc.c
 
file  digest.c
 
file  rpmpgp.c
 Routines to handle RFC-2440 detached signatures.
 

Typedefs

typedef enum pgpVersion_e pgpVersion
 Identify PGP versions. More...
 

Enumerations

enum  rpmSigTag_e {
  RPMSIGTAG_SIZE = 1000, RPMSIGTAG_LEMD5_1 = 1001, RPMSIGTAG_PGP = 1002, RPMSIGTAG_LEMD5_2 = 1003,
  RPMSIGTAG_MD5 = 1004, RPMSIGTAG_GPG = 1005, RPMSIGTAG_PGP5 = 1006, RPMSIGTAG_PAYLOADSIZE = 1007,
  RPMSIGTAG_BADSHA1_1 = RPMTAG_BADSHA1_1, RPMSIGTAG_BADSHA1_2 = RPMTAG_BADSHA1_2, RPMSIGTAG_SHA1 = RPMTAG_SHA1HEADER, RPMSIGTAG_DSA = RPMTAG_DSAHEADER,
  RPMSIGTAG_RSA = RPMTAG_RSAHEADER, RPMSIGTAG_PADDING = 0x3fffffff
}
 Tags found in signature header from package. More...
 
enum  pgpVersion_e { PGP_NOTDETECTED = -1, PGP_UNKNOWN = 0, PGP_2 = 2, PGP_5 = 5 }
 Identify PGP versions. More...
 

Functions

int rpmAddSignature (Header sigh, const char *file, rpmSigTag sigTag, const char *passPhrase)
 Generate signature(s) from a header+payload file, save in signature header. More...
 
rpmRC rpmVerifySignature (void *_dig, char *result)
 Verify a signature from a package. More...
 

Detailed Description

Typedef Documentation

typedef enum pgpVersion_e pgpVersion

Identify PGP versions.

Note
Greater than 0 is a valid PGP version.

Enumeration Type Documentation

Identify PGP versions.

Note
Greater than 0 is a valid PGP version.
Enumerator
PGP_NOTDETECTED 
PGP_UNKNOWN 
PGP_2 
PGP_5 

Definition at line 15 of file signature.h.

Tags found in signature header from package.

Enumerator
RPMSIGTAG_SIZE 

internal Header+Payload size in bytes.

RPMSIGTAG_LEMD5_1 

internal Broken MD5, take 1

Deprecated:
legacy.
RPMSIGTAG_PGP 

internal PGP 2.6.3 signature.

RPMSIGTAG_LEMD5_2 

internal Broken MD5, take 2

Deprecated:
legacy.
RPMSIGTAG_MD5 

internal MD5 signature.

RPMSIGTAG_GPG 

internal GnuPG signature.

RPMSIGTAG_PGP5 

internal PGP5 signature

Deprecated:
legacy.
RPMSIGTAG_PAYLOADSIZE 

internal uncompressed payload size in bytes.

RPMSIGTAG_BADSHA1_1 

internal Broken SHA1, take 1.

RPMSIGTAG_BADSHA1_2 

internal Broken SHA1, take 2.

RPMSIGTAG_SHA1 

internal sha1 header digest.

RPMSIGTAG_DSA 

internal DSA header signature.

RPMSIGTAG_RSA 

internal RSA header signature.

RPMSIGTAG_PADDING 

signature header padding

Definition at line 449 of file rpmtag.h.

Function Documentation

int rpmAddSignature ( Header  sigh,
const char *  file,
rpmSigTag  sigTag,
const char *  passPhrase 
)

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

Parameters
sighsignature header
fileheader+payload file name
sigTagtype of signature(s) to add
passPhraseprivate key pass phrase
Returns
0 on success, -1 on failure

Definition at line 433 of file signature.c.

References alloca(), assert(), _HE_s::c, dodigest(), headerPut(), makeHDRSignature(), memset(), NULL, _HE_s::p, PGPHASHALGO_MD5, pkt, pktlen, rpmDataType_u::ptr, ret, RPM_BIN_TYPE, RPM_UINT32_TYPE, RPMSIGTAG_DSA, RPMSIGTAG_GPG, RPMSIGTAG_MD5, RPMSIGTAG_RSA, RPMSIGTAG_SHA1, RPMSIGTAG_SIZE, Stat(), _HE_s::t, _HE_s::tag, rpmDataType_u::ui32p, and xx.

Referenced by rpmReSign(), and writeRPM().

rpmRC rpmVerifySignature ( void _dig,
char *  result 
)

Verify a signature from a package.

Parameters
_digcontainer
Return values
resultdetailed text result of signature verification
Returns
result of signature verification

Definition at line 941 of file signature.c.

References _, exit, fprintf(), pgpGetSig(), pgpGetSiglen(), pgpGetSigtag(), res, RPMRC_NOTFOUND, RPMSIGTAG_DSA, RPMSIGTAG_MD5, RPMSIGTAG_RSA, RPMSIGTAG_SHA1, RPMSIGTAG_SIZE, and sprintf().

Referenced by headerCheck(), rpmReadPackageFile(), and rpmVerifySignatures().