summaryrefslogtreecommitdiffstats
path: root/ext/openssl/ossl_ssl.c
Commit message (Collapse)AuthorAgeFilesLines
* * ext/openssl/lib/openssl/ssl.rb (OpenSSL::SSL::SSLServer#intialize):gotoyuzo2005-05-221-2/+12
| | | | | | | | | should initialize session id context. [ruby-core:4663] * ext/openssl/ossl_ssl.c (ossl_sslctx_setup): add session id support. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@8498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl/ossl_ssl.c (ossl_tmp_dh_callback): should get DHgotoyuzo2005-03-121-2/+2
| | | | | | | parameter from the current SSL object. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@8139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl/ossl_pkey_dh.c (ossl_create_dh): fix typo.gotoyuzo2005-03-121-2/+2
| | | | | | | | | | patch from IWATSUKI Hiroyuki. [ruby-dev:25867] * ext/openssl/ossl_ssl.c (ossl_tmp_dh_callback): ditto. (ossl_call_tmp_dh_callback): ditto git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@8137 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl/ossl_ssl.c: OpenSSL::SSL::SSLContexts suports callbacks:gotoyuzo2005-03-091-22/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | - 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: http://svn.ruby-lang.org/repos/ruby/trunk@8129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl/ossl_ssl.c (ssl_get_error): typo.usa2005-03-071-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@8101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl/ossl_ssl.c (ossl_start_ssl, ossl_ssl_read,usa2005-03-071-3/+9
| | | | | | | ossl_ssl_write): need to set errno on Win32 platform. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@8100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl/ossl_ssl.c (ossl_start_ssl): should wait for thatgotoyuzo2005-03-051-26/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: http://svn.ruby-lang.org/repos/ruby/trunk@8081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl/ossl_ssl.c (ossl_ssl_read, ossl_ssl_write): shouldgotoyuzo2005-02-151-1/+3
| | | | | | | | | | | | | | | | | call rb_sys_fail instead of rasing SSLError if SSL_ERROR_SYSCALL occured. * ext/openssl/lib/openssl/buffering.rb (Buffering#fill_rbuff): should rescue Errno::EAGAIN. * ext/openssl/lib/openssl/buffering.rb (Buffering#each): fix typo. suggested by Brian Ollenberger. * ext/openssl/lib/openssl/ssl.rb: set non-blocking flag to the underlying IO. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@7974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/set.rb (Set#==): [ruby-dev:25206]matz2004-12-151-11/+9
| | | | | | | | | | | * ext/openssl/ossl_digest.c (ossl_digest_initialize): [ruby-dev:25198] * utf8.c (utf8_is_mbc_ambiguous): [ruby-talk:123561] * utf8.c (utf8_mbc_to_normalize): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@7563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * rubyio.h, intern.h, io.c, file.c, process.c, ext/socket/socket.c,akr2004-12-061-2/+2
| | | | | | | | | | | ext/pty/pty.c, ext/io/wait/wait.c, ext/openssl/ossl_ssl.c: Use own buffering mechanism instead of stdio. * io.c, ext/stringio/stringio.c, test/ruby/ut_eof.rb: EOF flag removed. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@7473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * node.h (NODE_TYPESHIFT): allow 4 more bits for line numbers.matz2004-10-271-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | [ruby-talk:117841] * ruby.h (FL_ABLE): nodes are not subject for flag operations. * io.c (ARGF_FORWARD): should have specified argv explicitly, since we no longer have frame->argv saved. [ruby-dev:24602] * string.c (RESIZE_CAPA): check string attribute before modifying capacity member of string structure. [ruby-dev:24594] * ext/zlib/zlib.c (gzreader_gets): use memchr() to to gain performance. [ruby-talk:117701] * sprintf.c (rb_f_sprintf): raise ArgumentError for extra arguments, unless (digit)$ style used. * io.c (rb_io_fptr_finalize): leave stdin/stdout/stderr open in interpreter termination. [ruby-dev:24579] * eval.c (frame_free): Guy Decoux solved the leak problem. Thanks. [ruby-core:03549] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@7121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl/ossl_ssl.c (ossl_ssl_read):gotoyuzo2004-08-221-20/+27
| | | | | | | | | | | | | | | | | | - should return an empty string if specified length to read is 0. - should check for pending data and wait for fd before reading. - call underlying IO's sysread if SSL session is not started. [ruby-dev:24072], [ruby-dev:24075] * ext/openssl/ossl_ssl.c (ossl_ssl_write): - call underlying IO's syswrite if SSL session is not started. * ext/openssl/ossl_ssl.c (ossl_ssl_pending): new method OpenSSL::SSL#pending. * ext/openssl/lib/openssl/buffering.rb: should not use select. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@6806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl/ossl_ssl.c (ossl_ssl_read): take optional second argumentgotoyuzo2004-05-261-4/+10
| | | | | | | | | | | | | | | | to specify a string to be written. * ext/openssl/lib/openssl/buffering.rb (OpenSSL::Buffering#read): take optional second argument to specify a string to be written. * ext/openssl/lib/openssl/buffering.rb (OpenSSL::Buffering#gets): refine regexp for end-of-line. * ext/opnessl/lib/openssl/ssl.rb (OpenSSL::SSL::SocketForwarder#listen): fix typo. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@6411 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl/ossl_ssl.c (ossl_ssl_read): should check for errorgotoyuzo2003-12-241-12/+31
| | | | | | | | | status by SSL_get_error(). * ext/openssl/ossl_ssl.c (ossl_ssl_write): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* no need to care SSL_ERROR_NONE and SSL_ERROR_WANT_X509_LOOKUP.gotoyuzo2003-12-061-4/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl/ossl_ssl.c (ossl_start_ssl): new function to wrapgotoyuzo2003-12-061-6/+25
| | | | | | | | | | | | | | SSL_connect and SSL_accept; if SSL_connect (or SSL_accept) returned but not finished the handshake process, we should retry it. * ext/openssl/ossl_ssl.c (ossl_ssl_connect): call ossl_start_ssl. * ext/openssl/ossl_ssl.c (ossl_ssl_accept): ditto. * ext/openssl/ossl_ssl.c (ossl_ssl_read): allow signal traps. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/https.rb (HTTPRequest#parse): set @client_cert_chain.gotoyuzo2003-11-041-0/+1
| | | | | | | | | | | * lib/webrick/https.rb (HTTPRequest#meta_vars): create SSL_CLIENT_CERT_CHAIN_n from @client_cert_chain. * ext/openssl/ossl_ssl.c (ossl_ssl_get_peer_cert_chain): return nil if no cert-chain was given. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl/ossl_ssl.c (ossl_ssl_peer_cert_chain): add new methodgotoyuzo2003-11-011-0/+26
| | | | | | | | | | | | | | | SSLSocket#peer_cert_chain. * ext/openssl/ossl_x509req.c (GetX509ReqPtr): new function which returns underlying X509_REQ. * ext/openssl/ossl_x509ext.c (ossl_x509extfactory_set_issuer_cert, ossl_x509extfactory_set_subject_cert, ossl_x509extfactory_set_crl, ossl_x509extfactory_set_subject_req, ossl_x509extfactory_set_config): use underlying C struct without duplication not to leak momory. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl/lib/openssl/buffering.rb (Buffering#initialize):gotoyuzo2003-10-291-1/+24
| | | | | | | | | | | | | | | add new method to inherit @sync from @io.sync. * ext/openssl/lib/net/protocols.rb (SSLIO#ssl_connect): no need to set sync flag explicitly. * ext/openssl/ossl_ssl.c (ossl_sslctx_initialize): call super. * ext/openssl/ossl_ssl.c (ossl_sslctx_setup): set extra chain certificates in @extra_chain_cert. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl/ruby_missing.c: rid of unnecessary backwardgotoyuzo2003-09-061-2/+0
| | | | | | | | | | | | | | | | compatibility stuff. and remove DEFINE_ALLOC_WRAPPER from all sources. * ext/openssl/ossl_x509ext.c (X509::Extension.new): new method. * ext/openssl/ossl_x509ext.c (X509::Extension#oid=): new method. * ext/openssl/ossl_x509ext.c (X509::Extension#value=): new method. * ext/openssl/ossl_x509ext.c (X509::Extension#critical=): new method. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl/ossl_ssl.c: sync_close is moved to SSLSocket asgotoyuzo2003-08-181-7/+14
| | | | | | | | | | | | | | | | | | a builtin. * ext/openssl/lib/openssl/buffering.rb (Buffering#close): ditto. * ext/openssl/lib/openssl/buffering.rb (Buffering#puts): should add a return to the tails of each line. * ext/openssl/lib/openssl/ssl.rb: new class OpenSSL::SSL::SSLServer. * ext/openssl/lib/net/protocols.rb (SSLIO#ssl_connect): use sync_close. * ext/openssl/sample/echo_svr.rb: use SSLServer. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl/lib/openssl/buffering.rb: increase BLOCK_SIZEgotoyuzo2003-08-101-0/+1
| | | | | | | | | | from 1k to 16k bytes. [ruby-talk:78603] * ext/openssl/ossl_ssl.c (ossl_sslctx_s_alloc): enable partial write to allow interruption in SSLSocket#sysread. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl/ossl_ssl.c (ossl_sslctx_initialize): should initializegotoyuzo2003-07-301-0/+5
| | | | | | | instance variables. [ruby-talk:77362] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4229 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_fdopen): set errno if it's zero on win32 platforms.usa2003-07-261-1/+1
| | | | | | | | | | * ext/openssl/ossl_ssl.c (TO_SOCKET): define special version when _WIN32 is defined. this is ruby's problem, not OpenSSL. * win32/win32.c: remove some old comments. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl/ossl_ssl.c (ossl_ssl_setup): need to pass the realusa2003-07-251-1/+7
| | | | | | | socket to SSL_get_fd on native win32 platforms. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/openssl: imported.gotoyuzo2003-07-231-0/+678
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e