diff options
Diffstat (limited to 'contrib/pgcrypto/internal.c')
-rw-r--r-- | contrib/pgcrypto/internal.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/contrib/pgcrypto/internal.c b/contrib/pgcrypto/internal.c index dd45fee7ed6..5dd48351512 100644 --- a/contrib/pgcrypto/internal.c +++ b/contrib/pgcrypto/internal.c @@ -89,7 +89,8 @@ int_md5_update(PX_MD *h, const uint8 *data, unsigned dlen) pg_cryptohash_ctx *ctx = (pg_cryptohash_ctx *) h->p.ptr; if (pg_cryptohash_update(ctx, data, dlen) < 0) - elog(ERROR, "could not update %s context", "MD5"); + elog(ERROR, "could not update %s context: %s", "MD5", + pg_cryptohash_error(ctx)); } static void @@ -98,7 +99,8 @@ int_md5_reset(PX_MD *h) pg_cryptohash_ctx *ctx = (pg_cryptohash_ctx *) h->p.ptr; if (pg_cryptohash_init(ctx) < 0) - elog(ERROR, "could not initialize %s context", "MD5"); + elog(ERROR, "could not initialize %s context: %s", "MD5", + pg_cryptohash_error(ctx)); } static void @@ -107,7 +109,8 @@ int_md5_finish(PX_MD *h, uint8 *dst) pg_cryptohash_ctx *ctx = (pg_cryptohash_ctx *) h->p.ptr; if (pg_cryptohash_final(ctx, dst, h->result_size(h)) < 0) - elog(ERROR, "could not finalize %s context", "MD5"); + elog(ERROR, "could not finalize %s context: %s", "MD5", + pg_cryptohash_error(ctx)); } static void @@ -139,7 +142,8 @@ int_sha1_update(PX_MD *h, const uint8 *data, unsigned dlen) pg_cryptohash_ctx *ctx = (pg_cryptohash_ctx *) h->p.ptr; if (pg_cryptohash_update(ctx, data, dlen) < 0) - elog(ERROR, "could not update %s context", "SHA1"); + elog(ERROR, "could not update %s context: %s", "SHA1", + pg_cryptohash_error(ctx)); } static void @@ -148,7 +152,8 @@ int_sha1_reset(PX_MD *h) pg_cryptohash_ctx *ctx = (pg_cryptohash_ctx *) h->p.ptr; if (pg_cryptohash_init(ctx) < 0) - elog(ERROR, "could not initialize %s context", "SHA1"); + elog(ERROR, "could not initialize %s context: %s", "SHA1", + pg_cryptohash_error(ctx)); } static void @@ -157,7 +162,8 @@ int_sha1_finish(PX_MD *h, uint8 *dst) pg_cryptohash_ctx *ctx = (pg_cryptohash_ctx *) h->p.ptr; if (pg_cryptohash_final(ctx, dst, h->result_size(h)) < 0) - elog(ERROR, "could not finalize %s context", "SHA1"); + elog(ERROR, "could not finalize %s context: %s", "SHA1", + pg_cryptohash_error(ctx)); } static void |