postgresql/contrib/pgcrypto
Michael Paquier d0071f9228 pgcrypto: Fix incorrect argument vs PG_GETARG*() mappings
The following functions use a mix of bytea and text arguments, but their
C internals always used PG_GETARG_BYTEA_PP(), creating an incorrect mix
with the argument types expected by encrypt_internal():
- pgp_sym_encrypt_bytea(bytea,text[,text])
- pgp_sym_encrypt(text,text[,text])
- pgp_sym_decrypt_bytea(bytea,text[,text])
- pgp_sym_decrypt(bytea,text[,text])
- pgp_pub_encrypt_bytea(bytea,bytea[,text])
- pgp_pub_encrypt(text,bytea[,text])
- pgp_pub_decrypt_bytea(bytea, bytea[,text[,text]])
- pgp_pub_decrypt(bytea,bytea[,text[,text]])

This commit fixes the inconsistencies between the PG_GETARG*() macros
and the argument types of each function.

Both BYTEA_PP() and TEXT_PP() rely on PG_DETOAST_DATUM_PACKED(), that
returns an unaligned pointer, so this was not leading to an actual
problem as far as I know, but let's be consistent.

Author: Shihao Zhong
Discussion: https://postgr.es/m/CAGRkXqRfiWT--DzVPx_UGpNHTt0YT5Jo8eV2CtT56jNP=QpXSQ@mail.gmail.com
2024-02-14 08:59:05 +09:00
..
expected Fix typos in comments and in one isolation test. 2024-01-02 12:05:41 -05:00
sql Fix typos in comments and in one isolation test. 2024-01-02 12:05:41 -05:00
.gitignore
crypt-blowfish.c
crypt-des.c
crypt-gensalt.c
crypt-md5.c
Makefile pgcrypto: Split off pgp-encrypt-md5 test 2023-11-16 16:16:07 +01:00
mbuf.c
mbuf.h
meson.build Update copyright for 2024 2024-01-03 20:49:05 -05:00
openssl.c Fix typos in comments and in one isolation test. 2024-01-02 12:05:41 -05:00
pgcrypto--1.0--1.1.sql
pgcrypto--1.1--1.2.sql
pgcrypto--1.2--1.3.sql
pgcrypto--1.3.sql
pgcrypto.c
pgcrypto.control
pgcrypto.h
pgp-armor.c Add some const qualifiers 2023-09-26 11:28:57 +01:00
pgp-cfb.c
pgp-compress.c
pgp-decrypt.c pgcrypto: Fix check for buffer size 2024-01-30 11:15:46 +01:00
pgp-encrypt.c
pgp-info.c
pgp-mpi-openssl.c
pgp-mpi.c
pgp-pgsql.c pgcrypto: Fix incorrect argument vs PG_GETARG*() mappings 2024-02-14 08:59:05 +09:00
pgp-pubdec.c
pgp-pubenc.c
pgp-pubkey.c
pgp-s2k.c
pgp.c
pgp.h Add trailing commas to enum definitions 2023-10-26 09:20:54 +02:00
px-crypt.c
px-crypt.h
px-hmac.c
px.c
px.h