mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-19 02:00:06 +02:00
Backport some more fixes for ssl support in ruby-1.9.1
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
diff -up ruby-1.9.1-p243/configure.in.orig ruby-1.9.1-p243/configure.in
|
||||
--- ruby-1.9.1-p243/configure.in.orig 2009-05-11 09:06:48.052428800 -0600
|
||||
+++ ruby-1.9.1-p243/configure.in 2010-05-17 23:53:26.615514112 -0600
|
||||
--- ruby-1.9.1-p243/configure.in.orig 2009-05-11 09:06:48.016515072 -0600
|
||||
+++ ruby-1.9.1-p243/configure.in 2010-05-20 13:00:34.788529152 -0600
|
||||
@@ -1462,11 +1462,11 @@ if test "$with_dln_a_out" != yes; then
|
||||
haiku*) case "$target_cpu" in
|
||||
powerpc*)
|
||||
@@ -16,8 +16,8 @@ diff -up ruby-1.9.1-p243/configure.in.orig ruby-1.9.1-p243/configure.in
|
||||
esac
|
||||
: ${LIBPATHENV=LIBRARY_PATH}
|
||||
diff -up ruby-1.9.1-p243/signal.c.orig ruby-1.9.1-p243/signal.c
|
||||
--- ruby-1.9.1-p243/signal.c.orig 2009-02-22 02:48:12.016777216 -0700
|
||||
+++ ruby-1.9.1-p243/signal.c 2010-05-17 23:44:05.636223488 -0600
|
||||
--- ruby-1.9.1-p243/signal.c.orig 2009-02-22 02:48:12.048234496 -0700
|
||||
+++ ruby-1.9.1-p243/signal.c 2010-05-20 13:00:34.792461312 -0600
|
||||
@@ -34,7 +34,7 @@ typedef int rb_atomic_t;
|
||||
# define ATOMIC_DEC(var) (--(var))
|
||||
#endif
|
||||
@@ -37,8 +37,8 @@ diff -up ruby-1.9.1-p243/signal.c.orig ruby-1.9.1-p243/signal.c
|
||||
NORETURN(void ruby_thread_stack_overflow(rb_thread_t *th));
|
||||
rb_thread_t *th = GET_THREAD();
|
||||
diff -up ruby-1.9.1-p243/ext/nkf/nkf-utf8/nkf.h.orig ruby-1.9.1-p243/ext/nkf/nkf-utf8/nkf.h
|
||||
--- ruby-1.9.1-p243/ext/nkf/nkf-utf8/nkf.h.orig 2008-11-11 01:41:20.057671680 -0700
|
||||
+++ ruby-1.9.1-p243/ext/nkf/nkf-utf8/nkf.h 2010-05-17 23:44:05.639631360 -0600
|
||||
--- ruby-1.9.1-p243/ext/nkf/nkf-utf8/nkf.h.orig 2008-11-11 01:41:20.021757952 -0700
|
||||
+++ ruby-1.9.1-p243/ext/nkf/nkf-utf8/nkf.h 2010-05-20 13:00:34.794820608 -0600
|
||||
@@ -164,6 +164,11 @@ void setbinmode(FILE *fp)
|
||||
# ifndef HAVE_LOCALE_H
|
||||
# define HAVE_LOCALE_H
|
||||
@@ -52,8 +52,8 @@ diff -up ruby-1.9.1-p243/ext/nkf/nkf-utf8/nkf.h.orig ruby-1.9.1-p243/ext/nkf/nkf
|
||||
# ifndef HAVE_LANGINFO_H
|
||||
# define HAVE_LANGINFO_H
|
||||
diff -up ruby-1.9.1-p243/ext/openssl/ossl.c.orig ruby-1.9.1-p243/ext/openssl/ossl.c
|
||||
--- ruby-1.9.1-p243/ext/openssl/ossl.c.orig 2009-01-15 08:39:30.060293120 -0700
|
||||
+++ ruby-1.9.1-p243/ext/openssl/ossl.c 2010-05-17 23:44:05.643301376 -0600
|
||||
--- ruby-1.9.1-p243/ext/openssl/ossl.c.orig 2009-01-15 08:39:30.024641536 -0700
|
||||
+++ ruby-1.9.1-p243/ext/openssl/ossl.c 2010-05-20 13:00:34.797966336 -0600
|
||||
@@ -92,7 +92,7 @@ ossl_x509_ary2sk(VALUE ary)
|
||||
|
||||
#define OSSL_IMPL_SK2ARY(name, type) \
|
||||
@@ -82,8 +82,8 @@ diff -up ruby-1.9.1-p243/ext/openssl/ossl.c.orig ruby-1.9.1-p243/ext/openssl/oss
|
||||
} \
|
||||
return ary; \
|
||||
diff -up ruby-1.9.1-p243/ext/openssl/ossl.h.orig ruby-1.9.1-p243/ext/openssl/ossl.h
|
||||
--- ruby-1.9.1-p243/ext/openssl/ossl.h.orig 2008-09-25 21:05:47.060293120 -0600
|
||||
+++ ruby-1.9.1-p243/ext/openssl/ossl.h 2010-05-17 23:44:05.645398528 -0600
|
||||
--- ruby-1.9.1-p243/ext/openssl/ossl.h.orig 2008-09-25 21:05:47.024641536 -0600
|
||||
+++ ruby-1.9.1-p243/ext/openssl/ossl.h 2010-05-20 13:00:34.801112064 -0600
|
||||
@@ -104,6 +104,13 @@ extern VALUE eOSSLError;
|
||||
} while (0)
|
||||
|
||||
@@ -98,9 +98,192 @@ diff -up ruby-1.9.1-p243/ext/openssl/ossl.h.orig ruby-1.9.1-p243/ext/openssl/oss
|
||||
* String to HEXString conversion
|
||||
*/
|
||||
int string2hex(const unsigned char *, int, char **, int *);
|
||||
diff -up ruby-1.9.1-p243/ext/openssl/ossl_config.c.orig ruby-1.9.1-p243/ext/openssl/ossl_config.c
|
||||
--- ruby-1.9.1-p243/ext/openssl/ossl_config.c.orig 2010-05-20 13:16:19.708837376 -0600
|
||||
+++ ruby-1.9.1-p243/ext/openssl/ossl_config.c 2010-05-20 13:18:54.922746880 -0600
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
- * $Id: ossl_config.c 18971 2008-08-31 03:36:09Z nobu $
|
||||
+ * $Id: ossl_config.c 27460 2010-04-23 14:28:56Z akr $
|
||||
* 'OpenSSL for Ruby' project
|
||||
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
|
||||
* All rights reserved.
|
||||
@@ -33,8 +33,8 @@
|
||||
VALUE cConfig;
|
||||
VALUE eConfigError;
|
||||
|
||||
-/*
|
||||
- * Public
|
||||
+/*
|
||||
+ * Public
|
||||
*/
|
||||
|
||||
static CONF *parse_config(VALUE, CONF*);
|
||||
@@ -154,7 +154,7 @@ ossl_config_initialize(int argc, VALUE *
|
||||
_CONF_new_data(conf);
|
||||
}
|
||||
#endif
|
||||
-
|
||||
+
|
||||
return self;
|
||||
}
|
||||
|
||||
@@ -187,11 +187,30 @@ ossl_config_add_value(VALUE self, VALUE
|
||||
OPENSSL_free(cv);
|
||||
ossl_raise(eConfigError, "_CONF_add_string failure");
|
||||
}
|
||||
-
|
||||
+
|
||||
return value;
|
||||
#endif
|
||||
}
|
||||
|
||||
+static void
|
||||
+rb_ossl_config_modify_check(VALUE config)
|
||||
+{
|
||||
+ if (OBJ_FROZEN(config)) rb_error_frozen("OpenSSL::Config");
|
||||
+ if (!OBJ_UNTRUSTED(config) && rb_safe_level() >= 4)
|
||||
+ rb_raise(rb_eSecurityError, "Insecure: can't modify OpenSSL config");
|
||||
+}
|
||||
+
|
||||
+#if !defined(OSSL_NO_CONF_API)
|
||||
+static VALUE
|
||||
+ossl_config_add_value_m(VALUE self, VALUE section, VALUE name, VALUE value)
|
||||
+{
|
||||
+ rb_ossl_config_modify_check(self);
|
||||
+ return ossl_config_add_value(self, section, name, value);
|
||||
+}
|
||||
+#else
|
||||
+#define ossl_config_add_value_m rb_f_notimplement
|
||||
+#endif
|
||||
+
|
||||
static VALUE
|
||||
ossl_config_get_value(VALUE self, VALUE section, VALUE name)
|
||||
{
|
||||
@@ -214,7 +233,7 @@ static VALUE
|
||||
ossl_config_get_value_old(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
VALUE section, name;
|
||||
-
|
||||
+
|
||||
rb_scan_args(argc, argv, "11", §ion, &name);
|
||||
|
||||
/* support conf.value(nil, "HOME") -> conf.get_value("", "HOME") */
|
||||
@@ -247,6 +266,7 @@ ossl_config_set_section(VALUE self, VALU
|
||||
{
|
||||
VALUE arg[2];
|
||||
|
||||
+ rb_ossl_config_modify_check(self);
|
||||
arg[0] = self;
|
||||
arg[1] = section;
|
||||
rb_block_call(hash, rb_intern("each"), 0, 0, set_conf_section_i, (VALUE)arg);
|
||||
@@ -278,7 +298,7 @@ ossl_config_get_section(VALUE self, VALU
|
||||
return hash;
|
||||
}
|
||||
for (i=0; i<entries; i++) {
|
||||
- entry = sk_CONF_VALUE_value(sk, i);
|
||||
+ entry = sk_CONF_VALUE_value(sk, i);
|
||||
rb_hash_aset(hash, rb_str_new2(entry->name), rb_str_new2(entry->value));
|
||||
}
|
||||
|
||||
@@ -292,15 +312,16 @@ ossl_config_get_section_old(VALUE self,
|
||||
return ossl_config_get_section(self, section);
|
||||
}
|
||||
|
||||
-#ifdef IMPLEMENT_LHASH_DOALL_ARG_FN
|
||||
+#if defined(IMPLEMENT_LHASH_DOALL_ARG_FN) && defined(LHASH_OF)
|
||||
static void
|
||||
-get_conf_section(CONF_VALUE *cv, VALUE ary)
|
||||
+get_conf_section_doall_arg(CONF_VALUE *cv, void *tmp)
|
||||
{
|
||||
+ VALUE ary = (VALUE)tmp;
|
||||
if(cv->name) return;
|
||||
rb_ary_push(ary, rb_str_new2(cv->section));
|
||||
}
|
||||
|
||||
-static IMPLEMENT_LHASH_DOALL_ARG_FN(get_conf_section, CONF_VALUE*, VALUE);
|
||||
+static IMPLEMENT_LHASH_DOALL_ARG_FN(get_conf_section, CONF_VALUE, void)
|
||||
|
||||
static VALUE
|
||||
ossl_config_get_sections(VALUE self)
|
||||
@@ -310,14 +331,16 @@ ossl_config_get_sections(VALUE self)
|
||||
|
||||
GetConfig(self, conf);
|
||||
ary = rb_ary_new();
|
||||
- lh_doall_arg(conf->data, LHASH_DOALL_ARG_FN(get_conf_section), (void*)ary);
|
||||
+ lh_doall_arg((_LHASH *)conf->data, LHASH_DOALL_ARG_FN(get_conf_section),
|
||||
+ (void*)ary);
|
||||
|
||||
return ary;
|
||||
}
|
||||
|
||||
static void
|
||||
-dump_conf_value(CONF_VALUE *cv, VALUE str)
|
||||
+dump_conf_value_doall_arg(CONF_VALUE *cv, void *tmp)
|
||||
{
|
||||
+ VALUE str = (VALUE)tmp;
|
||||
STACK_OF(CONF_VALUE) *sk;
|
||||
CONF_VALUE *v;
|
||||
int i, num;
|
||||
@@ -338,7 +361,7 @@ dump_conf_value(CONF_VALUE *cv, VALUE st
|
||||
rb_str_cat2(str, "\n");
|
||||
}
|
||||
|
||||
-static IMPLEMENT_LHASH_DOALL_ARG_FN(dump_conf_value, CONF_VALUE*, VALUE);
|
||||
+static IMPLEMENT_LHASH_DOALL_ARG_FN(dump_conf_value, CONF_VALUE, void)
|
||||
|
||||
static VALUE
|
||||
dump_conf(CONF *conf)
|
||||
@@ -346,7 +369,8 @@ dump_conf(CONF *conf)
|
||||
VALUE str;
|
||||
|
||||
str = rb_str_new(0, 0);
|
||||
- lh_doall_arg(conf->data, LHASH_DOALL_ARG_FN(dump_conf_value), (void*)str);
|
||||
+ lh_doall_arg((_LHASH *)conf->data, LHASH_DOALL_ARG_FN(dump_conf_value),
|
||||
+ (void*)str);
|
||||
|
||||
return str;
|
||||
}
|
||||
@@ -362,7 +386,7 @@ ossl_config_to_s(VALUE self)
|
||||
}
|
||||
|
||||
static void
|
||||
-each_conf_value(CONF_VALUE *cv, void* dummy)
|
||||
+each_conf_value_doall_arg(CONF_VALUE *cv, void *dummy)
|
||||
{
|
||||
STACK_OF(CONF_VALUE) *sk;
|
||||
CONF_VALUE *v;
|
||||
@@ -382,7 +406,7 @@ each_conf_value(CONF_VALUE *cv, void* du
|
||||
}
|
||||
}
|
||||
|
||||
-static IMPLEMENT_LHASH_DOALL_ARG_FN(each_conf_value, CONF_VALUE*, void*);
|
||||
+static IMPLEMENT_LHASH_DOALL_ARG_FN(each_conf_value, CONF_VALUE, void *)
|
||||
|
||||
static VALUE
|
||||
ossl_config_each(VALUE self)
|
||||
@@ -392,7 +416,8 @@ ossl_config_each(VALUE self)
|
||||
RETURN_ENUMERATOR(self, 0, 0);
|
||||
|
||||
GetConfig(self, conf);
|
||||
- lh_doall_arg(conf->data, LHASH_DOALL_ARG_FN(each_conf_value), (void*)NULL);
|
||||
+ lh_doall_arg((_LHASH *)conf->data, LHASH_DOALL_ARG_FN(each_conf_value),
|
||||
+ (void*)NULL);
|
||||
|
||||
return self;
|
||||
}
|
||||
@@ -456,7 +481,7 @@ Init_ossl_config()
|
||||
rb_define_method(cConfig, "initialize", ossl_config_initialize, -1);
|
||||
rb_define_method(cConfig, "get_value", ossl_config_get_value, 2);
|
||||
rb_define_method(cConfig, "value", ossl_config_get_value_old, -1);
|
||||
- rb_define_method(cConfig, "add_value", ossl_config_add_value, 3);
|
||||
+ rb_define_method(cConfig, "add_value", ossl_config_add_value_m, 3);
|
||||
rb_define_method(cConfig, "[]", ossl_config_get_section, 1);
|
||||
rb_define_method(cConfig, "section", ossl_config_get_section_old, 1);
|
||||
rb_define_method(cConfig, "[]=", ossl_config_set_section, 2);
|
||||
diff -up ruby-1.9.1-p243/ext/openssl/ossl_pkcs7.c.orig ruby-1.9.1-p243/ext/openssl/ossl_pkcs7.c
|
||||
--- ruby-1.9.1-p243/ext/openssl/ossl_pkcs7.c.orig 2008-07-22 09:34:23.062914560 -0600
|
||||
+++ ruby-1.9.1-p243/ext/openssl/ossl_pkcs7.c 2010-05-17 23:44:05.650117120 -0600
|
||||
--- ruby-1.9.1-p243/ext/openssl/ossl_pkcs7.c.orig 2008-07-22 09:34:23.027262976 -0600
|
||||
+++ ruby-1.9.1-p243/ext/openssl/ossl_pkcs7.c 2010-05-20 13:00:34.805044224 -0600
|
||||
@@ -572,12 +572,11 @@ ossl_pkcs7_add_certificate(VALUE self, V
|
||||
return self;
|
||||
}
|
||||
@@ -195,8 +378,8 @@ diff -up ruby-1.9.1-p243/ext/openssl/ossl_pkcs7.c.orig ruby-1.9.1-p243/ext/opens
|
||||
|
||||
static VALUE
|
||||
diff -up ruby-1.9.1-p243/ext/openssl/ossl_ssl.c.orig ruby-1.9.1-p243/ext/openssl/ossl_ssl.c
|
||||
--- ruby-1.9.1-p243/ext/openssl/ossl_ssl.c.orig 2009-04-19 07:32:18.064225280 -0600
|
||||
+++ ruby-1.9.1-p243/ext/openssl/ossl_ssl.c 2010-05-17 23:44:05.653262848 -0600
|
||||
--- ruby-1.9.1-p243/ext/openssl/ossl_ssl.c.orig 2009-04-19 07:32:18.028311552 -0600
|
||||
+++ ruby-1.9.1-p243/ext/openssl/ossl_ssl.c 2010-05-20 13:00:34.808714240 -0600
|
||||
@@ -1195,10 +1195,10 @@ ossl_ssl_get_peer_cert_chain(VALUE self)
|
||||
}
|
||||
chain = SSL_get_peer_cert_chain(ssl);
|
||||
@@ -210,9 +393,29 @@ diff -up ruby-1.9.1-p243/ext/openssl/ossl_ssl.c.orig ruby-1.9.1-p243/ext/openssl
|
||||
rb_ary_push(ary, ossl_x509_new(cert));
|
||||
}
|
||||
|
||||
diff -up ruby-1.9.1-p243/ext/openssl/ossl_ssl_session.c.orig ruby-1.9.1-p243/ext/openssl/ossl_ssl_session.c
|
||||
--- ruby-1.9.1-p243/ext/openssl/ossl_ssl_session.c.orig 2008-07-22 09:34:23.028573696 -0600
|
||||
+++ ruby-1.9.1-p243/ext/openssl/ossl_ssl_session.c 2010-05-20 13:00:34.813694976 -0600
|
||||
@@ -72,6 +72,16 @@ static VALUE ossl_ssl_session_initialize
|
||||
return self;
|
||||
}
|
||||
|
||||
+#if HAVE_SSL_SESSION_CMP == 0
|
||||
+int SSL_SESSION_cmp(const SSL_SESSION *a,const SSL_SESSION *b)
|
||||
+{
|
||||
+ if (a->ssl_version != b->ssl_version ||
|
||||
+ a->session_id_length != b->session_id_length)
|
||||
+ return 1;
|
||||
+ return memcmp(a->session_id,b-> session_id, a->session_id_length);
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
/*
|
||||
* call-seq:
|
||||
* session1 == session2 -> boolean
|
||||
diff -up ruby-1.9.1-p243/ext/openssl/ossl_x509attr.c.orig ruby-1.9.1-p243/ext/openssl/ossl_x509attr.c
|
||||
--- ruby-1.9.1-p243/ext/openssl/ossl_x509attr.c.orig 2008-08-28 21:19:15.064749568 -0600
|
||||
+++ ruby-1.9.1-p243/ext/openssl/ossl_x509attr.c 2010-05-17 23:44:05.662700032 -0600
|
||||
--- ruby-1.9.1-p243/ext/openssl/ossl_x509attr.c.orig 2008-08-28 21:19:15.029097984 -0600
|
||||
+++ ruby-1.9.1-p243/ext/openssl/ossl_x509attr.c 2010-05-20 13:00:34.817102848 -0600
|
||||
@@ -218,8 +218,9 @@ ossl_x509attr_get_value(VALUE self)
|
||||
ossl_str_adjust(str, p);
|
||||
}
|
||||
@@ -226,8 +429,8 @@ diff -up ruby-1.9.1-p243/ext/openssl/ossl_x509attr.c.orig ruby-1.9.1-p243/ext/op
|
||||
p = (unsigned char *)RSTRING_PTR(str);
|
||||
i2d_ASN1_SET_OF_ASN1_TYPE(attr->value.set, &p,
|
||||
diff -up ruby-1.9.1-p243/ext/openssl/ossl_x509crl.c.orig ruby-1.9.1-p243/ext/openssl/ossl_x509crl.c
|
||||
--- ruby-1.9.1-p243/ext/openssl/ossl_x509crl.c.orig 2008-07-22 09:34:23.065011712 -0600
|
||||
+++ ruby-1.9.1-p243/ext/openssl/ossl_x509crl.c 2010-05-17 23:44:05.666632192 -0600
|
||||
--- ruby-1.9.1-p243/ext/openssl/ossl_x509crl.c.orig 2008-07-22 09:34:23.029360128 -0600
|
||||
+++ ruby-1.9.1-p243/ext/openssl/ossl_x509crl.c 2010-05-20 13:00:34.821821440 -0600
|
||||
@@ -264,7 +264,7 @@ ossl_x509crl_get_revoked(VALUE self)
|
||||
VALUE ary, revoked;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user