summary refs log tree commit diff
path: root/crypto/src/asn1/Asn1Encodable.cs
diff options
context:
space:
mode:
authorDavid Hook <dgh@cryptoworkshop.com>2021-10-07 11:20:11 +1100
committerDavid Hook <dgh@cryptoworkshop.com>2021-10-07 11:20:11 +1100
commit81977ab62fb74af1624930718b83acd8c5c78f72 (patch)
treea756d3dda3e967dffe1c97c6876f5fbaf4a51e88 /crypto/src/asn1/Asn1Encodable.cs
parentcorrected DER encoding of SET (diff)
downloadBouncyCastle.NET-ed25519-81977ab62fb74af1624930718b83acd8c5c78f72.tar.xz
added explicit sorting of DER encoded SET
Diffstat (limited to 'crypto/src/asn1/Asn1Encodable.cs')
-rw-r--r--crypto/src/asn1/Asn1Encodable.cs5
1 files changed, 5 insertions, 0 deletions
diff --git a/crypto/src/asn1/Asn1Encodable.cs b/crypto/src/asn1/Asn1Encodable.cs
index 12628082d..c7fde6e07 100644
--- a/crypto/src/asn1/Asn1Encodable.cs
+++ b/crypto/src/asn1/Asn1Encodable.cs
@@ -26,6 +26,11 @@ namespace Org.BouncyCastle.Asn1
 				MemoryStream bOut = new MemoryStream();
 				DerOutputStream dOut = new DerOutputStream(bOut);
 
+				if (this is Asn1Set)
+				{
+					(this as Asn1Set).Sort();
+				}
+
 				dOut.WriteObject(this);
 
 				return bOut.ToArray();