Author: spouliot
Date: 2006-06-14 11:27:32 -0400 (Wed, 14 Jun 2006)
New Revision: 61698
Modified:
Log:
2006-06-14 Sebastien Pouliot <sebastien (AT) ximian (DOT) com>
* ASN1.cs: Switch condition not to use the cached data if there is a
collection being used. Skip extra 0 at the end of the byte[] buffer.
Modified:
2006-06-14 15:26:34 UTC (rev 61697)
2006-06-14 15:27:32 UTC (rev 61698)
@@ -159,10 +159,8 @@
public virtual byte[] GetBytes ()
{
byte[] val = null;
-if (m_aValue != null) {
-val = m_aValue;
-}
-else if (Count 0) {
+
+if (Count 0) {
int esize = 0;
ArrayList al = new ArrayList ();
foreach (ASN1 a in elist) {
@@ -177,6 +175,8 @@
Buffer.BlockCopy (item, 0, val, pos, item.Length);
pos += item.Length;
}
+} else if (m_aValue != null) {
+val = m_aValue;
}
byte[] der;
@@ -247,6 +247,9 @@
// minimum is 2 bytes (tag + length of 0)
while (anPos < anLength - 1) {
DecodeTLV (asn1, ref anPos, out nTag, out nLength, out aValue);
+// sometimes we get trailing 0
+if (nTag == 0)
+continue;
ASN1 elm = Add (new ASN1 (nTag, aValue));
Modified:
2006-06-14 15:26:34 UTC (rev 61697)
2006-06-14 15:27:32 UTC (rev 61698)
@@ -1,3 +1,8 @@
+2006-06-14 Sebastien Pouliot <sebastien (AT) ximian (DOT) com>
+
+* ASN1.cs: Switch condition not to use the cached data if there is a
+collection being used. Skip extra 0 at the end of the byte[] buffer.
+
2006-01-04 Sebastien Pouliot <sebastien (AT) ximian (DOT) com>
* ASN1Convert.cs: Fix convertion of integer 0 to ASN.1.
Mono-patches maillist - Mono-patches (AT) lists (DOT) ximian.com