[Redbutton-devel] SF.net SVN: redbutton: [466] redbutton-author/trunk
Brought to you by:
skilvington
|
From: <ski...@us...> - 2007-11-21 16:28:05
|
Revision: 466
http://redbutton.svn.sourceforge.net/redbutton/?rev=466&view=rev
Author: skilvington
Date: 2007-11-21 08:27:56 -0800 (Wed, 21 Nov 2007)
Log Message:
-----------
fix NewContentSize NULL parsing
Modified Paths:
--------------
redbutton-author/trunk/asn1tag.h
redbutton-author/trunk/ccc.y
Modified: redbutton-author/trunk/asn1tag.h
===================================================================
--- redbutton-author/trunk/asn1tag.h 2007-11-19 16:44:26 UTC (rev 465)
+++ redbutton-author/trunk/asn1tag.h 2007-11-21 16:27:56 UTC (rev 466)
@@ -744,7 +744,7 @@
#define ASN1TAGCLASS_NewReferencedContent ASN1TAGCLASS_SEQUENCE
#define ASN1TAGCLASS_NextScene ASN1TAGCLASS_SEQUENCE
#define ASN1TAGCLASS_TokenGroupItem ASN1TAGCLASS_SEQUENCE
-#define ASN1TAGCLASS_Movement ASN1TAGCLASS_INTEGER
+#define ASN1TAGCLASS_Movement ASN1TAGCLASS_SEQUENCE
#define ASN1TAGCLASS_ActionSlots ASN1TAGCLASS_SEQUENCE
#define ASN1TAGCLASS_InVariables ASN1TAGCLASS_SEQUENCE
#define ASN1TAGCLASS_OutVariables ASN1TAGCLASS_SEQUENCE
Modified: redbutton-author/trunk/ccc.y
===================================================================
--- redbutton-author/trunk/ccc.y 2007-11-19 16:44:26 UTC (rev 465)
+++ redbutton-author/trunk/ccc.y 2007-11-21 16:27:56 UTC (rev 466)
@@ -983,17 +983,42 @@
{
buf_append(&state.decode_fns, "\t\tfseek(der, -sublen, SEEK_CUR);\n");
buf_append(&state.decode_fns, "\t\tsublen = asn1decode_%s(der, out, sublen + tag.length);\n", item->name);
+ buf_append(&state.decode_fns, "\t\tif(sublen < 0)\n");
+ buf_append(&state.decode_fns, "\t\t\treturn der_error(\"%s\");\n", name);
+ buf_append(&state.decode_fns, "\t\tleft -= tag.length;\n");
}
else
{
- buf_append(&state.decode_fns, "\t\tsublen = asn1decode_%s(der, out, tag.length);\n", item->name);
+ /* is it a type that is encoded as a NULL if it is not present */
+ if(item->type == IT_IDENTORNULL)
+ {
+ buf_append(&state.decode_fns, "\t\tstruct der_tag null_tag;\n");
+ buf_append(&state.decode_fns, "\t\tif((sublen = der_decode_Tag(der, &null_tag)) < 0)\n");
+ buf_append(&state.decode_fns, "\t\t\treturn der_error(\"%s\");\n", name);
+ buf_append(&state.decode_fns, "\t\tif(is_Null(null_tag.class, null_tag.number))\n");
+ buf_append(&state.decode_fns, "\t\t{\n");
+ buf_append(&state.decode_fns, "\t\t\tleft -= sublen;\n");
+ buf_append(&state.decode_fns, "\t\t}\n");
+ buf_append(&state.decode_fns, "\t\telse\n");
+ buf_append(&state.decode_fns, "\t\t{\n");
+ buf_append(&state.decode_fns, "\t\t\tfseek(der, -sublen, SEEK_CUR);\n");
+ buf_append(&state.decode_fns, "\t\t\tsublen = asn1decode_%s(der, out, tag.length);\n", item->name);
+ buf_append(&state.decode_fns, "\t\t\tif(sublen < 0)\n");
+ buf_append(&state.decode_fns, "\t\t\t\treturn der_error(\"%s\");\n", name);
+ buf_append(&state.decode_fns, "\t\t\tleft -= tag.length;\n");
+ buf_append(&state.decode_fns, "\t\t}\n");
+ }
+ else
+ {
+ buf_append(&state.decode_fns, "\t\tsublen = asn1decode_%s(der, out, tag.length);\n", item->name);
+ buf_append(&state.decode_fns, "\t\tif(sublen < 0)\n");
+ buf_append(&state.decode_fns, "\t\t\treturn der_error(\"%s\");\n", name);
+ buf_append(&state.decode_fns, "\t\tleft -= tag.length;\n");
+ }
}
- buf_append(&state.decode_fns, "\t\tif(sublen < 0)\n");
- buf_append(&state.decode_fns, "\t\t\treturn der_error(\"%s\");\n", name);
- buf_append(&state.decode_fns, "\t\tleft -= tag.length;\n");
buf_append(&state.decode_fns, "\t}\n");
/* is it a type that is encoded as a NULL if it is not present */
- if(item->type == IT_IDENTORNULL)
+ if(item->type == IT_IDENTORNULL && keep_tag(asn1tagclass(item->name)))
{
buf_append(&state.decode_fns, "\telse if(!is_Null(tag.class, tag.number))\n");
buf_append(&state.decode_fns, "\t{\n");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|