16 #include <rpm/rpmtypes.h> 17 #include <rpm/rpmstring.h> 43 char const *
const str;
304 uint8_t signhash16[2];
902 #define PGPARMOR_ERROR PGPARMOR_ERR_NO_BEGIN_PGP 958 unsigned int pgpGrab(
const uint8_t *s,
size_t nbytes)
961 size_t nb = (nbytes <=
sizeof(i) ? nbytes :
sizeof(i));
974 size_t pgpLen(
const uint8_t *s,
size_t * lenp)
979 }
else if (*s < 255) {
980 (*lenp) = ((((unsigned)s[0]) - 192) << 8) + s[1] + 192;
983 (*lenp) =
pgpGrab(s+1, (
size_t) 4);
994 char *
pgpHexStr(
const uint8_t *p,
size_t plen);
1024 int pgpPrtPkts(
const uint8_t *pkts,
size_t pktlen, pgpDig dig,
int printing);
1051 char *
pgpArmorWrap(
int atype,
const unsigned char * s,
size_t ns);
1146 size_t * lenp,
int asAscii);
1191 pgpHashAlgo algo,
void ** datap,
size_t * lenp,
int asAscii);
int rpmInitCrypto(void)
Perform cryptography initialization.
enum pgpHashAlgo_e pgpHashAlgo
9.4.
struct pgpPktPubkey_s pgpPktPubkey
5.1.
static size_t pgpLen(const uint8_t *s, size_t *lenp)
Return length of an OpenPGP packet.
DIGEST_CTX rpmDigestInit(pgpHashAlgo hashalgo, rpmDigestFlags flags)
Initialize digest.
enum pgpCompressAlgo_e pgpCompressAlgo
9.3.
int rpmDigestBundleAdd(rpmDigestBundle bundle, pgpHashAlgo algo, rpmDigestFlags flags)
Add a new type of digest to a bundle.
int pgpPubkeyFingerprint(const uint8_t *pkt, size_t pktlen, pgpKeyID_t keyid)
Calculate OpenPGP public key fingerprint.
enum pgpSubType_e pgpSubType
5.2.3.1.
int rpmFreeCrypto(void)
Shutdown cryptography.
rpmDigestBundle rpmDigestBundleFree(rpmDigestBundle bundle)
Free a digest bundle and all contained digest contexts.
union pgpPktKey_u pgpPktKey
5.5.3.
char * pgpArmorWrap(int atype, const unsigned char *s, size_t ns)
Wrap a OpenPGP packets in ascii armor for transport.
enum pgpSigType_e pgpSigType
5.2.1.
size_t rpmDigestLength(pgpHashAlgo hashalgo)
Obtain digest length in bytes.
pgpArmor pgpParsePkts(const char *armor, uint8_t **pkt, size_t *pktlen)
Parse armored OpenPGP packets from memory.
struct pgpPktTrust_s pgpPktTrust
struct pgpPktEdata_s pgpPktEdata
struct rpmDigestBundle_s * rpmDigestBundle
struct pgpPktSigV4_s * pgpPktSigV4
5.2.3.
const char * pgpValString(pgpValType type, uint8_t val)
Return string representation of am OpenPGP value.
struct pgpPktLdata_s pgpPktLdata
int rpmDigestBundleFinal(rpmDigestBundle bundle, pgpHashAlgo algo, 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.
char * pgpIdentItem(pgpDigParams digp)
Return a string identification of a PGP signature/pubkey.
enum pgpValType_e pgpValType
struct pgpPktUid_s pgpPktUid
int rpmDigestBundleUpdate(rpmDigestBundle bundle, const void *data, size_t len)
Update contexts within bundle with next plain text buffer.
enum pgpArmorKey_e pgpArmorKey
int rpmDigestFinal(DIGEST_CTX ctx, void **datap, size_t *lenp, int asAscii)
Return digest and destroy context.
int rpmDigestUpdate(DIGEST_CTX ctx, const void *data, size_t len)
Update context with next plain text buffer.
struct pgpPktCdata_s pgpPktCdata
enum rpmDigestFlags_e rpmDigestFlags
Bit(s) to control digest operation.
struct pgpPktKeyV4_s * pgpPktKeyV4
The version 4 format is similar to the version 3 format except for the absence of a validity period...
union pgpPktSig_u * pgpPktSig
5.2.
enum pgpPubkeyAlgo_e pgpPubkeyAlgo
9.1.
pgpArmor pgpReadPkts(const char *fn, uint8_t **pkt, size_t *pktlen)
Parse armored OpenPGP packets from a file.
pgpDig pgpFreeDig(pgpDig dig)
Destroy a container for parsed OpenPGP packet(s).
struct pgpPktSigV3_s * pgpPktSigV3
5.2.2.
enum pgpSymkeyAlgo_e pgpSymkeyAlgo
9.2.
rpmDigestBundle rpmDigestBundleNew(void)
Create a new digest bundle.
struct DIGEST_CTX_s * DIGEST_CTX
rpmRC pgpVerifySig(pgpDig dig, DIGEST_CTX hashctx)
Verify a PGP signature.
rpmDigestFlags_e
Bit(s) to control digest operation.
const struct pgpValTbl_s * pgpValTbl
pgpDig pgpNewDig(void)
Create a container for parsed OpenPGP packet(s).
struct pgpPktSymkey_s pgpPktSymkey
5.3.
static unsigned int pgpGrab(const uint8_t *s, size_t nbytes)
Return (native-endian) integer from big-endian representation.
enum rpmRC_e rpmRC
Package read return codes.
char * pgpHexStr(const uint8_t *p, size_t plen)
Return hex formatted representation of bytes.
DIGEST_CTX rpmDigestBundleDupCtx(rpmDigestBundle bundle, pgpHashAlgo algo)
Duplicate a digest context from a bundle.
int pgpExtractPubkeyFingerprint(const char *b64pkt, pgpKeyID_t keyid)
Extract OpenPGP public key fingerprint from base64 encoded packet.
struct pgpPktKeyV3_s * pgpPktKeyV3
5.5.1.
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...
struct pgpPktOnepass_s * pgpPktOnepass
5.4.
void pgpCleanDig(pgpDig dig)
Release (malloc'd) data from container.
struct pgpDigParams_s * pgpDigParams