]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Don't set cancel state/type
authorMatt Caswell <matt@openssl.org>
Mon, 28 Nov 2022 11:01:12 +0000 (11:01 +0000)
committerTomas Mraz <tomas@openssl.org>
Thu, 1 Dec 2022 14:34:38 +0000 (15:34 +0100)
pthread_cancel() is never called by OpenSSL. Therefore this is no point in
setting the cancel state/type. The functions to set the cancel state/type
are not supported on Android and result in compilation failures. Therefore
we remove these calls completely.

Fixes #19559

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19779)

crypto/thread/arch/thread_posix.c

index b737a5e78866deaa8662e0bf76e11dad0801a48d..b18f997b94b20a894804e656c290ab2b161a46ba 100644 (file)
@@ -22,9 +22,6 @@ static void *thread_start_thunk(void *vthread)
 
     thread = (CRYPTO_THREAD *)vthread;
 
-    pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
-    pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
-
     ret = thread->routine(thread->data);
     ossl_crypto_mutex_lock(thread->statelock);
     CRYPTO_THREAD_SET_STATE(thread, CRYPTO_THREAD_FINISHED);