249 #define HIDE_CKSUM 255
250 #define HIDE_SHA1 254
287 if (memcmp(my_sha1, got_sha1, 20) != 0)
310 got_cksum = ((unsigned)
buf[0] << 8) +
buf[1];
328 if (my_cksum != got_cksum)
376 px_debug(
"unknown cipher algo=%d", cipher_algo);
459 const uint8 *psw,
int psw_len,
int pubtype)
467 int got_main_key = 0;
519 px_debug(
"unknown/unexpected packet: %d", tag);
566 const uint8 *
key,
int key_len,
int pubtype)
static void PGresult * res
void err(int eval, const char *fmt,...)
int pullf_read_fixed(PullFilter *src, int len, uint8 *dst)
int pullf_create(PullFilter **pf_p, const PullFilterOps *op, void *init_arg, PullFilter *src)
int pullf_create_mbuf_reader(PullFilter **mp_p, MBuf *src)
void pullf_free(PullFilter *pf)
void pfree(void *pointer)
void * palloc0(Size size)
void pgp_cfb_free(PGP_CFB *ctx)
int pgp_cfb_create(PGP_CFB **ctx_p, int algo, const uint8 *key, int key_len, int resync, uint8 *iv)
int pgp_parse_pkt_hdr(PullFilter *src, uint8 *tag, int *len_p, int allow_ctx)
int pgp_expect_packet_end(PullFilter *pkt)
struct PullFilterOps pgp_decrypt_filter
int pgp_skip_packet(PullFilter *pkt)
int pgp_create_pkt_reader(PullFilter **pf_p, PullFilter *src, int len, int pkttype, PGP_Context *ctx)
int pgp_mpi_free(PGP_MPI *mpi)
int pgp_mpi_hash(PX_MD *md, PGP_MPI *n)
int pgp_mpi_read(PullFilter *src, PGP_MPI **mpi)
unsigned pgp_mpi_cksum(unsigned cksum, PGP_MPI *n)
static int calc_key_id(PGP_PubKey *pk)
static int process_secret_key(PullFilter *pkt, PGP_PubKey **pk_p, const uint8 *key, int key_len)
int pgp_key_alloc(PGP_PubKey **pk_p)
static int internal_read_key(PullFilter *src, PGP_PubKey **pk_p, const uint8 *psw, int psw_len, int pubtype)
static int check_key_cksum(PullFilter *src, PGP_PubKey *pk)
void pgp_key_free(PGP_PubKey *pk)
int pgp_set_pubkey(PGP_Context *ctx, MBuf *keypkt, const uint8 *key, int key_len, int pubtype)
static int check_key_sha1(PullFilter *src, PGP_PubKey *pk)
int _pgp_read_public_key(PullFilter *pkt, PGP_PubKey **pk_p)
int pgp_s2k_process(PGP_S2K *s2k, int cipher, const uint8 *key, int key_len)
int pgp_s2k_read(PullFilter *src, PGP_S2K *s2k)
int pgp_get_cipher_block_size(int code)
int pgp_load_digest(int code, PX_MD **res)
@ PGP_PUB_RSA_ENCRYPT_SIGN
void px_debug(const char *fmt,...)
void px_memset(void *ptr, int c, size_t len)
#define PXE_PGP_EXPECT_PUBLIC_KEY
#define px_md_finish(md, buf)
#define PXE_PGP_UNEXPECTED_PKT
#define PXE_PGP_MULTIPLE_KEYS
#define PXE_PGP_NO_USABLE_KEY
#define PXE_PGP_EXPECT_SECRET_KEY
#define PXE_PGP_NEED_SECRET_PSW
#define PXE_PGP_MULTIPLE_SUBKEYS
#define px_md_update(md, data, dlen)
#define PXE_PGP_UNSUPPORTED_CIPHER
#define PXE_PGP_UNKNOWN_PUBALGO
#define PXE_PGP_KEYPKT_CORRUPT
#define PXE_PGP_NOT_V4_KEYPKT
static unsigned hash(unsigned *uv, int n)
struct PGP_PubKey::@0::@3 rsa
struct PGP_PubKey::@0::@2 elg
struct PGP_PubKey::@0::@4 dsa