16 #include <rpm/rpmtypes.h> 17 #include <rpm/rpmstring.h> 300 uint8_t signhash16[2];
898 #define PGPARMOR_ERROR PGPARMOR_ERR_NO_BEGIN_PGP 956 unsigned int pgpGrab(
const uint8_t *s,
size_t nbytes)
959 size_t nb = (nbytes <=
sizeof(i) ? nbytes :
sizeof(i));
971 char *
pgpHexStr(
const uint8_t *p,
size_t plen);
982 uint8_t **fp,
size_t *fplen);
1001 int pgpPrtParams(
const uint8_t *pkts,
size_t pktlen,
unsigned int pkttype,
1002 pgpDigParams * ret);
1014 pgpDigParams mainkey, pgpDigParams **subkeys,
1024 int pgpPrtPkts(
const uint8_t *pkts,
size_t pktlen, pgpDig dig,
int printing);
1056 int pgpPubKeyCertLen(
const uint8_t *pkts,
size_t pktslen,
size_t *certlen);
1065 char *
pgpArmorWrap(
int atype,
const unsigned char * s,
size_t ns);
1178 DIGEST_CTX
rpmDigestInit(
int hashalgo, rpmDigestFlags flags);
1202 size_t * lenp,
int asAscii);
1226 rpmDigestFlags flags);
1237 rpmDigestFlags flags);
1259 void ** datap,
size_t * lenp,
int asAscii);
pgpArmor pgpParsePkts(const char *armor, uint8_t **pkt, size_t *pktlen)
Parse armored OpenPGP packets from memory.
enum pgpPubkeyAlgo_e pgpPubkeyAlgo
9.1.
pgpDig pgpNewDig(void)
Create a container for parsed OpenPGP packet(s).
struct pgpPktSigV4_s * pgpPktSigV4
5.2.3.
struct pgpPktPubkey_s pgpPktPubkey
5.1.
struct pgpPktKeyV3_s * pgpPktKeyV3
5.5.1.
enum pgpSymkeyAlgo_e pgpSymkeyAlgo
9.2.
int pgpDigParamsCmp(pgpDigParams p1, pgpDigParams p2)
Compare OpenPGP packet parameters param p1 1st parameter container param p2 2nd parameter container r...
pgpArmor pgpReadPkts(const char *fn, uint8_t **pkt, size_t *pktlen)
Parse armored OpenPGP packets from a file.
rpmDigestBundle rpmDigestBundleFree(rpmDigestBundle bundle)
Free a digest bundle and all contained digest contexts.
struct pgpPktKeyV4_s * pgpPktKeyV4
The version 4 format is similar to the version 3 format except for the absence of a validity period...
int rpmDigestFinal(DIGEST_CTX ctx, void **datap, size_t *lenp, int asAscii)
Return digest and destroy context.
struct DIGEST_CTX_s * DIGEST_CTX
enum pgpCompressAlgo_e pgpCompressAlgo
9.3.
DIGEST_CTX rpmDigestBundleDupCtx(rpmDigestBundle bundle, int id)
Duplicate a digest context from a bundle.
DIGEST_CTX rpmDigestInit(int hashalgo, rpmDigestFlags flags)
Initialize digest.
enum pgpArmorKey_e pgpArmorKey
pgpDig pgpFreeDig(pgpDig dig)
Destroy a container for parsed OpenPGP packet(s).
rpmRC pgpVerifySignature(pgpDigParams key, pgpDigParams sig, DIGEST_CTX hashctx)
Verify a PGP signature.
int pgpPubkeyKeyID(const uint8_t *pkt, size_t pktlen, pgpKeyID_t keyid)
Calculate OpenPGP public key Key ID.
struct pgpPktTrust_s pgpPktTrust
struct pgpPktEdata_s pgpPktEdata
int rpmDigestBundleFinal(rpmDigestBundle bundle, int id, void **datap, size_t *lenp, int asAscii)
Return digest from a bundle and destroy context, see rpmDigestFinal().
static unsigned int pgpGrab(const uint8_t *s, size_t nbytes)
Return (native-endian) integer from big-endian representation.
struct rpmDigestBundle_s * rpmDigestBundle
struct pgpPktLdata_s pgpPktLdata
enum pgpHashAlgo_e pgpHashAlgo
9.4.
enum pgpValType_e pgpValType
struct pgpPktUid_s pgpPktUid
int rpmDigestUpdate(DIGEST_CTX ctx, const void *data, size_t len)
Update context with next plain text buffer.
DIGEST_CTX rpmDigestDup(DIGEST_CTX octx)
Duplicate a digest context.
char * pgpHexStr(const uint8_t *p, size_t plen)
Return hex formatted representation of bytes.
pgpDigParams pgpDigParamsFree(pgpDigParams digp)
Destroy parsed OpenPGP packet parameter(s).
rpmDigestFlags_e
Bit(s) to control digest operation.
pgpDigParams pgpDigGetParams(pgpDig dig, unsigned int pkttype)
Retrieve parameters for parsed OpenPGP packet(s).
union pgpPktKey_u pgpPktKey
5.5.3.
struct pgpPktCdata_s pgpPktCdata
rpmRC pgpVerifySig(pgpDig dig, DIGEST_CTX hashctx)
Verify a PGP signature.
int rpmDigestBundleUpdate(rpmDigestBundle bundle, const void *data, size_t len)
Update contexts within bundle with next plain text buffer.
rpmDigestBundle rpmDigestBundleNew(void)
Create a new digest bundle.
int pgpPubkeyFingerprint(const uint8_t *pkt, size_t pktlen, uint8_t **fp, size_t *fplen)
Calculate OpenPGP public key fingerprint.
enum pgpSubType_e pgpSubType
5.2.3.1.
char * pgpArmorWrap(int atype, const unsigned char *s, size_t ns)
Wrap a OpenPGP packets in ascii armor for transport.
struct pgpPktSigV3_s * pgpPktSigV3
5.2.2.
unsigned int pgpDigParamsAlgo(pgpDigParams digp, unsigned int algotype)
Retrieve OpenPGP algorithm parameters param digp parameter container param algotype PGPVAL_HASHALGO /...
int rpmDigestBundleAddID(rpmDigestBundle bundle, int algo, int id, rpmDigestFlags flags)
Add a new type of digest to a bundle.
int rpmInitCrypto(void)
Perform cryptography initialization.
char * pgpIdentItem(pgpDigParams digp)
Return a string identification of a PGP signature/pubkey.
struct pgpDigParams_s * pgpDigParams
int rpmFreeCrypto(void)
Shutdown cryptography.
int pgpPubKeyCertLen(const uint8_t *pkts, size_t pktslen, size_t *certlen)
Return a length of the first public key certificate in a buffer given by pkts that contains one or mo...
struct pgpPktSymkey_s pgpPktSymkey
5.3.
int pgpPrtParamsSubkeys(const uint8_t *pkts, size_t pktlen, pgpDigParams mainkey, pgpDigParams **subkeys, int *subkeysCount)
Parse subkey parameters from OpenPGP packet(s).
const char * pgpValString(pgpValType type, uint8_t val)
Return string representation of am OpenPGP value.
enum pgpSigType_e pgpSigType
5.2.1.
int pgpPrtParams(const uint8_t *pkts, size_t pktlen, unsigned int pkttype, pgpDigParams *ret)
Parse a OpenPGP packet(s).
union pgpPktSig_u * pgpPktSig
5.2.
int rpmDigestBundleAdd(rpmDigestBundle bundle, int algo, rpmDigestFlags flags)
Add a new type of digest to a bundle.
void pgpCleanDig(pgpDig dig)
Release (malloc'd) data from container.
int pgpPrtPkts(const uint8_t *pkts, size_t pktlen, pgpDig dig, int printing)
Print/parse a OpenPGP packet(s).
The version 4 format is similar to the version 3 format except for the absence of a validity period...
enum rpmRC_e rpmRC
Package read return codes.
size_t rpmDigestLength(int hashalgo)
Obtain digest length in bytes.
struct pgpPktOnepass_s * pgpPktOnepass
5.4.