PostgreSQL Source Code
git master
|
Go to the source code of this file.
Macros | |
#define | CRC24_INIT 0x00b704ceL |
#define | CRC24_POLY 0x01864cfbL |
Functions | |
static int | pg_base64_encode (const uint8 *src, unsigned len, uint8 *dst) |
static int | pg_base64_decode (const uint8 *src, unsigned len, uint8 *dst) |
static unsigned | pg_base64_enc_len (unsigned srclen) |
static unsigned | pg_base64_dec_len (unsigned srclen) |
static long | crc24 (const uint8 *data, unsigned len) |
void | pgp_armor_encode (const uint8 *src, unsigned len, StringInfo dst, int num_headers, char **keys, char **values) |
static const uint8 * | find_str (const uint8 *data, const uint8 *data_end, const char *str, int strlen) |
static int | find_header (const uint8 *data, const uint8 *datend, const uint8 **start_p, int is_end) |
int | pgp_armor_decode (const uint8 *src, int len, StringInfo dst) |
int | pgp_extract_armor_headers (const uint8 *src, unsigned len, int *nheaders, char ***keys, char ***values) |
Variables | |
static const unsigned char | _base64 [] |
static const char *const | armor_header = "-----BEGIN PGP MESSAGE-----\n" |
static const char *const | armor_footer = "\n-----END PGP MESSAGE-----\n" |
#define CRC24_INIT 0x00b704ceL |
Definition at line 185 of file pgp-armor.c.
#define CRC24_POLY 0x01864cfbL |
Definition at line 186 of file pgp-armor.c.
|
static |
Definition at line 188 of file pgp-armor.c.
References crc, CRC24_INIT, CRC24_POLY, data, i, and len.
Referenced by pgp_armor_decode(), and pgp_armor_encode().
|
static |
Definition at line 266 of file pgp-armor.c.
References data, find_str(), and PXE_PGP_CORRUPT_ARMOR.
Referenced by pgp_armor_decode(), and pgp_extract_armor_headers().
|
static |
|
static |
Definition at line 172 of file pgp-armor.c.
Referenced by pgp_armor_decode().
Definition at line 95 of file pgp-armor.c.
References b, buf, len, and PXE_PGP_CORRUPT_ARMOR.
Referenced by pgp_armor_decode().
|
static |
Definition at line 45 of file pgp-armor.c.
References _base64, buf, and len.
Referenced by pgp_armor_encode().
int pgp_armor_decode | ( | const uint8 * | src, |
int | len, | ||
StringInfo | dst | ||
) |
Definition at line 314 of file pgp-armor.c.
References buf, crc, crc24(), StringInfoData::data, elog, enlargeStringInfo(), FATAL, find_header(), StringInfoData::len, len, pg_base64_dec_len(), pg_base64_decode(), PXE_PGP_CORRUPT_ARMOR, and res.
Referenced by pg_dearmor().
void pgp_armor_encode | ( | const uint8 * | src, |
unsigned | len, | ||
StringInfo | dst, | ||
int | num_headers, | ||
char ** | keys, | ||
char ** | values | ||
) |
Definition at line 207 of file pgp-armor.c.
References _base64, appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), armor_footer, armor_header, crc, crc24(), StringInfoData::data, elog, enlargeStringInfo(), FATAL, StringInfoData::len, len, pg_base64_enc_len(), pg_base64_encode(), res, and values.
Referenced by pg_armor().
int pgp_extract_armor_headers | ( | const uint8 * | src, |
unsigned | len, | ||
int * | nheaders, | ||
char *** | keys, | ||
char *** | values | ||
) |
Definition at line 390 of file pgp-armor.c.
References buf, colon, elog, ERROR, find_header(), len, palloc(), PXE_PGP_CORRUPT_ARMOR, and values.
Referenced by pgp_armor_headers().
|
static |
Definition at line 41 of file pgp-armor.c.
Referenced by pg_base64_encode(), and pgp_armor_encode().
|
static |
Definition at line 182 of file pgp-armor.c.
Referenced by pgp_armor_encode().
|
static |
Definition at line 181 of file pgp-armor.c.
Referenced by pgp_armor_encode().