Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 235815 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]
ruby-1.9.1_p376-openssl1.patch
ruby-1.9.1_p376-openssl1.patch (text/plain), 8.99 KB, created by
Lars Wendler (Polynomial-C) (RETIRED)
on 2010-06-18 07:22:06 UTC
(
hide
)
Description:
ruby-1.9.1_p376-openssl1.patch
Filename:
MIME Type:
Creator:
Lars Wendler (Polynomial-C) (RETIRED)
Created:
2010-06-18 07:22:06 UTC
Size:
8.99 KB
patch
obsolete
># http://redmine.ruby-lang.org/repositories/diff/ruby-19?rev=26781 ># http://redmine.ruby-lang.org/repositories/diff/ruby-19/ext/openssl/ossl_config.c?rev=27460&rev_to=27440 ># http://redmine.ruby-lang.org/repositories/diff/ruby-19/ext/openssl/ossl_ssl_session.c?rev=27461&rev_to=27437 ># http://redmine.ruby-lang.org/attachments/download/1026 > >--- ruby-1.9.1-p376/ext/openssl/openssl_missing.c >+++ ruby-1.9.1-p376/ext/openssl/openssl_missing.c >@@ -41,7 +41,9 @@ > { > return CRYPTO_set_ex_data(&str->ex_data, idx, data); > } >- >+#endif >+ >+#if !defined(HAVE_X509_STORE_GET_EX_DATA) > void *X509_STORE_get_ex_data(X509_STORE *str, int idx) > { > return CRYPTO_get_ex_data(&str->ex_data, idx); >--- ruby-1.9.1-p376/ext/openssl/openssl_missing.h >+++ ruby-1.9.1-p376/ext/openssl/openssl_missing.h >@@ -60,7 +60,7 @@ > (d2i_of_void *)d2i_PKCS7_RECIP_INFO, (char *)ri) > #endif > >-#if !defined(HAVE_EVP_MD_CTX_INIT) >+#if !defined(HAVE_HMAC_CTX_INIT) > void HMAC_CTX_init(HMAC_CTX *ctx); > #endif > >@@ -130,8 +130,11 @@ > #define OPENSSL_cleanse(p, l) memset(p, 0, l) > #endif > >-#if !defined(HAVE_X509_STORE_SET_EX_DATA) >+#if !defined(HAVE_X509_STORE_GET_EX_DATA) > void *X509_STORE_get_ex_data(X509_STORE *str, int idx); >+#endif >+ >+#if !defined(HAVE_X509_STORE_SET_EX_DATA) > int X509_STORE_set_ex_data(X509_STORE *str, int idx, void *data); > #endif > >--- ruby-1.9.1-p376/ext/openssl/ossl.c >+++ ruby-1.9.1-p376/ext/openssl/ossl.c >@@ -92,7 +92,7 @@ > > #define OSSL_IMPL_SK2ARY(name, type) \ > VALUE \ >-ossl_##name##_sk2ary(STACK *sk) \ >+ossl_##name##_sk2ary(STACK_OF(type) *sk) \ > { \ > type *t; \ > int i, num; \ >@@ -102,7 +102,7 @@ > OSSL_Debug("empty sk!"); \ > return Qnil; \ > } \ >- num = sk_num(sk); \ >+ num = sk_##type##_num(sk); \ > if (num < 0) { \ > OSSL_Debug("items in sk < -1???"); \ > return rb_ary_new(); \ >@@ -110,7 +110,7 @@ > ary = rb_ary_new2(num); \ > \ > for (i=0; i<num; i++) { \ >- t = (type *)sk_value(sk, i); \ >+ t = sk_##type##_value(sk, i); \ > rb_ary_push(ary, ossl_##name##_new(t)); \ > } \ > return ary; \ >--- ruby-1.9.1-p376/ext/openssl/ossl_config.c >+++ ruby-1.9.1-p376/ext/openssl/ossl_config.c >@@ -301,15 +301,16 @@ > 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) >@@ -319,14 +320,16 @@ > > 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; >@@ -347,7 +350,7 @@ > 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) >@@ -355,7 +358,8 @@ > 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; > } >@@ -371,7 +375,7 @@ > } > > 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; >@@ -391,7 +395,7 @@ > } > } > >-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) >@@ -401,7 +405,8 @@ > 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; > } >--- ruby-1.9.1-p376/ext/openssl/ossl.h >+++ ruby-1.9.1-p376/ext/openssl/ossl.h >@@ -104,6 +104,13 @@ > } while (0) > > /* >+ * Compatibility >+ */ >+#if OPENSSL_VERSION_NUMBER >= 0x10000000L >+#define STACK _STACK >+#endif >+ >+/* > * String to HEXString conversion > */ > int string2hex(const unsigned char *, int, char **, int *); >--- ruby-1.9.1-p376/ext/openssl/ossl_pkcs7.c >+++ ruby-1.9.1-p376/ext/openssl/ossl_pkcs7.c >@@ -572,11 +572,33 @@ > return self; > } > >-static STACK * >-pkcs7_get_certs_or_crls(VALUE self, int want_certs) >+static STACK_OF(X509) * >+pkcs7_get_certs(VALUE self) > { > PKCS7 *pkcs7; > STACK_OF(X509) *certs; >+ int i; >+ >+ GetPKCS7(self, pkcs7); >+ i = OBJ_obj2nid(pkcs7->type); >+ switch(i){ >+ case NID_pkcs7_signed: >+ certs = pkcs7->d.sign->cert; >+ break; >+ case NID_pkcs7_signedAndEnveloped: >+ certs = pkcs7->d.signed_and_enveloped->cert; >+ break; >+ default: >+ certs = NULL; >+ } >+ >+ return certs; >+} >+ >+static STACK_OF(X509_CRL) * >+pkcs7_get_crls(VALUE self) >+{ >+ PKCS7 *pkcs7; > STACK_OF(X509_CRL) *crls; > int i; > >@@ -584,18 +606,16 @@ > i = OBJ_obj2nid(pkcs7->type); > switch(i){ > case NID_pkcs7_signed: >- certs = pkcs7->d.sign->cert; > crls = pkcs7->d.sign->crl; > break; > case NID_pkcs7_signedAndEnveloped: >- certs = pkcs7->d.signed_and_enveloped->cert; > crls = pkcs7->d.signed_and_enveloped->crl; > break; > default: >- certs = crls = NULL; >+ crls = NULL; > } > >- return want_certs ? certs : crls; >+ return crls; > } > > static VALUE >@@ -610,7 +630,7 @@ > STACK_OF(X509) *certs; > X509 *cert; > >- certs = pkcs7_get_certs_or_crls(self, 1); >+ certs = pkcs7_get_certs(self); > while((cert = sk_X509_pop(certs))) X509_free(cert); > rb_block_call(ary, rb_intern("each"), 0, 0, ossl_pkcs7_set_certs_i, self); > >@@ -620,7 +640,7 @@ > static VALUE > ossl_pkcs7_get_certificates(VALUE self) > { >- return ossl_x509_sk2ary(pkcs7_get_certs_or_crls(self, 1)); >+ return ossl_x509_sk2ary(pkcs7_get_certs(self)); > } > > static VALUE >@@ -650,7 +670,7 @@ > STACK_OF(X509_CRL) *crls; > X509_CRL *crl; > >- crls = pkcs7_get_certs_or_crls(self, 0); >+ crls = pkcs7_get_crls(self); > while((crl = sk_X509_CRL_pop(crls))) X509_CRL_free(crl); > rb_block_call(ary, rb_intern("each"), 0, 0, ossl_pkcs7_set_crls_i, self); > >@@ -660,7 +680,7 @@ > static VALUE > ossl_pkcs7_get_crls(VALUE self) > { >- return ossl_x509crl_sk2ary(pkcs7_get_certs_or_crls(self, 0)); >+ return ossl_x509crl_sk2ary(pkcs7_get_crls(self)); > } > > static VALUE >--- ruby-1.9.1-p376/ext/openssl/ossl_ssl.c >+++ ruby-1.9.1-p376/ext/openssl/ossl_ssl.c >@@ -1195,10 +1195,10 @@ > } > chain = SSL_get_peer_cert_chain(ssl); > if(!chain) return Qnil; >- num = sk_num(chain); >+ num = sk_X509_num(chain); > ary = rb_ary_new2(num); > for (i = 0; i < num; i++){ >- cert = (X509*)sk_value(chain, i); >+ cert = sk_X509_value(chain, i); > rb_ary_push(ary, ossl_x509_new(cert)); > } > >--- ruby-1.9.1-p376/ext/openssl/ossl_ssl_session.c >+++ ruby-1.9.1-p376/ext/openssl/ossl_ssl_session.c >@@ -72,6 +72,16 @@ > 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 >--- ruby-1.9.1-p376/ext/openssl/ossl_x509attr.c >+++ ruby-1.9.1-p376/ext/openssl/ossl_x509attr.c >@@ -218,8 +218,9 @@ > ossl_str_adjust(str, p); > } > else{ >- length = i2d_ASN1_SET_OF_ASN1_TYPE(attr->value.set, NULL, >- i2d_ASN1_TYPE, V_ASN1_SET, V_ASN1_UNIVERSAL, 0); >+ length = i2d_ASN1_SET_OF_ASN1_TYPE(attr->value.set, >+ (unsigned char **) NULL, i2d_ASN1_TYPE, >+ V_ASN1_SET, V_ASN1_UNIVERSAL, 0); > str = rb_str_new(0, length); > p = (unsigned char *)RSTRING_PTR(str); > i2d_ASN1_SET_OF_ASN1_TYPE(attr->value.set, &p, >--- ruby-1.9.1-p376/ext/openssl/ossl_x509crl.c >+++ ruby-1.9.1-p376/ext/openssl/ossl_x509crl.c >@@ -264,7 +264,7 @@ > VALUE ary, revoked; > > GetX509CRL(self, crl); >- num = sk_X509_CRL_num(X509_CRL_get_REVOKED(crl)); >+ num = sk_X509_REVOKED_num(X509_CRL_get_REVOKED(crl)); > if (num < 0) { > OSSL_Debug("num < 0???"); > return rb_ary_new(); >@@ -272,7 +272,7 @@ > ary = rb_ary_new2(num); > for(i=0; i<num; i++) { > /* NO DUP - don't free! */ >- rev = (X509_REVOKED *)sk_X509_CRL_value(X509_CRL_get_REVOKED(crl), i); >+ rev = sk_X509_REVOKED_value(X509_CRL_get_REVOKED(crl), i); > revoked = ossl_x509revoked_new(rev); > rb_ary_push(ary, revoked); > }
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