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/openpgp | |
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/openpgp')
-rw-r--r-- | crypto/src/openpgp/PgpPublicKeyRingBundle.cs | 6 | ||||
-rw-r--r-- | crypto/src/openpgp/PgpSecretKey.cs | 2 | ||||
-rw-r--r-- | crypto/src/openpgp/PgpSecretKeyRingBundle.cs | 6 |
3 files changed, 7 insertions, 7 deletions
diff --git a/crypto/src/openpgp/PgpPublicKeyRingBundle.cs b/crypto/src/openpgp/PgpPublicKeyRingBundle.cs index 519a2f884..e73848439 100644 --- a/crypto/src/openpgp/PgpPublicKeyRingBundle.cs +++ b/crypto/src/openpgp/PgpPublicKeyRingBundle.cs @@ -113,7 +113,7 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp if (ignoreCase) { - userId = Platform.ToLowerInvariant(userId); + userId = Platform.ToUpperInvariant(userId); } foreach (PgpPublicKeyRing pubRing in GetKeyRings()) @@ -123,12 +123,12 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp string next = nextUserID; if (ignoreCase) { - next = Platform.ToLowerInvariant(next); + next = Platform.ToUpperInvariant(next); } if (matchPartial) { - if (next.IndexOf(userId) > -1) + if (Platform.IndexOf(next, userId) > -1) { rings.Add(pubRing); } diff --git a/crypto/src/openpgp/PgpSecretKey.cs b/crypto/src/openpgp/PgpSecretKey.cs index d3811c44c..b3986073d 100644 --- a/crypto/src/openpgp/PgpSecretKey.cs +++ b/crypto/src/openpgp/PgpSecretKey.cs @@ -1204,7 +1204,7 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp string curveID = SXprUtilities.ReadString(inputStream, inputStream.ReadByte()); curveName = SXprUtilities.ReadString(inputStream, inputStream.ReadByte()); - if (curveName.StartsWith("NIST ")) + if (Platform.StartsWith(curveName, "NIST ")) { curveName = curveName.Substring("NIST ".Length); } diff --git a/crypto/src/openpgp/PgpSecretKeyRingBundle.cs b/crypto/src/openpgp/PgpSecretKeyRingBundle.cs index 12c7c098c..b0df0ed3f 100644 --- a/crypto/src/openpgp/PgpSecretKeyRingBundle.cs +++ b/crypto/src/openpgp/PgpSecretKeyRingBundle.cs @@ -114,7 +114,7 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp if (ignoreCase) { - userId = Platform.ToLowerInvariant(userId); + userId = Platform.ToUpperInvariant(userId); } foreach (PgpSecretKeyRing secRing in GetKeyRings()) @@ -124,12 +124,12 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp string next = nextUserID; if (ignoreCase) { - next = Platform.ToLowerInvariant(next); + next = Platform.ToUpperInvariant(next); } if (matchPartial) { - if (next.IndexOf(userId) > -1) + if (Platform.IndexOf(next, userId) > -1) { rings.Add(secRing); } |