summary refs log tree commit diff
path: root/crypto/src/asn1
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2017-09-04 17:30:13 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2017-09-04 17:30:13 +0700
commitea97e77307f5e2b6f119250a1542ccea24446fc7 (patch)
treeba63b4bab444a76ec70ae7663457b6ef5e43b1ad /crypto/src/asn1
parentAvoid integer overflow in argument checks (diff)
downloadBouncyCastle.NET-ed25519-ea97e77307f5e2b6f119250a1542ccea24446fc7.tar.xz
Support INTEGER encoding when reading GOST private keys
- see https://github.com/bcgit/bc-csharp/pull/86
Diffstat (limited to 'crypto/src/asn1')
-rw-r--r--crypto/src/asn1/cryptopro/GOST3410PublicKeyAlgParameters.cs11
1 files changed, 2 insertions, 9 deletions
diff --git a/crypto/src/asn1/cryptopro/GOST3410PublicKeyAlgParameters.cs b/crypto/src/asn1/cryptopro/GOST3410PublicKeyAlgParameters.cs
index 10c45ba4d..ea42a1ec4 100644
--- a/crypto/src/asn1/cryptopro/GOST3410PublicKeyAlgParameters.cs
+++ b/crypto/src/asn1/cryptopro/GOST3410PublicKeyAlgParameters.cs
@@ -22,16 +22,9 @@ namespace Org.BouncyCastle.Asn1.CryptoPro
             object obj)
         {
             if (obj == null || obj is Gost3410PublicKeyAlgParameters)
-            {
-                return (Gost3410PublicKeyAlgParameters) obj;
-            }
-
-			if (obj is Asn1Sequence)
-            {
-                return new Gost3410PublicKeyAlgParameters((Asn1Sequence) obj);
-            }
+                return (Gost3410PublicKeyAlgParameters)obj;
 
-            throw new ArgumentException("Invalid GOST3410Parameter: " + Platform.GetTypeName(obj));
+            return new Gost3410PublicKeyAlgParameters(Asn1Sequence.GetInstance((obj)));
         }
 
 		public Gost3410PublicKeyAlgParameters(