From 5ef5b7ebec21ac99a61466cf5861b7d301bc7da0 Mon Sep 17 00:00:00 2001
From: boli <boli@localhost>
Date: Fri, 01 May 2009 01:14:55 +0000
Subject: [PATCH] Second fix for issue 3949: All ASN.1 parsing code now ignores trailing unrecognized SEQUENCE components.

---
 opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/ASN1ReaderTestCase.java |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/ASN1ReaderTestCase.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/ASN1ReaderTestCase.java
index 668b566..336afc5 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/ASN1ReaderTestCase.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/ASN1ReaderTestCase.java
@@ -752,21 +752,20 @@
   }
 
   /**
-   * Tests to make sure not reading all elements in a sub sequence can be
-   * detected.
+   * Tests to make sure trailing components are ignored if not used.
    *
    * @throws  Exception  If an unexpected problem occurs.
    */
-  @Test(expectedExceptions = { ASN1Exception.class })
+  @Test
   public void testDecodeSequenceIncompleteRead()
       throws Exception
   {
     // An ASN.1 sequence of booleans missing one boolean element at the end
-    byte[] b = new byte[] { 0x30, 0x06, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00 };
+    byte[] b = new byte[] { 0x30, 0x06, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00 };
     ASN1Reader reader = getReader(b, 0);
     reader.readStartSequence();
-    reader.readBoolean();
     reader.readEndSequence();
+    assertFalse(reader.readBoolean());
   }
 
   /**

--
Gitblit v1.10.0