]> 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)
committerNeil Horman <nhorman@openssl.org>
Sat, 9 Aug 2025 19:52:24 +0000 (15:52 -0400)
commitc3572c5f809dca2899fca84a825b431f8f47108d
tree969c50e94241f7a50aede04e17fb9220f264a637
parent0fa07898e1e0b57e548be3a037f31a746ae7f9a4
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: Neil Horman <nhorman@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28196)
crypto/sleep.c
test/sanitytest.c