diff options
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/pgcrypto/internal-sha2.c | 2 | ||||
-rw-r--r-- | contrib/pgcrypto/internal.c | 4 | ||||
-rw-r--r-- | contrib/uuid-ossp/uuid-ossp.c | 5 |
3 files changed, 6 insertions, 5 deletions
diff --git a/contrib/pgcrypto/internal-sha2.c b/contrib/pgcrypto/internal-sha2.c index 0fe53e15af..ecf3004e95 100644 --- a/contrib/pgcrypto/internal-sha2.c +++ b/contrib/pgcrypto/internal-sha2.c @@ -118,7 +118,7 @@ int_sha2_finish(PX_MD *h, uint8 *dst) { pg_cryptohash_ctx *ctx = (pg_cryptohash_ctx *) h->p.ptr; - if (pg_cryptohash_final(ctx, dst) < 0) + if (pg_cryptohash_final(ctx, dst, h->result_size(h)) < 0) elog(ERROR, "could not finalize %s context", "SHA2"); } diff --git a/contrib/pgcrypto/internal.c b/contrib/pgcrypto/internal.c index ef6ce2fb1e..dd45fee7ed 100644 --- a/contrib/pgcrypto/internal.c +++ b/contrib/pgcrypto/internal.c @@ -106,7 +106,7 @@ int_md5_finish(PX_MD *h, uint8 *dst) { pg_cryptohash_ctx *ctx = (pg_cryptohash_ctx *) h->p.ptr; - if (pg_cryptohash_final(ctx, dst) < 0) + if (pg_cryptohash_final(ctx, dst, h->result_size(h)) < 0) elog(ERROR, "could not finalize %s context", "MD5"); } @@ -156,7 +156,7 @@ int_sha1_finish(PX_MD *h, uint8 *dst) { pg_cryptohash_ctx *ctx = (pg_cryptohash_ctx *) h->p.ptr; - if (pg_cryptohash_final(ctx, dst) < 0) + if (pg_cryptohash_final(ctx, dst, h->result_size(h)) < 0) elog(ERROR, "could not finalize %s context", "SHA1"); } diff --git a/contrib/uuid-ossp/uuid-ossp.c b/contrib/uuid-ossp/uuid-ossp.c index 49a4a59264..f9335f2863 100644 --- a/contrib/uuid-ossp/uuid-ossp.c +++ b/contrib/uuid-ossp/uuid-ossp.c @@ -324,7 +324,8 @@ uuid_generate_internal(int v, unsigned char *ns, const char *ptr, int len) pg_cryptohash_update(ctx, (unsigned char *) ptr, len) < 0) elog(ERROR, "could not update %s context", "MD5"); /* we assume sizeof MD5 result is 16, same as UUID size */ - if (pg_cryptohash_final(ctx, (unsigned char *) &uu) < 0) + if (pg_cryptohash_final(ctx, (unsigned char *) &uu, + sizeof(uu)) < 0) elog(ERROR, "could not finalize %s context", "MD5"); pg_cryptohash_free(ctx); } @@ -338,7 +339,7 @@ uuid_generate_internal(int v, unsigned char *ns, const char *ptr, int len) if (pg_cryptohash_update(ctx, ns, sizeof(uu)) < 0 || pg_cryptohash_update(ctx, (unsigned char *) ptr, len) < 0) elog(ERROR, "could not update %s context", "SHA1"); - if (pg_cryptohash_final(ctx, sha1result) < 0) + if (pg_cryptohash_final(ctx, sha1result, sizeof(sha1result)) < 0) elog(ERROR, "could not finalize %s context", "SHA1"); pg_cryptohash_free(ctx); |