1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/test/openssl
nahi d3507e3ea6 * Release GVL while OpenSSL's public key generation.
t = Thread.new { print "."; sleep 0.1 }
    key = OpenSSL::PKey::RSA.new(2048)
    #=> Thread t works in parallel with public key generation if
        OS/machine allows it.

  This works with OpenSSL >= 0.9.8. From this version, it has new 
  public key generation function which allows us to interrupt the
  execution while pkey generation iterations.

* ext/openssl/extconf.rb: Check existence of OpenSSL's new public key
  generation function. (DH_generate_parameters_ex,
  DSA_generate_parameters_ex and RSA_generate_key_ex.

* ext/openssl/ossl_pkey.{h,c} (ossl_generate_cb_2,
  ossl_generate_cb_stop): Added new callback function for OpenSSL pkey
  generation which handles Thread interruption by Ruby.
  ossl_generate_cb_stop is the unblock function(ubf) for Ruby which
  sets a stop flag. New pkey generation callback ossl_generate_cb_2
  checks the stop flag at each iterations of OpenSSL and interrupts
  pkey generation when the flag is set.

* ext/openssl/ossl_pkey_dsa.c (dsa_generate): Call
  rb_thread_blocking_region with the above unblock function to release
  GVL while pkey generation.

* ext/openssl/ossl_pkey_rsa.c (rsa_generate): ditto.

* ext/openssl/ossl_pkey_dh.c (dh_generate): ditto.

* test/openssl/test_pkey_{dh,dsa,rsa}.rb: Test it.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-01 07:42:29 +00:00
..
ssl_server.rb
test_asn1.rb * ext/openssl/ossl_asn1.c: Do not parse zero-tagged values as EOC. Do 2011-05-23 01:01:49 +00:00
test_bn.rb
test_buffering.rb * test/openssl/test_buffering.rb 2011-06-22 05:48:44 +00:00
test_cipher.rb * ext/openssl/ossl_cipher.c (ossl_cipher_initialize): Avoid possible 2011-07-28 13:48:05 +00:00
test_config.rb * test/openssl/test_config.rb: Commit missing file 2011-06-15 16:04:32 +00:00
test_digest.rb * test/openssl/digest.rb: remove MDC2 from test, it is not available 2011-06-13 11:32:43 +00:00
test_engine.rb * ext/openssl/ossl_engine.c: Avoid double free of ENGINE reference. 2011-07-22 00:13:07 +00:00
test_hmac.rb
test_ns_spki.rb
test_ocsp.rb * test/openssl/test_ocsp.rb 2011-07-02 00:03:29 +00:00
test_pair.rb * ext/openssl/ossl.c (ossl_verify_cb): trap the exception from 2011-07-14 05:41:05 +00:00
test_pkcs7.rb
test_pkcs12.rb * test/openssl/test_pkcs12.rb: Add test and intermediate certificates. 2011-07-27 00:31:43 +00:00
test_pkey_dh.rb * Release GVL while OpenSSL's public key generation. 2011-09-01 07:42:29 +00:00
test_pkey_dsa.rb * Release GVL while OpenSSL's public key generation. 2011-09-01 07:42:29 +00:00
test_pkey_ec.rb * ext/openssl/ossl.h: Introduced OSSL_BIO_reset macro for PEM/DER 2011-06-22 08:41:08 +00:00
test_pkey_rsa.rb * Release GVL while OpenSSL's public key generation. 2011-09-01 07:42:29 +00:00
test_ssl.rb * ext/openssl/ossl_ssl.c: Support disabling OpenSSL compression. 2011-08-15 01:10:26 +00:00
test_ssl_session.rb * test/openssl/test_ssl_session.rb: add PEM SSL session without TLS 2011-07-16 23:02:42 +00:00
test_x509cert.rb * test/openssl/test_ocsp.rb 2011-07-02 00:03:29 +00:00
test_x509crl.rb
test_x509ext.rb
test_x509name.rb * ext/openssl/ossl_x509name.c: Add X509::Name#hash_old as a wrapper 2011-06-23 13:51:55 +00:00
test_x509req.rb
test_x509store.rb * test/openssl/test_x509store.rb (test_set_errors): Redhat is 2011-06-21 16:33:06 +00:00
utils.rb * ext/openssl/ossl.c (ossl_verify_cb): trap the exception from 2011-07-14 05:41:05 +00:00