PostgreSQL Source Code
git master
|
Go to the source code of this file.
Data Structures | |
struct | EncStat |
struct | PktStreamStat |
Macros | |
#define | MDC_DIGEST_LEN 20 |
#define | STREAM_ID 0xE0 |
#define | STREAM_BLOCK_SHIFT 14 |
#define | ENCBUF 8192 |
Functions | |
static uint8 * | render_newlen (uint8 *h, int len) |
static int | write_tag_only (PushFilter *dst, int tag) |
static int | write_normal_header (PushFilter *dst, int tag, int len) |
static int | mdc_init (PushFilter *dst, void *init_arg, void **priv_p) |
static int | mdc_write (PushFilter *dst, void *priv, const uint8 *data, int len) |
static int | mdc_flush (PushFilter *dst, void *priv) |
static void | mdc_free (void *priv) |
static int | encrypt_init (PushFilter *next, void *init_arg, void **priv_p) |
static int | encrypt_process (PushFilter *next, void *priv, const uint8 *data, int len) |
static void | encrypt_free (void *priv) |
static int | pkt_stream_init (PushFilter *next, void *init_arg, void **priv_p) |
static int | pkt_stream_process (PushFilter *next, void *priv, const uint8 *data, int len) |
static int | pkt_stream_flush (PushFilter *next, void *priv) |
static void | pkt_stream_free (void *priv) |
int | pgp_create_pkt_writer (PushFilter *dst, int tag, PushFilter **res_p) |
static int | crlf_process (PushFilter *dst, void *priv, const uint8 *data, int len) |
static int | init_litdata_packet (PushFilter **pf_res, PGP_Context *ctx, PushFilter *dst) |
static int | init_compress (PushFilter **pf_res, PGP_Context *ctx, PushFilter *dst) |
static int | init_encdata_packet (PushFilter **pf_res, PGP_Context *ctx, PushFilter *dst) |
static int | write_prefix (PGP_Context *ctx, PushFilter *dst) |
static int | symencrypt_sesskey (PGP_Context *ctx, uint8 *dst) |
static int | write_symenc_sesskey (PGP_Context *ctx, PushFilter *dst) |
static int | init_s2k_key (PGP_Context *ctx) |
static int | init_sess_key (PGP_Context *ctx) |
int | pgp_encrypt (PGP_Context *ctx, MBuf *src, MBuf *dst) |
Variables | |
static const PushFilterOps | mdc_filter |
static const PushFilterOps | encrypt_filter |
static const PushFilterOps | pkt_stream_filter |
static const PushFilterOps | crlf_filter |
#define ENCBUF 8192 |
Definition at line 150 of file pgp-encrypt.c.
#define MDC_DIGEST_LEN 20 |
Definition at line 40 of file pgp-encrypt.c.
#define STREAM_BLOCK_SHIFT 14 |
Definition at line 42 of file pgp-encrypt.c.
#define STREAM_ID 0xE0 |
Definition at line 41 of file pgp-encrypt.c.
|
static |
|
static |
Definition at line 214 of file pgp-encrypt.c.
References EncStat::ciph, pfree(), pgp_cfb_free(), and px_memset().
|
static |
Definition at line 158 of file pgp-encrypt.c.
References EncStat::ciph, PGP_Context::cipher_algo, PGP_Context::disable_mdc, ENCBUF, next, palloc0(), pgp_cfb_create(), pushf_write(), res, PGP_Context::sess_key, and PGP_Context::sess_key_len.
|
static |
Definition at line 189 of file pgp-encrypt.c.
References EncStat::buf, EncStat::ciph, data, ENCBUF, len, next, pgp_cfb_encrypt(), pushf_write(), and res.
|
static |
Definition at line 429 of file pgp-encrypt.c.
References PGP_Context::compress_algo, pgp_compress_filter(), PGP_PKT_COMPRESSED_DATA, pkt_stream_filter, pushf_create(), pushf_free(), pushf_write(), res, type, and write_tag_only().
Referenced by pgp_encrypt().
|
static |
Definition at line 457 of file pgp-encrypt.c.
References PGP_Context::disable_mdc, PGP_PKT_SYMENCRYPTED_DATA, PGP_PKT_SYMENCRYPTED_DATA_MDC, pkt_stream_filter, pushf_create(), res, and write_tag_only().
Referenced by pgp_encrypt().
|
static |
Definition at line 374 of file pgp-encrypt.c.
References PGP_PKT_LITERAL_DATA, pkt_stream_filter, pushf_create(), pushf_free(), pushf_write(), res, PGP_Context::text_mode, type, PGP_Context::unicode_mode, and write_tag_only().
Referenced by pgp_encrypt().
|
static |
Definition at line 562 of file pgp-encrypt.c.
References PGP_Context::cipher_algo, pgp_s2k_fill(), pgp_s2k_process(), res, PGP_Context::s2k, PGP_Context::s2k_cipher_algo, PGP_Context::s2k_count, PGP_Context::s2k_digest_algo, PGP_Context::s2k_mode, PGP_Context::sym_key, and PGP_Context::sym_key_len.
Referenced by pgp_encrypt().
|
static |
Definition at line 578 of file pgp-encrypt.c.
References PGP_Context::cipher_algo, PGP_S2K::key, PGP_S2K::key_len, pg_strong_random(), pgp_get_cipher_key_size(), PGP_Context::pub_key, PXE_NO_RANDOM, PGP_Context::s2k, PGP_Context::sess_key, PGP_Context::sess_key_len, and PGP_Context::use_sess_key.
Referenced by pgp_encrypt().
|
static |
Definition at line 115 of file pgp-encrypt.c.
References MDC_DIGEST_LEN, pushf_write(), px_md_finish, px_md_update, px_memset(), and res.
|
static |
|
static |
Definition at line 92 of file pgp-encrypt.c.
References PGP_DIGEST_SHA1, pgp_load_digest(), and res.
|
static |
Definition at line 106 of file pgp-encrypt.c.
References data, len, pushf_write(), and px_md_update.
int pgp_create_pkt_writer | ( | PushFilter * | dst, |
int | tag, | ||
PushFilter ** | res_p | ||
) |
Definition at line 311 of file pgp-encrypt.c.
References pkt_stream_filter, pushf_create(), res, and write_tag_only().
Referenced by pgp_write_pubenc_sesskey().
int pgp_encrypt | ( | PGP_Context * | ctx, |
MBuf * | src, | ||
MBuf * | dst | ||
) |
Definition at line 599 of file pgp-encrypt.c.
References buf, PGP_Context::compress_algo, PGP_Context::compress_level, PGP_Context::convert_crlf, crlf_filter, PGP_Context::disable_mdc, encrypt_filter, init_compress(), init_encdata_packet(), init_litdata_packet(), init_s2k_key(), init_sess_key(), len, mbuf_avail(), mbuf_grab(), mdc_filter, pgp_write_pubenc_sesskey(), PGP_Context::pub_key, pushf_create(), pushf_create_mbuf_writer(), pushf_flush(), pushf_free_all(), pushf_write(), PXE_ARGUMENT_ERROR, res, PGP_Context::sym_key, PGP_Context::text_mode, write_prefix(), and write_symenc_sesskey().
Referenced by encrypt_internal().
|
static |
Definition at line 278 of file pgp-encrypt.c.
References PktStreamStat::final_done, next, pushf_write(), render_newlen(), and res.
|
static |
|
static |
Definition at line 239 of file pgp-encrypt.c.
References PktStreamStat::final_done, palloc(), PktStreamStat::pkt_block, and STREAM_BLOCK_SHIFT.
|
static |
Definition at line 252 of file pgp-encrypt.c.
References data, PktStreamStat::final_done, len, next, PktStreamStat::pkt_block, pushf_write(), PXE_BUG, render_newlen(), res, STREAM_BLOCK_SHIFT, and STREAM_ID.
Definition at line 45 of file pgp-encrypt.c.
References len.
Referenced by pkt_stream_flush(), pkt_stream_process(), and write_normal_header().
|
static |
Definition at line 501 of file pgp-encrypt.c.
References PGP_Context::cipher_algo, PGP_S2K::key, PGP_S2K::key_len, pgp_cfb_create(), pgp_cfb_encrypt(), pgp_cfb_free(), res, PGP_Context::s2k, PGP_Context::s2k_cipher_algo, PGP_Context::sess_key, and PGP_Context::sess_key_len.
Referenced by write_symenc_sesskey().
|
static |
Definition at line 76 of file pgp-encrypt.c.
References len, pushf_write(), and render_newlen().
Referenced by write_symenc_sesskey().
|
static |
Definition at line 478 of file pgp-encrypt.c.
References PGP_Context::cipher_algo, pg_strong_random(), pgp_get_cipher_block_size(), PGP_MAX_BLOCK, pushf_write(), px_memset(), PXE_NO_RANDOM, and res.
Referenced by pgp_encrypt().
|
static |
Definition at line 521 of file pgp-encrypt.c.
References PGP_S2K::digest_algo, PGP_S2K::iter, PGP_S2K::mode, PGP_PKT_SYMENCRYPTED_SESSKEY, pushf_write(), px_memset(), res, PGP_Context::s2k, PGP_Context::s2k_cipher_algo, PGP_S2K::salt, symencrypt_sesskey(), PGP_Context::use_sess_key, and write_normal_header().
Referenced by pgp_encrypt().
|
static |
Definition at line 68 of file pgp-encrypt.c.
References pushf_write().
Referenced by init_compress(), init_encdata_packet(), init_litdata_packet(), and pgp_create_pkt_writer().
|
static |
Definition at line 366 of file pgp-encrypt.c.
Referenced by pgp_encrypt().
|
static |
Definition at line 224 of file pgp-encrypt.c.
Referenced by pgp_encrypt().
|
static |
Definition at line 142 of file pgp-encrypt.c.
Referenced by pgp_encrypt().
|
static |
Definition at line 306 of file pgp-encrypt.c.
Referenced by init_compress(), init_encdata_packet(), init_litdata_packet(), and pgp_create_pkt_writer().