rpm
4.17.0
|
OpenPGP constants and structures from RFC-2440. More...
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <rpm/rpmtypes.h>
#include <rpm/rpmstring.h>
Go to the source code of this file.
Data Structures | |
struct | pgpPktPubkey_s |
5.1. More... | |
struct | pgpPktSigV3_s |
5.2.2. More... | |
struct | pgpPktSigV4_s |
5.2.3. More... | |
union | pgpPktSig_u |
5.2. More... | |
struct | pgpPktSymkey_s |
5.3. More... | |
struct | pgpPktOnepass_s |
5.4. More... | |
struct | pgpPktKeyV3_s |
5.5.1. More... | |
struct | pgpPktKeyV4_s |
The version 4 format is similar to the version 3 format except for the absence of a validity period. More... | |
union | pgpPktKey_u |
5.5.3. More... | |
struct | pgpPktCdata_s |
5.6. More... | |
struct | pgpPktEdata_s |
5.7. More... | |
struct | pgpPktLdata_s |
5.8. More... | |
struct | pgpPktTrust_s |
5.10. More... | |
struct | pgpPktUid_s |
5.11. More... | |
union | pgpPktPre_u |
Macros | |
#define | PGPARMOR_ERROR PGPARMOR_ERR_NO_BEGIN_PGP |
Typedefs | |
typedef struct DIGEST_CTX_s * | DIGEST_CTX |
typedef struct rpmDigestBundle_s * | rpmDigestBundle |
typedef struct pgpDig_s * | pgpDig |
typedef struct pgpDigParams_s * | pgpDigParams |
typedef uint8_t | pgpKeyID_t[8] |
typedef uint8_t | pgpTime_t[4] |
typedef enum pgpTag_e | pgpTag |
4.3. More... | |
typedef struct pgpPktPubkey_s | pgpPktPubkey |
5.1. More... | |
typedef enum pgpSigType_e | pgpSigType |
5.2.1. More... | |
typedef enum pgpPubkeyAlgo_e | pgpPubkeyAlgo |
9.1. More... | |
typedef enum pgpSymkeyAlgo_e | pgpSymkeyAlgo |
9.2. More... | |
typedef enum pgpCompressAlgo_e | pgpCompressAlgo |
9.3. More... | |
typedef enum pgpHashAlgo_e | pgpHashAlgo |
9.4. More... | |
typedef enum pgpCurveId_e | pgpCurveId |
ECC Curves. More... | |
typedef struct pgpPktSigV3_s * | pgpPktSigV3 |
5.2.2. More... | |
typedef struct pgpPktSigV4_s * | pgpPktSigV4 |
5.2.3. More... | |
typedef enum pgpSubType_e | pgpSubType |
5.2.3.1. More... | |
typedef union pgpPktSig_u * | pgpPktSig |
5.2. More... | |
typedef struct pgpPktSymkey_s | pgpPktSymkey |
5.3. More... | |
typedef struct pgpPktOnepass_s * | pgpPktOnepass |
5.4. More... | |
typedef struct pgpPktKeyV3_s * | pgpPktKeyV3 |
5.5.1. More... | |
typedef struct pgpPktKeyV4_s * | pgpPktKeyV4 |
The version 4 format is similar to the version 3 format except for the absence of a validity period. More... | |
typedef union pgpPktKey_u | pgpPktKey |
5.5.3. More... | |
typedef struct pgpPktCdata_s | pgpPktCdata |
5.6. More... | |
typedef struct pgpPktEdata_s | pgpPktEdata |
5.7. More... | |
typedef struct pgpPktLdata_s | pgpPktLdata |
5.8. More... | |
typedef struct pgpPktTrust_s | pgpPktTrust |
5.10. More... | |
typedef struct pgpPktUid_s | pgpPktUid |
5.11. More... | |
typedef enum pgpArmor_e | pgpArmor |
typedef enum pgpArmorKey_e | pgpArmorKey |
typedef enum pgpValType_e | pgpValType |
typedef rpmFlags | rpmDigestFlags |
Functions | |
const char * | pgpValString (pgpValType type, uint8_t val) |
Return string representation of am OpenPGP value. More... | |
static unsigned int | pgpGrab (const uint8_t *s, size_t nbytes) |
Return (native-endian) integer from big-endian representation. More... | |
char * | pgpHexStr (const uint8_t *p, size_t plen) |
Return hex formatted representation of bytes. More... | |
int | pgpPubkeyFingerprint (const uint8_t *pkt, size_t pktlen, uint8_t **fp, size_t *fplen) |
Calculate OpenPGP public key fingerprint. More... | |
int | pgpPubkeyKeyID (const uint8_t *pkt, size_t pktlen, pgpKeyID_t keyid) |
Calculate OpenPGP public key Key ID. More... | |
int | pgpPrtParams (const uint8_t *pkts, size_t pktlen, unsigned int pkttype, pgpDigParams *ret) |
Parse a OpenPGP packet(s). More... | |
int | pgpPrtParamsSubkeys (const uint8_t *pkts, size_t pktlen, pgpDigParams mainkey, pgpDigParams **subkeys, int *subkeysCount) |
Parse subkey parameters from OpenPGP packet(s). More... | |
int | pgpPrtPkts (const uint8_t *pkts, size_t pktlen, pgpDig dig, int printing) |
Print/parse a OpenPGP packet(s). More... | |
pgpArmor | pgpReadPkts (const char *fn, uint8_t **pkt, size_t *pktlen) |
Parse armored OpenPGP packets from a file. More... | |
pgpArmor | pgpParsePkts (const char *armor, uint8_t **pkt, size_t *pktlen) |
Parse armored OpenPGP packets from memory. More... | |
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 more certificates. More... | |
char * | pgpArmorWrap (int atype, const unsigned char *s, size_t ns) |
Wrap a OpenPGP packets in ascii armor for transport. More... | |
pgpDig | pgpNewDig (void) |
Create a container for parsed OpenPGP packet(s). More... | |
void | pgpCleanDig (pgpDig dig) |
Release (malloc'd) data from container. More... | |
pgpDig | pgpFreeDig (pgpDig dig) |
Destroy a container for parsed OpenPGP packet(s). More... | |
pgpDigParams | pgpDigGetParams (pgpDig dig, unsigned int pkttype) |
Retrieve parameters for parsed OpenPGP packet(s). More... | |
int | pgpDigParamsCmp (pgpDigParams p1, pgpDigParams p2) |
Compare OpenPGP packet parameters param p1 1st parameter container param p2 2nd parameter container return 1 if the parameters differ, 0 otherwise. More... | |
unsigned int | pgpDigParamsAlgo (pgpDigParams digp, unsigned int algotype) |
Retrieve OpenPGP algorithm parameters param digp parameter container param algotype PGPVAL_HASHALGO / PGPVAL_PUBKEYALGO return algorithm value, 0 on error. More... | |
pgpDigParams | pgpDigParamsFree (pgpDigParams digp) |
Destroy parsed OpenPGP packet parameter(s). More... | |
rpmRC | pgpVerifySignature (pgpDigParams key, pgpDigParams sig, DIGEST_CTX hashctx) |
Verify a PGP signature. More... | |
rpmRC | pgpVerifySig (pgpDig dig, DIGEST_CTX hashctx) |
Verify a PGP signature. More... | |
char * | pgpIdentItem (pgpDigParams digp) |
Return a string identification of a PGP signature/pubkey. More... | |
int | rpmInitCrypto (void) |
Perform cryptography initialization. More... | |
int | rpmFreeCrypto (void) |
Shutdown cryptography. More... | |
DIGEST_CTX | rpmDigestDup (DIGEST_CTX octx) |
Duplicate a digest context. More... | |
size_t | rpmDigestLength (int hashalgo) |
Obtain digest length in bytes. More... | |
DIGEST_CTX | rpmDigestInit (int hashalgo, rpmDigestFlags flags) |
Initialize digest. More... | |
int | rpmDigestUpdate (DIGEST_CTX ctx, const void *data, size_t len) |
Update context with next plain text buffer. More... | |
int | rpmDigestFinal (DIGEST_CTX ctx, void **datap, size_t *lenp, int asAscii) |
Return digest and destroy context. More... | |
rpmDigestBundle | rpmDigestBundleNew (void) |
Create a new digest bundle. More... | |
rpmDigestBundle | rpmDigestBundleFree (rpmDigestBundle bundle) |
Free a digest bundle and all contained digest contexts. More... | |
int | rpmDigestBundleAdd (rpmDigestBundle bundle, int algo, rpmDigestFlags flags) |
Add a new type of digest to a bundle. More... | |
int | rpmDigestBundleAddID (rpmDigestBundle bundle, int algo, int id, rpmDigestFlags flags) |
Add a new type of digest to a bundle. More... | |
int | rpmDigestBundleUpdate (rpmDigestBundle bundle, const void *data, size_t len) |
Update contexts within bundle with next plain text buffer. More... | |
int | rpmDigestBundleFinal (rpmDigestBundle bundle, int id, void **datap, size_t *lenp, int asAscii) |
Return digest from a bundle and destroy context, see rpmDigestFinal(). More... | |
DIGEST_CTX | rpmDigestBundleDupCtx (rpmDigestBundle bundle, int id) |
Duplicate a digest context from a bundle. More... | |
OpenPGP constants and structures from RFC-2440.
Text from RFC-2440 in comments is Copyright (C) The Internet Society (1998). All Rights Reserved.
EdDSA algorithm identifier value taken from https://datatracker.ietf.org/doc/draft-ietf-openpgp-rfc4880bis/ This value is used in gnupg since version 2.1.0
Definition in file rpmpgp.h.
#define PGPARMOR_ERROR PGPARMOR_ERR_NO_BEGIN_PGP |
typedef struct pgpPktSymkey_s pgpPktSymkey |
5.3.
Symmetric-Key Encrypted Session-Key Packets (Tag 3)
The Symmetric-Key Encrypted Session Key packet holds the symmetric- key encryption of a session key used to encrypt a message. Zero or more Encrypted Session Key packets and/or Symmetric-Key Encrypted Session Key packets may precede a Symmetrically Encrypted Data Packet that holds an encrypted message. The message is encrypted with a session key, and the session key is itself encrypted and stored in the Encrypted Session Key packet or the Symmetric-Key Encrypted Session Key packet.
If the Symmetrically Encrypted Data Packet is preceded by one or more Symmetric-Key Encrypted Session Key packets, each specifies a passphrase that may be used to decrypt the message. This allows a message to be encrypted to a number of public keys, and also to one or more pass phrases. This packet type is new, and is not generated by PGP 2.x or PGP 5.0.
The body of this packet consists of:
typedef enum pgpValType_e pgpValType |
typedef struct rpmDigestBundle_s* rpmDigestBundle |
typedef rpmFlags rpmDigestFlags |
enum pgpValType_e |