rpm
5.4.15
|
Generate and verify rpm package signatures. More...
#include <rpmtag.h>
Go to the source code of this file.
Typedefs | |
typedef enum pgpVersion_e | pgpVersion |
Identify PGP versions. More... | |
Enumerations | |
enum | pgpVersion_e { PGP_NOTDETECTED = -1, PGP_UNKNOWN = 0, PGP_2 = 2, PGP_5 = 5 } |
Identify PGP versions. More... | |
Functions | |
int | rpmTempFile (const char *prefix, const char **fnptr, void *fdptr) |
Return file handle for a temporaray file. More... | |
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... | |
int | rpmCheckPassPhrase (const char *passPhrase) |
Check for valid pass phrase by invoking a helper. More... | |
rpmRC | rpmVerifySignature (void *_dig, char *result) |
Verify a signature from a package. More... | |
Generate and verify rpm package signatures.
Definition in file signature.h.
typedef enum pgpVersion_e pgpVersion |
Identify PGP versions.
enum pgpVersion_e |
Identify PGP versions.
Enumerator | |
---|---|
PGP_NOTDETECTED | |
PGP_UNKNOWN | |
PGP_2 | |
PGP_5 |
Definition at line 15 of file signature.h.
Generate signature(s) from a header+payload file, save in signature header.
sigh | signature header |
file | header+payload file name |
sigTag | type of signature(s) to add |
passPhrase | private key pass phrase |
Definition at line 477 of file signature.c.
References alloca(), _HE_s::c, dodigest(), headerPut(), makeHDRSignature(), _HE_s::p, PGPHASHALGO_MD5, rpmDataType_u::ptr, RPM_BIN_TYPE, RPM_UINT32_TYPE, RPMSIGTAG_DSA, RPMSIGTAG_ECDSA, RPMSIGTAG_GPG, RPMSIGTAG_MD5, RPMSIGTAG_RSA, RPMSIGTAG_SHA1, RPMSIGTAG_SIZE, Stat(), _HE_s::t, _HE_s::tag, and rpmDataType_u::ui32p.
Referenced by rpmReSign(), and writeRPM().
int rpmCheckPassPhrase | ( | const char * | passPhrase | ) |
Check for valid pass phrase by invoking a helper.
passPhrase | pass phrase |
Definition at line 534 of file signature.c.
References _, _free(), cmd, environ, errno, rpmExpand(), rpmIsVerbose, rpmkuPassPhrase(), rpmlog(), RPMLOG_ERR, setenv(), and unsetenv().
Referenced by main().
int rpmTempFile | ( | const char * | prefix, |
const char ** | fnptr, | ||
void * | fdptr | ||
) |
Return file handle for a temporaray file.
A unique temporaray file path will be generated using rpmGenPath(prefix, "%{_tmppath}/", "rpm-tmp.XXXXX") where "XXXXXX" is filled in using rand(3). The file is opened, and the link count and (dev,ino) location are verified after opening. The file name and the open file handle are returned.
prefix | leading part of temp file path |
*fnptr | temp file name (or NULL) |
*fdptr | temp file handle |
Definition at line 30 of file signature.c.
References _, _free(), errno, Fclose(), Ferror(), Fileno(), Fopen(), rpmGenPath(), rpmioMkpath(), rpmlog(), RPMLOG_ERR, S_ISLNK, time, URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_MONGO, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
Referenced by makeHDRSignature(), manageFile(), runScript(), and writeRPM().
rpmRC rpmVerifySignature | ( | void * | _dig, |
char * | result | ||
) |
Verify a signature from a package.
_dig | container |
result | detailed text result of signature verification |
Definition at line 1094 of file signature.c.
References _, _rpmhkp_debug, pgpGetPubkey(), pgpGetSig(), pgpGetSiglen(), pgpGetSignature(), pgpGetSigtag(), PGPPUBKEYALGO_DSA, PGPPUBKEYALGO_ECDSA, PGPPUBKEYALGO_RSA, RPMRC_NOTFOUND, RPMSIGTAG_DSA, RPMSIGTAG_ECDSA, RPMSIGTAG_MD5, RPMSIGTAG_RSA, RPMSIGTAG_SHA1, RPMSIGTAG_SIZE, verifyDSA(), verifyECDSA(), verifyMD5(), verifyRSA(), verifySHA1(), and verifySize().
Referenced by headerCheck(), rpmReadPackageFile(), and rpmVerifySignatures().