diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2015-11-12 22:57:06 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2015-11-12 22:57:06 +0700 |
commit | 809e86bbf8ed478e7aa7b9de8a3bfc3014289bd5 (patch) | |
tree | 9287ae725992c5972bed155ec4f4773fdace7b22 /crypto/src/pkcs | |
parent | Refactoring of "unused bits" changes (diff) | |
download | BouncyCastle.NET-ed25519-809e86bbf8ed478e7aa7b9de8a3bfc3014289bd5.tar.xz |
Review of culture-independent String comparison methods
Diffstat (limited to 'crypto/src/pkcs')
-rw-r--r-- | crypto/src/pkcs/Pkcs10CertificationRequest.cs | 2 | ||||
-rw-r--r-- | crypto/src/pkcs/Pkcs12Store.cs | 16 |
2 files changed, 9 insertions, 9 deletions
diff --git a/crypto/src/pkcs/Pkcs10CertificationRequest.cs b/crypto/src/pkcs/Pkcs10CertificationRequest.cs index 0411d9190..c2504e6e5 100644 --- a/crypto/src/pkcs/Pkcs10CertificationRequest.cs +++ b/crypto/src/pkcs/Pkcs10CertificationRequest.cs @@ -379,7 +379,7 @@ namespace Org.BouncyCastle.Pkcs // throw new SignatureException("IOException decoding parameters: " + e.Message); // } - if (signature.AlgorithmName.EndsWith("MGF1")) + if (Platform.EndsWith(signature.AlgorithmName, "MGF1")) { throw Platform.CreateNotImplementedException("signature algorithm with MGF1"); diff --git a/crypto/src/pkcs/Pkcs12Store.cs b/crypto/src/pkcs/Pkcs12Store.cs index b649a726e..e65788733 100644 --- a/crypto/src/pkcs/Pkcs12Store.cs +++ b/crypto/src/pkcs/Pkcs12Store.cs @@ -1052,13 +1052,13 @@ namespace Org.BouncyCastle.Pkcs public object Remove( string alias) { - string lower = Platform.ToLowerInvariant(alias); - string k = (string) keys[lower]; + string upper = Platform.ToUpperInvariant(alias); + string k = (string)keys[upper]; if (k == null) return null; - keys.Remove(lower); + keys.Remove(upper); object o = orig[k]; orig.Remove(k); @@ -1070,8 +1070,8 @@ namespace Org.BouncyCastle.Pkcs { get { - string lower = Platform.ToLowerInvariant(alias); - string k = (string)keys[lower]; + string upper = Platform.ToUpperInvariant(alias); + string k = (string)keys[upper]; if (k == null) return null; @@ -1080,13 +1080,13 @@ namespace Org.BouncyCastle.Pkcs } set { - string lower = Platform.ToLowerInvariant(alias); - string k = (string)keys[lower]; + string upper = Platform.ToUpperInvariant(alias); + string k = (string)keys[upper]; if (k != null) { orig.Remove(k); } - keys[lower] = alias; + keys[upper] = alias; orig[alias] = value; } } |