[#4745] Win32: Ruby & APR; build problems for Ruby Subversion SWIG bindings — Erik Huelsmann <ehuels@...>

Having taken upon me the task to provide a Windows build for

24 messages 2005/04/20
[#4746] Re: Win32: Ruby & APR; build problems for Ruby Subversion SWIG bindings — Austin Ziegler <halostatue@...> 2005/04/20

On 4/20/05, Erik Huelsmann <ehuels@gmail.com> wrote:

[#4747] Re: Win32: Ruby & APR; build problems for Ruby Subversion SWIG bindings — Erik Huelsmann <ehuels@...> 2005/04/20

Hi Austin,

[#4762] Re: Win32: Ruby & APR; build problems for Ruby Subversion SWIG bindings — nobu.nokada@... 2005/04/24

Hi,

[#4783] Re: Win32: Ruby & APR; build problems for Ruby Subversion SWIG bindings — Erik Huelsmann <ehuels@...> 2005/04/25

On 4/24/05, nobu.nokada@softhome.net <nobu.nokada@softhome.net> wrote:

[#4787] Re: Win32: Ruby & APR; build problems for Ruby Subversion SWIG bindings — nobu.nokada@... 2005/04/25

Hi,

[#4794] Re: Win32: Ruby & APR; build problems for Ruby Subversion SWIG bindings — Erik Huelsmann <ehuels@...> 2005/04/25

> > > Ruby is just using AC_TYPE_UID_T. So, using typedef for them,

[#4751] Illegal regexp causes segfault — Andrew Walrond <andrew@...>

irb(main):058:0> a = /\[([^]]*)\]/

13 messages 2005/04/22

[PATCH] openssl session id support

From: "Evan M. Webb" <evan@...>
Date: 2005-04-04 23:31:13 UTC
List: ruby-core #4663
The following patch adds support for setting the session id within an
SSL::Context object. Setting the context is necessary for any client
using peer certificates that wish to reuse session ids from previous
connections. Without this patch, any client that connects again and
attempts to reuse the session id will recieve 'session id context
uninitialized' as an SSL Error and the connection is terminated
immediately.


-- 
Evan M. Webb <evan@fallingsnow.net>

Attachments (1)

ruby-ssl-session.diff (1.85 KB, text/x-patch)
--- ruby-1.8.2/ext/openssl/ossl_ssl.c.orig	2005-04-04 12:07:26.000000000 -0700
+++ ruby-1.8.2/ext/openssl/ossl_ssl.c	2005-04-04 12:13:33.000000000 -0700
@@ -349,6 +349,30 @@
     return Qnil;
 }
 
+VALUE
+ossl_sslctx_set_session_id(VALUE self, VALUE sid) {
+    SSL_CTX *ctx;
+    int i;
+    VALUE str;
+
+    rb_check_frozen(self);
+    str = sid;
+    StringValue(str);
+
+    Data_Get_Struct(self, SSL_CTX, ctx);
+
+    if(!ctx) {
+        ossl_raise(eSSLError, "SSL_CTX is not initialized.");
+        return Qnil;
+    }
+    if(!SSL_CTX_set_session_id_context(ctx,RSTRING(str)->ptr,
+                RSTRING(str)->len)) {
+        ossl_raise(eSSLError, "SSL_CTX_set_session_id_context");
+    }
+
+    return Qnil;
+}
+
 /*
  * SSLSocket class
  */
@@ -728,6 +752,7 @@
     rb_define_method(cSSLContext, "initialize",  ossl_sslctx_initialize, -1);
     rb_define_method(cSSLContext, "ciphers",     ossl_sslctx_get_ciphers, 0);
     rb_define_method(cSSLContext, "ciphers=",    ossl_sslctx_set_ciphers, 1);
+    rb_define_method(cSSLContext, "session_id=", ossl_sslctx_set_session_id, 1);
 
     /* class SSLSocket */
     cSSLSocket = rb_define_class_under(mSSL, "SSLSocket", rb_cObject);
--- ruby-1.8.2/ext/openssl/lib/openssl/ssl.rb.orig	2005-04-04 13:03:18.000000000 -0700
+++ ruby-1.8.2/ext/openssl/lib/openssl/ssl.rb	2005-04-04 12:33:41.000000000 -0700
@@ -58,9 +58,19 @@
       include SocketForwarder
       attr_accessor :start_immediately
 
-      def initialize(svr, ctx)
+      def initialize(svr, ctx, session_id=nil)
         @svr = svr
         @ctx = ctx
+        if session_id
+            @session_id = session_id
+        else
+            @session_id = ('a' .. 'z').to_a.sort_by { rand } [0,24].join("")
+        end
+
+        if @ctx.respond_to? :session_id=
+            @ctx.session_id = @session_id
+        end
+
         @start_immediately = true
       end
 

In This Thread

Prev Next