summary refs log tree commit diff
path: root/crypto/test
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2021-11-10 00:38:54 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2021-11-10 00:38:54 +0700
commit212ec41dd10152391c5218c0a6c98af31ff02d6f (patch)
tree5ebbddb7d80684c586884939b990e274f51d4558 /crypto/test
parentAdd DLSequence, DLSet for internal use (diff)
downloadBouncyCastle.NET-ed25519-212ec41dd10152391c5218c0a6c98af31ff02d6f.tar.xz
Handle high tag numbers
Diffstat (limited to 'crypto/test')
-rw-r--r--crypto/test/src/asn1/test/TagTest.cs13
1 files changed, 11 insertions, 2 deletions
diff --git a/crypto/test/src/asn1/test/TagTest.cs b/crypto/test/src/asn1/test/TagTest.cs

index 80ca2c0ea..fd6995c44 100644 --- a/crypto/test/src/asn1/test/TagTest.cs +++ b/crypto/test/src/asn1/test/TagTest.cs
@@ -27,6 +27,8 @@ namespace Org.BouncyCastle.Asn1.Tests private static readonly byte[] longAppSpecificTag = Hex.Decode("5F610101"); + private static readonly byte[] taggedInteger = Hex.Decode("BF2203020101"); + public override string Name { get { return "Tag"; } @@ -100,9 +102,16 @@ namespace Org.BouncyCastle.Asn1.Tests Fail("incorrect tag number read on recode (random test value: " + testTag + ")"); } } - } - public static void Main( + tagged = new DerTaggedObject(false, 34, new DerTaggedObject(true, 1000, new DerInteger(1))); + + if (!AreEqual(taggedInteger, tagged.GetEncoded())) + { + Fail("incorrect encoding for implicit explicit tagged integer"); + } + } + + public static void Main( string[] args) { RunTest(new TagTest());