From 8bb519b11cacd65b6043e5cde007f0765049d283 Mon Sep 17 00:00:00 2001 From: Kazuki Yamaguchi Date: Mon, 2 Jul 2018 21:28:57 +0900 Subject: pkey: resume key generation after interrupt Key/parameter generation (OpenSSL::PKey::*.{new,generate}) immediately aborts when it is done with GVL released (in other words, no block is given) and the thread is interrupted (e.g., by a signal) during the operation. Have ossl_generate_cb_2() acquire GVL and call rb_thread_check_ints() if needed to process the pending interrupt rather than abort the operation completely by returning 0. Reference: https://bugs.ruby-lang.org/issues/14882 --- ext/openssl/ossl_pkey.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/openssl/ossl_pkey.h') diff --git a/ext/openssl/ossl_pkey.h b/ext/openssl/ossl_pkey.h index a0b49744..5c8ccc0f 100644 --- a/ext/openssl/ossl_pkey.h +++ b/ext/openssl/ossl_pkey.h @@ -41,7 +41,7 @@ extern const rb_data_type_t ossl_evp_pkey_type; struct ossl_generate_cb_arg { int yield; - int stop; + int interrupted; int state; }; int ossl_generate_cb_2(int p, int n, BN_GENCB *cb); -- cgit v1.2.3