#include "system.h"
#include "rpmio_internal.h"
#include "debug.h"
Go to the source code of this file.
Defines | |
#define | TOKEQ(_s, _tok) (!strncmp((_s), (_tok), sizeof(_tok)-1)) |
Functions | |
void * | _free (const void *p) |
Wrapper to free(3), hides const compilation noise, permit NULL, return NULL. More... | |
void | pgpPrtNL (void) |
void | pgpPrtInt (const char *pre, int i) |
void | pgpPrtStr (const char *pre, const char *s) |
void | pgpPrtHex (const char *pre, const byte *p, unsigned int plen) |
void | pgpPrtVal (const char *pre, pgpValTbl vs, byte val) |
Print an OpenPGP value. More... | |
const char * | pgpMpiHex (const byte *p) |
int | pgpHexSet (const char *pre, int lbits, mp32number *mpn, const byte *p, const byte *pend) |
int | pgpPrtSubType (const byte *h, unsigned int hlen, pgpSigType sigtype) |
Print/parse an OpenPGP subtype packet. More... | |
int | pgpPrtSigParams (pgpTag tag, byte pubkey_algo, byte sigtype, const byte *p, const byte *h, unsigned int hlen) |
int | pgpPrtSig (pgpTag tag, const byte *h, unsigned int hlen) |
Print/parse an OpenPGP signature packet. More... | |
const byte * | pgpPrtPubkeyParams (byte pubkey_algo, const byte *p, const byte *h, unsigned int hlen) |
const byte * | pgpPrtSeckeyParams (byte pubkey_algo, const byte *p, const byte *h, unsigned int hlen) |
int | pgpPrtKey (pgpTag tag, const byte *h, unsigned int hlen) |
Print/parse an OpenPGP key packet. More... | |
int | pgpPrtUserID (pgpTag tag, const byte *h, unsigned int hlen) |
Print/parse an OpenPGP userid packet. More... | |
int | pgpPrtComment (pgpTag tag, const byte *h, unsigned int hlen) |
Print/parse an OpenPGP comment packet. More... | |
int | pgpPrtPkt (const byte *pkt, unsigned int pleft) |
Print/parse next OpenPGP packet. More... | |
pgpDig | pgpNewDig (void) |
Create a container for parsed OpenPGP packates. More... | |
void | pgpCleanDig (pgpDig dig) |
Release (malloc'd) data from container. More... | |
pgpDig | pgpFreeDig (pgpDig dig) |
Destroy a container for parsed OpenPGP packates. More... | |
int | pgpPrtPkts (const byte *pkts, unsigned int pktlen, pgpDig dig, int printing) |
Print/parse a OpenPGP packet(s). More... | |
pgpArmor | pgpReadPkts (const char *fn, const byte **pkt, size_t *pktlen) |
Parse armored OpenPGP packets from a file. More... | |
Variables | |
int | _debug = 0 |
int | _print = 0 |
pgpDig | _dig = NULL |
pgpDigParams | _digp = NULL |
pgpValTbl_s | pgpSigTypeTbl [] |
pgpValTbl_s | pgpPubkeyTbl [] |
pgpValTbl_s | pgpSymkeyTbl [] |
Symmetric key (string, value) pairs. More... | |
pgpValTbl_s | pgpCompressionTbl [] |
Compression (string, value) pairs. More... | |
pgpValTbl_s | pgpHashTbl [] |
Hash (string, value) pairs. More... | |
pgpValTbl_s | pgpKeyServerPrefsTbl [] |
pgpValTbl_s | pgpSubTypeTbl [] |
Subtype (string, value) pairs. More... | |
pgpValTbl_s | pgpTagTbl [] |
pgpValTbl_s | pgpArmorTbl [] |
Armor (string, value) pairs. More... | |
pgpValTbl_s | pgpArmorKeyTbl [] |
Armor key (string, value) pairs. More... | |
const char * | pgpSigRSA [] |
const char * | pgpSigDSA [] |
const char * | pgpPublicRSA [] |
const char * | pgpSecretRSA [] |
const char * | pgpPublicDSA [] |
const char * | pgpSecretDSA [] |
const char * | pgpPublicELGAMAL [] |
const char * | pgpSecretELGAMAL [] |
Definition in file rpmpgp.c.
|
|
|
Wrapper to free(3), hides const compilation noise, permit NULL, return NULL.
|
|
Release (malloc'd) data from container.
Definition at line 1036 of file rpmpgp.c. References _free, pgpDig_s::c, pgpDigParams_s::hash, pgpDig_s::hm, pgpDig_s::m, pgpDig_s::md5, mp32nfree, pgpDigParams_s::params, pgpDig_s::pubkey, pgpDig_s::r, pgpDig_s::rsa_pk, pgpDig_s::rsahm, rsapkFree, pgpDig_s::s, pgpDig_s::sha1, pgpDig_s::signature, and pgpDigParams_s::userid. |
|
Destroy a container for parsed OpenPGP packates.
Definition at line 1071 of file rpmpgp.c. References _free, mp32bfree, mp32nfree, pgpCleanDig, and rpmDigestFinal. |
|
Definition at line 326 of file rpmpgp.c. References _debug, _free, _print, mp32nsethex, mp32println, pgpMpiBits, pgpMpiHex, and xmalloc. Referenced by pgpPrtSigParams. |
|
Definition at line 313 of file rpmpgp.c. References pgpHexCvt, and pgpMpiLen. Referenced by pgpHexSet, pgpPrtPubkeyParams, and pgpPrtSigParams. |
|
Create a container for parsed OpenPGP packates.
Definition at line 1029 of file rpmpgp.c. References xcalloc. Referenced by getSignid, pgpsigFormat, rpmcliImportPubkey, rpmdbAdd, rpmdbRemove, and rpmtsDig. |
|
Print/parse an OpenPGP comment packet.
|
|
Definition at line 290 of file rpmpgp.c. References _print, and pgpHexStr. Referenced by pgpPrtComment, pgpPrtPkt, pgpPrtSeckeyParams, pgpPrtSig, and pgpPrtSubType. |
|
Definition at line 270 of file rpmpgp.c. References _print. Referenced by pgpPrtSeckeyParams. |
|
Print/parse an OpenPGP key packet.
Definition at line 850 of file rpmpgp.c. References pgpGrab, pgpPrtNL, pgpPrtPubkeyParams, pgpPrtSeckeyParams, pgpPrtVal, pgpTag, PGPTAG_PUBLIC_KEY, PGPTAG_PUBLIC_SUBKEY, pgpPktKeyV4_s::pubkey_algo, pgpDigParams_s::pubkey_algo, pgpPktKeyV3_s::pubkey_algo, pgpDigParams_s::tag, pgpPktKeyV4_s::time, pgpDigParams_s::time, pgpPktKeyV3_s::time, pgpPktKeyV3_s::valid, pgpPktKeyV4_s::version, pgpPktKeyV3_s::version, and pgpDigParams_s::version. |
|
Definition at line 262 of file rpmpgp.c. References _print. Referenced by pgpPrtComment, pgpPrtKey, pgpPrtPkt, pgpPrtPubkeyParams, pgpPrtSeckeyParams, pgpPrtSig, pgpPrtSigParams, pgpPrtSubType, and pgpPrtUserID. |
|
Print/parse next OpenPGP packet.
Definition at line 957 of file rpmpgp.c. References pgpGrab, pgpLen, pgpPrtComment, pgpPrtHex, pgpPrtKey, pgpPrtNL, pgpPrtSig, pgpPrtUserID, pgpPrtVal, pgpTag, PGPTAG_COMMENT, PGPTAG_COMMENT_OLD, PGPTAG_COMPRESSED_DATA, PGPTAG_CONTROL, PGPTAG_ENCRYPTED_MDC, PGPTAG_LITERAL_DATA, PGPTAG_MARKER, PGPTAG_MDC, PGPTAG_PHOTOID, PGPTAG_PRIVATE_60, PGPTAG_PRIVATE_62, PGPTAG_PUBLIC_KEY, PGPTAG_PUBLIC_SESSION_KEY, PGPTAG_PUBLIC_SUBKEY, PGPTAG_RESERVED, PGPTAG_SECRET_KEY, PGPTAG_SECRET_SUBKEY, PGPTAG_SIGNATURE, PGPTAG_SYMMETRIC_DATA, PGPTAG_SYMMETRIC_SESSION_KEY, PGPTAG_TRUST, and PGPTAG_USER_ID. |
|
Print/parse a OpenPGP packet(s).
Definition at line 1124 of file rpmpgp.c. References _print, pgpPrtPkt, pgpTag, PGPTAG_SIGNATURE, pgpDig_s::pubkey, pgpDig_s::signature, and pgpDigParams_s::tag. |
|
Definition at line 687 of file rpmpgp.c. References _debug, _print, mp32number::data, rsapk::e, pgpDig_s::g, mp32barrett::modl, mp32bsethex, mp32nsethex, mp32println, rsapk::n, pgpDig_s::p, pgpMpiHex, pgpMpiLen, pgpMpiStr, pgpPrtNL, pgpPrtStr, PGPPUBKEYALGO_DSA, PGPPUBKEYALGO_ELGAMAL_ENCRYPT, PGPPUBKEYALGO_RSA, pgpPublicDSA, pgpPublicELGAMAL, pgpPublicRSA, pgpDig_s::q, pgpDig_s::rsa_pk, pgpDigParams_s::signid, mp32number::size, mp32barrett::size, swapu32, uint32, and pgpDig_s::y. Referenced by pgpPrtKey. |
|
Definition at line 776 of file rpmpgp.c. References pgpMpiLen, pgpMpiStr, pgpPrtHex, pgpPrtInt, pgpPrtNL, pgpPrtStr, pgpPrtVal, PGPPUBKEYALGO_DSA, PGPPUBKEYALGO_ELGAMAL_ENCRYPT, PGPPUBKEYALGO_RSA, pgpSecretDSA, pgpSecretELGAMAL, and pgpSecretRSA. Referenced by pgpPrtKey. |
|
Print/parse an OpenPGP signature packet.
Definition at line 529 of file rpmpgp.c. References _debug, _print, pgpDigParams_s::hash, pgpPktSigV4_s::hash_algo, pgpDigParams_s::hash_algo, pgpPktSigV3_s::hash_algo, pgpPktSigV4_s::hashlen, pgpDigParams_s::hashlen, pgpPktSigV3_s::hashlen, pgpGrab, pgpHexStr, pgpPrtHex, pgpPrtNL, pgpPrtSigParams, pgpPrtSubType, pgpPrtVal, pgpTag, pgpPktSigV4_s::pubkey_algo, pgpDigParams_s::pubkey_algo, pgpPktSigV3_s::pubkey_algo, pgpDigParams_s::signhash16, pgpPktSigV3_s::signhash16, pgpDigParams_s::signid, pgpPktSigV3_s::signid, pgpPktSigV4_s::sigtype, pgpDigParams_s::sigtype, pgpPktSigV3_s::sigtype, pgpDigParams_s::time, pgpPktSigV3_s::time, pgpPktSigV4_s::version, pgpPktSigV3_s::version, pgpDigParams_s::version, and xmalloc. |
|
Definition at line 468 of file rpmpgp.c. References _debug, _print, pgpDig_s::c, mp32number::data, mp32nsethex, mp32println, pgpHexSet, pgpMpiHex, pgpMpiLen, pgpMpiStr, pgpPrtNL, pgpPrtStr, PGPPUBKEYALGO_DSA, PGPPUBKEYALGO_RSA, pgpSigDSA, pgpSigRSA, PGPSIGTYPE_BINARY, PGPSIGTYPE_TEXT, pgpTag, pgpDig_s::r, pgpDig_s::s, and mp32number::size. Referenced by pgpPrtSig. |
|
Definition at line 280 of file rpmpgp.c. References _print. Referenced by pgpPrtPubkeyParams, pgpPrtSeckeyParams, and pgpPrtSigParams. |
|
|
Print/parse an OpenPGP userid packet.
Definition at line 914 of file rpmpgp.c. References pgpPrtNL, pgpPrtVal, pgpTag, pgpDigParams_s::userid, and xmalloc. |
|
Print an OpenPGP value.
|
|
Parse armored OpenPGP packets from a file.
Definition at line 1153 of file rpmpgp.c. References _free, b64decode, pgpArmor, PGPARMOR_ERROR, PGPARMOR_NONE, PGPARMOR_PUBKEY, pgpCRC, pgpGrab, pgpIsPkt, pgpValTok, rpmioSlurp, and uint32. |
|
Definition at line 15 of file rpmpgp.c. Referenced by pgpHexSet, pgpPrtPubkeyParams, pgpPrtSig, and pgpPrtSigParams. |
|
|
|
|
|
Definition at line 18 of file rpmpgp.c. Referenced by pgpHexSet, pgpPrtHex, pgpPrtInt, pgpPrtNL, pgpPrtPkts, pgpPrtPubkeyParams, pgpPrtSig, pgpPrtSigParams, pgpPrtStr, and pgpPrtVal. |
|
Initial value: { { PGPARMORKEY_VERSION, "Version: " }, { PGPARMORKEY_COMMENT, "Comment: " }, { PGPARMORKEY_MESSAGEID, "MessageID: " }, { PGPARMORKEY_HASH, "Hash: " }, { PGPARMORKEY_CHARSET, "Charset: " }, { -1, "Unknown armor key" } }
|
|
Initial value: { { PGPARMOR_MESSAGE, "MESSAGE" }, { PGPARMOR_PUBKEY, "PUBLIC KEY BLOCK" }, { PGPARMOR_SIGNATURE, "SIGNATURE" }, { PGPARMOR_SIGNED_MESSAGE, "SIGNED MESSAGE" }, { PGPARMOR_FILE, "ARMORED FILE" }, { PGPARMOR_PRIVKEY, "PRIVATE KEY BLOCK" }, { PGPARMOR_SECKEY, "SECRET KEY BLOCK" }, { -1, "Unknown armor block" } }
|
|
Initial value: { { PGPCOMPRESSALGO_NONE, "Uncompressed" }, { PGPCOMPRESSALGO_ZIP, "ZIP" }, { PGPCOMPRESSALGO_ZLIB, "ZLIB" }, { -1, "Unknown compression algorithm" }, }
|
|
Initial value: { { PGPHASHALGO_MD5, "MD5" }, { PGPHASHALGO_SHA1, "SHA1" }, { PGPHASHALGO_RIPEMD160, "RIPEMD160" }, { PGPHASHALGO_MD2, "MD2" }, { PGPHASHALGO_TIGER192, "TIGER192" }, { PGPHASHALGO_HAVAL_5_160, "HAVAL-5-160" }, { -1, "Unknown hash algorithm" }, }
|
|
Initial value: { { 0x80, "No-modify" }, { -1, "Unknown key server preference" }, } |
|
Initial value: { { PGPPUBKEYALGO_RSA, "RSA" }, { PGPPUBKEYALGO_RSA_ENCRYPT,"RSA(Encrypt-Only)" }, { PGPPUBKEYALGO_RSA_SIGN, "RSA(Sign-Only)" }, { PGPPUBKEYALGO_ELGAMAL_ENCRYPT,"Elgamal(Encrypt-Only)" }, { PGPPUBKEYALGO_DSA, "DSA" }, { PGPPUBKEYALGO_EC, "Elliptic Curve" }, { PGPPUBKEYALGO_ECDSA, "ECDSA" }, { PGPPUBKEYALGO_ELGAMAL, "Elgamal" }, { PGPPUBKEYALGO_DH, "Diffie-Hellman (X9.42)" }, { -1, "Unknown public key algorithm" }, } |
|
Initial value: { " p =", " q =", " g =", " y =", NULL, } Definition at line 658 of file rpmpgp.c. Referenced by pgpPrtPubkeyParams. |
|
Initial value: { " p =", " g =", " y =", NULL, } Definition at line 673 of file rpmpgp.c. Referenced by pgpPrtPubkeyParams. |
|
Initial value: { " n =", " e =", NULL, } Definition at line 642 of file rpmpgp.c. Referenced by pgpPrtPubkeyParams. |
|
Initial value: { " x =", NULL, } Definition at line 667 of file rpmpgp.c. Referenced by pgpPrtSeckeyParams. |
|
Initial value: { " x =", NULL, } Definition at line 681 of file rpmpgp.c. Referenced by pgpPrtSeckeyParams. |
|
Initial value: { " d =", " p =", " q =", " u =", NULL, } Definition at line 649 of file rpmpgp.c. Referenced by pgpPrtSeckeyParams. |
|
Initial value: { " r =", " s =", NULL, } Definition at line 461 of file rpmpgp.c. Referenced by pgpPrtSigParams. |
|
Initial value: { " m**d =", NULL, } Definition at line 455 of file rpmpgp.c. Referenced by pgpPrtSigParams. |
|
Initial value: { { PGPSIGTYPE_BINARY, "Binary document signature" }, { PGPSIGTYPE_TEXT, "Text document signature" }, { PGPSIGTYPE_STANDALONE, "Standalone signature" }, { PGPSIGTYPE_GENERIC_CERT, "Generic certification of a User ID and Public Key" }, { PGPSIGTYPE_PERSONA_CERT, "Persona certification of a User ID and Public Key" }, { PGPSIGTYPE_CASUAL_CERT, "Casual certification of a User ID and Public Key" }, { PGPSIGTYPE_POSITIVE_CERT, "Positive certification of a User ID and Public Key" }, { PGPSIGTYPE_SUBKEY_BINDING,"Subkey Binding Signature" }, { PGPSIGTYPE_SIGNED_KEY, "Signature directly on a key" }, { PGPSIGTYPE_KEY_REVOKE, "Key revocation signature" }, { PGPSIGTYPE_SUBKEY_REVOKE, "Subkey revocation signature" }, { PGPSIGTYPE_CERT_REVOKE, "Certification revocation signature" }, { PGPSIGTYPE_TIMESTAMP, "Timestamp signature" }, { -1, "Unknown signature type" }, } |
|
Subtype (string, value) pairs.
|
|
Initial value: { { PGPSYMKEYALGO_PLAINTEXT, "Plaintext" }, { PGPSYMKEYALGO_IDEA, "IDEA" }, { PGPSYMKEYALGO_TRIPLE_DES, "3DES" }, { PGPSYMKEYALGO_CAST5, "CAST5" }, { PGPSYMKEYALGO_BLOWFISH, "BLOWFISH" }, { PGPSYMKEYALGO_SAFER, "SAFER" }, { PGPSYMKEYALGO_DES_SK, "DES/SK" }, { PGPSYMKEYALGO_AES_128, "AES(128-bit key)" }, { PGPSYMKEYALGO_AES_192, "AES(192-bit key)" }, { PGPSYMKEYALGO_AES_256, "AES(256-bit key)" }, { PGPSYMKEYALGO_TWOFISH, "TWOFISH" }, { -1, "Unknown symmetric key algorithm" }, }
|
|
Initial value: { { PGPTAG_PUBLIC_SESSION_KEY,"Public-Key Encrypted Session Key" }, { PGPTAG_SIGNATURE, "Signature" }, { PGPTAG_SYMMETRIC_SESSION_KEY,"Symmetric-Key Encrypted Session Key" }, { PGPTAG_ONEPASS_SIGNATURE, "One-Pass Signature" }, { PGPTAG_SECRET_KEY, "Secret Key" }, { PGPTAG_PUBLIC_KEY, "Public Key" }, { PGPTAG_SECRET_SUBKEY, "Secret Subkey" }, { PGPTAG_COMPRESSED_DATA, "Compressed Data" }, { PGPTAG_SYMMETRIC_DATA, "Symmetrically Encrypted Data" }, { PGPTAG_MARKER, "Marker" }, { PGPTAG_LITERAL_DATA, "Literal Data" }, { PGPTAG_TRUST, "Trust" }, { PGPTAG_USER_ID, "User ID" }, { PGPTAG_PUBLIC_SUBKEY, "Public Subkey" }, { PGPTAG_COMMENT_OLD, "Comment (from OpenPGP draft)" }, { PGPTAG_PHOTOID, "PGP's photo ID" }, { PGPTAG_ENCRYPTED_MDC, "Integrity protected encrypted data" }, { PGPTAG_MDC, "Manipulaion detection code packet" }, { PGPTAG_PRIVATE_60, "Private #60" }, { PGPTAG_COMMENT, "Comment" }, { PGPTAG_PRIVATE_62, "Private #62" }, { PGPTAG_CONTROL, "Control (GPG)" }, { -1, "Unknown packet tag" }, } |