PostgreSQL Source Code
git master
|
#include "postgres.h"
#include <sys/param.h>
#include "common/cryptohash.h"
#include "md5_int.h"
#include "sha1_int.h"
#include "sha2_int.h"
Go to the source code of this file.
Data Structures | |
struct | pg_cryptohash_ctx |
Macros | |
#define | ALLOC(size) palloc(size) |
#define | FREE(ptr) pfree(ptr) |
Typedefs | |
typedef enum pg_cryptohash_errno | pg_cryptohash_errno |
Enumerations | |
enum | pg_cryptohash_errno { PG_CRYPTOHASH_ERROR_NONE = 0 , PG_CRYPTOHASH_ERROR_DEST_LEN , PG_CRYPTOHASH_ERROR_NONE = 0 , PG_CRYPTOHASH_ERROR_DEST_LEN , PG_CRYPTOHASH_ERROR_OPENSSL } |
Functions | |
pg_cryptohash_ctx * | pg_cryptohash_create (pg_cryptohash_type type) |
int | pg_cryptohash_init (pg_cryptohash_ctx *ctx) |
int | pg_cryptohash_update (pg_cryptohash_ctx *ctx, const uint8 *data, size_t len) |
int | pg_cryptohash_final (pg_cryptohash_ctx *ctx, uint8 *dest, size_t len) |
void | pg_cryptohash_free (pg_cryptohash_ctx *ctx) |
const char * | pg_cryptohash_error (pg_cryptohash_ctx *ctx) |
Definition at line 36 of file cryptohash.c.
#define FREE | ( | ptr | ) | pfree(ptr) |
Definition at line 37 of file cryptohash.c.
typedef enum pg_cryptohash_errno pg_cryptohash_errno |
enum pg_cryptohash_errno |
Enumerator | |
---|---|
PG_CRYPTOHASH_ERROR_NONE | |
PG_CRYPTOHASH_ERROR_DEST_LEN | |
PG_CRYPTOHASH_ERROR_NONE | |
PG_CRYPTOHASH_ERROR_DEST_LEN | |
PG_CRYPTOHASH_ERROR_OPENSSL |
Definition at line 44 of file cryptohash.c.
pg_cryptohash_ctx* pg_cryptohash_create | ( | pg_cryptohash_type | type | ) |
Definition at line 74 of file cryptohash.c.
References ALLOC, pg_cryptohash_ctx::error, PG_CRYPTOHASH_ERROR_NONE, type, and pg_cryptohash_ctx::type.
Referenced by cryptohash_internal(), InitializeBackupManifest(), json_parse_manifest_incremental_init(), pg_checksum_init(), pg_hmac_create(), pg_hmac_init(), pg_md5_binary(), pg_md5_hash(), scram_H(), scram_mock_salt(), uuid_generate_internal(), and verify_manifest_checksum().
const char* pg_cryptohash_error | ( | pg_cryptohash_ctx * | ctx | ) |
Definition at line 254 of file cryptohash.c.
References _, Assert, pg_cryptohash_ctx::error, PG_CRYPTOHASH_ERROR_DEST_LEN, and PG_CRYPTOHASH_ERROR_NONE.
Referenced by AppendStringToManifest(), cryptohash_internal(), InitializeBackupManifest(), pg_hmac_final(), pg_hmac_init(), pg_hmac_update(), pg_md5_binary(), pg_md5_hash(), scram_H(), SendBackupManifest(), and uuid_generate_internal().
int pg_cryptohash_final | ( | pg_cryptohash_ctx * | ctx, |
uint8 * | dest, | ||
size_t | len | ||
) |
Definition at line 172 of file cryptohash.c.
References pg_cryptohash_ctx::data, generate_unaccent_rules::dest, pg_cryptohash_ctx::error, len, pg_cryptohash_ctx::md5, MD5_DIGEST_LENGTH, PG_CRYPTOHASH_ERROR_DEST_LEN, PG_MD5, pg_md5_final(), PG_SHA1, pg_sha1_final(), PG_SHA224, PG_SHA224_DIGEST_LENGTH, pg_sha224_final(), PG_SHA256, PG_SHA256_DIGEST_LENGTH, pg_sha256_final(), PG_SHA384, PG_SHA384_DIGEST_LENGTH, pg_sha384_final(), PG_SHA512, PG_SHA512_DIGEST_LENGTH, pg_sha512_final(), pg_cryptohash_ctx::sha1, SHA1_DIGEST_LENGTH, pg_cryptohash_ctx::sha224, pg_cryptohash_ctx::sha256, pg_cryptohash_ctx::sha384, pg_cryptohash_ctx::sha512, and pg_cryptohash_ctx::type.
Referenced by cryptohash_internal(), pg_checksum_final(), pg_hmac_final(), pg_hmac_init(), pg_md5_binary(), pg_md5_hash(), scram_H(), scram_mock_salt(), SendBackupManifest(), uuid_generate_internal(), and verify_manifest_checksum().
void pg_cryptohash_free | ( | pg_cryptohash_ctx * | ctx | ) |
Definition at line 238 of file cryptohash.c.
References explicit_bzero(), and FREE.
Referenced by cryptohash_internal(), FreeBackupManifest(), pg_checksum_final(), pg_checksum_init(), pg_hmac_free(), pg_hmac_init(), pg_md5_binary(), pg_md5_hash(), scram_H(), scram_mock_salt(), uuid_generate_internal(), and verify_manifest_checksum().
int pg_cryptohash_init | ( | pg_cryptohash_ctx * | ctx | ) |
Definition at line 100 of file cryptohash.c.
References pg_cryptohash_ctx::data, pg_cryptohash_ctx::md5, PG_MD5, pg_md5_init(), PG_SHA1, pg_sha1_init(), PG_SHA224, pg_sha224_init(), PG_SHA256, pg_sha256_init(), PG_SHA384, pg_sha384_init(), PG_SHA512, pg_sha512_init(), pg_cryptohash_ctx::sha1, pg_cryptohash_ctx::sha224, pg_cryptohash_ctx::sha256, pg_cryptohash_ctx::sha384, pg_cryptohash_ctx::sha512, and pg_cryptohash_ctx::type.
Referenced by cryptohash_internal(), InitializeBackupManifest(), json_parse_manifest_incremental_init(), pg_checksum_init(), pg_hmac_final(), pg_hmac_init(), pg_md5_binary(), pg_md5_hash(), scram_H(), scram_mock_salt(), uuid_generate_internal(), and verify_manifest_checksum().
int pg_cryptohash_update | ( | pg_cryptohash_ctx * | ctx, |
const uint8 * | data, | ||
size_t | len | ||
) |
Definition at line 136 of file cryptohash.c.
References pg_cryptohash_ctx::data, data, len, pg_cryptohash_ctx::md5, PG_MD5, pg_md5_update(), PG_SHA1, pg_sha1_update(), PG_SHA224, pg_sha224_update(), PG_SHA256, pg_sha256_update(), PG_SHA384, pg_sha384_update(), PG_SHA512, pg_sha512_update(), pg_cryptohash_ctx::sha1, pg_cryptohash_ctx::sha224, pg_cryptohash_ctx::sha256, pg_cryptohash_ctx::sha384, pg_cryptohash_ctx::sha512, and pg_cryptohash_ctx::type.
Referenced by AppendStringToManifest(), cryptohash_internal(), json_parse_manifest_incremental_chunk(), pg_checksum_update(), pg_hmac_final(), pg_hmac_init(), pg_hmac_update(), pg_md5_binary(), pg_md5_hash(), scram_H(), scram_mock_salt(), uuid_generate_internal(), and verify_manifest_checksum().