PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "catalog/pg_type.h"
#include "common/string.h"
#include "funcapi.h"
#include "lib/stringinfo.h"
#include "mb/pg_wchar.h"
#include "mbuf.h"
#include "pgp.h"
#include "px.h"
#include "utils/array.h"
#include "utils/builtins.h"
Go to the source code of this file.
Data Structures | |
struct | debug_expect |
struct | pgp_armor_headers_state |
Macros | |
#define | EX_MSG(arg) |
#define | EX_CHECK(arg) |
#define EX_CHECK | ( | arg | ) |
Definition at line 142 of file pgp-pgsql.c.
#define EX_MSG | ( | arg | ) |
Definition at line 137 of file pgp-pgsql.c.
|
static |
Definition at line 147 of file pgp-pgsql.c.
References EX_CHECK, and PGP_Context::use_sess_key.
Referenced by decrypt_internal().
|
static |
Definition at line 97 of file pgp-pgsql.c.
References pfree(), px_memset(), and VARSIZE_ANY.
Referenced by decrypt_internal(), and encrypt_internal().
Definition at line 68 of file pgp-pgsql.c.
References cstring_to_text(), pfree(), pg_do_encoding_conversion(), res, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Referenced by convert_from_utf8(), and convert_to_utf8().
Definition at line 85 of file pgp-pgsql.c.
References convert_charset(), GetDatabaseEncoding(), and PG_UTF8.
Referenced by decrypt_internal().
Definition at line 91 of file pgp-pgsql.c.
References convert_charset(), GetDatabaseEncoding(), and PG_UTF8.
Referenced by encrypt_internal().
Definition at line 344 of file pgp-pgsql.c.
References data, mbuf_create_from_data(), VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Referenced by decrypt_internal(), encrypt_internal(), and pgp_key_id_w().
|
static |
Definition at line 458 of file pgp-pgsql.c.
References generate_unaccent_rules::args, check_expect(), clear_and_pfree(), convert_from_utf8(), create_mbuf_from_vardata(), data, err(), debug_expect::expect, init_work(), sort-test::key, mbuf_append(), mbuf_create(), mbuf_create_from_data(), mbuf_free(), mbuf_steal_data(), pgp_decrypt(), pgp_free(), pgp_get_unicode_mode(), pgp_set_pubkey(), pgp_set_symkey(), px_set_debug_handler(), px_THROW_ERROR(), res, SET_VARSIZE, VARDATA_ANY, VARHDRSZ, VARSIZE_ANY, and VARSIZE_ANY_EXHDR.
Referenced by pgp_pub_decrypt_bytea(), pgp_pub_decrypt_text(), pgp_sym_decrypt_bytea(), and pgp_sym_decrypt_text().
|
static |
Definition at line 288 of file pgp-pgsql.c.
References i, len, palloc(), and res.
Referenced by parse_args().
|
static |
Definition at line 372 of file pgp-pgsql.c.
References generate_unaccent_rules::args, clear_and_pfree(), convert_to_utf8(), create_mbuf_from_vardata(), data, debug_expect::debug, err(), init_work(), sort-test::key, mbuf_append(), mbuf_create(), mbuf_free(), mbuf_steal_data(), pgp_encrypt(), pgp_free(), pgp_get_unicode_mode(), pgp_set_pubkey(), pgp_set_symkey(), px_set_debug_handler(), px_THROW_ERROR(), res, SET_VARSIZE, VARDATA_ANY, VARHDRSZ, VARSIZE_ANY, and VARSIZE_ANY_EXHDR.
Referenced by pgp_pub_encrypt_bytea(), pgp_pub_encrypt_text(), pgp_sym_encrypt_bytea(), and pgp_sym_encrypt_text().
|
static |
Definition at line 122 of file pgp-pgsql.c.
References debug_expect::cipher_algo, debug_expect::compress_algo, debug_expect::debug, debug_expect::disable_mdc, debug_expect::expect, debug_expect::s2k_cipher_algo, debug_expect::s2k_count, debug_expect::s2k_digest_algo, debug_expect::s2k_mode, debug_expect::unicode_mode, and debug_expect::use_sess_key.
Referenced by init_work().
|
static |
|
static |
Definition at line 351 of file pgp-pgsql.c.
References generate_unaccent_rules::args, debug_expect::debug, err(), fill_expect(), parse_args(), pgp_init(), pgp_set_text_mode(), px_set_debug_handler(), px_THROW_ERROR(), show_debug(), VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Referenced by decrypt_internal(), and encrypt_internal().
|
static |
Definition at line 306 of file pgp-pgsql.c.
References generate_unaccent_rules::args, downcase_convert(), getword(), sort-test::key, pfree(), PXE_ARGUMENT_ERROR, res, set_arg(), str, and val.
Referenced by init_work().
|
static |
Definition at line 755 of file pgp-pgsql.c.
References ARR_NDIM, deconstruct_array_builtin(), ereport, errcode(), errmsg(), ERROR, i, palloc(), pg_is_ascii(), TextDatumGetCString, and values.
Referenced by pg_armor().
Datum pg_armor | ( | PG_FUNCTION_ARGS | ) |
Definition at line 840 of file pgp-pgsql.c.
References buf, data, elog, ERROR, initStringInfo(), palloc(), parse_key_value_arrays(), pfree(), PG_FREE_IF_COPY, PG_GETARG_ARRAYTYPE_P, PG_GETARG_BYTEA_PP, PG_NARGS, PG_RETURN_TEXT_P, pgp_armor_encode(), res, SET_VARSIZE, values, VARDATA, VARDATA_ANY, VARHDRSZ, and VARSIZE_ANY_EXHDR.
Datum pg_dearmor | ( | PG_FUNCTION_ARGS | ) |
Definition at line 878 of file pgp-pgsql.c.
References buf, data, initStringInfo(), palloc(), pfree(), PG_FREE_IF_COPY, PG_GETARG_TEXT_PP, PG_RETURN_TEXT_P, pgp_armor_decode(), px_THROW_ERROR(), res, SET_VARSIZE, VARDATA, VARDATA_ANY, VARHDRSZ, and VARSIZE_ANY_EXHDR.
PG_FUNCTION_INFO_V1 | ( | pg_armor | ) |
PG_FUNCTION_INFO_V1 | ( | pg_dearmor | ) |
PG_FUNCTION_INFO_V1 | ( | pgp_armor_headers | ) |
PG_FUNCTION_INFO_V1 | ( | pgp_key_id_w | ) |
PG_FUNCTION_INFO_V1 | ( | pgp_pub_decrypt_bytea | ) |
PG_FUNCTION_INFO_V1 | ( | pgp_pub_decrypt_text | ) |
PG_FUNCTION_INFO_V1 | ( | pgp_pub_encrypt_bytea | ) |
PG_FUNCTION_INFO_V1 | ( | pgp_pub_encrypt_text | ) |
PG_FUNCTION_INFO_V1 | ( | pgp_sym_decrypt_bytea | ) |
PG_FUNCTION_INFO_V1 | ( | pgp_sym_decrypt_text | ) |
PG_FUNCTION_INFO_V1 | ( | pgp_sym_encrypt_bytea | ) |
PG_FUNCTION_INFO_V1 | ( | pgp_sym_encrypt_text | ) |
Datum pgp_armor_headers | ( | PG_FUNCTION_ARGS | ) |
Definition at line 912 of file pgp-pgsql.c.
References FuncCallContext::attinmeta, BuildTupleFromCStrings(), FuncCallContext::call_cntr, data, elog, ERROR, get_call_result_type(), HeapTupleGetDatum(), if(), MemoryContextSwitchTo(), FuncCallContext::multi_call_memory_ctx, palloc(), pg_any_to_server(), PG_GETARG_TEXT_PP, PG_UTF8, pgp_extract_armor_headers(), px_THROW_ERROR(), res, SRF_FIRSTCALL_INIT, SRF_IS_FIRSTCALL, SRF_PERCALL_SETUP, SRF_RETURN_DONE, SRF_RETURN_NEXT, TupleDescGetAttInMetadata(), TYPEFUNC_COMPOSITE, FuncCallContext::user_fctx, values, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Datum pgp_key_id_w | ( | PG_FUNCTION_ARGS | ) |
Definition at line 982 of file pgp-pgsql.c.
References buf, create_mbuf_from_vardata(), data, mbuf_free(), palloc(), PG_FREE_IF_COPY, PG_GETARG_BYTEA_PP, PG_RETURN_TEXT_P, pgp_get_keyid(), px_THROW_ERROR(), res, SET_VARSIZE, VARDATA, and VARHDRSZ.
Datum pgp_pub_decrypt_bytea | ( | PG_FUNCTION_ARGS | ) |
Definition at line 692 of file pgp-pgsql.c.
References arg, data, decrypt_internal(), sort-test::key, PG_FREE_IF_COPY, PG_GETARG_BYTEA_PP, PG_GETARG_TEXT_PP, PG_NARGS, PG_RETURN_TEXT_P, and res.
Datum pgp_pub_decrypt_text | ( | PG_FUNCTION_ARGS | ) |
Definition at line 719 of file pgp-pgsql.c.
References arg, data, decrypt_internal(), sort-test::key, PG_FREE_IF_COPY, PG_GETARG_BYTEA_PP, PG_GETARG_TEXT_PP, PG_NARGS, PG_RETURN_TEXT_P, and res.
Datum pgp_pub_encrypt_bytea | ( | PG_FUNCTION_ARGS | ) |
Definition at line 647 of file pgp-pgsql.c.
References arg, data, encrypt_internal(), sort-test::key, PG_FREE_IF_COPY, PG_GETARG_BYTEA_PP, PG_GETARG_TEXT_PP, PG_NARGS, PG_RETURN_TEXT_P, and res.
Datum pgp_pub_encrypt_text | ( | PG_FUNCTION_ARGS | ) |
Definition at line 669 of file pgp-pgsql.c.
References arg, data, encrypt_internal(), sort-test::key, PG_FREE_IF_COPY, PG_GETARG_BYTEA_PP, PG_GETARG_TEXT_PP, PG_NARGS, PG_RETURN_TEXT_P, and res.
Datum pgp_sym_decrypt_bytea | ( | PG_FUNCTION_ARGS | ) |
Definition at line 599 of file pgp-pgsql.c.
References arg, data, decrypt_internal(), sort-test::key, PG_FREE_IF_COPY, PG_GETARG_BYTEA_PP, PG_GETARG_TEXT_PP, PG_NARGS, PG_RETURN_TEXT_P, and res.
Datum pgp_sym_decrypt_text | ( | PG_FUNCTION_ARGS | ) |
Definition at line 621 of file pgp-pgsql.c.
References arg, data, decrypt_internal(), sort-test::key, PG_FREE_IF_COPY, PG_GETARG_BYTEA_PP, PG_GETARG_TEXT_PP, PG_NARGS, PG_RETURN_TEXT_P, and res.
Datum pgp_sym_encrypt_bytea | ( | PG_FUNCTION_ARGS | ) |
Definition at line 554 of file pgp-pgsql.c.
References arg, data, encrypt_internal(), sort-test::key, PG_FREE_IF_COPY, PG_GETARG_BYTEA_PP, PG_GETARG_TEXT_PP, PG_NARGS, PG_RETURN_TEXT_P, and res.
Datum pgp_sym_encrypt_text | ( | PG_FUNCTION_ARGS | ) |
Definition at line 576 of file pgp-pgsql.c.
References arg, data, encrypt_internal(), sort-test::key, PG_FREE_IF_COPY, PG_GETARG_TEXT_PP, PG_NARGS, PG_RETURN_TEXT_P, and res.
|
static |
Definition at line 168 of file pgp-pgsql.c.
References debug_expect::cipher_algo, debug_expect::compress_algo, debug_expect::debug, debug_expect::disable_mdc, debug_expect::expect, sort-test::key, pgp_disable_mdc(), pgp_get_cipher_code(), pgp_get_digest_code(), pgp_set_cipher_algo(), pgp_set_compress_algo(), pgp_set_compress_level(), pgp_set_convert_crlf(), pgp_set_s2k_cipher_algo(), pgp_set_s2k_count(), pgp_set_s2k_digest_algo(), pgp_set_s2k_mode(), pgp_set_sess_key(), pgp_set_unicode_mode(), PXE_ARGUMENT_ERROR, res, debug_expect::s2k_cipher_algo, debug_expect::s2k_count, debug_expect::s2k_digest_algo, debug_expect::s2k_mode, debug_expect::unicode_mode, debug_expect::use_sess_key, and val.
Referenced by parse_args().
|
static |
Definition at line 162 of file pgp-pgsql.c.
References ereport, errmsg(), and NOTICE.
Referenced by init_work().