rpm  4.13.0
rpmpgp.h
Go to the documentation of this file.
1 #ifndef H_RPMPGP
2 #define H_RPMPGP
3 
13 #include <string.h>
14 #include <stdio.h>
15 #include <stdlib.h>
16 #include <rpm/rpmtypes.h>
17 #include <rpm/rpmstring.h>
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
25 typedef struct DIGEST_CTX_s * DIGEST_CTX;
26 typedef struct rpmDigestBundle_s * rpmDigestBundle;
27 
30 typedef struct pgpDig_s * pgpDig;
31 
34 typedef struct pgpDigParams_s * pgpDigParams;
35 
36 typedef uint8_t pgpKeyID_t[8];
37 typedef uint8_t pgpTime_t[4];
38 
46 typedef enum pgpTag_e {
59  PGPTAG_TRUST = 12,
65  PGPTAG_MDC = 19,
70 } pgpTag;
71 
106 typedef struct pgpPktPubkey_s {
107  uint8_t version;
109  uint8_t algo;
110 } pgpPktPubkey;
111 
112 
119 typedef enum pgpSigType_e {
137 } pgpSigType;
138 
162 typedef enum pgpPubkeyAlgo_e {
172 } pgpPubkeyAlgo;
173 
198 typedef enum pgpSymkeyAlgo_e {
211 } pgpSymkeyAlgo;
212 
228 typedef enum pgpCompressAlgo_e {
234 
256 typedef enum pgpHashAlgo_e {
267 } pgpHashAlgo;
268 
290 typedef struct pgpPktSigV3_s {
291  uint8_t version;
292  uint8_t hashlen;
293  uint8_t sigtype;
296  uint8_t pubkey_algo;
297  uint8_t hash_algo;
298  uint8_t signhash16[2];
299 } * pgpPktSigV3;
300 
322 typedef struct pgpPktSigV4_s {
323  uint8_t version;
324  uint8_t sigtype;
325  uint8_t pubkey_algo;
326  uint8_t hash_algo;
327  uint8_t hashlen[2];
328 } * pgpPktSigV4;
329 
396 typedef enum pgpSubType_e {
435 } pgpSubType;
436 
457 typedef union pgpPktSig_u {
460 } * pgpPktSig;
461 
490 typedef struct pgpPktSymkey_s {
491  uint8_t version;
492  uint8_t symkey_algo;
493  uint8_t s2k[1];
494 } pgpPktSymkey;
495 
525 typedef struct pgpPktOnepass_s {
526  uint8_t version;
527  uint8_t sigtype;
528  uint8_t hash_algo;
529  uint8_t pubkey_algo;
531  uint8_t nested;
532 } * pgpPktOnepass;
533 
606 typedef struct pgpPktKeyV3_s {
607  uint8_t version;
609  uint8_t valid[2];
610  uint8_t pubkey_algo;
611 } * pgpPktKeyV3;
612 
644 typedef struct pgpPktKeyV4_s {
645  uint8_t version;
647  uint8_t pubkey_algo;
648 } * pgpPktKeyV4;
649 
714 typedef union pgpPktKey_u {
717 } pgpPktKey;
718 
719 /* \ingroup rpmpgp
720  * 5.6. Compressed Data Packet (Tag 8)
721  *
722  * The Compressed Data packet contains compressed data. Typically, this
723  * packet is found as the contents of an encrypted packet, or following
724  * a Signature or One-Pass Signature packet, and contains literal data
725  * packets.
726  *
727  * The body of this packet consists of:
728  * - One octet that gives the algorithm used to compress the packet.
729  * - The remainder of the packet is compressed data.
730  *
731  * A Compressed Data Packet's body contains an block that compresses
732  * some set of packets. See section "Packet Composition" for details on
733  * how messages are formed.
734  *
735  * ZIP-compressed packets are compressed with raw RFC 1951 DEFLATE
736  * blocks. Note that PGP V2.6 uses 13 bits of compression. If an
737  * implementation uses more bits of compression, PGP V2.6 cannot
738  * decompress it.
739  *
740  * ZLIB-compressed packets are compressed with RFC 1950 ZLIB-style
741  * blocks.
742  */
743 typedef struct pgpPktCdata_s {
744  uint8_t compressalgo;
745  uint8_t data[1];
746 } pgpPktCdata;
747 
748 /* \ingroup rpmpgp
749  * 5.7. Symmetrically Encrypted Data Packet (Tag 9)
750  *
751  * The Symmetrically Encrypted Data packet contains data encrypted with
752  * a symmetric-key algorithm. When it has been decrypted, it will
753  * typically contain other packets (often literal data packets or
754  * compressed data packets).
755  *
756  * The body of this packet consists of:
757  * - Encrypted data, the output of the selected symmetric-key cipher
758  * operating in PGP's variant of Cipher Feedback (CFB) mode.
759  *
760  * The symmetric cipher used may be specified in an Public-Key or
761  * Symmetric-Key Encrypted Session Key packet that precedes the
762  * Symmetrically Encrypted Data Packet. In that case, the cipher
763  * algorithm octet is prefixed to the session key before it is
764  * encrypted. If no packets of these types precede the encrypted data,
765  * the IDEA algorithm is used with the session key calculated as the MD5
766  * hash of the passphrase.
767  *
768  * The data is encrypted in CFB mode, with a CFB shift size equal to the
769  * cipher's block size. The Initial Vector (IV) is specified as all
770  * zeros. Instead of using an IV, OpenPGP prefixes a 10-octet string to
771  * the data before it is encrypted. The first eight octets are random,
772  * and the 9th and 10th octets are copies of the 7th and 8th octets,
773  * respectively. After encrypting the first 10 octets, the CFB state is
774  * resynchronized if the cipher block size is 8 octets or less. The
775  * last 8 octets of ciphertext are passed through the cipher and the
776  * block boundary is reset.
777  *
778  * The repetition of 16 bits in the 80 bits of random data prefixed to
779  * the message allows the receiver to immediately check whether the
780  * session key is incorrect.
781  */
782 typedef struct pgpPktEdata_s {
783  uint8_t data[1];
784 } pgpPktEdata;
785 
786 /* \ingroup rpmpgp
787  * 5.8. Marker Packet (Obsolete Literal Packet) (Tag 10)
788  *
789  * An experimental version of PGP used this packet as the Literal
790  * packet, but no released version of PGP generated Literal packets with
791  * this tag. With PGP 5.x, this packet has been re-assigned and is
792  * reserved for use as the Marker packet.
793  *
794  * The body of this packet consists of:
795  * - The three octets 0x50, 0x47, 0x50 (which spell "PGP" in UTF-8).
796  *
797  * Such a packet MUST be ignored when received. It may be placed at the
798  * beginning of a message that uses features not available in PGP 2.6.x
799  * in order to cause that version to report that newer software is
800  * necessary to process the message.
801  */
802 /* \ingroup rpmpgp
803  * 5.9. Literal Data Packet (Tag 11)
804  *
805  * A Literal Data packet contains the body of a message; data that is
806  * not to be further interpreted.
807  *
808  * The body of this packet consists of:
809  * - A one-octet field that describes how the data is formatted.
810  *
811  * If it is a 'b' (0x62), then the literal packet contains binary data.
812  * If it is a 't' (0x74), then it contains text data, and thus may need
813  * line ends converted to local form, or other text-mode changes. RFC
814  * 1991 also defined a value of 'l' as a 'local' mode for machine-local
815  * conversions. This use is now deprecated.
816  * - File name as a string (one-octet length, followed by file name),
817  * if the encrypted data should be saved as a file.
818  *
819  * If the special name "_CONSOLE" is used, the message is considered to
820  * be "for your eyes only". This advises that the message data is
821  * unusually sensitive, and the receiving program should process it more
822  * carefully, perhaps avoiding storing the received data to disk, for
823  * example.
824  * - A four-octet number that indicates the modification date of the
825  * file, or the creation time of the packet, or a zero that
826  * indicates the present time.
827  * - The remainder of the packet is literal data.
828  *
829  * Text data is stored with <CR><LF> text endings (i.e. network-normal
830  * line endings). These should be converted to native line endings by
831  * the receiving software.
832  */
833 typedef struct pgpPktLdata_s {
834  uint8_t format;
835  uint8_t filenamelen;
836  uint8_t filename[1];
837 } pgpPktLdata;
838 
839 /* \ingroup rpmpgp
840  * 5.10. Trust Packet (Tag 12)
841  *
842  * The Trust packet is used only within keyrings and is not normally
843  * exported. Trust packets contain data that record the user's
844  * specifications of which key holders are trustworthy introducers,
845  * along with other information that implementing software uses for
846  * trust information.
847  *
848  * Trust packets SHOULD NOT be emitted to output streams that are
849  * transferred to other users, and they SHOULD be ignored on any input
850  * other than local keyring files.
851  */
852 typedef struct pgpPktTrust_s {
853  uint8_t flag;
854 } pgpPktTrust;
855 
856 /* \ingroup rpmpgp
857  * 5.11. User ID Packet (Tag 13)
858  *
859  * A User ID packet consists of data that is intended to represent the
860  * name and email address of the key holder. By convention, it includes
861  * an RFC 822 mail name, but there are no restrictions on its content.
862  * The packet length in the header specifies the length of the user id.
863  * If it is text, it is encoded in UTF-8.
864  *
865  */
866 typedef struct pgpPktUid_s {
867  uint8_t userid[1];
868 } pgpPktUid;
869 
872 union pgpPktPre_u {
884 };
885 
888 typedef enum pgpArmor_e {
896 #define PGPARMOR_ERROR PGPARMOR_ERR_NO_BEGIN_PGP
905 } pgpArmor;
906 
909 typedef enum pgpArmorKey_e {
915 } pgpArmorKey;
916 
917 typedef enum pgpValType_e {
928 } pgpValType;
929 
935 };
936 
938 
945 const char * pgpValString(pgpValType type, uint8_t val);
946 
953 static inline
954 unsigned int pgpGrab(const uint8_t *s, size_t nbytes)
955 {
956  size_t i = 0;
957  size_t nb = (nbytes <= sizeof(i) ? nbytes : sizeof(i));
958  while (nb--)
959  i = (i << 8) | *s++;
960  return i;
961 }
962 
969 char * pgpHexStr(const uint8_t *p, size_t plen);
970 
979 int pgpPubkeyFingerprint(const uint8_t * pkt, size_t pktlen,
980  pgpKeyID_t keyid);
981 
989 int pgpExtractPubkeyFingerprint(const char * b64pkt, pgpKeyID_t keyid);
990 
999 int pgpPrtParams(const uint8_t *pkts, size_t pktlen, unsigned int pkttype,
1000  pgpDigParams * ret);
1001 
1011 int pgpPrtParamsSubkeys(const uint8_t *pkts, size_t pktlen,
1012  pgpDigParams mainkey, pgpDigParams **subkeys,
1013  int *subkeysCount);
1022 int pgpPrtPkts(const uint8_t *pkts, size_t pktlen, pgpDig dig, int printing);
1023 
1031 pgpArmor pgpReadPkts(const char * fn, uint8_t ** pkt, size_t * pktlen);
1032 
1040 pgpArmor pgpParsePkts(const char *armor, uint8_t ** pkt, size_t * pktlen);
1041 
1054 int pgpPubKeyCertLen(const uint8_t *pkts, size_t pktslen, size_t *certlen);
1055 
1063 char * pgpArmorWrap(int atype, const unsigned char * s, size_t ns);
1064 
1069 pgpDig pgpNewDig(void);
1070 
1075 void pgpCleanDig(pgpDig dig);
1076 
1082 pgpDig pgpFreeDig(pgpDig dig);
1083 
1090 pgpDigParams pgpDigGetParams(pgpDig dig, unsigned int pkttype);
1091 
1099 
1106 unsigned int pgpDigParamsAlgo(pgpDigParams digp, unsigned int algotype);
1107 
1114 
1123 
1132 rpmRC pgpVerifySig(pgpDig dig, DIGEST_CTX hashctx);
1133 
1139 char *pgpIdentItem(pgpDigParams digp);
1140 
1148 int rpmInitCrypto(void);
1149 
1153 int rpmFreeCrypto(void);
1154 
1161 
1167 size_t rpmDigestLength(int hashalgo);
1168 
1176 DIGEST_CTX rpmDigestInit(int hashalgo, rpmDigestFlags flags);
1177 
1185 int rpmDigestUpdate(DIGEST_CTX ctx, const void * data, size_t len);
1186 
1198 int rpmDigestFinal(DIGEST_CTX ctx,
1199  void ** datap,
1200  size_t * lenp, int asAscii);
1201 
1207 
1214 
1222 int rpmDigestBundleAdd(rpmDigestBundle bundle, int algo,
1223  rpmDigestFlags flags);
1224 
1232 int rpmDigestBundleUpdate(rpmDigestBundle bundle, const void *data, size_t len);
1233 
1245  int algo, void ** datap, size_t * lenp, int asAscii);
1246 
1254 
1255 #ifdef __cplusplus
1256 }
1257 #endif
1258 
1259 #endif /* H_RPMPGP */
pgpPktCdata_s
Definition: rpmpgp.h:743
pgpPktOnepass_s::signid
pgpKeyID_t signid
Definition: rpmpgp.h:530
PGPVAL_TAG
@ PGPVAL_TAG
Definition: rpmpgp.h:918
rpmFlags
uint32_t rpmFlags
Definition: rpmtypes.h:42
PGPARMORKEY_MESSAGEID
@ PGPARMORKEY_MESSAGEID
Definition: rpmpgp.h:912
pgpPktSig_u
Definition: rpmpgp.h:457
PGPVAL_SIGTYPE
@ PGPVAL_SIGTYPE
Definition: rpmpgp.h:921
PGPHASHALGO_MD5
@ PGPHASHALGO_MD5
Definition: rpmpgp.h:257
pgpPktCdata_s::compressalgo
uint8_t compressalgo
Definition: rpmpgp.h:744
pgpPktLdata_s::filenamelen
uint8_t filenamelen
Definition: rpmpgp.h:835
PGPPUBKEYALGO_ECDSA
@ PGPPUBKEYALGO_ECDSA
Definition: rpmpgp.h:169
pgpPktSigV4_s::pubkey_algo
uint8_t pubkey_algo
Definition: rpmpgp.h:325
PGPSUBTYPE_REVOKE_REASON
@ PGPSUBTYPE_REVOKE_REASON
Definition: rpmpgp.h:418
PGPSUBTYPE_CRITICAL
@ PGPSUBTYPE_CRITICAL
Definition: rpmpgp.h:434
PGPHASHALGO_SHA512
@ PGPHASHALGO_SHA512
Definition: rpmpgp.h:265
pgpPktPre_u::onepass
pgpPktOnepass onepass
Definition: rpmpgp.h:876
PGPVAL_SYMKEYALGO
@ PGPVAL_SYMKEYALGO
Definition: rpmpgp.h:924
pgpPktKeyV4_s::version
uint8_t version
Definition: rpmpgp.h:645
pgpPktSigV4
struct pgpPktSigV4_s * pgpPktSigV4
PGPSUBTYPE_INTERNAL_106
@ PGPSUBTYPE_INTERNAL_106
Definition: rpmpgp.h:428
PGPARMOR_PRIVKEY
@ PGPARMOR_PRIVKEY
Definition: rpmpgp.h:903
pgpTag_e
pgpTag_e
Definition: rpmpgp.h:46
rpmDigestLength
size_t rpmDigestLength(int hashalgo)
pgpPubkeyAlgo
enum pgpPubkeyAlgo_e pgpPubkeyAlgo
pgpPrtPkts
int pgpPrtPkts(const uint8_t *pkts, size_t pktlen, pgpDig dig, int printing)
PGPARMOR_SIGNED_MESSAGE
@ PGPARMOR_SIGNED_MESSAGE
Definition: rpmpgp.h:901
PGPARMOR_SECKEY
@ PGPARMOR_SECKEY
Definition: rpmpgp.h:904
rpmDigestDup
DIGEST_CTX rpmDigestDup(DIGEST_CTX octx)
pgpDigParamsFree
pgpDigParams pgpDigParamsFree(pgpDigParams digp)
pgpPktKeyV3_s
Definition: rpmpgp.h:606
pgpPktSymkey_s::symkey_algo
uint8_t symkey_algo
Definition: rpmpgp.h:492
pgpKeyID_t
uint8_t pgpKeyID_t[8]
Definition: rpmpgp.h:36
pgpHexStr
char * pgpHexStr(const uint8_t *p, size_t plen)
pgpPktSigV4_s
Definition: rpmpgp.h:322
PGPTAG_TRUST
@ PGPTAG_TRUST
Definition: rpmpgp.h:59
PGPSUBTYPE_REGEX
@ PGPSUBTYPE_REGEX
Definition: rpmpgp.h:402
PGPARMOR_SIGNATURE
@ PGPARMOR_SIGNATURE
Definition: rpmpgp.h:900
PGPSUBTYPE_NONE
@ PGPSUBTYPE_NONE
Definition: rpmpgp.h:397
rpmFreeCrypto
int rpmFreeCrypto(void)
pgpPktSig
union pgpPktSig_u * pgpPktSig
PGPSIGTYPE_STANDALONE
@ PGPSIGTYPE_STANDALONE
Definition: rpmpgp.h:122
PGPSUBTYPE_INTERNAL_110
@ PGPSUBTYPE_INTERNAL_110
Definition: rpmpgp.h:432
pgpPktSig_u::v4
struct pgpPktSigV4_s v4
Definition: rpmpgp.h:459
PGPSYMKEYALGO_IDEA
@ PGPSYMKEYALGO_IDEA
Definition: rpmpgp.h:200
PGPSUBTYPE_PREFER_SYMKEY
@ PGPSUBTYPE_PREFER_SYMKEY
Definition: rpmpgp.h:406
PGPSUBTYPE_REVOKE_KEY
@ PGPSUBTYPE_REVOKE_KEY
Definition: rpmpgp.h:407
pgpPktSigV4_s::version
uint8_t version
Definition: rpmpgp.h:323
pgpPktOnepass_s::hash_algo
uint8_t hash_algo
Definition: rpmpgp.h:528
PGPTAG_PUBLIC_SESSION_KEY
@ PGPTAG_PUBLIC_SESSION_KEY
Definition: rpmpgp.h:48
pgpPktPre_u::symkey
pgpPktSymkey symkey
Definition: rpmpgp.h:875
PGPPUBKEYALGO_RSA
@ PGPPUBKEYALGO_RSA
Definition: rpmpgp.h:163
PGPSUBTYPE_SIG_CREATE_TIME
@ PGPSUBTYPE_SIG_CREATE_TIME
Definition: rpmpgp.h:398
PGPPUBKEYALGO_EC
@ PGPPUBKEYALGO_EC
Definition: rpmpgp.h:168
PGPSUBTYPE_SIG_EXPIRE_TIME
@ PGPSUBTYPE_SIG_EXPIRE_TIME
Definition: rpmpgp.h:399
PGPHASHALGO_TIGER192
@ PGPHASHALGO_TIGER192
Definition: rpmpgp.h:261
PGPHASHALGO_SHA1
@ PGPHASHALGO_SHA1
Definition: rpmpgp.h:258
pgpGrab
static unsigned int pgpGrab(const uint8_t *s, size_t nbytes)
Definition: rpmpgp.h:954
pgpSubType
enum pgpSubType_e pgpSubType
pgpPktPre_u::pubkey
pgpPktPubkey pubkey
Definition: rpmpgp.h:873
PGPSUBTYPE_INTERNAL_101
@ PGPSUBTYPE_INTERNAL_101
Definition: rpmpgp.h:423
pgpSigType_e
pgpSigType_e
Definition: rpmpgp.h:119
pgpPktUid_s
Definition: rpmpgp.h:866
pgpPktTrust_s::flag
uint8_t flag
Definition: rpmpgp.h:853
pgpTag
enum pgpTag_e pgpTag
pgpPktPre_u::edata
pgpPktEdata edata
Definition: rpmpgp.h:879
PGPSYMKEYALGO_AES_256
@ PGPSYMKEYALGO_AES_256
Definition: rpmpgp.h:208
rpmDigestInit
DIGEST_CTX rpmDigestInit(int hashalgo, rpmDigestFlags flags)
rpmDigestFinal
int rpmDigestFinal(DIGEST_CTX ctx, void **datap, size_t *lenp, int asAscii)
PGPSIGTYPE_POSITIVE_CERT
@ PGPSIGTYPE_POSITIVE_CERT
Definition: rpmpgp.h:129
RPMDIGEST_NONE
@ RPMDIGEST_NONE
Definition: rpmpgp.h:934
pgpCompressAlgo_e
pgpCompressAlgo_e
Definition: rpmpgp.h:228
pgpIdentItem
char * pgpIdentItem(pgpDigParams digp)
pgpPktOnepass_s::pubkey_algo
uint8_t pubkey_algo
Definition: rpmpgp.h:529
pgpVerifySig
rpmRC pgpVerifySig(pgpDig dig, DIGEST_CTX hashctx)
PGPPUBKEYALGO_DSA
@ PGPPUBKEYALGO_DSA
Definition: rpmpgp.h:167
PGPSUBTYPE_INTERNAL_109
@ PGPSUBTYPE_INTERNAL_109
Definition: rpmpgp.h:431
pgpArmorWrap
char * pgpArmorWrap(int atype, const unsigned char *s, size_t ns)
pgpPktOnepass_s::version
uint8_t version
Definition: rpmpgp.h:526
rpmDigestBundleFree
rpmDigestBundle rpmDigestBundleFree(rpmDigestBundle bundle)
pgpPktPre_u::tdata
pgpPktTrust tdata
Definition: rpmpgp.h:882
PGPHASHALGO_SHA384
@ PGPHASHALGO_SHA384
Definition: rpmpgp.h:264
PGPSIGTYPE_TEXT
@ PGPSIGTYPE_TEXT
Definition: rpmpgp.h:121
pgpPubkeyFingerprint
int pgpPubkeyFingerprint(const uint8_t *pkt, size_t pktlen, pgpKeyID_t keyid)
pgpPktOnepass
struct pgpPktOnepass_s * pgpPktOnepass
PGPSIGTYPE_KEY_REVOKE
@ PGPSIGTYPE_KEY_REVOKE
Definition: rpmpgp.h:133
PGPPUBKEYALGO_DH
@ PGPPUBKEYALGO_DH
Definition: rpmpgp.h:171
PGPTAG_PRIVATE_60
@ PGPTAG_PRIVATE_60
Definition: rpmpgp.h:66
PGPSUBTYPE_ARR
@ PGPSUBTYPE_ARR
Definition: rpmpgp.h:405
PGPSYMKEYALGO_PLAINTEXT
@ PGPSYMKEYALGO_PLAINTEXT
Definition: rpmpgp.h:199
PGPSUBTYPE_PREFER_HASH
@ PGPSUBTYPE_PREFER_HASH
Definition: rpmpgp.h:410
pgpPktKeyV3
struct pgpPktKeyV3_s * pgpPktKeyV3
PGPARMOR_ERR_CRC_CHECK
@ PGPARMOR_ERR_CRC_CHECK
Definition: rpmpgp.h:889
pgpHashAlgo_e
pgpHashAlgo_e
Definition: rpmpgp.h:256
PGPSYMKEYALGO_TRIPLE_DES
@ PGPSYMKEYALGO_TRIPLE_DES
Definition: rpmpgp.h:201
PGPSUBTYPE_INTERNAL_102
@ PGPSUBTYPE_INTERNAL_102
Definition: rpmpgp.h:424
PGPSIGTYPE_SUBKEY_BINDING
@ PGPSIGTYPE_SUBKEY_BINDING
Definition: rpmpgp.h:131
pgpVerifySignature
rpmRC pgpVerifySignature(pgpDigParams key, pgpDigParams sig, DIGEST_CTX hashctx)
pgpDigParamsCmp
int pgpDigParamsCmp(pgpDigParams p1, pgpDigParams p2)
pgpPktSigV3_s::pubkey_algo
uint8_t pubkey_algo
Definition: rpmpgp.h:296
PGPSUBTYPE_KEYSERVER_PREFERS
@ PGPSUBTYPE_KEYSERVER_PREFERS
Definition: rpmpgp.h:412
PGPTAG_MDC
@ PGPTAG_MDC
Definition: rpmpgp.h:65
PGPSUBTYPE_EMBEDDED_SIG
@ PGPSUBTYPE_EMBEDDED_SIG
Definition: rpmpgp.h:420
PGPVAL_PUBKEYALGO
@ PGPVAL_PUBKEYALGO
Definition: rpmpgp.h:923
pgpPktKeyV4
struct pgpPktKeyV4_s * pgpPktKeyV4
pgpParsePkts
pgpArmor pgpParsePkts(const char *armor, uint8_t **pkt, size_t *pktlen)
PGPSUBTYPE_NOTATION
@ PGPSUBTYPE_NOTATION
Definition: rpmpgp.h:409
rpmDigestBundleDupCtx
DIGEST_CTX rpmDigestBundleDupCtx(rpmDigestBundle bundle, int algo)
pgpPktPubkey
struct pgpPktPubkey_s pgpPktPubkey
pgpPktSigV3_s
Definition: rpmpgp.h:290
pgpPktPre_u::ldata
pgpPktLdata ldata
Definition: rpmpgp.h:881
PGPSYMKEYALGO_NOENCRYPT
@ PGPSYMKEYALGO_NOENCRYPT
Definition: rpmpgp.h:210
pgpPktPubkey_s::keyid
pgpKeyID_t keyid
Definition: rpmpgp.h:108
pgpPktKey
union pgpPktKey_u pgpPktKey
PGPARMOR_PUBKEY
@ PGPARMOR_PUBKEY
Definition: rpmpgp.h:899
PGPTAG_PRIVATE_62
@ PGPTAG_PRIVATE_62
Definition: rpmpgp.h:68
pgpSymkeyAlgo_e
pgpSymkeyAlgo_e
Definition: rpmpgp.h:198
PGPTAG_COMMENT_OLD
@ PGPTAG_COMMENT_OLD
Definition: rpmpgp.h:62
pgpPktCdata_s::data
uint8_t data[1]
Definition: rpmpgp.h:745
PGPCOMPRESSALGO_ZIP
@ PGPCOMPRESSALGO_ZIP
Definition: rpmpgp.h:230
rpmInitCrypto
int rpmInitCrypto(void)
PGPTAG_PUBLIC_KEY
@ PGPTAG_PUBLIC_KEY
Definition: rpmpgp.h:53
pgpPktCdata
struct pgpPktCdata_s pgpPktCdata
PGPTAG_PUBLIC_SUBKEY
@ PGPTAG_PUBLIC_SUBKEY
Definition: rpmpgp.h:61
PGPSUBTYPE_EXPORTABLE_CERT
@ PGPSUBTYPE_EXPORTABLE_CERT
Definition: rpmpgp.h:400
pgpPktPre_u::cdata
pgpPktCdata cdata
Definition: rpmpgp.h:878
PGPARMOR_MESSAGE
@ PGPARMOR_MESSAGE
Definition: rpmpgp.h:898
pgpReadPkts
pgpArmor pgpReadPkts(const char *fn, uint8_t **pkt, size_t *pktlen)
pgpPktLdata_s::filename
uint8_t filename[1]
Definition: rpmpgp.h:836
PGPARMORKEY_CHARSET
@ PGPARMORKEY_CHARSET
Definition: rpmpgp.h:914
pgpHashAlgo
enum pgpHashAlgo_e pgpHashAlgo
PGPSIGTYPE_TIMESTAMP
@ PGPSIGTYPE_TIMESTAMP
Definition: rpmpgp.h:136
PGPSUBTYPE_INTERNAL_104
@ PGPSUBTYPE_INTERNAL_104
Definition: rpmpgp.h:426
pgpPktPubkey_s
Definition: rpmpgp.h:106
pgpPktLdata_s::format
uint8_t format
Definition: rpmpgp.h:834
PGPVAL_ARMORKEY
@ PGPVAL_ARMORKEY
Definition: rpmpgp.h:920
PGPARMOR_NONE
@ PGPARMOR_NONE
Definition: rpmpgp.h:897
pgpPktKey_u::v4
struct pgpPktKeyV4_s v4
Definition: rpmpgp.h:716
pgpPktSigV3_s::hash_algo
uint8_t hash_algo
Definition: rpmpgp.h:297
PGPTAG_SECRET_SUBKEY
@ PGPTAG_SECRET_SUBKEY
Definition: rpmpgp.h:54
rpmDigestFlags_e
rpmDigestFlags_e
Definition: rpmpgp.h:933
PGPARMORKEY_COMMENT
@ PGPARMORKEY_COMMENT
Definition: rpmpgp.h:911
rpmDigestFlags
rpmFlags rpmDigestFlags
Definition: rpmpgp.h:937
pgpPktKeyV3_s::time
pgpTime_t time
Definition: rpmpgp.h:608
pgpPktKeyV3_s::pubkey_algo
uint8_t pubkey_algo
Definition: rpmpgp.h:610
pgpDigParams
struct pgpDigParams_s * pgpDigParams
Definition: rpmpgp.h:34
PGPSUBTYPE_REVOCABLE
@ PGPSUBTYPE_REVOCABLE
Definition: rpmpgp.h:403
PGPVAL_SUBTYPE
@ PGPVAL_SUBTYPE
Definition: rpmpgp.h:922
rpmDigestBundleUpdate
int rpmDigestBundleUpdate(rpmDigestBundle bundle, const void *data, size_t len)
pgpCompressAlgo
enum pgpCompressAlgo_e pgpCompressAlgo
pgpPktUid
struct pgpPktUid_s pgpPktUid
pgpArmorKey_e
pgpArmorKey_e
Definition: rpmpgp.h:909
pgpPktPre_u
Definition: rpmpgp.h:872
pgpSubType_e
pgpSubType_e
Definition: rpmpgp.h:396
PGPSYMKEYALGO_TWOFISH
@ PGPSYMKEYALGO_TWOFISH
Definition: rpmpgp.h:209
PGPCOMPRESSALGO_BZIP2
@ PGPCOMPRESSALGO_BZIP2
Definition: rpmpgp.h:232
pgpPktKeyV3_s::version
uint8_t version
Definition: rpmpgp.h:607
rpmDigestBundle
struct rpmDigestBundle_s * rpmDigestBundle
Definition: rpmpgp.h:26
pgpPktTrust
struct pgpPktTrust_s pgpPktTrust
PGPSUBTYPE_INTERNAL_107
@ PGPSUBTYPE_INTERNAL_107
Definition: rpmpgp.h:429
PGPHASHALGO_HAVAL_5_160
@ PGPHASHALGO_HAVAL_5_160
Definition: rpmpgp.h:262
pgpCleanDig
void pgpCleanDig(pgpDig dig)
PGPSUBTYPE_INTERNAL_103
@ PGPSUBTYPE_INTERNAL_103
Definition: rpmpgp.h:425
PGPSYMKEYALGO_BLOWFISH
@ PGPSYMKEYALGO_BLOWFISH
Definition: rpmpgp.h:203
PGPARMOR_FILE
@ PGPARMOR_FILE
Definition: rpmpgp.h:902
pgpPktKeyV4_s::time
pgpTime_t time
Definition: rpmpgp.h:646
pgpFreeDig
pgpDig pgpFreeDig(pgpDig dig)
PGPSUBTYPE_INTERNAL_108
@ PGPSUBTYPE_INTERNAL_108
Definition: rpmpgp.h:430
pgpPktUid_s::userid
uint8_t userid[1]
Definition: rpmpgp.h:867
pgpSigType
enum pgpSigType_e pgpSigType
pgpPktPubkey_s::version
uint8_t version
Definition: rpmpgp.h:107
PGPSYMKEYALGO_AES_128
@ PGPSYMKEYALGO_AES_128
Definition: rpmpgp.h:206
PGPSIGTYPE_SUBKEY_REVOKE
@ PGPSIGTYPE_SUBKEY_REVOKE
Definition: rpmpgp.h:134
PGPSUBTYPE_INTERNAL_105
@ PGPSUBTYPE_INTERNAL_105
Definition: rpmpgp.h:427
pgpPktSigV3_s::signid
pgpKeyID_t signid
Definition: rpmpgp.h:295
PGPHASHALGO_MD2
@ PGPHASHALGO_MD2
Definition: rpmpgp.h:260
pgpPktSigV3
struct pgpPktSigV3_s * pgpPktSigV3
pgpValString
const char * pgpValString(pgpValType type, uint8_t val)
rpmDigestUpdate
int rpmDigestUpdate(DIGEST_CTX ctx, const void *data, size_t len)
pgpPktKey_u
Definition: rpmpgp.h:714
PGPTAG_SIGNATURE
@ PGPTAG_SIGNATURE
Definition: rpmpgp.h:49
pgpPktKeyV4_s::pubkey_algo
uint8_t pubkey_algo
Definition: rpmpgp.h:647
PGPSYMKEYALGO_AES_192
@ PGPSYMKEYALGO_AES_192
Definition: rpmpgp.h:207
pgpPktOnepass_s::nested
uint8_t nested
Definition: rpmpgp.h:531
pgpPktOnepass_s
Definition: rpmpgp.h:525
PGPSUBTYPE_PREFER_KEYSERVER
@ PGPSUBTYPE_PREFER_KEYSERVER
Definition: rpmpgp.h:413
PGPSUBTYPE_PRIMARY_USERID
@ PGPSUBTYPE_PRIMARY_USERID
Definition: rpmpgp.h:414
PGPSUBTYPE_ISSUER_KEYID
@ PGPSUBTYPE_ISSUER_KEYID
Definition: rpmpgp.h:408
pgpPktSigV4_s::hashlen
uint8_t hashlen[2]
Definition: rpmpgp.h:327
pgpExtractPubkeyFingerprint
int pgpExtractPubkeyFingerprint(const char *b64pkt, pgpKeyID_t keyid)
PGPSUBTYPE_POLICY_URL
@ PGPSUBTYPE_POLICY_URL
Definition: rpmpgp.h:415
PGPARMORKEY_HASH
@ PGPARMORKEY_HASH
Definition: rpmpgp.h:913
pgpNewDig
pgpDig pgpNewDig(void)
pgpArmorKey
enum pgpArmorKey_e pgpArmorKey
pgpPktSigV3_s::signhash16
uint8_t signhash16[2]
Definition: rpmpgp.h:298
PGPARMOR_ERR_CRC_DECODE
@ PGPARMOR_ERR_CRC_DECODE
Definition: rpmpgp.h:891
rpmDigestBundleFinal
int rpmDigestBundleFinal(rpmDigestBundle bundle, int algo, void **datap, size_t *lenp, int asAscii)
PGPVAL_HASHALGO
@ PGPVAL_HASHALGO
Definition: rpmpgp.h:926
PGPSIGTYPE_PERSONA_CERT
@ PGPSIGTYPE_PERSONA_CERT
Definition: rpmpgp.h:125
PGPCOMPRESSALGO_ZLIB
@ PGPCOMPRESSALGO_ZLIB
Definition: rpmpgp.h:231
pgpArmor
enum pgpArmor_e pgpArmor
pgpPubkeyAlgo_e
pgpPubkeyAlgo_e
Definition: rpmpgp.h:162
PGPPUBKEYALGO_RSA_ENCRYPT
@ PGPPUBKEYALGO_RSA_ENCRYPT
Definition: rpmpgp.h:164
pgpPktSigV3_s::hashlen
uint8_t hashlen
Definition: rpmpgp.h:292
pgpPktPre_u::uid
pgpPktUid uid
Definition: rpmpgp.h:883
PGPTAG_LITERAL_DATA
@ PGPTAG_LITERAL_DATA
Definition: rpmpgp.h:58
PGPTAG_RESERVED
@ PGPTAG_RESERVED
Definition: rpmpgp.h:47
pgpPktEdata
struct pgpPktEdata_s pgpPktEdata
rpmDigestBundleAdd
int rpmDigestBundleAdd(rpmDigestBundle bundle, int algo, rpmDigestFlags flags)
pgpValType
enum pgpValType_e pgpValType
PGPTAG_SYMMETRIC_DATA
@ PGPTAG_SYMMETRIC_DATA
Definition: rpmpgp.h:56
PGPTAG_ONEPASS_SIGNATURE
@ PGPTAG_ONEPASS_SIGNATURE
Definition: rpmpgp.h:51
PGPVAL_SERVERPREFS
@ PGPVAL_SERVERPREFS
Definition: rpmpgp.h:927
PGPVAL_COMPRESSALGO
@ PGPVAL_COMPRESSALGO
Definition: rpmpgp.h:925
pgpArmor_e
pgpArmor_e
Definition: rpmpgp.h:888
pgpPktSigV3_s::version
uint8_t version
Definition: rpmpgp.h:291
pgpPktSymkey_s
5.3.
Definition: rpmpgp.h:490
PGPSIGTYPE_SIGNED_KEY
@ PGPSIGTYPE_SIGNED_KEY
Definition: rpmpgp.h:132
PGPPUBKEYALGO_ELGAMAL_ENCRYPT
@ PGPPUBKEYALGO_ELGAMAL_ENCRYPT
Definition: rpmpgp.h:166
PGPSYMKEYALGO_DES_SK
@ PGPSYMKEYALGO_DES_SK
Definition: rpmpgp.h:205
pgpValType_e
pgpValType_e
Definition: rpmpgp.h:917
pgpSymkeyAlgo
enum pgpSymkeyAlgo_e pgpSymkeyAlgo
PGPARMOR_ERR_UNKNOWN_ARMOR_TYPE
@ PGPARMOR_ERR_UNKNOWN_ARMOR_TYPE
Definition: rpmpgp.h:894
PGPPUBKEYALGO_ELGAMAL
@ PGPPUBKEYALGO_ELGAMAL
Definition: rpmpgp.h:170
pgpPktSig_u::v3
struct pgpPktSigV3_s v3
Definition: rpmpgp.h:458
pgpPktSymkey_s::version
uint8_t version
Definition: rpmpgp.h:491
pgpPktSigV4_s::hash_algo
uint8_t hash_algo
Definition: rpmpgp.h:326
PGPTAG_PHOTOID
@ PGPTAG_PHOTOID
Definition: rpmpgp.h:63
PGPHASHALGO_RIPEMD160
@ PGPHASHALGO_RIPEMD160
Definition: rpmpgp.h:259
pgpPktSymkey_s::s2k
uint8_t s2k[1]
Definition: rpmpgp.h:493
pgpPktKeyV4_s
Definition: rpmpgp.h:644
PGPSIGTYPE_CASUAL_CERT
@ PGPSIGTYPE_CASUAL_CERT
Definition: rpmpgp.h:127
PGPTAG_COMMENT
@ PGPTAG_COMMENT
Definition: rpmpgp.h:67
PGPSUBTYPE_KEY_FLAGS
@ PGPSUBTYPE_KEY_FLAGS
Definition: rpmpgp.h:416
pgpPktTrust_s
Definition: rpmpgp.h:852
PGPTAG_COMPRESSED_DATA
@ PGPTAG_COMPRESSED_DATA
Definition: rpmpgp.h:55
PGPSIGTYPE_CERT_REVOKE
@ PGPSIGTYPE_CERT_REVOKE
Definition: rpmpgp.h:135
pgpPktLdata_s
Definition: rpmpgp.h:833
PGPPUBKEYALGO_RSA_SIGN
@ PGPPUBKEYALGO_RSA_SIGN
Definition: rpmpgp.h:165
PGPSIGTYPE_GENERIC_CERT
@ PGPSIGTYPE_GENERIC_CERT
Definition: rpmpgp.h:123
pgpPrtParams
int pgpPrtParams(const uint8_t *pkts, size_t pktlen, unsigned int pkttype, pgpDigParams *ret)
PGPTAG_MARKER
@ PGPTAG_MARKER
Definition: rpmpgp.h:57
pgpPktKey_u::v3
struct pgpPktKeyV3_s v3
Definition: rpmpgp.h:715
PGPTAG_SECRET_KEY
@ PGPTAG_SECRET_KEY
Definition: rpmpgp.h:52
pgpPktSymkey
struct pgpPktSymkey_s pgpPktSymkey
5.3.
pgpPubKeyCertLen
int pgpPubKeyCertLen(const uint8_t *pkts, size_t pktslen, size_t *certlen)
PGPARMOR_ERR_UNKNOWN_PREAMBLE_TAG
@ PGPARMOR_ERR_UNKNOWN_PREAMBLE_TAG
Definition: rpmpgp.h:893
pgpTime_t
uint8_t pgpTime_t[4]
Definition: rpmpgp.h:37
pgpPktLdata
struct pgpPktLdata_s pgpPktLdata
PGPSUBTYPE_KEY_EXPIRE_TIME
@ PGPSUBTYPE_KEY_EXPIRE_TIME
Definition: rpmpgp.h:404
pgpPktPre_u::sig
pgpPktSig sig
Definition: rpmpgp.h:874
rpmRC
enum rpmRC_e rpmRC
pgpPktEdata_s::data
uint8_t data[1]
Definition: rpmpgp.h:783
PGPSUBTYPE_TRUST_SIG
@ PGPSUBTYPE_TRUST_SIG
Definition: rpmpgp.h:401
PGPARMOR_ERR_NO_END_PGP
@ PGPARMOR_ERR_NO_END_PGP
Definition: rpmpgp.h:892
pgpPktKeyV3_s::valid
uint8_t valid[2]
Definition: rpmpgp.h:609
PGPCOMPRESSALGO_NONE
@ PGPCOMPRESSALGO_NONE
Definition: rpmpgp.h:229
pgpPktEdata_s
Definition: rpmpgp.h:782
pgpPktSigV3_s::time
pgpTime_t time
Definition: rpmpgp.h:294
pgpPktOnepass_s::sigtype
uint8_t sigtype
Definition: rpmpgp.h:527
pgpDigGetParams
pgpDigParams pgpDigGetParams(pgpDig dig, unsigned int pkttype)
PGPTAG_CONTROL
@ PGPTAG_CONTROL
Definition: rpmpgp.h:69
PGPHASHALGO_SHA224
@ PGPHASHALGO_SHA224
Definition: rpmpgp.h:266
PGPARMOR_ERR_NO_BEGIN_PGP
@ PGPARMOR_ERR_NO_BEGIN_PGP
Definition: rpmpgp.h:895
pgpPktSigV3_s::sigtype
uint8_t sigtype
Definition: rpmpgp.h:293
PGPSIGTYPE_BINARY
@ PGPSIGTYPE_BINARY
Definition: rpmpgp.h:120
PGPSUBTYPE_PREFER_COMPRESS
@ PGPSUBTYPE_PREFER_COMPRESS
Definition: rpmpgp.h:411
PGPARMOR_ERR_BODY_DECODE
@ PGPARMOR_ERR_BODY_DECODE
Definition: rpmpgp.h:890
pgpPktPubkey_s::algo
uint8_t algo
Definition: rpmpgp.h:109
PGPTAG_USER_ID
@ PGPTAG_USER_ID
Definition: rpmpgp.h:60
DIGEST_CTX
struct DIGEST_CTX_s * DIGEST_CTX
Definition: rpmpgp.h:25
pgpPktPre_u::key
pgpPktKey key
Definition: rpmpgp.h:877
PGPSUBTYPE_SIGNER_USERID
@ PGPSUBTYPE_SIGNER_USERID
Definition: rpmpgp.h:417
PGPSYMKEYALGO_CAST5
@ PGPSYMKEYALGO_CAST5
Definition: rpmpgp.h:202
rpmDigestBundleNew
rpmDigestBundle rpmDigestBundleNew(void)
PGPSYMKEYALGO_SAFER
@ PGPSYMKEYALGO_SAFER
Definition: rpmpgp.h:204
PGPTAG_ENCRYPTED_MDC
@ PGPTAG_ENCRYPTED_MDC
Definition: rpmpgp.h:64
pgpPktSigV4_s::sigtype
uint8_t sigtype
Definition: rpmpgp.h:324
pgpDig
struct pgpDig_s * pgpDig
Definition: rpmpgp.h:30
pgpPrtParamsSubkeys
int pgpPrtParamsSubkeys(const uint8_t *pkts, size_t pktlen, pgpDigParams mainkey, pgpDigParams **subkeys, int *subkeysCount)
PGPHASHALGO_SHA256
@ PGPHASHALGO_SHA256
Definition: rpmpgp.h:263
pgpDigParamsAlgo
unsigned int pgpDigParamsAlgo(pgpDigParams digp, unsigned int algotype)
PGPVAL_ARMORBLOCK
@ PGPVAL_ARMORBLOCK
Definition: rpmpgp.h:919
PGPSUBTYPE_INTERNAL_100
@ PGPSUBTYPE_INTERNAL_100
Definition: rpmpgp.h:422
PGPTAG_SYMMETRIC_SESSION_KEY
@ PGPTAG_SYMMETRIC_SESSION_KEY
Definition: rpmpgp.h:50
PGPARMORKEY_VERSION
@ PGPARMORKEY_VERSION
Definition: rpmpgp.h:910
PGPSUBTYPE_FEATURES
@ PGPSUBTYPE_FEATURES
Definition: rpmpgp.h:419