[Redbutton-devel] SF.net SVN: redbutton: [395] redbutton-author/trunk
Brought to you by:
skilvington
|
From: <ski...@us...> - 2007-09-18 13:02:59
|
Revision: 395
http://redbutton.svn.sourceforge.net/redbutton/?rev=395&view=rev
Author: skilvington
Date: 2007-09-18 06:02:58 -0700 (Tue, 18 Sep 2007)
Log Message:
-----------
resolve synthetic types where needed
Modified Paths:
--------------
redbutton-author/trunk/asn1tag.h
redbutton-author/trunk/parser.c.header
Modified: redbutton-author/trunk/asn1tag.h
===================================================================
--- redbutton-author/trunk/asn1tag.h 2007-09-18 12:55:32 UTC (rev 394)
+++ redbutton-author/trunk/asn1tag.h 2007-09-18 13:02:58 UTC (rev 395)
@@ -555,10 +555,12 @@
#define ASN1TAG_BOOLEAN 1
#define ASN1TAG_INTEGER 2
#define ASN1TAG_OctetString 4
+#define ASN1TAG_Null 5
/* and with the class included */
#define ASN1TAGCLASS_BOOLEAN ((ASN1CLASS_UNIVERSAL << 24) | ASN1TAG_BOOLEAN)
#define ASN1TAGCLASS_INTEGER ((ASN1CLASS_UNIVERSAL << 24) | ASN1TAG_INTEGER)
#define ASN1TAGCLASS_OctetString ((ASN1CLASS_UNIVERSAL << 24) | ASN1TAG_OctetString)
+#define ASN1TAGCLASS_Null ((ASN1CLASS_UNIVERSAL << 24) | ASN1TAG_Null)
/* UNIVERSAL ASN1 types in the grammar */
#define ASN1TAGCLASS_JointIsoItuIdentifier ASN1TAGCLASS_INTEGER
Modified: redbutton-author/trunk/parser.c.header
===================================================================
--- redbutton-author/trunk/parser.c.header 2007-09-18 12:55:32 UTC (rev 394)
+++ redbutton-author/trunk/parser.c.header 2007-09-18 13:02:58 UTC (rev 395)
@@ -87,6 +87,13 @@
verbose("<BOOLEAN value=%s/>\n", token_text());
+ /* give our parent a UNIVERSAL type if it is synthetic */
+ if(is_synthetic(parent->asn1tag))
+ {
+ parent->asn1tag = ASN1TAG_BOOLEAN;
+ parent->asn1class = ASN1CLASS_UNIVERSAL;
+ }
+
der_encode_BOOLEAN(&parent->value, &parent->length, strcmp(token_text(), "false"));
return;
@@ -100,6 +107,13 @@
verbose("<INTEGER value=%s/>\n", token_text());
+ /* give our parent a UNIVERSAL type if it is synthetic */
+ if(is_synthetic(parent->asn1tag))
+ {
+ parent->asn1tag = ASN1TAG_INTEGER;
+ parent->asn1class = ASN1CLASS_UNIVERSAL;
+ }
+
der_encode_INTEGER(&parent->value, &parent->length, strtol(token_text(), NULL, 0));
return;
@@ -112,6 +126,13 @@
verbose("<STRING value=%s/>\n", token_text());
+ /* give our parent a UNIVERSAL type if it is synthetic */
+ if(is_synthetic(parent->asn1tag))
+ {
+ parent->asn1tag = ASN1TAG_OctetString;
+ parent->asn1class = ASN1CLASS_UNIVERSAL;
+ }
+
der_encode_OctetString(&parent->value, &parent->length, token_text());
return;
@@ -125,6 +146,13 @@
verbose("<QPRINTABLE value=%s/>\n", token_text());
+ /* give our parent a UNIVERSAL type if it is synthetic */
+ if(is_synthetic(parent->asn1tag))
+ {
+ parent->asn1tag = ASN1TAG_OctetString;
+ parent->asn1class = ASN1CLASS_UNIVERSAL;
+ }
+
der_encode_OctetString(&parent->value, &parent->length, token_text());
return;
@@ -138,6 +166,13 @@
verbose("<BASE64 value=%s/>\n", token_text());
+ /* give our parent a UNIVERSAL type if it is synthetic */
+ if(is_synthetic(parent->asn1tag))
+ {
+ parent->asn1tag = ASN1TAG_OctetString;
+ parent->asn1class = ASN1CLASS_UNIVERSAL;
+ }
+
der_encode_OctetString(&parent->value, &parent->length, token_text());
return;
@@ -155,6 +190,13 @@
if(parent->length != 0)
fatal("Null: length=%u", parent->length);
+ /* give our parent a UNIVERSAL type if it is synthetic */
+ if(is_synthetic(parent->asn1tag))
+ {
+ parent->asn1tag = ASN1TAG_Null;
+ parent->asn1class = ASN1CLASS_UNIVERSAL;
+ }
+
return;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|