You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Michael Paquier
b83dcf7928
Add result size as argument of pg_cryptohash_final() for overflow checks
...
With its current design, a careless use of pg_cryptohash_final() could
would result in an out-of-bound write in memory as the size of the
destination buffer to store the result digest is not known to the
cryptohash internals, without the caller knowing about that. This
commit adds a new argument to pg_cryptohash_final() to allow such sanity
checks, and implements such defenses.
The internals of SCRAM for HMAC could be tightened a bit more, but as
everything is based on SCRAM_KEY_LEN with uses particular to this code
there is no need to complicate its interface more than necessary, and
this comes back to the refactoring of HMAC in core. Except that, this
minimizes the uses of the existing DIGEST_LENGTH variables, relying
instead on sizeof() for the result sizes. In ossp-uuid, this also makes
the code more defensive, as it already relied on dce_uuid_t being at
least the size of a MD5 digest.
This is in philosophy similar to cfc40d3 for base64.c and aef8948 for
hex.c.
Reported-by: Ranier Vilela
Author: Michael Paquier, Ranier Vilela
Reviewed-by: Kyotaro Horiguchi
Discussion: https://postgr.es/m/CAEudQAoqEGmcff3J4sTSV-R_16Monuz-UpJFbf_dnVH=APr02Q@mail.gmail.com
5 years ago
..
expected
Fix corner case with 16kB-long decompression in pgcrypto, take 2
5 years ago
sql
Fix corner case with 16kB-long decompression in pgcrypto, take 2
5 years ago
.gitignore
Support SCRAM-SHA-256 authentication (RFC 5802 and 7677).
9 years ago
Makefile
Introduce --with-ssl={openssl} as a configure option
5 years ago
blf.c
…
blf.h
…
crypt-blowfish.c
Get rid of trailing semicolons in C macro definitions.
6 years ago
crypt-des.c
Replace remaining StrNCpy() by strlcpy()
5 years ago
crypt-gensalt.c
Phase 3 of pgindent updates.
9 years ago
crypt-md5.c
Add missing error check in pgcrypto/crypt-md5.c.
5 years ago
imath.c
Update copyright for 2021
5 years ago
imath.h
Initial pgindent run for v12.
7 years ago
internal-sha2.c
Add result size as argument of pg_cryptohash_final() for overflow checks
5 years ago
internal.c
Add result size as argument of pg_cryptohash_final() for overflow checks
5 years ago
mbuf.c
Remove custom memory allocation layer in pgcrypto
5 years ago
mbuf.h
Phase 2 pgindent run for v12.
7 years ago
openssl.c
pgcrypto: Detect errors with EVP calls from OpenSSL
5 years ago
pgcrypto--1.0--1.1.sql
…
pgcrypto--1.1--1.2.sql
Add functions for dealing with PGP armor header lines to pgcrypto.
11 years ago
pgcrypto--1.2--1.3.sql
Update pgcrypto extension for parallel query.
10 years ago
pgcrypto--1.3.sql
Minor fixes in contrib installation scripts.
10 years ago
pgcrypto.c
Make the order of the header file includes consistent in contrib modules.
6 years ago
pgcrypto.control
Mark some contrib modules as "trusted".
6 years ago
pgcrypto.h
Remove unnecessary prototypes
9 years ago
pgp-armor.c
Make the order of the header file includes consistent in contrib modules.
6 years ago
pgp-cfb.c
Remove custom memory allocation layer in pgcrypto
5 years ago
pgp-compress.c
Fix some grammar and typos in comments and docs
5 years ago
pgp-decrypt.c
Remove custom memory allocation layer in pgcrypto
5 years ago
pgp-encrypt.c
Remove custom memory allocation layer in pgcrypto
5 years ago
pgp-info.c
Dial back -Wimplicit-fallthrough to level 3
6 years ago
pgp-mpi-internal.c
Remove custom memory allocation layer in pgcrypto
5 years ago
pgp-mpi-openssl.c
Make the order of the header file includes consistent in contrib modules.
6 years ago
pgp-mpi.c
Remove custom memory allocation layer in pgcrypto
5 years ago
pgp-pgsql.c
Refactor logic to check for ASCII-only characters in string
5 years ago
pgp-pubdec.c
Make the order of the header file includes consistent in contrib modules.
6 years ago
pgp-pubenc.c
Remove custom memory allocation layer in pgcrypto
5 years ago
pgp-pubkey.c
Remove custom memory allocation layer in pgcrypto
5 years ago
pgp-s2k.c
Make the order of the header file includes consistent in contrib modules.
6 years ago
pgp.c
Remove custom memory allocation layer in pgcrypto
5 years ago
pgp.h
Fix inconsistencies and typos in the tree, take 10
6 years ago
px-crypt.c
Make the order of the header file includes consistent in contrib modules.
6 years ago
px-crypt.h
Phase 2 pgindent run for v12.
7 years ago
px-hmac.c
Remove custom memory allocation layer in pgcrypto
5 years ago
px.c
Add error code for encryption failure in pgcrypto
5 years ago
px.h
Add error code for encryption failure in pgcrypto
5 years ago
rijndael.c
Fix a boatload of typos in C comments.
8 years ago
rijndael.h
Phase 2 of pgindent updates.
9 years ago
rijndael.tbl
…