PostgreSQL Source Code
git master
|
#include "postgres.h"
#include <openssl/evp.h>
#include "common/cryptohash.h"
#include "common/md5.h"
#include "common/sha1.h"
#include "common/sha2.h"
#include "utils/memutils.h"
#include "utils/resowner.h"
#include "utils/resowner_private.h"
Go to the source code of this file.
Data Structures | |
struct | pg_cryptohash_ctx |
Macros | |
#define | ALLOC(size) MemoryContextAlloc(TopMemoryContext, size) |
#define | FREE(ptr) pfree(ptr) |
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) |
#define ALLOC | ( | size | ) | MemoryContextAlloc(TopMemoryContext, size) |
Definition at line 42 of file cryptohash_openssl.c.
Referenced by pg_cryptohash_create().
#define FREE | ( | ptr | ) | pfree(ptr) |
Definition at line 43 of file cryptohash_openssl.c.
Referenced by pg_cryptohash_create(), and pg_cryptohash_free().
pg_cryptohash_ctx* pg_cryptohash_create | ( | pg_cryptohash_type | type | ) |
Definition at line 73 of file cryptohash_openssl.c.
References ALLOC, CurrentResourceOwner, ereport, errcode(), errmsg(), ERROR, pg_cryptohash_ctx::evpctx, explicit_bzero(), FREE, PointerGetDatum, ResourceOwnerEnlargeCryptoHash(), ResourceOwnerRememberCryptoHash(), pg_cryptohash_ctx::resowner, and pg_cryptohash_ctx::type.
int pg_cryptohash_final | ( | pg_cryptohash_ctx * | ctx, |
uint8 * | dest, | ||
size_t | len | ||
) |
Definition at line 187 of file cryptohash_openssl.c.
References pg_cryptohash_ctx::data, pg_cryptohash_ctx::evpctx, pg_cryptohash_ctx::md5, MD5_DIGEST_LENGTH, 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, status(), and pg_cryptohash_ctx::type.
void pg_cryptohash_free | ( | pg_cryptohash_ctx * | ctx | ) |
Definition at line 236 of file cryptohash_openssl.c.
References pg_cryptohash_ctx::evpctx, explicit_bzero(), FREE, PointerGetDatum, ResourceOwnerForgetCryptoHash(), and pg_cryptohash_ctx::resowner.
int pg_cryptohash_init | ( | pg_cryptohash_ctx * | ctx | ) |
Definition at line 125 of file cryptohash_openssl.c.
References pg_cryptohash_ctx::data, pg_cryptohash_ctx::evpctx, 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, status(), and pg_cryptohash_ctx::type.
int pg_cryptohash_update | ( | pg_cryptohash_ctx * | ctx, |
const uint8 * | data, | ||
size_t | len | ||
) |
Definition at line 166 of file cryptohash_openssl.c.
References pg_cryptohash_ctx::data, pg_cryptohash_ctx::evpctx, 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, status(), and pg_cryptohash_ctx::type.