diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2017-09-04 17:30:13 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2017-09-04 17:30:13 +0700 |
commit | ea97e77307f5e2b6f119250a1542ccea24446fc7 (patch) | |
tree | ba63b4bab444a76ec70ae7663457b6ef5e43b1ad /crypto/src/asn1 | |
parent | Avoid integer overflow in argument checks (diff) | |
download | BouncyCastle.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.cs | 11 |
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( |