22#include <rpm/rpmcrypto.h>
30typedef struct pgpDigParams_s * pgpDigParams;
35#define PGP_KEYID_LEN 8
69#define PGPTAG_PHOTOID PGPTAG_USER_ATTRIBUTE
232 PGPARMOR_ERR_CRC_CHECK = -7,
233 PGPARMOR_ERR_BODY_DECODE = -6,
234 PGPARMOR_ERR_CRC_DECODE = -5,
235 PGPARMOR_ERR_NO_END_PGP = -4,
236 PGPARMOR_ERR_UNKNOWN_PREAMBLE_TAG = -3,
237 PGPARMOR_ERR_UNKNOWN_ARMOR_TYPE = -2,
238 PGPARMOR_ERR_NO_BEGIN_PGP = -1,
239#define PGPARMOR_ERROR PGPARMOR_ERR_NO_BEGIN_PGP
260typedef enum pgpValType_e {
262 PGPVAL_ARMORBLOCK = 2,
266 PGPVAL_PUBKEYALGO = 6,
267 PGPVAL_SYMKEYALGO = 7,
268 PGPVAL_COMPRESSALGO = 8,
270 PGPVAL_SERVERPREFS = 10,
290 uint8_t **fp,
size_t *fplen);
309int pgpPrtParams(
const uint8_t *pkts,
size_t pktlen,
unsigned int pkttype,
322 pgpDigParams * ret,
char **lints);
334 pgpDigParams mainkey, pgpDigParams **subkeys,
344pgpArmor
pgpReadPkts(
const char * fn, uint8_t ** pkt,
size_t * pktlen);
353pgpArmor
pgpParsePkts(
const char *armor, uint8_t ** pkt,
size_t * pktlen);
543rpmRC pgpPubkeyMerge(
const uint8_t *pkts1,
size_t pkts1len,
const uint8_t *pkts2,
size_t pkts2len, uint8_t **pktsm,
size_t *pktsmlen,
int flags);
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
pgpCompressAlgo_e
Definition rpmpgp.h:140
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)
pgpPubkeyAlgo_e
Definition rpmpgp.h:99
int pgpDigParamsVersion(pgpDigParams digp)
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)
rpmRC pgpPubKeyLint(const uint8_t *pkts, size_t pktslen, char **explanation)
rpmRC pgpPubkeyMerge(const uint8_t *pkts1, size_t pkts1len, const uint8_t *pkts2, size_t pkts2len, uint8_t **pktsm, size_t *pktsmlen, int flags)
pgpCurveId_e
Definition rpmpgp.h:172
enum pgpCompressAlgo_e pgpCompressAlgo
pgpArmor_e
Definition rpmpgp.h:231
pgpHashAlgo_e
Definition rpmpgp.h:150
pgpSigType_e
Definition rpmpgp.h:74
int pgpDigParamsCmp(pgpDigParams p1, pgpDigParams p2)
char * pgpArmorWrap(int atype, const unsigned char *s, size_t ns)
pgpArmorKey_e
Definition rpmpgp.h:252
unsigned int pgpDigParamsAlgo(pgpDigParams digp, unsigned int algotype)
#define PGP_KEYID_LEN
Definition rpmpgp.h:35
enum pgpSymkeyAlgo_e pgpSymkeyAlgo
pgpDigParams pgpDigParamsFree(pgpDigParams digp)
int pgpPubkeyKeyID(const uint8_t *pkt, size_t pktlen, pgpKeyID_t keyid)
pgpTag_e
Definition rpmpgp.h:42
pgpSymkeyAlgo_e
Definition rpmpgp.h:119
enum pgpSubType_e pgpSubType
const char * pgpDigParamsUserID(pgpDigParams digp)
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:185
enum pgpCurveId_e pgpCurveId
@ PGPCOMPRESSALGO_NONE
Definition rpmpgp.h:141
@ PGPCOMPRESSALGO_BZIP2
Definition rpmpgp.h:144
@ PGPCOMPRESSALGO_ZLIB
Definition rpmpgp.h:143
@ PGPCOMPRESSALGO_ZIP
Definition rpmpgp.h:142
@ PGPPUBKEYALGO_ELGAMAL
Definition rpmpgp.h:107
@ PGPPUBKEYALGO_EC
Definition rpmpgp.h:105
@ PGPPUBKEYALGO_X25519
Definition rpmpgp.h:110
@ PGPPUBKEYALGO_EDDSA
Definition rpmpgp.h:109
@ PGPPUBKEYALGO_X448
Definition rpmpgp.h:111
@ PGPPUBKEYALGO_RSA_ENCRYPT
Definition rpmpgp.h:101
@ PGPPUBKEYALGO_ELGAMAL_ENCRYPT
Definition rpmpgp.h:103
@ PGPPUBKEYALGO_RSA
Definition rpmpgp.h:100
@ PGPPUBKEYALGO_ECDSA
Definition rpmpgp.h:106
@ PGPPUBKEYALGO_DH
Definition rpmpgp.h:108
@ PGPPUBKEYALGO_RSA_SIGN
Definition rpmpgp.h:102
@ PGPPUBKEYALGO_ED448
Definition rpmpgp.h:113
@ PGPPUBKEYALGO_DSA
Definition rpmpgp.h:104
@ PGPPUBKEYALGO_ED25519
Definition rpmpgp.h:112
@ PGPCURVE_ED25519
Definition rpmpgp.h:178
@ PGPCURVE_NIST_P_384
Definition rpmpgp.h:174
@ PGPCURVE_NIST_P_521
Definition rpmpgp.h:175
@ PGPCURVE_BRAINPOOL_P256R1
Definition rpmpgp.h:176
@ PGPCURVE_BRAINPOOL_P512R1
Definition rpmpgp.h:177
@ PGPCURVE_NIST_P_256
Definition rpmpgp.h:173
@ PGPCURVE_CURVE25519
Definition rpmpgp.h:179
@ PGPARMOR_PRIVKEY
Definition rpmpgp.h:246
@ PGPARMOR_MESSAGE
Definition rpmpgp.h:241
@ PGPARMOR_PUBKEY
Definition rpmpgp.h:242
@ PGPARMOR_SIGNED_MESSAGE
Definition rpmpgp.h:244
@ PGPARMOR_SIGNATURE
Definition rpmpgp.h:243
@ PGPARMOR_FILE
Definition rpmpgp.h:245
@ PGPARMOR_SECKEY
Definition rpmpgp.h:247
@ PGPHASHALGO_SHA384
Definition rpmpgp.h:158
@ PGPHASHALGO_SHA256
Definition rpmpgp.h:157
@ PGPHASHALGO_HAVAL_5_160
Definition rpmpgp.h:156
@ PGPHASHALGO_MD2
Definition rpmpgp.h:154
@ PGPHASHALGO_RIPEMD160
Definition rpmpgp.h:153
@ PGPHASHALGO_TIGER192
Definition rpmpgp.h:155
@ PGPHASHALGO_SHA3_512
Definition rpmpgp.h:163
@ PGPHASHALGO_SHA512
Definition rpmpgp.h:159
@ PGPHASHALGO_MD5
Definition rpmpgp.h:151
@ PGPHASHALGO_SHA3_256
Definition rpmpgp.h:161
@ PGPHASHALGO_SHA224
Definition rpmpgp.h:160
@ PGPHASHALGO_SHA1
Definition rpmpgp.h:152
@ PGPSIGTYPE_CASUAL_CERT
Definition rpmpgp.h:82
@ PGPSIGTYPE_STANDALONE
Definition rpmpgp.h:77
@ PGPSIGTYPE_GENERIC_CERT
Definition rpmpgp.h:78
@ PGPSIGTYPE_SUBKEY_BINDING
Definition rpmpgp.h:86
@ PGPSIGTYPE_KEY_REVOKE
Definition rpmpgp.h:89
@ PGPSIGTYPE_THIRD_PARTY
Definition rpmpgp.h:93
@ PGPSIGTYPE_PERSONA_CERT
Definition rpmpgp.h:80
@ PGPSIGTYPE_SIGNED_KEY
Definition rpmpgp.h:88
@ PGPSIGTYPE_SUBKEY_REVOKE
Definition rpmpgp.h:90
@ PGPSIGTYPE_TEXT
Definition rpmpgp.h:76
@ PGPSIGTYPE_PRIMARY_BINDING
Definition rpmpgp.h:87
@ PGPSIGTYPE_CERT_REVOKE
Definition rpmpgp.h:91
@ PGPSIGTYPE_BINARY
Definition rpmpgp.h:75
@ PGPSIGTYPE_TIMESTAMP
Definition rpmpgp.h:92
@ PGPSIGTYPE_POSITIVE_CERT
Definition rpmpgp.h:84
@ PGPARMORKEY_COMMENT
Definition rpmpgp.h:254
@ PGPARMORKEY_MESSAGEID
Definition rpmpgp.h:255
@ PGPARMORKEY_HASH
Definition rpmpgp.h:256
@ PGPARMORKEY_CHARSET
Definition rpmpgp.h:257
@ PGPARMORKEY_VERSION
Definition rpmpgp.h:253
@ PGPTAG_COMPRESSED_DATA
Definition rpmpgp.h:51
@ PGPTAG_PRIVATE_60
Definition rpmpgp.h:63
@ PGPTAG_MARKER
Definition rpmpgp.h:53
@ PGPTAG_USER_ATTRIBUTE
Definition rpmpgp.h:59
@ PGPTAG_SYMMETRIC_DATA
Definition rpmpgp.h:52
@ PGPTAG_USER_ID
Definition rpmpgp.h:56
@ PGPTAG_ENCRYPTED_MDC
Definition rpmpgp.h:60
@ PGPTAG_PADDING
Definition rpmpgp.h:62
@ PGPTAG_SECRET_SUBKEY
Definition rpmpgp.h:50
@ PGPTAG_PRIVATE_62
Definition rpmpgp.h:65
@ PGPTAG_ONEPASS_SIGNATURE
Definition rpmpgp.h:47
@ PGPTAG_TRUST
Definition rpmpgp.h:55
@ PGPTAG_PUBLIC_KEY
Definition rpmpgp.h:49
@ PGPTAG_RESERVED
Definition rpmpgp.h:43
@ PGPTAG_COMMENT_OLD
Definition rpmpgp.h:58
@ PGPTAG_LITERAL_DATA
Definition rpmpgp.h:54
@ PGPTAG_SIGNATURE
Definition rpmpgp.h:45
@ PGPTAG_PUBLIC_SESSION_KEY
Definition rpmpgp.h:44
@ PGPTAG_SYMMETRIC_SESSION_KEY
Definition rpmpgp.h:46
@ PGPTAG_COMMENT
Definition rpmpgp.h:64
@ PGPTAG_SECRET_KEY
Definition rpmpgp.h:48
@ PGPTAG_PUBLIC_SUBKEY
Definition rpmpgp.h:57
@ PGPTAG_MDC
Definition rpmpgp.h:61
@ PGPTAG_CONTROL
Definition rpmpgp.h:66
@ PGPSYMKEYALGO_DES_SK
Definition rpmpgp.h:126
@ PGPSYMKEYALGO_BLOWFISH
Definition rpmpgp.h:124
@ PGPSYMKEYALGO_CAMELLIA_192
Definition rpmpgp.h:132
@ PGPSYMKEYALGO_PLAINTEXT
Definition rpmpgp.h:120
@ PGPSYMKEYALGO_AES_192
Definition rpmpgp.h:128
@ PGPSYMKEYALGO_CAMELLIA_256
Definition rpmpgp.h:133
@ PGPSYMKEYALGO_NOENCRYPT
Definition rpmpgp.h:134
@ PGPSYMKEYALGO_AES_256
Definition rpmpgp.h:129
@ PGPSYMKEYALGO_TWOFISH
Definition rpmpgp.h:130
@ PGPSYMKEYALGO_TRIPLE_DES
Definition rpmpgp.h:122
@ PGPSYMKEYALGO_CAMELLIA_128
Definition rpmpgp.h:131
@ PGPSYMKEYALGO_CAST5
Definition rpmpgp.h:123
@ PGPSYMKEYALGO_SAFER
Definition rpmpgp.h:125
@ PGPSYMKEYALGO_IDEA
Definition rpmpgp.h:121
@ PGPSYMKEYALGO_AES_128
Definition rpmpgp.h:127
@ PGPSUBTYPE_EMBEDDED_SIG
Definition rpmpgp.h:209
@ PGPSUBTYPE_EXPORTABLE_CERT
Definition rpmpgp.h:189
@ PGPSUBTYPE_ARR
Definition rpmpgp.h:194
@ PGPSUBTYPE_NOTATION
Definition rpmpgp.h:198
@ PGPSUBTYPE_ISSUER_FINGERPRINT
Definition rpmpgp.h:210
@ PGPSUBTYPE_ISSUER_KEYID
Definition rpmpgp.h:197
@ PGPSUBTYPE_PFERER_AEAD
Definition rpmpgp.h:212
@ PGPSUBTYPE_REVOCABLE
Definition rpmpgp.h:192
@ PGPSUBTYPE_POLICY_URL
Definition rpmpgp.h:204
@ PGPSUBTYPE_FEATURES
Definition rpmpgp.h:208
@ PGPSUBTYPE_TRUST_SIG
Definition rpmpgp.h:190
@ PGPSUBTYPE_PREFER_SYMKEY
Definition rpmpgp.h:195
@ PGPSUBTYPE_SIG_EXPIRE_TIME
Definition rpmpgp.h:188
@ PGPSUBTYPE_INTERNAL_104
Definition rpmpgp.h:218
@ PGPSUBTYPE_SIGNER_USERID
Definition rpmpgp.h:206
@ PGPSUBTYPE_PREFER_COMPRESS
Definition rpmpgp.h:200
@ PGPSUBTYPE_KEY_EXPIRE_TIME
Definition rpmpgp.h:193
@ PGPSUBTYPE_REVOKE_KEY
Definition rpmpgp.h:196
@ PGPSUBTYPE_INTERNAL_101
Definition rpmpgp.h:215
@ PGPSUBTYPE_PREFER_HASH
Definition rpmpgp.h:199
@ PGPSUBTYPE_NONE
Definition rpmpgp.h:186
@ PGPSUBTYPE_SIG_CREATE_TIME
Definition rpmpgp.h:187
@ PGPSUBTYPE_REVOKE_REASON
Definition rpmpgp.h:207
@ PGPSUBTYPE_KEYSERVER_PREFERS
Definition rpmpgp.h:201
@ PGPSUBTYPE_CRITICAL
Definition rpmpgp.h:226
@ PGPSUBTYPE_INTERNAL_110
Definition rpmpgp.h:224
@ PGPSUBTYPE_INTERNAL_109
Definition rpmpgp.h:223
@ PGPSUBTYPE_INTERNAL_108
Definition rpmpgp.h:222
@ PGPSUBTYPE_INTERNAL_105
Definition rpmpgp.h:219
@ PGPSUBTYPE_INTERNAL_100
Definition rpmpgp.h:214
@ PGPSUBTYPE_PREFER_KEYSERVER
Definition rpmpgp.h:202
@ PGPSUBTYPE_INTERNAL_107
Definition rpmpgp.h:221
@ PGPSUBTYPE_INTREC_FINGERPRINT
Definition rpmpgp.h:211
@ PGPSUBTYPE_REGEX
Definition rpmpgp.h:191
@ PGPSUBTYPE_PRIMARY_USERID
Definition rpmpgp.h:203
@ PGPSUBTYPE_INTERNAL_102
Definition rpmpgp.h:216
@ PGPSUBTYPE_INTERNAL_103
Definition rpmpgp.h:217
@ PGPSUBTYPE_INTERNAL_106
Definition rpmpgp.h:220
@ PGPSUBTYPE_KEY_FLAGS
Definition rpmpgp.h:205