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
rhe f52ab6e494 openssl: improve handling of password for encrypted PEM
* ext/openssl/ossl.c (ossl_pem_passwd_value): Added. Convert the
  argument to String with StringValue() and validate the length is in
  4..PEM_BUFSIZE. PEM_BUFSIZE is a macro defined in OpenSSL headers.
  (ossl_pem_passwd_cb): When reading/writing encrypted PEM format, we
  used to pass the password to PEM_def_callback() directly but it was
  problematic. It is not NUL character safe. And surprisingly, it
  silently truncates the password to 1024 bytes.  [GH ruby/openssl#51]

* ext/openssl/ossl.h: Add function prototype declaration of newly
  added ossl_pem_passwd_value().

* ext/openssl/ossl_pkey.c (ossl_pkey_new_from_data): Use
  ossl_pem_passwd_value() to validate the password String.

* ext/openssl/ossl_pkey_dsa.c (ossl_dsa_initialize, ossl_dsa_export):
  ditto.

* ext/openssl/ossl_pkey_ec.c (ossl_ec_key_initialize,
  ossl_ec_key_to_string): ditto.

* ext/openssl/ossl_pkey_rsa.c (ossl_rsa_initialize, ossl_rsa_export):
  ditto.

* test/openssl/test_pkey_{dsa,ec,rsa}.rb: test this.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55087 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-20 15:05:25 +00:00
..
test_asn1.rb openssl: clear OpenSSL error queue before return to Ruby 2016-05-18 04:07:47 +00:00
test_bn.rb openssl: clear OpenSSL error queue before return to Ruby 2016-05-18 04:07:47 +00:00
test_buffering.rb openssl: clear OpenSSL error queue before return to Ruby 2016-05-18 04:07:47 +00:00
test_cipher.rb openssl: clear OpenSSL error queue before return to Ruby 2016-05-18 04:07:47 +00:00
test_config.rb openssl: clear OpenSSL error queue before return to Ruby 2016-05-18 04:07:47 +00:00
test_digest.rb openssl: clear OpenSSL error queue before return to Ruby 2016-05-18 04:07:47 +00:00
test_engine.rb openssl: clear OpenSSL error queue before return to Ruby 2016-05-18 04:07:47 +00:00
test_fips.rb openssl: clear OpenSSL error queue before return to Ruby 2016-05-18 04:07:47 +00:00
test_hmac.rb openssl: clear OpenSSL error queue before return to Ruby 2016-05-18 04:07:47 +00:00
test_ns_spki.rb openssl: clear OpenSSL error queue before return to Ruby 2016-05-18 04:07:47 +00:00
test_ocsp.rb openssl: clear OpenSSL error queue before return to Ruby 2016-05-18 04:07:47 +00:00
test_pair.rb openssl: clear OpenSSL error queue before return to Ruby 2016-05-18 04:07:47 +00:00
test_partial_record_read.rb
test_pkcs5.rb openssl: clear OpenSSL error queue before return to Ruby 2016-05-18 04:07:47 +00:00
test_pkcs7.rb openssl: clear OpenSSL error queue before return to Ruby 2016-05-18 04:07:47 +00:00
test_pkcs12.rb openssl: clear OpenSSL error queue before return to Ruby 2016-05-18 04:07:47 +00:00
test_pkey_dh.rb openssl: clear OpenSSL error queue before return to Ruby 2016-05-18 04:07:47 +00:00
test_pkey_dsa.rb openssl: improve handling of password for encrypted PEM 2016-05-20 15:05:25 +00:00
test_pkey_ec.rb openssl: improve handling of password for encrypted PEM 2016-05-20 15:05:25 +00:00
test_pkey_rsa.rb openssl: improve handling of password for encrypted PEM 2016-05-20 15:05:25 +00:00
test_random.rb test_random.rb: skip old OpenSSL 2016-05-18 08:06:23 +00:00
test_ssl.rb
test_ssl_session.rb openssl: don't test default session lifetime value 2016-05-20 04:36:03 +00:00
test_x509attr.rb openssl: check argument type in OpenSSL::X509::Attribute#value= 2016-05-19 04:12:57 +00:00
test_x509cert.rb openssl: clear OpenSSL error queue before return to Ruby 2016-05-18 04:07:47 +00:00
test_x509crl.rb openssl: clear OpenSSL error queue before return to Ruby 2016-05-18 04:07:47 +00:00
test_x509ext.rb openssl: clear OpenSSL error queue before return to Ruby 2016-05-18 04:07:47 +00:00
test_x509name.rb openssl: clear OpenSSL error queue before return to Ruby 2016-05-18 04:07:47 +00:00
test_x509req.rb openssl: clear OpenSSL error queue before return to Ruby 2016-05-18 04:07:47 +00:00
test_x509store.rb openssl: clear OpenSSL error queue before return to Ruby 2016-05-18 04:07:47 +00:00
utils.rb openssl: clear OpenSSL error queue before return to Ruby 2016-05-18 04:07:47 +00:00