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

ruby-changes:19654

From: emboss <ko1@a...>
Date: Mon, 23 May 2011 04:38:12 +0900 (JST)
Subject: [ruby-changes:19654] emboss:r31699 (trunk): * ext/openssl/ossl_asn1.c (ossl_asn1_initialize): Allow creation of

emboss	2011-05-23 04:38:05 +0900 (Mon, 23 May 2011)

  New Revision: 31699

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

  Log:
    * ext/openssl/ossl_asn1.c (ossl_asn1_initialize): Allow creation of
    Constructives with an explicit tag_class parameter without
    automatically setting tagging to :EXPLICIT. Fixes a bug when encoding
    infinite length primitive values.

  Modified files:
    trunk/ChangeLog
    trunk/ext/openssl/ossl_asn1.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 31698)
+++ ChangeLog	(revision 31699)
@@ -1,5 +1,12 @@
 Mon May 23 04:03:46 2011  Martin Bosslet  <Martin.Bosslet@g...>
 
+	* ext/openssl/ossl_asn1.c (ossl_asn1_initialize): Allow creation of
+	Constructives with an explicit tag_class parameter without
+	automatically setting tagging to :EXPLICIT. Fixes a bug when encoding
+	infinite length primitive values.
+
+Mon May 23 04:03:46 2011  Martin Bosslet  <Martin.Bosslet@g...>
+
 	* ext/openssl/ossl_asn1.c (ossl_asn1_cons_to_der): Add an additional
 	EOC for infinite length Constructives that are supposed to be encoded
 	with explicit tagging. Also tabify method correctly.
Index: ext/openssl/ossl_asn1.c
===================================================================
--- ext/openssl/ossl_asn1.c	(revision 31698)
+++ ext/openssl/ossl_asn1.c	(revision 31699)
@@ -1011,12 +1011,14 @@
     if(argc > 1){
 	if(NIL_P(tag))
 	    ossl_raise(eASN1Error, "must specify tag number");
-        if(NIL_P(tagging))
-	    tagging = ID2SYM(sEXPLICIT);
-	if(!SYMBOL_P(tagging))
-	    ossl_raise(eASN1Error, "invalid tag default");
-	if(NIL_P(tag_class))
-	    tag_class = ID2SYM(sCONTEXT_SPECIFIC);
+	if(!NIL_P(tagging) && !SYMBOL_P(tagging))
+	    ossl_raise(eASN1Error, "invalid tagging method");
+	if(NIL_P(tag_class)) {
+	    if (NIL_P(tagging))
+		tag_class = ID2SYM(sUNIVERSAL);
+	    else
+		tag_class = ID2SYM(sCONTEXT_SPECIFIC);
+	}
 	if(!SYMBOL_P(tag_class))
 	    ossl_raise(eASN1Error, "invalid tag class");
 	if(SYM2ID(tagging) == sIMPLICIT && NUM2INT(tag) > 31)
@@ -1024,7 +1026,7 @@
     }
     else{
 	tag = INT2NUM(ossl_asn1_default_tag(self));
-        tagging = Qnil;
+	tagging = Qnil;
 	tag_class = ID2SYM(sUNIVERSAL);
     }
     ossl_asn1_set_tag(self, tag);

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

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