20 #include <rpm/rpmtypes.h>
21 #include <rpm/rpmstring.h>
925 #define PGPARMOR_ERROR PGPARMOR_ERR_NO_BEGIN_PGP
983 unsigned int pgpGrab(
const uint8_t *s,
size_t nbytes)
986 size_t nb = (nbytes <=
sizeof(i) ? nbytes :
sizeof(i));
1009 uint8_t **fp,
size_t *fplen);
1229 size_t * lenp,
int asAscii);
1286 void ** datap,
size_t * lenp,
int asAscii);
int rpmInitCrypto(void)
Perform cryptography initialization.
enum pgpHashAlgo_e pgpHashAlgo
9.4.
rpmRC pgpVerifySignature(pgpDigParams key, pgpDigParams sig, DIGEST_CTX hashctx)
Verify a PGP signature.
int pgpPrtParams(const uint8_t *pkts, size_t pktlen, unsigned int pkttype, pgpDigParams *ret)
Parse a OpenPGP packet(s).
enum pgpPubkeyAlgo_e pgpPubkeyAlgo
9.1.
rpmDigestBundle rpmDigestBundleFree(rpmDigestBundle bundle)
Free a digest bundle and all contained digest contexts.
enum pgpSigType_e pgpSigType
5.2.1.
pgpDig pgpNewDig(void)
Create a container for parsed OpenPGP packet(s).
struct pgpPktKeyV4_s * pgpPktKeyV4
The version 4 format is similar to the version 3 format except for the absence of a validity period.
struct pgpPktSigV3_s * pgpPktSigV3
5.2.2.
pgpDig pgpFreeDig(pgpDig dig)
Destroy a container for parsed OpenPGP packet(s).
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 pgpPktTrust_s pgpPktTrust
5.10.
rpmDigestFlags_e
Bit(s) to control digest operation.
DIGEST_CTX rpmDigestInit(int hashalgo, rpmDigestFlags flags)
Initialize digest.
int rpmDigestBundleAdd(rpmDigestBundle bundle, int algo, rpmDigestFlags flags)
Add a new type of digest to a bundle.
struct pgpPktKeyV3_s * pgpPktKeyV3
5.5.1.
void pgpCleanDig(pgpDig dig)
Release (malloc'd) data from container.
struct pgpPktOnepass_s * pgpPktOnepass
5.4.
int rpmDigestFinal(DIGEST_CTX ctx, void **datap, size_t *lenp, int asAscii)
Return digest and destroy context.
pgpArmor pgpParsePkts(const char *armor, uint8_t **pkt, size_t *pktlen)
Parse armored OpenPGP packets from memory.
pgpArmor pgpReadPkts(const char *fn, uint8_t **pkt, size_t *pktlen)
Parse armored OpenPGP packets from a file.
const char * pgpValString(pgpValType type, uint8_t val)
Return string representation of am OpenPGP value.
char * pgpHexStr(const uint8_t *p, size_t plen)
Return hex formatted representation of bytes.
struct pgpPktCdata_s pgpPktCdata
5.6.
rpmDigestBundle rpmDigestBundleNew(void)
Create a new digest bundle.
enum pgpCompressAlgo_e pgpCompressAlgo
9.3.
int rpmDigestBundleFinal(rpmDigestBundle bundle, int id, void **datap, size_t *lenp, int asAscii)
Return digest from a bundle and destroy context, see rpmDigestFinal().
DIGEST_CTX rpmDigestDup(DIGEST_CTX octx)
Duplicate a digest context.
union pgpPktKey_u pgpPktKey
5.5.3.
size_t rpmDigestLength(int hashalgo)
Obtain digest length in bytes.
int pgpDigParamsCmp(pgpDigParams p1, pgpDigParams p2)
Compare OpenPGP packet parameters param p1 1st parameter container param p2 2nd parameter container r...
enum pgpArmorKey_e pgpArmorKey
struct pgpDigParams_s * pgpDigParams
DIGEST_CTX rpmDigestBundleDupCtx(rpmDigestBundle bundle, int id)
Duplicate a digest context from a bundle.
union pgpPktSig_u * pgpPktSig
5.2.
unsigned int pgpDigParamsAlgo(pgpDigParams digp, unsigned int algotype)
Retrieve OpenPGP algorithm parameters param digp parameter container param algotype PGPVAL_HASHALGO /...
enum pgpSymkeyAlgo_e pgpSymkeyAlgo
9.2.
struct pgpPktLdata_s pgpPktLdata
5.8.
pgpDigParams pgpDigParamsFree(pgpDigParams digp)
Destroy parsed OpenPGP packet parameter(s).
int pgpPubkeyKeyID(const uint8_t *pkt, size_t pktlen, pgpKeyID_t keyid)
Calculate OpenPGP public key Key ID.
int pgpPrtPkts(const uint8_t *pkts, size_t pktlen, pgpDig dig, int printing)
Print/parse a OpenPGP packet(s).
enum pgpSubType_e pgpSubType
5.2.3.1.
int rpmDigestUpdate(DIGEST_CTX ctx, const void *data, size_t len)
Update context with next plain text buffer.
int rpmFreeCrypto(void)
Shutdown cryptography.
struct DIGEST_CTX_s * DIGEST_CTX
struct pgpPktEdata_s pgpPktEdata
5.7.
char * pgpArmorWrap(int atype, const unsigned char *s, size_t ns)
Wrap a OpenPGP packets in ascii armor for transport.
int rpmDigestBundleAddID(rpmDigestBundle bundle, int algo, int id, rpmDigestFlags flags)
Add a new type of digest to a bundle.
int rpmDigestBundleUpdate(rpmDigestBundle bundle, const void *data, size_t len)
Update contexts within bundle with next plain text buffer.
pgpDigParams pgpDigGetParams(pgpDig dig, unsigned int pkttype)
Retrieve parameters for parsed OpenPGP packet(s).
struct pgpPktUid_s pgpPktUid
5.11.
int pgpPrtParamsSubkeys(const uint8_t *pkts, size_t pktlen, pgpDigParams mainkey, pgpDigParams **subkeys, int *subkeysCount)
Parse subkey parameters from OpenPGP packet(s).
char * pgpIdentItem(pgpDigParams digp)
Return a string identification of a PGP signature/pubkey.
rpmRC pgpVerifySig(pgpDig dig, DIGEST_CTX hashctx)
Verify a PGP signature.
static unsigned int pgpGrab(const uint8_t *s, size_t nbytes)
Return (native-endian) integer from big-endian representation.
int pgpPubkeyFingerprint(const uint8_t *pkt, size_t pktlen, uint8_t **fp, size_t *fplen)
Calculate OpenPGP public key fingerprint.
struct pgpPktPubkey_s pgpPktPubkey
5.1.
struct pgpPktSigV4_s * pgpPktSigV4
5.2.3.
enum pgpCurveId_e pgpCurveId
ECC Curves.
@ PGPPUBKEYALGO_RSA_ENCRYPT
@ PGPPUBKEYALGO_ELGAMAL_ENCRYPT
@ PGPCURVE_BRAINPOOL_P256R1
@ PGPCURVE_BRAINPOOL_P512R1
@ PGPARMOR_ERR_CRC_DECODE
@ PGPARMOR_ERR_BODY_DECODE
@ PGPARMOR_SIGNED_MESSAGE
@ PGPARMOR_ERR_UNKNOWN_ARMOR_TYPE
@ PGPARMOR_ERR_NO_BEGIN_PGP
@ PGPARMOR_ERR_NO_END_PGP
@ PGPARMOR_ERR_UNKNOWN_PREAMBLE_TAG
@ PGPHASHALGO_HAVAL_5_160
@ PGPSIGTYPE_GENERIC_CERT
@ PGPSIGTYPE_SUBKEY_BINDING
@ PGPSIGTYPE_PERSONA_CERT
@ PGPSIGTYPE_SUBKEY_REVOKE
@ PGPSIGTYPE_POSITIVE_CERT
@ PGPTAG_ONEPASS_SIGNATURE
@ PGPTAG_PUBLIC_SESSION_KEY
@ PGPTAG_SYMMETRIC_SESSION_KEY
@ PGPSYMKEYALGO_PLAINTEXT
@ PGPSYMKEYALGO_NOENCRYPT
@ PGPSYMKEYALGO_TRIPLE_DES
@ PGPSUBTYPE_EMBEDDED_SIG
@ PGPSUBTYPE_EXPORTABLE_CERT
@ PGPSUBTYPE_ISSUER_KEYID
@ PGPSUBTYPE_PREFER_SYMKEY
@ PGPSUBTYPE_SIG_EXPIRE_TIME
@ PGPSUBTYPE_INTERNAL_104
@ PGPSUBTYPE_SIGNER_USERID
@ PGPSUBTYPE_PREFER_COMPRESS
@ PGPSUBTYPE_KEY_EXPIRE_TIME
@ PGPSUBTYPE_INTERNAL_101
@ PGPSUBTYPE_SIG_CREATE_TIME
@ PGPSUBTYPE_REVOKE_REASON
@ PGPSUBTYPE_KEYSERVER_PREFERS
@ PGPSUBTYPE_INTERNAL_110
@ PGPSUBTYPE_INTERNAL_109
@ PGPSUBTYPE_INTERNAL_108
@ PGPSUBTYPE_INTERNAL_105
@ PGPSUBTYPE_INTERNAL_100
@ PGPSUBTYPE_PREFER_KEYSERVER
@ PGPSUBTYPE_INTERNAL_107
@ PGPSUBTYPE_PRIMARY_USERID
@ PGPSUBTYPE_INTERNAL_102
@ PGPSUBTYPE_INTERNAL_103
@ PGPSUBTYPE_INTERNAL_106
enum rpmRC_e rpmRC
Package read return codes.
enum pgpValType_e pgpValType
struct rpmDigestBundle_s * rpmDigestBundle
struct pgpPktSymkey_s pgpPktSymkey
5.3.
The version 4 format is similar to the version 3 format except for the absence of a validity period.