From a610e3ed96f70969d21b57f453435d3a95bbe8ed Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Mon, 4 Sep 2017 17:32:10 +0700 Subject: Update handling of implicitly-tagged OIDs (from bc-java) --- crypto/src/asn1/DerObjectIdentifier.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'crypto') 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( -- cgit 1.4.1