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 /meson.build | |
| 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 <github-tech@jeltef.nl>
Discussion: https://www.postgresql.org/message-id/7b86da3b-9356-4e50-aa1b-56570825e234@iki.fi
Diffstat (limited to 'meson.build')
| -rw-r--r-- | meson.build | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/meson.build b/meson.build index ba7916d1493..e8b872d29ad 100644 --- a/meson.build +++ b/meson.build @@ -2569,6 +2569,7 @@ decl_checks = [ ['strlcpy', 'string.h'], ['strnlen', 'string.h'], ['strsep', 'string.h'], + ['timingsafe_bcmp', 'string.h'], ] # Need to check for function declarations for these functions, because @@ -2826,6 +2827,7 @@ func_checks = [ ['strsignal'], ['sync_file_range'], ['syncfs'], + ['timingsafe_bcmp'], ['uselocale'], ['wcstombs_l'], ] |
