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

18 commits

Author SHA1 Message Date
nahi
bebc39d135 * ext/openssl/ossl_x509name.c: added X509::Name#hash_old as a wrapper
for X509_NAME_hash_old in OpenSSL 1.0.0.

        * test/openssl/test_x509name.rb (test_hash): make test pass with
          OpenSSL 1.0.0.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@26840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-06 21:49:54 +00:00
nahi
ef5c7c951a * ext/openssl: backport fixes in 1.9.
* r25019 by marcandre
	    * ossl_ocsp.c (ossl_ocspres_to_der): Bug fix in Response#to_def.
	      Patch by Chris Chandler [ruby-core:18411]

	  * r25017 by marcandre
	    * ossl_config.c (ossl_config_add_value_m,
	      ossl_config_set_section): Check if frozen (or untrusted for
	      $SECURE >= 4) [ruby-core:18377]

	  * r22925 by nobu
	    * ext/openssl/openssl_missing.h (i2d_of_void): cast for callbacks.
	      [ruby-core:22860]

	    * ext/openssl/ossl_engine.c (ossl_engine_s_by_id): suppress a
	      warning.

	    * ext/openssl/ossl_ssl.c (ossl_sslctx_flush_sessions): time_t may
	      be larger than long.

	    * ext/openssl/ossl_ssl_session.c (ossl_ssl_session_get_time),
	      (ossl_ssl_session_get_timeout): use TIMET2NUM() to convert
	      time_t.

	  * r22924 by nobu
	    * ext/openssl/ossl_x509ext.c (ossl_x509ext_set_value): should use
	      OPENSSL_free instead of free.  a patch from Charlie Savage at
	      [ruby-core:22858].

	  * r22918 by akr
	    * ext/openssl: suppress warnings.

	    * ext/openssl/ossl.h (OSSL_Debug): don't use gcc extention for
	      variadic macro.

	  * r22666 by akr
	    * ext/openssl/lib/openssl/buffering.rb: define Buffering module
	      under OpenSSL.  [ruby-dev:37906]

	  * r22440 by nobu
	    * ext/openssl/ossl_ocsp.c (ossl_ocspbres_verify): OCSP_basic_verify
	      returns positive value on success, not non-zero.
	      [ruby-core:21762]

	  * r22378 by akr
	    * ext/openssl: avoid cyclic require.

	    * ext/openssl/lib/openssl/ssl-internal.rb: renamed from ssl.rb

	    * ext/openssl/lib/openssl/x509-internal.rb: renamed from x509.rb.
	      [ruby-dev:38018]

	  * r22101 by nobu
	    * ext/openssl/ossl_cipher.c (add_cipher_name_to_ary): used
	      conditionally.

	  * r21510 by akr
	    * ext/openssl/ossl.c (ossl_raise): abolish a warning.

	  * r21208 by akr
	    * ext/openssl/ossl_digest.c (GetDigestPtr): use StringValueCStr
	      instead of STR2CSTR.

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

	  * r19420 by mame
	    * ext/openssl/ossl_pkey_ec.c (ossl_ec_key_to_string): comment out
	      fragments of unused code.

	  * r18975 by nobu
	    * ext/openssl/ossl_ocsp.c (ossl_ocspres_initialize): fix for
	      initialization of r18168.

	  * r18971 by nobu
	    * ext/openssl/ossl_config.c (Init_ossl_config): removed C99ism.

	  * r18944 by matz
	    * ext/openssl/ossl_config.c (Init_ossl_config): memory leak fixed.
	      a patch <shinichiro.hamaji at gmail.com> in [ruby-dev:35880].

	    * ext/openssl/ossl_x509ext.c (ossl_x509ext_set_value): ditto.

	  * r18917 by nobu
	    * ext/openssl/ossl_x509attr.c (ossl_x509attr_initialize): fix for
	      initialization of r18168.

	    * ext/openssl/ossl_ocsp.c (ossl_ocspreq_initialize): ditto.

	    * ext/openssl/ossl_x509name.c (ossl_x509name_initialize): ditto.

	  * r18283 by nobu
	    * ext/openssl/ossl_asn1.c (ossl_asn1_get_asn1type): suppress
	      warnings on platforms which int size differs from pointer size.

	  * r18181 by nobu
	    * ext/openssl/openssl_missing.h (d2i_of_void): define for older
	      versions.  [ruby-dev:35637]

	  * r18168 by nobu
	    * ext/openssl: suppress warnings.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@26835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-06 21:37:39 +00:00
nobu
337f8efb63 * ext/openssl/ossl_x509attr.c (ossl_x509attr_initialize): fix for
initialization of r18168.

* ext/openssl/ossl_ocsp.c (ossl_ocspreq_initialize): ditto.

* ext/openssl/ossl_x509ext.c (ossl_x509ext_initialize): ditto.
    
* ext/openssl/ossl_x509name.c (ossl_x509name_initialize): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@18943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-30 05:59:58 +00:00
nobu
e934121534 * ext/openssl: suppress warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@18172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-22 19:16:41 +00:00
nobu
f298a1a670 * ext/digest/digest.c (rb_digest_instance_update,
rb_digest_instance_finish, rb_digest_instance_reset,
  rb_digest_instance_block_length): %s in rb_raise() expects char*.
  [ruby-dev:31222]

* ext/openssl/ossl.h: include ossl_pkcs5.h.  [ruby-dev:31231]

* ext/openssl/ossl_pkcs5.h: new file for PKCS5.  [ruby-dev:31231]

* ext/openssl/ossl_x509name.c (ossl_x509name_to_s): use ossl_raise()
  instead of rb_raise().  [ruby-dev:31222]

* ext/sdbm/_sdbm.c: DOSISH platforms need io.h.  [ruby-dev:31232]

* ext/syck/syck.h: include stdlib.h for malloc() and free().
  [ruby-dev:31232]

* ext/syck/syck.h (syck_parser_set_input_type): prototype added.
  [ruby-dev:31231]

* win32/win32.c: include mbstring.h for _mbspbrk().  [ruby-dev:31232]

* win32.h (rb_w32_getcwd): prototype added.  [ruby-dev:31232]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-15 13:24:51 +00:00
technorama
18342ff8e0 import OpenSSL from trunk
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12496 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-08 15:02:04 +00:00
gotoyuzo
16cdfdad28 * ext/openssl/ossl_x509name.c (Init_ossl_x509name): should use
rb_hash_new to get exactly a Hash. fix [ruby-dev:25325].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-12-27 07:55:56 +00:00
gotoyuzo
049c3927ff * ext/openssl/ossl_x509store.c
(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.

* 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.

* test/openssl/ossl_x509name.rb: add tests about RFC2253 DN.

* text/openssl/ssl_server.rb: try to listen ports from 20443 to 20542
  while EADDRINUSE is raised.

* all changes in this entry are backport from 1.9.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7599 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-12-19 08:28:33 +00:00
gotoyuzo
db82a3315b * ext/openssl/ossl_x509name.c (ossl_x509name_to_a): avoid SEGV
(rollback the previous commit).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-12-15 06:46:19 +00:00
matz
d89b8333c5 * ext/openssl/ossl_digest.c (ossl_digest_initialize): [ruby-dev:25198]
* lib/cgi/session.rb (CGI::Session::initialize): generate new
  session if given session_id does not exist.  [ruby-list:40368]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-12-15 01:54:40 +00:00
gotoyuzo
4e5fbd0b8a * ext/openssl/ossl_x509attr.c (ossl_x509attr_initialize): d2i
functions may replace the pointer indicated by the first argument.

* ext/openssl/ossl_x509ext.c (ossl_x509ext_initialize): ditto.

* ext/openssl/ossl_x509name.c (ossl_x509name_initialize): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-08-24 00:09:47 +00:00
gotoyuzo
a472b97810 * ext/openssl/ossl_x509name.c: attribute value of DC (short name of
domainComponent) should be IA5String.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6295 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-05-12 05:38:20 +00:00
gotoyuzo
86faa72cde * ext/openssl/ossl_x509name.c (ossl_x509name_init_i): should return a value.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-04-12 09:53:14 +00:00
gotoyuzo
d097999e44 backport from Ruby-1.9.
* ext/openssl/ossl_x509hame.c (ossl_x509name_initialize): change
  second argument. it expected to be a Hash not an Integer.

* ext/openssl/ossl_x509name.c (ossl_x509name_add_entry): add new
  function for OpenSSL::X509::Name#add_entry.

* ext/openssl/ossl_x509name.c (ossl_x509name_to_a): append ASN.1
  tag number to each element of return value.

* ext/openssl/ossl_x509name.c (Init_ossl_x509name): add constants
  OpenSSL::X509::Name::DEFAULT_OBJECT_TYPE and OBJECT_TYPE_TEMPLATE.

* ext/openssl/lib/openssl/x509.rb (OpenSSL::X509::Name#initialize):
  second argument takes OBJECT_TYPE_TEMPLATE by default.

* sample/openssl/gen_csr.rb: use OpenSSL::X509::Name.parse.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@5575 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-01-29 06:49:11 +00:00
gotoyuzo
80549d5f17 * ext/openssl/ossl_x509name.c (ossl_x509name_initialize): add
optional argument to specify the DirectoryString type
  (ASN1::UTF8STRING by default). RFC3280 deprecates PrintableString
  for DirectoryString, and strongly requires to use UTF8String for
  all certificates issued after December, 31 2003.

* ext/openssl/lib/openssl/x509.rb (X509::Name::parse): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4733 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-10-09 16:20:22 +00:00
gotoyuzo
30103702c3 * ext/openssl: all files are reviewed to simplify and avoid memory leak.
* ext/openssl/extconf.rb: add check for assert.h.

* ext/openssl/ossl.c (ossl_buf2str): new function to convert
  C buffer to String and free buffer.

* ext/openssl/ossl.c (ossl_x509_ary2sk): new function to convert
  Array of OpenSSL::X509 to STACK_OF(X509) with exception safe.

* ext/openssl/ossl.c (ossl_to_der, ossl_to_der_if_possible): new
  functions to convert object to DER string.

* ext/openssl/ossl.h: ditto.

* ext/openssl/ossl_bio.c (ossl_membio2str): new function to convert
  BIO to String object and free BIO.

* ext/openssl/ossl_bio.h: ditto.

* ext/openssl/ossl_pkcs7.c (ossl_pkcs7_to_der): add for "to_der".

* ext/openssl/ossl_x509name.c (ossl_x509name_to_der): ditto.

* ext/openssl/ossl_x509ext.c (ossl_x509ext_to_der): ditto.

* ext/openssl/ossl_x509ext.c (create_ext_from_array): removed
  and reimplement in openssl/x509.rb.

* ext/openssl/ossl_x509attr.c: reimplemented and disable some
  method temporarily. this class doesn't work fine without ASN.1
  data support;-) I'll rewrite in near future.

* ext/openssl/lib/openssl/x509.c (X509::Attribute): get rid off
  unused code.

* ext/openssl/lib/openssl/x509.c (X509::ExtensionFactory): refine all.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-09-17 09:05:02 +00:00
gotoyuzo
256d273e69 * ext/openssl/ruby_missing.c: rid of unnecessary backward
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@4522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-09-06 08:56:09 +00:00
gotoyuzo
231247c010 * ext/openssl: imported.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-07-23 16:12:24 +00:00