summary refs log tree commit diff
path: root/crypto/src/asn1/LazyDERSet.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2019-08-01 20:30:22 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2019-08-01 20:30:22 +0700
commitf06dc7c2f2e578c77bdb53ff981c578c3fe017eb (patch)
treeda2e616d2554028d0314681abacc5632aa523627 /crypto/src/asn1/LazyDERSet.cs
parentDon't create a SecureRandom unnecessarily (diff)
downloadBouncyCastle.NET-ed25519-f06dc7c2f2e578c77bdb53ff981c578c3fe017eb.tar.xz
Rewrite Asn1Sequence/Set to store elements as Asn1Encodable[]
Diffstat (limited to 'crypto/src/asn1/LazyDERSet.cs')
-rw-r--r--crypto/src/asn1/LazyDERSet.cs10
1 files changed, 6 insertions, 4 deletions
diff --git a/crypto/src/asn1/LazyDERSet.cs b/crypto/src/asn1/LazyDERSet.cs
index e6c9319dd..eac64cbbe 100644
--- a/crypto/src/asn1/LazyDERSet.cs
+++ b/crypto/src/asn1/LazyDERSet.cs
@@ -21,16 +21,18 @@ namespace Org.BouncyCastle.Asn1
 			{
 				if (encoded != null)
 				{
-					Asn1InputStream e = new LazyAsn1InputStream(encoded);
+                    Asn1EncodableVector v = new Asn1EncodableVector();
+                    Asn1InputStream e = new LazyAsn1InputStream(encoded);
 
 					Asn1Object o;
 					while ((o = e.ReadObject()) != null)
 					{
-						AddObject(o);
+						v.Add(o);
 					}
 
-					encoded = null;
-				}
+                    this.elements = v.TakeElements();
+                    this.encoded = null;
+                }
 			}
 		}