[前][次][番号順一覧][スレッド一覧]

ruby-changes:7424

From: nobu <ko1@a...>
Date: Sat, 30 Aug 2008 15:00:09 +0900 (JST)
Subject: [ruby-changes:7424] Ruby:r18943 (ruby_1_8): * ext/openssl/ossl_x509attr.c (ossl_x509attr_initialize): fix for

nobu	2008-08-30 14:59:58 +0900 (Sat, 30 Aug 2008)

  New Revision: 18943

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=18943

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

  Modified files:
    branches/ruby_1_8/ChangeLog
    branches/ruby_1_8/ext/openssl/ossl_ocsp.c
    branches/ruby_1_8/ext/openssl/ossl_x509attr.c
    branches/ruby_1_8/ext/openssl/ossl_x509ext.c
    branches/ruby_1_8/ext/openssl/ossl_x509name.c
    branches/ruby_1_8/version.h

Index: ruby_1_8/ext/openssl/ossl_x509attr.c
===================================================================
--- ruby_1_8/ext/openssl/ossl_x509attr.c	(revision 18942)
+++ ruby_1_8/ext/openssl/ossl_x509attr.c	(revision 18943)
@@ -92,7 +92,7 @@
 ossl_x509attr_initialize(int argc, VALUE *argv, VALUE self)
 {
     VALUE oid, value;
-    X509_ATTRIBUTE *attr;
+    X509_ATTRIBUTE *attr, *x;
     const unsigned char *p;
 
     GetX509Attr(self, attr);
@@ -100,7 +100,9 @@
 	oid = ossl_to_der_if_possible(oid);
 	StringValue(oid);
 	p = (unsigned char *)RSTRING_PTR(oid);
-	if(!d2i_X509_ATTRIBUTE(&attr, &p, RSTRING_LEN(oid)) && (DATA_PTR(self) = attr, 1)){
+	x = d2i_X509_ATTRIBUTE(&attr, &p, RSTRING_LEN(oid));
+	DATA_PTR(self) = attr;
+	if(!x){
 	    ossl_raise(eX509AttrError, NULL);
 	}
 	return self;
Index: ruby_1_8/ext/openssl/ossl_ocsp.c
===================================================================
--- ruby_1_8/ext/openssl/ossl_ocsp.c	(revision 18942)
+++ ruby_1_8/ext/openssl/ossl_ocsp.c	(revision 18943)
@@ -107,11 +107,13 @@
 
     rb_scan_args(argc, argv, "01", &arg);
     if(!NIL_P(arg)){
-	OCSP_REQUEST *req = DATA_PTR(self);
+	OCSP_REQUEST *req = DATA_PTR(self), *x;
 	arg = ossl_to_der_if_possible(arg);
 	StringValue(arg);
 	p = (unsigned char*)RSTRING_PTR(arg);
-	if(!d2i_OCSP_REQUEST(&req, &p, RSTRING_LEN(arg)) && (DATA_PTR(self) = req, 1)){
+	x = d2i_OCSP_REQUEST(&req, &p, RSTRING_LEN(arg));
+	DATA_PTR(self) = req;
+	if(!x){
 	    ossl_raise(eOCSPError, "cannot load DER encoded request");
 	}
     }
Index: ruby_1_8/ext/openssl/ossl_x509name.c
===================================================================
--- ruby_1_8/ext/openssl/ossl_x509name.c	(revision 18942)
+++ ruby_1_8/ext/openssl/ossl_x509name.c	(revision 18943)
@@ -137,10 +137,12 @@
 	else{
 	    const unsigned char *p;
 	    VALUE str = ossl_to_der_if_possible(arg);
-	    X509_NAME *x = DATA_PTR(self);
+	    X509_NAME *x;
 	    StringValue(str);
 	    p = (unsigned char *)RSTRING_PTR(str);
-	    if(!d2i_X509_NAME(&x, &p, RSTRING_LEN(str)) && (DATA_PTR(self) = x, 1)){
+ 	    x = d2i_X509_NAME(&name, &p, RSTRING_LEN(str));
+ 	    DATA_PTR(self) = name;
+ 	    if(!x){
 		ossl_raise(eX509NameError, NULL);
 	    }
 	}
Index: ruby_1_8/ext/openssl/ossl_x509ext.c
===================================================================
--- ruby_1_8/ext/openssl/ossl_x509ext.c	(revision 18942)
+++ ruby_1_8/ext/openssl/ossl_x509ext.c	(revision 18943)
@@ -274,14 +274,16 @@
 {
     VALUE oid, value, critical;
     const unsigned char *p;
-    X509_EXTENSION *ext, *x = DATA_PTR(self);
+    X509_EXTENSION *ext, *x;
 
     GetX509Ext(self, ext);
     if(rb_scan_args(argc, argv, "12", &oid, &value, &critical) == 1){
 	oid = ossl_to_der_if_possible(oid);
 	StringValue(oid);
 	p = (unsigned char *)RSTRING_PTR(oid);
-	if(!d2i_X509_EXTENSION(&x, &p, RSTRING_LEN(oid)) && (DATA_PTR(self) = x, 1))
+	x = d2i_X509_EXTENSION(&ext, &p, RSTRING_LEN(oid));
+	DATA_PTR(self) = ext;
+	if(!x)
 	    ossl_raise(eX509ExtError, NULL);
 	return self;
     }
Index: ruby_1_8/ChangeLog
===================================================================
--- ruby_1_8/ChangeLog	(revision 18942)
+++ ruby_1_8/ChangeLog	(revision 18943)
@@ -1,3 +1,14 @@
+Sat Aug 30 14:59:52 2008  Nobuyoshi Nakada  <nobu@r...>
+
+	* 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.
+
 Thu Aug 21 17:30:32 2008  Akinori MUSHA  <knu@i...>
 
 	* enumerator.c (enumerator_ptr), lib/generator.rb:
Index: ruby_1_8/version.h
===================================================================
--- ruby_1_8/version.h	(revision 18942)
+++ ruby_1_8/version.h	(revision 18943)
@@ -1,7 +1,7 @@
 #define RUBY_VERSION "1.8.7"
-#define RUBY_RELEASE_DATE "2008-08-21"
+#define RUBY_RELEASE_DATE "2008-08-30"
 #define RUBY_VERSION_CODE 187
-#define RUBY_RELEASE_CODE 20080821
+#define RUBY_RELEASE_CODE 20080830
 #define RUBY_PATCHLEVEL 5000
 
 #define RUBY_VERSION_MAJOR 1
@@ -9,7 +9,7 @@
 #define RUBY_VERSION_TEENY 7
 #define RUBY_RELEASE_YEAR 2008
 #define RUBY_RELEASE_MONTH 8
-#define RUBY_RELEASE_DAY 21
+#define RUBY_RELEASE_DAY 30
 
 #ifdef RUBY_EXTERN
 RUBY_EXTERN const char ruby_version[];

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]