Use Locale.US instead of Locale.ROOT to make jdk 1.5 happy

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1423842 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Karl Wright 2012-12-19 12:32:26 +00:00
parent 093284e54a
commit ba065fca60
1 changed files with 4 additions and 4 deletions

View File

@ -573,7 +573,7 @@ final class NTLMEngineImpl implements NTLMEngine {
*/
private static byte[] lmHash(String password) throws NTLMEngineException {
try {
byte[] oemPassword = password.toUpperCase(Locale.ROOT).getBytes("US-ASCII");
byte[] oemPassword = password.toUpperCase(Locale.US).getBytes("US-ASCII");
int length = Math.min(oemPassword.length, 14);
byte[] keyBytes = new byte[14];
System.arraycopy(oemPassword, 0, keyBytes, 0, length);
@ -633,7 +633,7 @@ final class NTLMEngineImpl implements NTLMEngine {
byte[] ntlmHash = ntlmHash(password);
HMACMD5 hmacMD5 = new HMACMD5(ntlmHash);
// Upper case username, mixed case target!!
hmacMD5.update(user.toUpperCase(Locale.ROOT).getBytes("UnicodeLittleUnmarked"));
hmacMD5.update(user.toUpperCase(Locale.US).getBytes("UnicodeLittleUnmarked"));
hmacMD5.update(target.getBytes("UnicodeLittleUnmarked"));
return hmacMD5.getOutput();
} catch (java.io.UnsupportedEncodingException e) {
@ -952,7 +952,7 @@ final class NTLMEngineImpl implements NTLMEngine {
domain = convertDomain(domain);
hostBytes = host.getBytes("UnicodeLittleUnmarked");
domainBytes = domain.toUpperCase(Locale.ROOT).getBytes("UnicodeLittleUnmarked");
domainBytes = domain.toUpperCase(Locale.US).getBytes("UnicodeLittleUnmarked");
} catch (java.io.UnsupportedEncodingException e) {
throw new NTLMEngineException("Unicode unsupported: " + e.getMessage(), e);
}
@ -1198,7 +1198,7 @@ final class NTLMEngineImpl implements NTLMEngine {
sessionKey = null;
try {
domainBytes = domain.toUpperCase(Locale.ROOT).getBytes("UnicodeLittleUnmarked");
domainBytes = domain.toUpperCase(Locale.US).getBytes("UnicodeLittleUnmarked");
hostBytes = host.getBytes("UnicodeLittleUnmarked");
userBytes = user.getBytes("UnicodeLittleUnmarked");
} catch (java.io.UnsupportedEncodingException e) {