summary refs log tree commit diff
path: root/crypto
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2017-09-04 17:32:10 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2017-09-04 17:32:10 +0700
commita610e3ed96f70969d21b57f453435d3a95bbe8ed (patch)
treeb690bfd81c569f6479e4ab37d258677c8adf20c1 /crypto
parentSupport INTEGER encoding when reading GOST private keys (diff)
downloadBouncyCastle.NET-ed25519-a610e3ed96f70969d21b57f453435d3a95bbe8ed.tar.xz
Update handling of implicitly-tagged OIDs (from bc-java)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/src/asn1/DerObjectIdentifier.cs9
1 files changed, 8 insertions, 1 deletions
diff --git a/crypto/src/asn1/DerObjectIdentifier.cs b/crypto/src/asn1/DerObjectIdentifier.cs
index 6ac2b7e9e..495260a68 100644
--- a/crypto/src/asn1/DerObjectIdentifier.cs
+++ b/crypto/src/asn1/DerObjectIdentifier.cs
@@ -42,7 +42,14 @@ namespace Org.BouncyCastle.Asn1
             Asn1TaggedObject	obj,
             bool				explicitly)
         {
-            return GetInstance(obj.GetObject());
+            Asn1Object o = obj.GetObject();
+
+            if (explicitly || o is DerObjectIdentifier)
+            {
+                return GetInstance(o);
+            }
+
+            return FromOctetString(Asn1OctetString.GetInstance(o).GetOctets());
         }
 
         public DerObjectIdentifier(