diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2015-11-12 17:32:38 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2015-11-12 17:32:38 +0700 |
commit | 005288002936b16dce66912f06fcd1ba09ed2508 (patch) | |
tree | 08addda717ec485c44c2babefe1441fd31dac1d8 /crypto/src | |
parent | Add sanity check on input length (diff) | |
download | BouncyCastle.NET-ed25519-005288002936b16dce66912f06fcd1ba09ed2508.tar.xz |
Use culture-independent prefix-check in MacUtilities.GetMac
- Fix for https://github.com/bcgit/bc-csharp/pull/40 (modified from original patch)
Diffstat (limited to 'crypto/src')
-rw-r--r-- | crypto/src/security/MacUtilities.cs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/src/security/MacUtilities.cs b/crypto/src/security/MacUtilities.cs index d7fe91142..41cf5e9e2 100644 --- a/crypto/src/security/MacUtilities.cs +++ b/crypto/src/security/MacUtilities.cs @@ -1,4 +1,6 @@ +using System; using System.Collections; +using System.Globalization; using Org.BouncyCastle.Asn1; using Org.BouncyCastle.Asn1.Iana; @@ -117,7 +119,7 @@ namespace Org.BouncyCastle.Security mechanism = mechanism.Substring("PBEWITH".Length); } - if (mechanism.StartsWith("HMAC")) + if (CultureInfo.InvariantCulture.CompareInfo.IsPrefix(mechanism, "HMAC", CompareOptions.Ordinal)) { string digestName; if (mechanism.StartsWith("HMAC-") || mechanism.StartsWith("HMAC/")) |