PostgreSQL Source Code
git master
|
#include <sys/param.h>
Go to the source code of this file.
Data Structures | |
struct | px_digest |
struct | px_alias |
struct | px_hmac |
struct | px_cipher |
struct | px_combo |
Macros | |
#define | PX_DEBUG |
#define | PX_MAX_SALT_LEN 128 |
#define | PXE_OK 0 |
#define | PXE_NO_HASH -2 |
#define | PXE_NO_CIPHER -3 |
#define | PXE_BAD_OPTION -5 |
#define | PXE_BAD_FORMAT -6 |
#define | PXE_KEY_TOO_BIG -7 |
#define | PXE_CIPHER_INIT -8 |
#define | PXE_HASH_UNUSABLE_FOR_HMAC -9 |
#define | PXE_BUG -12 |
#define | PXE_ARGUMENT_ERROR -13 |
#define | PXE_UNKNOWN_SALT_ALGO -14 |
#define | PXE_BAD_SALT_ROUNDS -15 |
#define | PXE_NO_RANDOM -17 |
#define | PXE_DECRYPT_FAILED -18 |
#define | PXE_ENCRYPT_FAILED -19 |
#define | PXE_PGP_CORRUPT_DATA -100 |
#define | PXE_PGP_CORRUPT_ARMOR -101 |
#define | PXE_PGP_UNSUPPORTED_COMPR -102 |
#define | PXE_PGP_UNSUPPORTED_CIPHER -103 |
#define | PXE_PGP_UNSUPPORTED_HASH -104 |
#define | PXE_PGP_COMPRESSION_ERROR -105 |
#define | PXE_PGP_NOT_TEXT -106 |
#define | PXE_PGP_UNEXPECTED_PKT -107 |
#define | PXE_PGP_MATH_FAILED -109 |
#define | PXE_PGP_SHORT_ELGAMAL_KEY -110 |
#define | PXE_PGP_UNKNOWN_PUBALGO -112 |
#define | PXE_PGP_WRONG_KEY -113 |
#define | PXE_PGP_MULTIPLE_KEYS -114 |
#define | PXE_PGP_EXPECT_PUBLIC_KEY -115 |
#define | PXE_PGP_EXPECT_SECRET_KEY -116 |
#define | PXE_PGP_NOT_V4_KEYPKT -117 |
#define | PXE_PGP_KEYPKT_CORRUPT -118 |
#define | PXE_PGP_NO_USABLE_KEY -119 |
#define | PXE_PGP_NEED_SECRET_PSW -120 |
#define | PXE_PGP_BAD_S2K_MODE -121 |
#define | PXE_PGP_UNSUPPORTED_PUBALGO -122 |
#define | PXE_PGP_MULTIPLE_SUBKEYS -123 |
#define | px_md_result_size(md) (md)->result_size(md) |
#define | px_md_block_size(md) (md)->block_size(md) |
#define | px_md_reset(md) (md)->reset(md) |
#define | px_md_update(md, data, dlen) (md)->update(md, data, dlen) |
#define | px_md_finish(md, buf) (md)->finish(md, buf) |
#define | px_md_free(md) (md)->free(md) |
#define | px_hmac_result_size(hmac) (hmac)->result_size(hmac) |
#define | px_hmac_block_size(hmac) (hmac)->block_size(hmac) |
#define | px_hmac_reset(hmac) (hmac)->reset(hmac) |
#define | px_hmac_init(hmac, key, klen) (hmac)->init(hmac, key, klen) |
#define | px_hmac_update(hmac, data, dlen) (hmac)->update(hmac, data, dlen) |
#define | px_hmac_finish(hmac, buf) (hmac)->finish(hmac, buf) |
#define | px_hmac_free(hmac) (hmac)->free(hmac) |
#define | px_cipher_key_size(c) (c)->key_size(c) |
#define | px_cipher_block_size(c) (c)->block_size(c) |
#define | px_cipher_iv_size(c) (c)->iv_size(c) |
#define | px_cipher_init(c, k, klen, iv) (c)->init(c, k, klen, iv) |
#define | px_cipher_encrypt(c, padding, data, dlen, res, rlen) (c)->encrypt(c, padding, data, dlen, res, rlen) |
#define | px_cipher_decrypt(c, padding, data, dlen, res, rlen) (c)->decrypt(c, padding, data, dlen, res, rlen) |
#define | px_cipher_free(c) (c)->free(c) |
#define | px_combo_encrypt_len(c, dlen) (c)->encrypt_len(c, dlen) |
#define | px_combo_decrypt_len(c, dlen) (c)->decrypt_len(c, dlen) |
#define | px_combo_init(c, key, klen, iv, ivlen) (c)->init(c, key, klen, iv, ivlen) |
#define | px_combo_encrypt(c, data, dlen, res, rlen) (c)->encrypt(c, data, dlen, res, rlen) |
#define | px_combo_decrypt(c, data, dlen, res, rlen) (c)->decrypt(c, data, dlen, res, rlen) |
#define | px_combo_free(c) (c)->free(c) |
Typedefs | |
typedef struct px_digest | PX_MD |
typedef struct px_alias | PX_Alias |
typedef struct px_hmac | PX_HMAC |
typedef struct px_cipher | PX_Cipher |
typedef struct px_combo | PX_Combo |
Functions | |
int | px_find_digest (const char *name, PX_MD **res) |
int | px_find_hmac (const char *name, PX_HMAC **res) |
int | px_find_cipher (const char *name, PX_Cipher **res) |
int | px_find_combo (const char *name, PX_Combo **res) |
void | px_THROW_ERROR (int err) pg_attribute_noreturn() |
const char * | px_strerror (int err) |
const char * | px_resolve_alias (const PX_Alias *list, const char *name) |
void | px_set_debug_handler (void(*handler)(const char *)) |
void | px_memset (void *ptr, int c, size_t len) |
void | px_debug (const char *fmt,...) pg_attribute_printf(1 |
#define px_hmac_block_size | ( | hmac | ) | (hmac)->block_size(hmac) |
#define px_hmac_init | ( | hmac, | |
key, | |||
klen | |||
) | (hmac)->init(hmac, key, klen) |
#define px_md_block_size | ( | md | ) | (md)->block_size(md) |
void px_debug | ( | const char * | fmt, |
... | |||
) |
int px_find_cipher | ( | const char * | name, |
PX_Cipher ** | res | ||
) |
Definition at line 736 of file openssl.c.
References OSSLCipher::ciph, CurrentResourceOwner, OSSLCipher::evp_ciph, OSSLCipher::evp_ctx, gen_ossl_block_size(), gen_ossl_decrypt(), gen_ossl_encrypt(), gen_ossl_free(), gen_ossl_iv_size(), gen_ossl_key_size(), i, ossl_cipher::init, MemoryContextAllocZero(), name, ossl_aliases, ossl_cipher_types, OSSLCipher::owner, palloc(), pfree(), px_resolve_alias(), PXE_CIPHER_INIT, PXE_NO_CIPHER, res, ResourceOwnerEnlarge(), ResourceOwnerRememberOSSLCipher(), and TopMemoryContext.
Referenced by pgp_load_cipher(), and px_find_combo().
int px_find_combo | ( | const char * | name, |
PX_Combo ** | res | ||
) |
Definition at line 285 of file px.c.
References buf, combo_decrypt(), combo_decrypt_len(), combo_encrypt(), combo_encrypt_len(), combo_free(), combo_init(), cx(), err(), name, palloc0(), parse_cipher_name(), pfree(), pstrdup(), px_cipher_free, px_find_cipher(), PXE_NO_CIPHER, and res.
Referenced by pg_decrypt(), pg_decrypt_iv(), pg_encrypt(), and pg_encrypt_iv().
int px_find_digest | ( | const char * | name, |
PX_MD ** | res | ||
) |
Definition at line 160 of file openssl.c.
References OSSLDigest::algo, px_digest::block_size, OSSLDigest::ctx, CurrentResourceOwner, digest_block_size(), digest_finish(), digest_free(), digest_reset(), digest_result_size(), digest_update(), px_digest::finish, px_digest::free, MemoryContextAlloc(), name, OSSLDigest::owner, px_digest::p, palloc(), pfree(), px_digest::ptr, PXE_CIPHER_INIT, PXE_NO_HASH, res, px_digest::reset, ResourceOwnerEnlarge(), ResourceOwnerRememberOSSLDigest(), px_digest::result_size, TopMemoryContext, and px_digest::update.
Referenced by pg_digest(), pgp_load_digest(), px_crypt_md5(), and px_find_hmac().
int px_find_hmac | ( | const char * | name, |
PX_HMAC ** | res | ||
) |
Definition at line 142 of file px-hmac.c.
References px_hmac::block_size, err(), px_hmac::finish, px_hmac::free, hmac_block_size(), hmac_finish(), hmac_free(), hmac_init(), hmac_reset(), hmac_result_size(), hmac_update(), px_hmac::init, px_hmac::ipad, px_hmac::md, name, px_hmac::opad, px_hmac::p, palloc(), px_find_digest(), px_md_block_size, px_md_free, PXE_HASH_UNUSABLE_FOR_HMAC, res, px_hmac::reset, px_hmac::result_size, and px_hmac::update.
Referenced by pg_hmac().
void px_memset | ( | void * | ptr, |
int | c, | ||
size_t | len | ||
) |
Definition at line 123 of file px.c.
References len.
Referenced by _crypt_blowfish_rn(), calc_key_id(), calc_s2k_iter_salted(), calc_s2k_salted(), calc_s2k_simple(), check_key_sha1(), clear_and_pfree(), combo_free(), copy_crlf(), create_secmsg(), encrypt_free(), hmac_finish(), hmac_free(), hmac_init(), mbuf_free(), mdc_finish(), mdc_flush(), mdcbuf_finish(), pad_eme_pkcs1_v15(), parse_literal_data(), parse_symenc_sesskey(), pgp_cfb_free(), pgp_free(), pgp_key_free(), pgp_mpi_free(), pkt_stream_free(), pullf_free(), pullf_read_max(), pushf_free(), px_crypt_md5(), px_gen_salt(), write_prefix(), and write_symenc_sesskey().
const char* px_resolve_alias | ( | const PX_Alias * | list, |
const char * | name | ||
) |
Definition at line 129 of file px.c.
References sort-test::list, name, and pg_strcasecmp().
Referenced by px_find_cipher().
void px_set_debug_handler | ( | void(*)(const char *) | handler | ) |
Definition at line 143 of file px.c.
References debug_handler.
Referenced by decrypt_internal(), encrypt_internal(), and init_work().
const char* px_strerror | ( | int | err | ) |
Definition at line 111 of file px.c.
References error_desc::desc, err(), and px_err_list.
Referenced by find_provider(), pg_decrypt(), pg_decrypt_iv(), pg_encrypt(), pg_encrypt_iv(), pg_gen_salt(), pg_gen_salt_rounds(), and px_THROW_ERROR().
void px_THROW_ERROR | ( | int | err | ) |
Definition at line 93 of file px.c.
References ereport, err(), errcode(), errmsg(), ERROR, px_strerror(), and PXE_NO_RANDOM.
Referenced by decrypt_internal(), encrypt_internal(), init_work(), pg_dearmor(), pg_random_bytes(), pgp_armor_headers(), and pgp_key_id_w().