Tk Library Source Code

Artifact [0dcf059f7d]
Login

Artifact 0dcf059f7df0d6aa2034da5b10226ed0366d839c:

Attachment "asn.tcl.diff" to ticket [1645333fff] added by vbwagner 2007-01-26 21:29:13.
--- /var/autofs/net/lynx/home/vitus/src/asn.tcl	2007-01-26 16:57:38.000000000 +0300
+++ ../../maketool/asn.tcl	2007-01-26 17:24:51.000000000 +0300
@@ -1054,17 +1054,21 @@
 # asnGetApplication
 #-----------------------------------------------------------------------------
 
-proc ::asn::asnGetApplication {data_var appNumber_var {content_var {}}} {
+proc ::asn::asnGetApplication {data_var appNumber_var {content_var {}} {constructed_var {}}} {
     upvar $data_var data $appNumber_var appNumber
 
     asnGetByte   data tag
     asnGetLength data length
 
-    if {($tag & 0xE0) != 0x060} {
+    if {($tag & 0xC0) != 0x040} {
         return -code error \
-            [format "Expected Application (0x60), but got %02x" $tag]
+            [format "Expected Application (0x60 or 0x40), but got %02x" $tag]
     }    
     set appNumber [expr {$tag & 0x1F}]
+	if {[string length $constructed_var]} {
+		upvar 1 $constructed_var constructed
+		set constructed [expr {$tag & 0x20}]
+	}
 	if {[string length $content_var]} {
 		upvar 1 $content_var content
 		asnGetBytes data $length content
@@ -1200,19 +1204,23 @@
 #
 #-----------------------------------------------------------------------------
 
-proc ::asn::asnGetContext {data_var contextNumber_var {content_var {}}} {
+proc ::asn::asnGetContext {data_var contextNumber_var {content_var {}} {constructed_var {}}} {
     upvar 1 $data_var data $contextNumber_var contextNumber
 
     asnGetByte   data tag
     asnGetLength data length
 
-    if {($tag & 0xE0) != 0x0a0} {
+    if {($tag & 0xC0) != 0x080} {
         return -code error \
-            [format "Expected Context (0xa0), but got %02x" $tag]
+            [format "Expected Context (0xa0 or 0x80), but got %02x" $tag]
     }    
     set contextNumber [expr {$tag & 0x1F}]
-	if {[string length content_var]} {
-		upvar $content_var content
+	if {[string length $constructed_var]} {
+		upvar 1 $constructed_var constructed
+		set constructed [expr {$tag & 0x20}]
+	}
+	if {[string length $content_var]} {
+		upvar 1 $content_var content
 		asnGetBytes data $length content
 	}	
     return