58 memcpy(keyid_buf, pk->
key_id, 8);
87 static const char hextbl[] =
"0123456789ABCDEF";
95 for (
i = 0;
i < 8;
i++)
98 *dst++ =
hextbl[(
c >> 4) & 0x0F];
106 {0, 0, 0, 0, 0, 0, 0, 0};
124 int got_main_key = 0;
189 if (
res < 0 || got_data)
201 if (got_pub_key && got_pubenc_key)
207 if (got_pubenc_key > 1)
215 if (got_pubenc_key || got_pub_key)
217 if (memcmp(keyid_buf,
any_key, 8) == 0)
219 memcpy(dst,
"ANYKEY", 7);
225 else if (got_symenc_key)
227 memcpy(dst,
"SYMKEY", 7);
static void PGresult * res
void err(int eval, const char *fmt,...)
int pullf_read_fixed(PullFilter *src, int len, uint8 *dst)
int pullf_create_mbuf_reader(PullFilter **mp_p, MBuf *src)
void pullf_free(PullFilter *pf)
int pgp_parse_pkt_hdr(PullFilter *src, uint8 *tag, int *len_p, int allow_ctx)
int pgp_skip_packet(PullFilter *pkt)
int pgp_create_pkt_reader(PullFilter **pf_p, PullFilter *src, int len, int pkttype, PGP_Context *ctx)
static const uint8 any_key[]
static int read_pubkey_keyid(PullFilter *pkt, uint8 *keyid_buf)
static const char hextbl[]
static int print_key(uint8 *keyid, char *dst)
static int read_pubenc_keyid(PullFilter *pkt, uint8 *keyid_buf)
int pgp_get_keyid(MBuf *pgp_data, char *dst)
void pgp_key_free(PGP_PubKey *pk)
int _pgp_read_public_key(PullFilter *pkt, PGP_PubKey **pk_p)
@ PGP_PKT_SYMENCRYPTED_DATA
@ PGP_PKT_SYMENCRYPTED_SESSKEY
@ PGP_PKT_SYMENCRYPTED_DATA_MDC
@ PGP_PKT_PUBENCRYPTED_SESSKEY
@ PGP_PUB_RSA_ENCRYPT_SIGN
#define PXE_PGP_MULTIPLE_KEYS
#define PXE_PGP_NO_USABLE_KEY
#define PXE_PGP_CORRUPT_DATA