24#include <openssl/err.h>
25#include <openssl/evp.h>
42#define ALLOC(size) MemoryContextAlloc(TopMemoryContext, size)
43#define FREE(ptr) pfree(ptr)
45#define ALLOC(size) malloc(size)
46#define FREE(ptr) free(ptr)
82 .
name =
"OpenSSL cryptohash context",
158 errmsg(
"out of memory")));
356 return _(
"out of memory");
370 return _(
"destination buffer too small");
372 return _(
"OpenSSL failure");
#define Assert(condition)
const char * pg_cryptohash_error(pg_cryptohash_ctx *ctx)
static void ResOwnerReleaseCryptoHash(Datum res)
static const char * SSLerrmessage(unsigned long ecode)
int pg_cryptohash_update(pg_cryptohash_ctx *ctx, const uint8 *data, size_t len)
pg_cryptohash_ctx * pg_cryptohash_create(pg_cryptohash_type type)
int pg_cryptohash_init(pg_cryptohash_ctx *ctx)
static void ResourceOwnerForgetCryptoHash(ResourceOwner owner, pg_cryptohash_ctx *ctx)
static const ResourceOwnerDesc cryptohash_resowner_desc
@ PG_CRYPTOHASH_ERROR_DEST_LEN
@ PG_CRYPTOHASH_ERROR_NONE
@ PG_CRYPTOHASH_ERROR_OPENSSL
static void ResourceOwnerRememberCryptoHash(ResourceOwner owner, pg_cryptohash_ctx *ctx)
void pg_cryptohash_free(pg_cryptohash_ctx *ctx)
int pg_cryptohash_final(pg_cryptohash_ctx *ctx, uint8 *dest, size_t len)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
#define MD5_DIGEST_LENGTH
void explicit_bzero(void *buf, size_t len)
static Datum PointerGetDatum(const void *X)
static Pointer DatumGetPointer(Datum X)
ResourceOwner CurrentResourceOwner
void ResourceOwnerForget(ResourceOwner owner, Datum value, const ResourceOwnerDesc *kind)
void ResourceOwnerRemember(ResourceOwner owner, Datum value, const ResourceOwnerDesc *kind)
void ResourceOwnerEnlarge(ResourceOwner owner)
@ RESOURCE_RELEASE_BEFORE_LOCKS
#define RELEASE_PRIO_CRYPTOHASH_CONTEXTS
#define SHA1_DIGEST_LENGTH
#define PG_SHA256_DIGEST_LENGTH
#define PG_SHA384_DIGEST_LENGTH
#define PG_SHA512_DIGEST_LENGTH
#define PG_SHA224_DIGEST_LENGTH
pg_cryptohash_errno error