diff options
author | Heikki Linnakangas | 2025-04-02 12:32:40 +0000 |
---|---|---|
committer | Heikki Linnakangas | 2025-04-02 12:32:40 +0000 |
commit | 09be39112654c3f158098fdb5f820143c0330763 (patch) | |
tree | 1864a2d06bac4af18cd9c62dbd2db638a8815991 /configure.ac | |
parent | 85d799ba8a7fe3f6a462fcccbb449e08d21f4ea4 (diff) |
Add timingsafe_bcmp(), for constant-time memory comparison
timingsafe_bcmp() should be used instead of memcmp() or a naive
for-loop, when comparing passwords or secret tokens, to avoid leaking
information about the secret token by timing. This commit just
introduces the function but does not change any existing code to use
it yet.
Co-authored-by: Jelte Fennema-Nio <[email protected]>
Discussion: https://www.postgresql.org/message-id/[email protected]
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index 47a287926bc..65db0673f8a 100644 --- a/configure.ac +++ b/configure.ac @@ -1805,7 +1805,7 @@ AC_CHECK_DECLS(posix_fadvise, [], [], [#include <fcntl.h>]) ]) # fi AC_CHECK_DECLS(fdatasync, [], [], [#include <unistd.h>]) -AC_CHECK_DECLS([strlcat, strlcpy, strnlen, strsep]) +AC_CHECK_DECLS([strlcat, strlcpy, strnlen, strsep, timingsafe_bcmp]) # We can't use AC_CHECK_FUNCS to detect these functions, because it # won't handle deployment target restrictions on macOS @@ -1826,6 +1826,7 @@ AC_REPLACE_FUNCS(m4_normalize([ strlcpy strnlen strsep + timingsafe_bcmp ])) AC_REPLACE_FUNCS(pthread_barrier_wait) |