22#include <rpm/rpmcrypto.h>
30typedef struct pgpDigParams_s * pgpDigParams;
36#define PGP_KEYID_LEN 8
39typedef uint8_t pgpTime_t[4];
771 uint8_t compressalgo;
916 PGPARMOR_ERR_CRC_CHECK = -7,
917 PGPARMOR_ERR_BODY_DECODE = -6,
918 PGPARMOR_ERR_CRC_DECODE = -5,
919 PGPARMOR_ERR_NO_END_PGP = -4,
920 PGPARMOR_ERR_UNKNOWN_PREAMBLE_TAG = -3,
921 PGPARMOR_ERR_UNKNOWN_ARMOR_TYPE = -2,
922 PGPARMOR_ERR_NO_BEGIN_PGP = -1,
923#define PGPARMOR_ERROR PGPARMOR_ERR_NO_BEGIN_PGP
944typedef enum pgpValType_e {
946 PGPVAL_ARMORBLOCK = 2,
950 PGPVAL_PUBKEYALGO = 6,
951 PGPVAL_SYMKEYALGO = 7,
952 PGPVAL_COMPRESSALGO = 8,
954 PGPVAL_SERVERPREFS = 10,
972unsigned int pgpGrab(
const uint8_t *s,
size_t nbytes)
975 size_t nb = (nbytes <=
sizeof(i) ? nbytes :
sizeof(i));
990 uint8_t **fp,
size_t *fplen);
1010 pgpDigParams * ret);
1022 pgpDigParams * ret,
char **lints);
1034 pgpDigParams mainkey, pgpDigParams **subkeys,
1044pgpArmor
pgpReadPkts(
const char * fn, uint8_t ** pkt,
size_t * pktlen);
const char * pgpValString(pgpValType type, uint8_t val)
enum pgpHashAlgo_e pgpHashAlgo
rpmRC pgpVerifySignature(pgpDigParams key, pgpDigParams sig, DIGEST_CTX hashctx)
int pgpPrtParams(const uint8_t *pkts, size_t pktlen, unsigned int pkttype, pgpDigParams *ret)
enum pgpPubkeyAlgo_e pgpPubkeyAlgo
enum pgpSigType_e pgpSigType
struct pgpPktKeyV4_s * pgpPktKeyV4
struct pgpPktSigV3_s * pgpPktSigV3
pgpCompressAlgo_e
Definition: rpmpgp.h:232
uint32_t pgpDigParamsCreationTime(pgpDigParams digp)
int pgpPubKeyCertLen(const uint8_t *pkts, size_t pktslen, size_t *certlen)
const uint8_t * pgpDigParamsSignID(pgpDigParams digp)
int pgpSignatureType(pgpDigParams sig)
int pgpPrtParams2(const uint8_t *pkts, size_t pktlen, unsigned int pkttype, pgpDigParams *ret, char **lints)
struct pgpPktTrust_s pgpPktTrust
pgpPubkeyAlgo_e
Definition: rpmpgp.h:165
struct pgpPktKeyV3_s * pgpPktKeyV3
int pgpDigParamsVersion(pgpDigParams digp)
struct pgpPktOnepass_s * pgpPktOnepass
rpmRC pgpVerifySignature2(pgpDigParams key, pgpDigParams sig, DIGEST_CTX hashctx, char **lints)
pgpArmor pgpParsePkts(const char *armor, uint8_t **pkt, size_t *pktlen)
pgpArmor pgpReadPkts(const char *fn, uint8_t **pkt, size_t *pktlen)
struct pgpPktCdata_s pgpPktCdata
rpmRC pgpPubKeyLint(const uint8_t *pkts, size_t pktslen, char **explanation)
pgpCurveId_e
Definition: rpmpgp.h:281
enum pgpCompressAlgo_e pgpCompressAlgo
pgpArmor_e
Definition: rpmpgp.h:915
union pgpPktKey_u pgpPktKey
pgpHashAlgo_e
Definition: rpmpgp.h:262
pgpSigType_e
Definition: rpmpgp.h:121
int pgpDigParamsCmp(pgpDigParams p1, pgpDigParams p2)
char * pgpArmorWrap(int atype, const unsigned char *s, size_t ns)
pgpArmorKey_e
Definition: rpmpgp.h:936
union pgpPktSig_u * pgpPktSig
unsigned int pgpDigParamsAlgo(pgpDigParams digp, unsigned int algotype)
#define PGP_KEYID_LEN
Definition: rpmpgp.h:36
enum pgpSymkeyAlgo_e pgpSymkeyAlgo
struct pgpPktLdata_s pgpPktLdata
pgpDigParams pgpDigParamsFree(pgpDigParams digp)
int pgpPubkeyKeyID(const uint8_t *pkt, size_t pktlen, pgpKeyID_t keyid)
pgpTag_e
Definition: rpmpgp.h:48
pgpSymkeyAlgo_e
Definition: rpmpgp.h:202
enum pgpSubType_e pgpSubType
struct pgpPktEdata_s pgpPktEdata
const char * pgpDigParamsUserID(pgpDigParams digp)
struct pgpPktUid_s pgpPktUid
int pgpPrtParamsSubkeys(const uint8_t *pkts, size_t pktlen, pgpDigParams mainkey, pgpDigParams **subkeys, int *subkeysCount)
char * pgpIdentItem(pgpDigParams digp)
int pgpPubkeyFingerprint(const uint8_t *pkt, size_t pktlen, uint8_t **fp, size_t *fplen)
pgpSubType_e
Definition: rpmpgp.h:418
struct pgpPktPubkey_s pgpPktPubkey
struct pgpPktSigV4_s * pgpPktSigV4
enum pgpCurveId_e pgpCurveId
@ PGPCOMPRESSALGO_NONE
Definition: rpmpgp.h:233
@ PGPCOMPRESSALGO_BZIP2
Definition: rpmpgp.h:236
@ PGPCOMPRESSALGO_ZLIB
Definition: rpmpgp.h:235
@ PGPCOMPRESSALGO_ZIP
Definition: rpmpgp.h:234
@ PGPPUBKEYALGO_ELGAMAL
Definition: rpmpgp.h:173
@ PGPPUBKEYALGO_EC
Definition: rpmpgp.h:171
@ PGPPUBKEYALGO_EDDSA
Definition: rpmpgp.h:175
@ PGPPUBKEYALGO_RSA_ENCRYPT
Definition: rpmpgp.h:167
@ PGPPUBKEYALGO_ELGAMAL_ENCRYPT
Definition: rpmpgp.h:169
@ PGPPUBKEYALGO_RSA
Definition: rpmpgp.h:166
@ PGPPUBKEYALGO_ECDSA
Definition: rpmpgp.h:172
@ PGPPUBKEYALGO_DH
Definition: rpmpgp.h:174
@ PGPPUBKEYALGO_RSA_SIGN
Definition: rpmpgp.h:168
@ PGPPUBKEYALGO_DSA
Definition: rpmpgp.h:170
@ PGPCURVE_ED25519
Definition: rpmpgp.h:287
@ PGPCURVE_NIST_P_384
Definition: rpmpgp.h:283
@ PGPCURVE_NIST_P_521
Definition: rpmpgp.h:284
@ PGPCURVE_BRAINPOOL_P256R1
Definition: rpmpgp.h:285
@ PGPCURVE_BRAINPOOL_P512R1
Definition: rpmpgp.h:286
@ PGPCURVE_NIST_P_256
Definition: rpmpgp.h:282
@ PGPCURVE_CURVE25519
Definition: rpmpgp.h:288
@ PGPARMOR_PRIVKEY
Definition: rpmpgp.h:930
@ PGPARMOR_MESSAGE
Definition: rpmpgp.h:925
@ PGPARMOR_PUBKEY
Definition: rpmpgp.h:926
@ PGPARMOR_SIGNED_MESSAGE
Definition: rpmpgp.h:928
@ PGPARMOR_SIGNATURE
Definition: rpmpgp.h:927
@ PGPARMOR_FILE
Definition: rpmpgp.h:929
@ PGPARMOR_SECKEY
Definition: rpmpgp.h:931
@ PGPHASHALGO_SHA384
Definition: rpmpgp.h:270
@ PGPHASHALGO_SHA256
Definition: rpmpgp.h:269
@ PGPHASHALGO_HAVAL_5_160
Definition: rpmpgp.h:268
@ PGPHASHALGO_MD2
Definition: rpmpgp.h:266
@ PGPHASHALGO_RIPEMD160
Definition: rpmpgp.h:265
@ PGPHASHALGO_TIGER192
Definition: rpmpgp.h:267
@ PGPHASHALGO_SHA512
Definition: rpmpgp.h:271
@ PGPHASHALGO_MD5
Definition: rpmpgp.h:263
@ PGPHASHALGO_SHA224
Definition: rpmpgp.h:272
@ PGPHASHALGO_SHA1
Definition: rpmpgp.h:264
@ PGPSIGTYPE_CASUAL_CERT
Definition: rpmpgp.h:129
@ PGPSIGTYPE_STANDALONE
Definition: rpmpgp.h:124
@ PGPSIGTYPE_GENERIC_CERT
Definition: rpmpgp.h:125
@ PGPSIGTYPE_SUBKEY_BINDING
Definition: rpmpgp.h:133
@ PGPSIGTYPE_KEY_REVOKE
Definition: rpmpgp.h:135
@ PGPSIGTYPE_PERSONA_CERT
Definition: rpmpgp.h:127
@ PGPSIGTYPE_SIGNED_KEY
Definition: rpmpgp.h:134
@ PGPSIGTYPE_SUBKEY_REVOKE
Definition: rpmpgp.h:136
@ PGPSIGTYPE_TEXT
Definition: rpmpgp.h:123
@ PGPSIGTYPE_CERT_REVOKE
Definition: rpmpgp.h:137
@ PGPSIGTYPE_BINARY
Definition: rpmpgp.h:122
@ PGPSIGTYPE_TIMESTAMP
Definition: rpmpgp.h:138
@ PGPSIGTYPE_POSITIVE_CERT
Definition: rpmpgp.h:131
@ PGPARMORKEY_COMMENT
Definition: rpmpgp.h:938
@ PGPARMORKEY_MESSAGEID
Definition: rpmpgp.h:939
@ PGPARMORKEY_HASH
Definition: rpmpgp.h:940
@ PGPARMORKEY_CHARSET
Definition: rpmpgp.h:941
@ PGPARMORKEY_VERSION
Definition: rpmpgp.h:937
@ PGPTAG_COMPRESSED_DATA
Definition: rpmpgp.h:57
@ PGPTAG_PRIVATE_60
Definition: rpmpgp.h:68
@ PGPTAG_MARKER
Definition: rpmpgp.h:59
@ PGPTAG_SYMMETRIC_DATA
Definition: rpmpgp.h:58
@ PGPTAG_USER_ID
Definition: rpmpgp.h:62
@ PGPTAG_ENCRYPTED_MDC
Definition: rpmpgp.h:66
@ PGPTAG_SECRET_SUBKEY
Definition: rpmpgp.h:56
@ PGPTAG_PRIVATE_62
Definition: rpmpgp.h:70
@ PGPTAG_ONEPASS_SIGNATURE
Definition: rpmpgp.h:53
@ PGPTAG_TRUST
Definition: rpmpgp.h:61
@ PGPTAG_PUBLIC_KEY
Definition: rpmpgp.h:55
@ PGPTAG_RESERVED
Definition: rpmpgp.h:49
@ PGPTAG_COMMENT_OLD
Definition: rpmpgp.h:64
@ PGPTAG_PHOTOID
Definition: rpmpgp.h:65
@ PGPTAG_LITERAL_DATA
Definition: rpmpgp.h:60
@ PGPTAG_SIGNATURE
Definition: rpmpgp.h:51
@ PGPTAG_PUBLIC_SESSION_KEY
Definition: rpmpgp.h:50
@ PGPTAG_SYMMETRIC_SESSION_KEY
Definition: rpmpgp.h:52
@ PGPTAG_COMMENT
Definition: rpmpgp.h:69
@ PGPTAG_SECRET_KEY
Definition: rpmpgp.h:54
@ PGPTAG_PUBLIC_SUBKEY
Definition: rpmpgp.h:63
@ PGPTAG_MDC
Definition: rpmpgp.h:67
@ PGPTAG_CONTROL
Definition: rpmpgp.h:71
@ PGPSYMKEYALGO_DES_SK
Definition: rpmpgp.h:209
@ PGPSYMKEYALGO_BLOWFISH
Definition: rpmpgp.h:207
@ PGPSYMKEYALGO_PLAINTEXT
Definition: rpmpgp.h:203
@ PGPSYMKEYALGO_AES_192
Definition: rpmpgp.h:211
@ PGPSYMKEYALGO_NOENCRYPT
Definition: rpmpgp.h:214
@ PGPSYMKEYALGO_AES_256
Definition: rpmpgp.h:212
@ PGPSYMKEYALGO_TWOFISH
Definition: rpmpgp.h:213
@ PGPSYMKEYALGO_TRIPLE_DES
Definition: rpmpgp.h:205
@ PGPSYMKEYALGO_CAST5
Definition: rpmpgp.h:206
@ PGPSYMKEYALGO_SAFER
Definition: rpmpgp.h:208
@ PGPSYMKEYALGO_IDEA
Definition: rpmpgp.h:204
@ PGPSYMKEYALGO_AES_128
Definition: rpmpgp.h:210
@ PGPSUBTYPE_EMBEDDED_SIG
Definition: rpmpgp.h:442
@ PGPSUBTYPE_EXPORTABLE_CERT
Definition: rpmpgp.h:422
@ PGPSUBTYPE_ARR
Definition: rpmpgp.h:427
@ PGPSUBTYPE_NOTATION
Definition: rpmpgp.h:431
@ PGPSUBTYPE_ISSUER_KEYID
Definition: rpmpgp.h:430
@ PGPSUBTYPE_REVOCABLE
Definition: rpmpgp.h:425
@ PGPSUBTYPE_POLICY_URL
Definition: rpmpgp.h:437
@ PGPSUBTYPE_FEATURES
Definition: rpmpgp.h:441
@ PGPSUBTYPE_TRUST_SIG
Definition: rpmpgp.h:423
@ PGPSUBTYPE_PREFER_SYMKEY
Definition: rpmpgp.h:428
@ PGPSUBTYPE_SIG_EXPIRE_TIME
Definition: rpmpgp.h:421
@ PGPSUBTYPE_INTERNAL_104
Definition: rpmpgp.h:448
@ PGPSUBTYPE_SIGNER_USERID
Definition: rpmpgp.h:439
@ PGPSUBTYPE_PREFER_COMPRESS
Definition: rpmpgp.h:433
@ PGPSUBTYPE_KEY_EXPIRE_TIME
Definition: rpmpgp.h:426
@ PGPSUBTYPE_REVOKE_KEY
Definition: rpmpgp.h:429
@ PGPSUBTYPE_INTERNAL_101
Definition: rpmpgp.h:445
@ PGPSUBTYPE_PREFER_HASH
Definition: rpmpgp.h:432
@ PGPSUBTYPE_NONE
Definition: rpmpgp.h:419
@ PGPSUBTYPE_SIG_CREATE_TIME
Definition: rpmpgp.h:420
@ PGPSUBTYPE_REVOKE_REASON
Definition: rpmpgp.h:440
@ PGPSUBTYPE_KEYSERVER_PREFERS
Definition: rpmpgp.h:434
@ PGPSUBTYPE_CRITICAL
Definition: rpmpgp.h:456
@ PGPSUBTYPE_INTERNAL_110
Definition: rpmpgp.h:454
@ PGPSUBTYPE_INTERNAL_109
Definition: rpmpgp.h:453
@ PGPSUBTYPE_INTERNAL_108
Definition: rpmpgp.h:452
@ PGPSUBTYPE_INTERNAL_105
Definition: rpmpgp.h:449
@ PGPSUBTYPE_INTERNAL_100
Definition: rpmpgp.h:444
@ PGPSUBTYPE_PREFER_KEYSERVER
Definition: rpmpgp.h:435
@ PGPSUBTYPE_INTERNAL_107
Definition: rpmpgp.h:451
@ PGPSUBTYPE_REGEX
Definition: rpmpgp.h:424
@ PGPSUBTYPE_PRIMARY_USERID
Definition: rpmpgp.h:436
@ PGPSUBTYPE_INTERNAL_102
Definition: rpmpgp.h:446
@ PGPSUBTYPE_INTERNAL_103
Definition: rpmpgp.h:447
@ PGPSUBTYPE_INTERNAL_106
Definition: rpmpgp.h:450
@ PGPSUBTYPE_KEY_FLAGS
Definition: rpmpgp.h:438
struct pgpPktSymkey_s pgpPktSymkey
uint8_t version
Definition: rpmpgp.h:629
uint8_t pubkey_algo
Definition: rpmpgp.h:632
pgpTime_t time
Definition: rpmpgp.h:630
uint8_t valid[2]
Definition: rpmpgp.h:631
uint8_t pubkey_algo
Definition: rpmpgp.h:674
pgpTime_t time
Definition: rpmpgp.h:673
uint8_t version
Definition: rpmpgp.h:672
uint8_t sigtype
Definition: rpmpgp.h:549
uint8_t pubkey_algo
Definition: rpmpgp.h:551
pgpKeyID_t signid
Definition: rpmpgp.h:552
uint8_t version
Definition: rpmpgp.h:548
uint8_t hash_algo
Definition: rpmpgp.h:550
uint8_t algo
Definition: rpmpgp.h:111
uint8_t version
Definition: rpmpgp.h:109
pgpKeyID_t keyid
Definition: rpmpgp.h:110
uint8_t version
Definition: rpmpgp.h:313
pgpTime_t time
Definition: rpmpgp.h:316
pgpKeyID_t signid
Definition: rpmpgp.h:317
uint8_t signhash16[2]
Definition: rpmpgp.h:320
uint8_t sigtype
Definition: rpmpgp.h:315
uint8_t hashlen
Definition: rpmpgp.h:314
uint8_t pubkey_algo
Definition: rpmpgp.h:318
uint8_t hash_algo
Definition: rpmpgp.h:319
uint8_t hash_algo
Definition: rpmpgp.h:348
uint8_t version
Definition: rpmpgp.h:345
uint8_t hashlen[2]
Definition: rpmpgp.h:349
uint8_t sigtype
Definition: rpmpgp.h:346
uint8_t pubkey_algo
Definition: rpmpgp.h:347
uint8_t version
Definition: rpmpgp.h:513
pgpPktSymkey symkey
Definition: rpmpgp.h:902
pgpPktTrust tdata
Definition: rpmpgp.h:909
pgpPktPubkey pubkey
Definition: rpmpgp.h:900
pgpPktUid uid
Definition: rpmpgp.h:910
pgpPktCdata cdata
Definition: rpmpgp.h:905
pgpPktSig sig
Definition: rpmpgp.h:901
pgpPktOnepass onepass
Definition: rpmpgp.h:903
pgpPktEdata edata
Definition: rpmpgp.h:906
pgpPktLdata ldata
Definition: rpmpgp.h:908
pgpPktKey key
Definition: rpmpgp.h:904