summary refs log tree commit diff
path: root/crypto/src/asn1/cms/AuthenticatedDataParser.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@gmail.com>2022-06-22 01:40:55 +0700
committerPeter Dettman <peter.dettman@gmail.com>2022-06-22 01:40:55 +0700
commit892dbe845c98ff3fad3d682aaed3cd40b3161d4f (patch)
tree785ea8dc92cde60b6c06d5f56f6c3f0cda69bb2c /crypto/src/asn1/cms/AuthenticatedDataParser.cs
parentCleanup old build systems (diff)
downloadBouncyCastle.NET-ed25519-892dbe845c98ff3fad3d682aaed3cd40b3161d4f.tar.xz
ObsoleteAttribute cleanup
Diffstat (limited to 'crypto/src/asn1/cms/AuthenticatedDataParser.cs')
-rw-r--r--crypto/src/asn1/cms/AuthenticatedDataParser.cs38
1 files changed, 20 insertions, 18 deletions
diff --git a/crypto/src/asn1/cms/AuthenticatedDataParser.cs b/crypto/src/asn1/cms/AuthenticatedDataParser.cs
index 4b80d1b02..54dee99e8 100644
--- a/crypto/src/asn1/cms/AuthenticatedDataParser.cs
+++ b/crypto/src/asn1/cms/AuthenticatedDataParser.cs
@@ -53,12 +53,15 @@ namespace Org.BouncyCastle.Asn1.Cms
 	            nextObject = seq.ReadObject();
 	        }
 
-	        if (nextObject is Asn1TaggedObjectParser && ((Asn1TaggedObjectParser)nextObject).TagNo == 0)
-	        {
-	            Asn1SequenceParser originatorInfo = (Asn1SequenceParser) ((Asn1TaggedObjectParser)nextObject).GetObjectParser(Asn1Tags.Sequence, false);
-	            nextObject = null;
-	            return OriginatorInfo.GetInstance(originatorInfo.ToAsn1Object());
-	        }
+			if (nextObject is Asn1TaggedObjectParser o)
+			{
+				if (o.HasContextTag(0))
+				{
+					Asn1SequenceParser originatorInfo = (Asn1SequenceParser)o.ParseBaseUniversal(false, Asn1Tags.Sequence);
+					nextObject = null;
+					return OriginatorInfo.GetInstance(originatorInfo.ToAsn1Object());
+				}
+			}
 
 	        return null;
 	    }
@@ -139,12 +142,11 @@ namespace Org.BouncyCastle.Asn1.Cms
 	            nextObject = seq.ReadObject();
 	        }
 
-	        if (nextObject is Asn1TaggedObjectParser)
-	        {
-	            IAsn1Convertible o = nextObject;
-	            nextObject = null;
-	            return (Asn1SetParser)((Asn1TaggedObjectParser)o).GetObjectParser(Asn1Tags.Set, false);
-	        }
+			if (nextObject is Asn1TaggedObjectParser o)
+			{
+				nextObject = null;
+				return (Asn1SetParser)Asn1Utilities.ParseContextBaseUniversal(o, 2, false, Asn1Tags.SetOf);
+			}
 
 	        return null;
 	    }
@@ -169,12 +171,12 @@ namespace Org.BouncyCastle.Asn1.Cms
 	            nextObject = seq.ReadObject();
 	        }
 
-	        if (nextObject != null)
-	        {
-	            IAsn1Convertible o = nextObject;
-	            nextObject = null;
-	            return (Asn1SetParser)((Asn1TaggedObjectParser)o).GetObjectParser(Asn1Tags.Set, false);
-	        }
+			if (nextObject != null)
+			{
+				Asn1TaggedObject o = (Asn1TaggedObject)nextObject;
+				nextObject = null;
+				return (Asn1SetParser)Asn1Utilities.ParseContextBaseUniversal(o, 3, false, Asn1Tags.SetOf);
+			}
 
 	        return null;
 	    }