]> git.ipfire.org Git - thirdparty/openssl.git/commit
crypto/sleep.c: avoid returning early due to signal master
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:33:08 +0000 (15:33 -0400)
commit760929f6ba18952c052e92acb2f0c0163ab7720a
treee302fd2ea91635624b0783b1175999f0a8bc0c6b
parent00f4228524c4909597dad635b7e7196c5abc3526
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: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28193)
crypto/sleep.c
test/sanitytest.c