PostgreSQL Source Code
git master
|
Go to the source code of this file.
Macros | |
#define | HIDE_CLEAR 0 |
#define | HIDE_CKSUM 255 |
#define | HIDE_SHA1 254 |
Functions | |
int | pgp_key_alloc (PGP_PubKey **pk_p) |
void | pgp_key_free (PGP_PubKey *pk) |
static int | calc_key_id (PGP_PubKey *pk) |
int | _pgp_read_public_key (PullFilter *pkt, PGP_PubKey **pk_p) |
static int | check_key_sha1 (PullFilter *src, PGP_PubKey *pk) |
static int | check_key_cksum (PullFilter *src, PGP_PubKey *pk) |
static int | process_secret_key (PullFilter *pkt, PGP_PubKey **pk_p, const uint8 *key, int key_len) |
static int | internal_read_key (PullFilter *src, PGP_PubKey **pk_p, const uint8 *psw, int psw_len, int pubtype) |
int | pgp_set_pubkey (PGP_Context *ctx, MBuf *keypkt, const uint8 *key, int key_len, int pubtype) |
#define HIDE_CKSUM 255 |
Definition at line 249 of file pgp-pubkey.c.
#define HIDE_CLEAR 0 |
Definition at line 248 of file pgp-pubkey.c.
#define HIDE_SHA1 254 |
Definition at line 250 of file pgp-pubkey.c.
int _pgp_read_public_key | ( | PullFilter * | pkt, |
PGP_PubKey ** | pk_p | ||
) |
Definition at line 158 of file pgp-pubkey.c.
References PGP_PubKey::algo, calc_key_id(), PGP_PubKey::can_encrypt, PGP_PubKey::dsa, PGP_PubKey::elg, GETBYTE, pgp_key_alloc(), pgp_key_free(), pgp_mpi_read(), PGP_PUB_DSA_SIGN, PGP_PUB_ELG_ENCRYPT, PGP_PUB_RSA_ENCRYPT, PGP_PUB_RSA_ENCRYPT_SIGN, PGP_PUB_RSA_SIGN, PGP_PubKey::pub, pullf_read_fixed(), px_debug(), PXE_PGP_NOT_V4_KEYPKT, PXE_PGP_UNKNOWN_PUBALGO, res, PGP_PubKey::rsa, PGP_PubKey::time, and PGP_PubKey::ver.
Referenced by internal_read_key(), process_secret_key(), and read_pubkey_keyid().
|
static |
Definition at line 84 of file pgp-pubkey.c.
References PGP_PubKey::algo, PGP_PubKey::dsa, PGP_PubKey::elg, hash(), PGP_PubKey::key_id, len, PGP_DIGEST_SHA1, pgp_load_digest(), pgp_mpi_hash(), PGP_PUB_DSA_SIGN, PGP_PUB_ELG_ENCRYPT, PGP_PUB_RSA_ENCRYPT, PGP_PUB_RSA_ENCRYPT_SIGN, PGP_PUB_RSA_SIGN, PGP_PubKey::pub, px_md_finish, px_md_free, px_md_update, px_memset(), res, PGP_PubKey::rsa, PGP_PubKey::time, and PGP_PubKey::ver.
Referenced by _pgp_read_public_key().
|
static |
Definition at line 299 of file pgp-pubkey.c.
References PGP_PubKey::algo, buf, PGP_PubKey::dsa, PGP_PubKey::elg, pgp_mpi_cksum(), PGP_PUB_DSA_SIGN, PGP_PUB_ELG_ENCRYPT, PGP_PUB_RSA_ENCRYPT, PGP_PUB_RSA_ENCRYPT_SIGN, PGP_PUB_RSA_SIGN, pullf_read_fixed(), px_debug(), PXE_PGP_KEYPKT_CORRUPT, res, PGP_PubKey::rsa, and PGP_PubKey::sec.
Referenced by process_secret_key().
|
static |
Definition at line 253 of file pgp-pubkey.c.
References PGP_PubKey::algo, PGP_PubKey::dsa, PGP_PubKey::elg, err(), PGP_DIGEST_SHA1, pgp_load_digest(), pgp_mpi_hash(), PGP_PUB_DSA_SIGN, PGP_PUB_ELG_ENCRYPT, PGP_PUB_RSA_ENCRYPT, PGP_PUB_RSA_ENCRYPT_SIGN, PGP_PUB_RSA_SIGN, pullf_read_fixed(), px_debug(), px_md_finish, px_md_free, px_memset(), PXE_PGP_KEYPKT_CORRUPT, res, PGP_PubKey::rsa, and PGP_PubKey::sec.
Referenced by process_secret_key().
|
static |
Definition at line 458 of file pgp-pubkey.c.
References _pgp_read_public_key(), PGP_PubKey::can_encrypt, len, pgp_create_pkt_reader(), pgp_key_free(), pgp_parse_pkt_hdr(), PGP_PKT_MARKER, PGP_PKT_PRIV_61, PGP_PKT_PUBLIC_KEY, PGP_PKT_PUBLIC_SUBKEY, PGP_PKT_SECRET_KEY, PGP_PKT_SECRET_SUBKEY, PGP_PKT_SIGNATURE, PGP_PKT_TRUST, PGP_PKT_USER_ATTR, PGP_PKT_USER_ID, pgp_skip_packet(), process_secret_key(), pullf_free(), px_debug(), PXE_PGP_EXPECT_PUBLIC_KEY, PXE_PGP_EXPECT_SECRET_KEY, PXE_PGP_MULTIPLE_KEYS, PXE_PGP_MULTIPLE_SUBKEYS, PXE_PGP_NO_USABLE_KEY, PXE_PGP_UNEXPECTED_PKT, and res.
Referenced by pgp_set_pubkey().
int pgp_key_alloc | ( | PGP_PubKey ** | pk_p | ) |
Definition at line 38 of file pgp-pubkey.c.
References palloc0().
Referenced by _pgp_read_public_key().
void pgp_key_free | ( | PGP_PubKey * | pk | ) |
Definition at line 48 of file pgp-pubkey.c.
References PGP_PubKey::algo, PGP_PubKey::dsa, PGP_PubKey::elg, pfree(), pgp_mpi_free(), PGP_PUB_DSA_SIGN, PGP_PUB_ELG_ENCRYPT, PGP_PUB_RSA_ENCRYPT, PGP_PUB_RSA_ENCRYPT_SIGN, PGP_PUB_RSA_SIGN, PGP_PubKey::pub, px_memset(), PGP_PubKey::rsa, and PGP_PubKey::sec.
Referenced by _pgp_read_public_key(), internal_read_key(), pgp_free(), process_secret_key(), and read_pubkey_keyid().
int pgp_set_pubkey | ( | PGP_Context * | ctx, |
MBuf * | keypkt, | ||
const uint8 * | key, | ||
int | key_len, | ||
int | pubtype | ||
) |
Definition at line 565 of file pgp-pubkey.c.
References internal_read_key(), sort-test::key, PGP_Context::pub_key, pullf_create_mbuf_reader(), pullf_free(), and res.
Referenced by decrypt_internal(), and encrypt_internal().
|
static |
Definition at line 337 of file pgp-pubkey.c.
References _pgp_read_public_key(), PGP_PubKey::algo, check_key_cksum(), check_key_sha1(), PGP_PubKey::dsa, PGP_PubKey::elg, GETBYTE, HIDE_CKSUM, HIDE_CLEAR, HIDE_SHA1, PGP_S2K::key, sort-test::key, PGP_S2K::key_len, pgp_cfb_create(), pgp_cfb_free(), pgp_decrypt_filter, pgp_expect_packet_end(), pgp_get_cipher_block_size(), pgp_key_free(), pgp_mpi_read(), PGP_PUB_DSA_SIGN, PGP_PUB_ELG_ENCRYPT, PGP_PUB_RSA_ENCRYPT, PGP_PUB_RSA_ENCRYPT_SIGN, PGP_PUB_RSA_SIGN, pgp_s2k_process(), pgp_s2k_read(), pullf_create(), pullf_free(), pullf_read_fixed(), px_debug(), PXE_PGP_KEYPKT_CORRUPT, PXE_PGP_NEED_SECRET_PSW, PXE_PGP_UNSUPPORTED_CIPHER, res, PGP_PubKey::rsa, and PGP_PubKey::sec.
Referenced by internal_read_key().