]> git.ipfire.org Git - thirdparty/openssl.git/commit
crypto/sleep.c: avoid returning early due to signal
authorEugene Syromiatnikov <esyr@openssl.org>
Thu, 7 Aug 2025 14:01:23 +0000 (16:01 +0200)
committerAlexandr Nedvedicky <sashan@openssl.org>
Thu, 21 Aug 2025 11:37:30 +0000 (13:37 +0200)
commitf85ef7f8f68b7790b29ef39ee2aad03ebaafadf0
tree7effb6c85881045d8c9a464e4d95fff23ac2283e
parent2feb6ebb7dff938336b9117593a7d06a750a6a00
crypto/sleep.c: avoid returning early due to signal

On POSIX systems, sleep/usleep/nanosleep may return early due to arrival
of a signal, and OSSL_sleep does not report that, so it is assumed that
it cannot return early.  Fix that by introducing a loop that checks
the remaining time and sleep some more if the time has not passed;
that also solves the issue of limited sleeping time on some systems.

Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28197)
crypto/sleep.c
test/sanitytest.c