diff --git a/crypto/test/src/asn1/test/TagTest.cs b/crypto/test/src/asn1/test/TagTest.cs
index c5fce6dbc..80ca2c0ea 100644
--- a/crypto/test/src/asn1/test/TagTest.cs
+++ b/crypto/test/src/asn1/test/TagTest.cs
@@ -1,4 +1,5 @@
using System;
+using System.IO;
using NUnit.Framework;
@@ -33,14 +34,17 @@ namespace Org.BouncyCastle.Asn1.Tests
public override void PerformTest()
{
- DerApplicationSpecific app = (DerApplicationSpecific)
- Asn1Object.FromByteArray(longTagged);
+ Asn1InputStream aIn = new Asn1InputStream(longTagged);
- app = (DerApplicationSpecific) Asn1Object.FromByteArray(app.GetContents());
+ DerApplicationSpecific app = (DerApplicationSpecific)aIn.ReadObject();
- Asn1InputStream aIn = new Asn1InputStream(app.GetContents());
+ aIn = new Asn1InputStream(app.GetContents());
- Asn1TaggedObject tagged = (Asn1TaggedObject) aIn.ReadObject();
+ app = (DerApplicationSpecific)aIn.ReadObject();
+
+ aIn = new Asn1InputStream(app.GetContents());
+
+ Asn1TaggedObject tagged = (Asn1TaggedObject)aIn.ReadObject();
if (tagged.TagNo != 32)
{
diff --git a/crypto/test/src/openssl/test/ReaderTest.cs b/crypto/test/src/openssl/test/ReaderTest.cs
index e3990b562..c0be5c848 100644
--- a/crypto/test/src/openssl/test/ReaderTest.cs
+++ b/crypto/test/src/openssl/test/ReaderTest.cs
@@ -198,7 +198,7 @@ namespace Org.BouncyCastle.OpenSsl.Tests
doDudPasswordTest("3ee7a8", 10, "DER length more than 4 bytes: 57");
doDudPasswordTest("41af75", 11, "unknown tag 16 encountered");
doDudPasswordTest("1704a5", 12, "corrupted stream detected");
- doDudPasswordTest("1c5822", 13, "Unknown object in GetInstance: Org.BouncyCastle.Asn1.DerUtf8String");
+ doDudPasswordTest("1c5822", 13, "extra data found after object");
doDudPasswordTest("5a3d16", 14, "corrupted stream detected");
doDudPasswordTest("8d0c97", 15, "corrupted stream detected");
doDudPasswordTest("bc0daf", 16, "corrupted stream detected");
@@ -342,7 +342,7 @@ namespace Org.BouncyCastle.OpenSsl.Tests
Fail("issue not detected: " + index);
}
- catch (IOException e)
+ catch (Exception e)
{
if (e.Message.IndexOf(message) < 0)
{
|