Fix broken scram-sha-256 authentication on big-endian machies.
authorBo Peng <pengbo@sraoss.co.jp>
Mon, 30 Jun 2025 02:52:28 +0000 (11:52 +0900)
committerBo Peng <pengbo@sraoss.co.jp>
Mon, 30 Jun 2025 02:52:28 +0000 (11:52 +0900)
commit864a1fe114a6af283804f1c3e231ed697a0a8573
tree0050923d366a0f3de99e5c313299e410622c4751
parentb76c6876de4bca2da5e009f5cc64212060ccb1fb
Fix broken scram-sha-256 authentication on big-endian machies.

When scram-sha-256 authentication is performed, a hash function
pg_sha_256_final is used. It was imported from PostgreSQL and it uses
preprocessor define WORDS_BIGENDIAN to judge host machine's
endianness. Although WORDS_BIGENDIAN should be defined while
configure, this part was missed when pg_sha_256_final (and others) was
imported from PostgreSQL. As a result, scram-sha-256 worked only in
little endian machines. This commit fixes the issue by adding
AC_C_BIGENDIAN macro to configure.ac.

Author: Tatsuo Ishii
Reported-by: Christoph Berg
Reviewed-by: pranavkaruvally
Discussion: https://github.com/pgpool/pgpool2/issues/106
Backpatch-through: v4.2
configure.ac