Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 235805 Details for
Bug 304427
dev-lang/ruby fails to compile with openssl 1.0.0
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
missing bits for openssl 1.0.0 compatibility
ruby-openssl.diff (text/plain), 5.11 KB, created by
Hanno Böck
on 2010-06-17 23:22:45 UTC
(
hide
)
Description:
missing bits for openssl 1.0.0 compatibility
Filename:
MIME Type:
Creator:
Hanno Böck
Created:
2010-06-17 23:22:45 UTC
Size:
5.11 KB
patch
obsolete
>ossl_config part is from >http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/39053 > >ossl_ssl_sesion part is from >http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/ext/openssl/ossl_ssl_session.c?r1=26850&r2=26861 > >diff -Naur ruby-1.8.7-p249/ext/openssl/ossl_config.c ruby-1.8.7-p249-1//ext/openssl/ossl_config.c >--- ruby-1.8.7-p249/ext/openssl/ossl_config.c 2009-11-18 06:20:22.000000000 +0100 >+++ ruby-1.8.7-p249-1//ext/openssl/ossl_config.c 2010-06-18 01:19:04.000000000 +0200 >@@ -303,12 +303,27 @@ > } > > #ifdef IMPLEMENT_LHASH_DOALL_ARG_FN >+ >+#if OPENSSL_VERSION_NUMBER >= 0x10000000L >+static void >+get_conf_section_doall_arg(void *arg1, void *arg2) >+{ >+ CONF_VALUE *cv; >+ VALUE ary; >+ >+ cv = arg1; >+ ary = (VALUE)arg2; >+ if(cv->name) return; >+ rb_ary_push(ary, rb_str_new2(cv->section)); >+} >+#else > static void > get_conf_section(CONF_VALUE *cv, VALUE ary) > { > if(cv->name) return; > rb_ary_push(ary, rb_str_new2(cv->section)); > } >+#endif > > static IMPLEMENT_LHASH_DOALL_ARG_FN(get_conf_section, CONF_VALUE*, VALUE); > >@@ -320,11 +335,44 @@ > > GetConfig(self, conf); > ary = rb_ary_new(); >+ >+#if OPENSSL_VERSION_NUMBER >= 0x10000000L >+ LHM_lh_doall_arg(CONF_VALUE, conf->data, >+ LHASH_DOALL_ARG_FN(get_conf_section), void, (void*)ary); >+#else > lh_doall_arg(conf->data, LHASH_DOALL_ARG_FN(get_conf_section), (void*)ary); >+#endif > > return ary; > } > >+#if OPENSSL_VERSION_NUMBER >= 0x10000000L >+static void >+dump_conf_value_doall_arg(void *arg1, void *arg2) >+{ >+ STACK_OF(CONF_VALUE) *sk; >+ CONF_VALUE *cv, *v; >+ VALUE str; >+ int i, num; >+ >+ cv = arg1; >+ if (cv->name) return; >+ str = (VALUE)arg2; >+ sk = (STACK_OF(CONF_VALUE)*)cv->value; >+ num = sk_CONF_VALUE_num(sk); >+ rb_str_cat2(str, "[ "); >+ rb_str_cat2(str, cv->section); >+ rb_str_cat2(str, " ]\n"); >+ for(i = 0; i < num; i++){ >+ v = sk_CONF_VALUE_value(sk, i); >+ rb_str_cat2(str, v->name ? v->name : "None"); >+ rb_str_cat2(str, "="); >+ rb_str_cat2(str, v->value ? v->value : "None"); >+ rb_str_cat2(str, "\n"); >+ } >+ rb_str_cat2(str, "\n"); >+} >+#else > static void > dump_conf_value(CONF_VALUE *cv, VALUE str) > { >@@ -347,6 +395,7 @@ > } > rb_str_cat2(str, "\n"); > } >+#endif > > static IMPLEMENT_LHASH_DOALL_ARG_FN(dump_conf_value, CONF_VALUE*, VALUE); > >@@ -356,7 +405,12 @@ > VALUE str; > > str = rb_str_new(0, 0); >+#if OPENSSL_VERSION_NUMBER >= 0x10000000L >+ LHM_lh_doall_arg(CONF_VALUE, conf->data, >+ LHASH_DOALL_ARG_FN(dump_conf_value), void, (void*)str); >+#else > lh_doall_arg(conf->data, LHASH_DOALL_ARG_FN(dump_conf_value), (void*)str); >+#endif > > return str; > } >@@ -371,8 +425,32 @@ > return dump_conf(conf); > } > >+#if OPENSSL_VERSION_NUMBER >= 0x10000000L >+static void >+each_conf_value_doall_arg(void *arg1, void* dummy) >+{ >+ STACK_OF(CONF_VALUE) *sk; >+ CONF_VALUE *cv, *v; >+ VALUE section, name, value, args; >+ int i, num; >+ >+ cv = arg1; >+ if (cv->name) return; >+ sk = (STACK_OF(CONF_VALUE)*)cv->value; >+ num = sk_CONF_VALUE_num(sk); >+ section = rb_str_new2(cv->section); >+ for(i = 0; i < num; i++){ >+ v = sk_CONF_VALUE_value(sk, i); >+ name = v->name ? rb_str_new2(v->name) : Qnil; >+ value = v->value ? rb_str_new2(v->value) : Qnil; >+ args = rb_ary_new3(3, section, name, value); >+ rb_yield(args); >+ } >+} >+#else > static void >-each_conf_value(CONF_VALUE *cv, void* dummy) >+each_conf_value >+(CONF_VALUE *cv, void* dummy) > { > STACK_OF(CONF_VALUE) *sk; > CONF_VALUE *v; >@@ -391,6 +469,7 @@ > rb_yield(args); > } > } >+#endif > > static IMPLEMENT_LHASH_DOALL_ARG_FN(each_conf_value, CONF_VALUE*, void*); > >@@ -400,7 +479,12 @@ > CONF *conf; > > GetConfig(self, conf); >+#if OPENSSL_VERSION_NUMBER >= 0x10000000L >+ LHM_lh_doall_arg(CONF_VALUE, conf->data, >+ LHASH_DOALL_ARG_FN(each_conf_value), void, (void*)NULL); >+#else > lh_doall_arg(conf->data, LHASH_DOALL_ARG_FN(each_conf_value), (void*)NULL); >+#endif > > return self; > } >@@ -431,7 +515,7 @@ > ossl_config_inspect(VALUE self) > { > VALUE str, ary = ossl_config_get_sections(self); >- char *cname = rb_class2name(rb_obj_class(self)); >+ const char *cname = rb_class2name(rb_obj_class(self)); > > str = rb_str_new2("#<"); > rb_str_cat2(str, cname); >diff -Naur ruby-1.8.7-p249/ext/openssl/ossl_ssl_session.c ruby-1.8.7-p249-1//ext/openssl/ossl_ssl_session.c >--- ruby-1.8.7-p249/ext/openssl/ossl_ssl_session.c 2008-06-06 10:05:24.000000000 +0200 >+++ ruby-1.8.7-p249-1//ext/openssl/ossl_ssl_session.c 2010-06-18 01:19:13.000000000 +0200 >@@ -86,9 +86,18 @@ > GetSSLSession(val1, ctx1); > SafeGetSSLSession(val2, ctx2); > >- switch (SSL_SESSION_cmp(ctx1, ctx2)) { >- case 0: return Qtrue; >- default: return Qfalse; >+ /* >+ * OpenSSL 1.0.0betas do not have non-static SSL_SESSION_cmp. >+ * ssl_session_cmp (was SSL_SESSION_cmp in 0.9.8) is for lhash >+ * comparing so we should not depend on it. Just compare sessions >+ * by version and id. >+ */ >+ if ((ctx1->ssl_version == ctx2->ssl_version) && >+ (ctx1->session_id_length == ctx2->session_id_length) && >+ (memcmp(ctx1->session_id, ctx2->session_id, ctx1->session_id_length) == 0)) { >+ return Qtrue; >+ } else { >+ return Qfalse; > } > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 304427
:
231019
| 235805 |
235815