1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
Commit graph

29 commits

Author SHA1 Message Date
gotoyuzo
2a0604d7b8 * test/openssl/test_ssl.rb (test_parallel): call GC.start to close
unused files. [ruby-dev:27981]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-12-12 06:56:08 +00:00
gotoyuzo
67673f6b47 * ext/openssl/extconf.rb: check for X509V3_EXT_nconf_nid.
* ext/openssl/ossl_x509ext.c (MakeX509ExtFactory): should use
  OPENSSL_malloc to allocate X509V3_CTX.

* ext/openssl/ossl_x509ext.c (ossl_x509extfactory_create_ext): use
  X509V3_EXT_nconf_nid to avoid SEGV (and to build extensions which
  values are placed in separate section).

* test/openssl/test_x509ext.rb: new file.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9592 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-11-22 22:29:13 +00:00
gotoyuzo
ab509c0edb * ext/openssl/ossl_cipher.c (ossl_cipher_update): input data must
not be empty. [ruby-talk:161220]

* test/openssl/test_cipher.rb: add test for Cipher#update("").


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-10-30 20:50:48 +00:00
gotoyuzo
246f5cfe67 * ext/openssl/ossl_pkey.h, ossl_pkey_rsa.c, ossl_pkey_dsa.c:
an instance variable "private" is added to OpenSSL::PKey class.
  this ivar is a flag that shows whether there is a private key
  in the instance.

* ext/openssl/ossl_engine.c: (ossl_engine_load_privkey): set private
  key flag.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-18 22:56:11 +00:00
gotoyuzo
7877b56572 * test/openssl/test_pkcs7.rb (test_enveloped): skip this test
to avoid a bug of PKCS7_enctypt() (only if ext/openssl is
  compiled with OpenSSL-0.9.7d or earlier versions).
  http://www.mail-archive.com/openssl-dev@openssl.org/msg17376.html


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9130 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-12 11:55:25 +00:00
gotoyuzo
9147e519ba * ext/openssl/ossl_asn1.c (asn1str_to_str): new function.
* ext/openssl/ossl_pkcs7.c: new class OpenSSL::PKCS7::RecipientInfo.
  this class wraps PKCS7_RECIP_INFO struct.

* ext/openssl/ossl_pkcs7.c: OpenSSL::PKCS7::Signer is renamed to
  OpenSSL::PKCS7::SignerInfo. ("Signer" remains as an alias of
  SignerInfo.)

* test/openssl/test_pkcs7.rb: new file.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-07 07:40:55 +00:00
gotoyuzo
60106097ce * add test for SHA224, SHA256, SHA384 and SHA512.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-08-22 21:14:24 +00:00
gotoyuzo
8a94b1740a * ext/openssl/ossl_ns_spki.c (ossl_spki_initialize): try to decode
the argument as a string.

* ext/openssl/ossl_ns_pki.c (ossl_spki_to_der): new method.

* ext/openssl/ossl_x509store.c (ossl_x509store_initialize): should
  set @time to avoid warning.

* ext/openssl/ossl_x509store.c (ossl_x509store_set_default_paths,
  X509_STORE_add_cert, X509_STORE_add_crl): should raise error if
  wrapped functions fails.

* ext/openssl/ossl_ssl.c (ossl_sslctx_set_ciphers): fix error message.

* ext/openssl/ossl_x509req.c (ossl_x509req_set_attributes): get rid
  of unused variable.

* test/openssl/test_ns_spki.rb: add new file.

* test/openssl/test_x509store.rb: add test for error.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-08-22 20:47:55 +00:00
gotoyuzo
1e0f2f7ca8 * test/openssl/test_x509store.rb: add test for expired CRL
and refine some assertions.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-05-28 07:41:36 +00:00
gotoyuzo
5505449793 * ext/openssl/ossl_ssl.c: OpenSSL::SSL::SSLContexts suports callbacks:
- SSLContext#client_cert_cb is a Proc. it is called when a client
    certificate is requested by a server and no certificate was yet
    set for the SSLContext. it must return an Array which includes
    OpenSSL::X509::Certificate and OpenSSL::PKey::RSA/DSA objects.
  - SSLContext#tmp_dh_callback is called in key exchange with DH
    algorithm. it must return an OpenSSL::PKey::DH object.

* ext/openssl/ossl_ssl.c:
  (ossl_sslctx_set_ciphers): ignore the argument if it's nil.
  (ossl_start_ssl, ossl_ssl_write): call rb_sys_fail if errno isn't 0.
  [ruby-dev:25831]

* ext/openssl/ossl_pkey.c
  (GetPrivPKeyPtr, ossl_pkey_sign): should call rb_funcall first.
  (DupPrivPKeyPtr): new function.

* ext/openssl/ossl_pkey_dh.c: add default DH parameters.

* ext/openssl/ossl_pkey.h: ditto.

* ext/openssl/lib/openssl/cipher.rb: fix typo. [ruby-dev:24285]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-03-09 10:45:42 +00:00
gotoyuzo
a9fb0817a1 * ext/openssl/ossl_ssl.c (ossl_start_ssl): should wait for that
the underlying IO become readable or writable if the error was
  SSL_ERROR_WANT_READ or SSL_ERROR_WANT_WRITE. [ruby-dev:25795]

* ext/openssl/ossl_ssl.c (ossl_ssl_read, ossl_ssl_write): ditto.

* ext/openssl/lib/openssl/buffering.rb
  (Buffering#consume_rbuf): pointless eof flag resetting is deleted.
  (Buffering#read): should return an empty string if the specified
  size is zero.
  (Buffering#readpartial): new method.
  (Buffering#readline): fix typo.
  (Buffering#getc): return the first character of string correctly.
  (Buffering#readchar): fix typo.
  (Buffering#eof?): should read again it the input buffer is empty.
  (Buffering#do_write): should rescue Errno::EAGAIN.
  (Buffering#puts): use "\n" as the output field separator.

* ext/openssl/extconf.rb: get rid of GNUmakefile generation.

* text/openssl/test_pair.rb: test for IO like methods.

* test/ruby/ut_eof.rb: test about empty file.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-03-05 21:36:11 +00:00
nobu
482abfc851 * test/openssl/ssl_server.rb: get rid of race condition.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-02-16 14:58:25 +00:00
gotoyuzo
1883e41c1b * ext/openssl/lib/openssl/ssl.rb
(OpenSSL::SSL::SSLSocket#post_connection_check): new method.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-02-14 04:14:39 +00:00
gotoyuzo
21d42dc45b * ext/openssl/ossl_asn1.c (ossl_asn1_traverse, ossl_asn1_decode):
use rb_str_new4 to avoid SEGV. fix [ruby-dev:25261]

* test/openssl/test_asn1.rb: add tests for OpenSSL::ASN1.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7623 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-12-21 03:44:17 +00:00
gotoyuzo
dd92742ce1 * ext/openssl/ossl_pkey_rsa.c (ossl_rsa_public_encrypt,
ossl_rsa_public_decrypt, ossl_rsa_private_encrypt,
  ossl_rsa_private_decrypt): should take an optional argument
  to specify padding mode. [ruby-talk:122539]

* ext/openssl/ossl_pkey_rsa.c (Init_ossl_rsa): add new constants
  PKCS1_PADDING, SSLV23_PADDING, NO_PADDING and PKCS1_OAEP_PADDING
  under OpenSSL::PKey::RSA.

* test/openssl/test_pkey_rsa.rb: new file.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-12-05 16:36:26 +00:00
gotoyuzo
3691ea5cf4 * test/openssl/ssl_server.rb: try to listen ports from 20443 to 20542
while failed in getting a TCPServer.

* test/openssl/test_x509name.rb: remove version dependence about
  nickname of OIDs.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-17 08:04:19 +00:00
gotoyuzo
8c1b803ed4 * ext/openssl/ossl_x509store.c
(ossl_x509stctx_initialize): setup OpenSSL::X509::StoreContext with
  ossl_x509stctx_* functions instead of X509_STORE_CTX_*.
  (ossl_x509store_set_time): add OpenSSL::X509::Store#time=.
  (ossl_x509stctx_set_time): add OpenSSL::X509::StoreContext#time=.

* test/openssl/ossl_x509store.rb: test certificate validity times.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7040 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-15 09:16:19 +00:00
gotoyuzo
07f245da37 * ext/openssl/ossl_x509name.c (ossl_x509name_to_s): add optional
second argument to specify the output format (see also
  X509_NAME_print_ex).

* ext/openssl/ossl_x509name.c (ossl_x509name_init): new constants:
  OpenSSL::X509::Name::COMPAT, OpenSSL::X509::Name::RFC2253,
  OpenSSL::X509::ONELINE, OpenSSL::X509::MULTILINE.

* ext/openssl/lib/openssl/x509.rb (OpenSSL::X509::Name::RFC2253DN):
  new module to provide the parse for RFC2253 DN format.

* ext/openssl/lib/openssl/x509.rb (OpenSSL::X509::Name.parse_rfc2253):
  new method to parse RFC2253 DN format.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-09-13 12:35:25 +00:00
matz
1bd47bf0bc * eval.c (rb_call0): should call rb_call_super() directly for
visibility overriding.  [ruby-dev:23989]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-07-28 09:05:08 +00:00
gotoyuzo
f4991ab795 * test/openssl/test_ssl.rb: add workaround for Cygwin.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6674 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-07-18 14:40:04 +00:00
gotoyuzo
97094af3ca * test/openssl/ssl_server.rb, test/openssl/test_ssl.rb: workaround to
terminate child process.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-07-16 05:56:44 +00:00
gotoyuzo
1a760a6f76 * ext/openssl/ossl_asn1.c (ossl_asn1cons_to_der): fix type of
argument. [ruby-dev:23891]

* test/openssl/test_x509store.rb: prune tests for CRL checking
  unless X509::V_FLAG_CRL_CHECK is defined.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-07-14 09:09:36 +00:00
gotoyuzo
22ab58c03c * ext/openssl/extconf.rb: check for EVP_CIPHER_CTX_copy, ENGINE_add,
EVP_CIPHER_CTX_set_padding, EVP_CipherFinal_ex, EVP_CipherInit_ex,
  EVP_DigestFinal_ex and EVP_DigestInit_ex.

* ext/openssl/openssl_missing.c (EVP_CIPHER_CTX_copy): new function.

* ext/openssl/openssl_missing.h (EVP_DigestInit_ex, EVP_DigestFinal_ex,
  EVP_CipherInit_ex, EVP_CipherFinal_ex, HMAC_Init_ex): new macro for
  OpenSSL 0.9.6.

* ext/openssl/ossl_cipher.c (ossl_cipher_alloc, ossl_cipher_initialize,
  ossl_cipher_copy, ossl_cipher_reset, ossl_cipher_encrypt,
  ossl_cipher_decrypt, ossl_cipher_final, ossl_cipher_set_key,
  ossl_cipher_set_iv): replace all EVP_CipherInit and
  EVP_CipherFinal into EVP_CipherInit_ex and EVP_CipherFinal_ex.
  and EVP_CIPHER_CTX_init should only be called once.

* ext/openssl/ossl_cipher.c (ossl_cipher_set_padding): check for
  EVP_CIPHER_CTX_set_padding.

* ext/openssl/ossl_cipher.c (Init_ossl_cipher): Cipher#<< is deprecated.

* ext/openssl/ossl_digest.c: replace all EVP_DigestInit and
  EVP_DigestFinal into EVP_DigestInit_ex and EVP_DigestFinal_ex.
  and EVP_MD_CTX_init should only be called once.

* ext/openssl/ossl_digest.c (digest_final): should call
  EVP_MD_CTX_cleanup to avoid memory leak.

* ext/openssl/ossl_hmac.c (ossl_hmac_initialize): repalce HMAC_init
  into HMAC_init_ex. and HMAC_CTX_init is moved to ossl_hmac_alloc.

* ext/openssl/ossl_hmac.c (hmac_final): should call
  HMAC_CTX_cleanup to avoid memory leak.

* test/openssl/test_cipher.rb, test/openssl/test_digest.rb,
  test/openssl/test_hmac.rb: new file.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-06-30 10:48:43 +00:00
gotoyuzo
f9bdcf5495 * test/openssl/test_ssl.rb: use Process.kill to kill child process
instead of waiting for closing popen-ed IO.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6482 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-06-20 15:57:40 +00:00
gotoyuzo
61949eefde * add test for OpenSSL::SSL.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-05-26 18:14:27 +00:00
gotoyuzo
5059c5a53b * test/openssl/test_x509name.rb: short names of some OIDs (serialNumber
and emailAddress) are mismatched between OpenSSL 0.9.6 and 0.9.7.

* test/openssl/test_x509store.rb: get rid of unused flag.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-05-24 16:57:44 +00:00
gotoyuzo
11784c2c4b * test_x509crl.rb (test_basic): add test for CRL issuer.
* test_x509store.rb: test for OpenSSL::X509::Store
* utils.rb (issue_crl): should set issuer's subject.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-05-21 18:25:25 +00:00
gotoyuzo
6988d86035 * rescue LoadError. [ruby-dev:23539]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-05-19 18:30:52 +00:00
gotoyuzo
bd0cd7f92b * test for OpenSSL::X509
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6350 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-05-17 20:23:28 +00:00