Add timingsafe_bcmp(), for constant-time memory comparison
Heikki Linnakangas <heikki.linnakangas@iki.fi>
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
Files
| Path | Change | +/− |
|---|---|---|
| configure | modified | +23 −0 |
| configure.ac | modified | +2 −1 |
| meson.build | modified | +2 −0 |
| src/include/port.h | modified | +4 −0 |
| src/port/meson.build | modified | +1 −0 |
| src/port/timingsafe_bcmp.c | added | +43 −0 |
Discussion
- Make query cancellation keys longer 40 messages · 2024-02-29 → 2025-04-03