[Mono-bugs] [Bug 76012][Wis] New - X509Certificates.cs: Parse Problem Of Version

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Wed Sep 7 12:41:22 EDT 2005


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by sascha.kiefer at dialogika.de.

http://bugzilla.ximian.com/show_bug.cgi?id=76012

--- shadow/76012	2005-09-07 12:41:22.000000000 -0400
+++ shadow/76012.tmp.26719	2005-09-07 12:41:22.000000000 -0400
@@ -0,0 +1,47 @@
+Bug#: 76012
+Product: Mono: Class Libraries
+Version: 1.1
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: Mono.Security
+AssignedTo: sebastien at ximian.com                            
+ReportedBy: sascha.kiefer at dialogika.de               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: X509Certificates.cs: Parse Problem Of Version
+
+Description of Problem:
+
+The version of a X.509 Certificates is parsed wrong.
+
+The code right now is:
+// Certificate / TBSCertificate / Version
+ASN1 v = decoder [0][tbs];
+version = 1;			// DEFAULT v1
+if (v.Tag == 0xA0) {
+   // version (optional) is present only in v2+ certs
+   version += v.Value [0];	// zero based
+   tbs++;
+}
+
+v.Tag == 0xA0 means, that it is a context specific type, so we have to 
+parse the data. here a bug fix:
+
+// Certificate / TBSCertificate / Version
+ASN1 v = decoder [0][tbs];
+version = 1;			// DEFAULT v1
+if (v.Tag == 0xA0) {
+   // version (optional) is present only in v2+ certs
+   ASN1 vers = new ASN1(v.Value);
+   version += vers.Value [0];	// zero based
+   tbs++;
+}
+
+HTH
+Sascha


More information about the mono-bugs mailing list