hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1423841 - /httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/auth/NTLMEngineImpl.java
Date Wed, 19 Dec 2012 12:31:14 GMT
Author: kwright
Date: Wed Dec 19 12:31:12 2012
New Revision: 1423841

URL: http://svn.apache.org/viewvc?rev=1423841&view=rev
Log:
Use Locale.US instead of Locale.ROOT to make jdk 1.5 happy

Modified:
    httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/auth/NTLMEngineImpl.java

Modified: httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/auth/NTLMEngineImpl.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/auth/NTLMEngineImpl.java?rev=1423841&r1=1423840&r2=1423841&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/auth/NTLMEngineImpl.java
(original)
+++ httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/auth/NTLMEngineImpl.java
Wed Dec 19 12:31:12 2012
@@ -574,7 +574,7 @@ final class NTLMEngineImpl implements NT
      */
     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);
@@ -634,7 +634,7 @@ final class NTLMEngineImpl implements NT
             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) {
@@ -953,7 +953,7 @@ final class NTLMEngineImpl implements NT
                 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);
             }
@@ -1201,7 +1201,7 @@ final class NTLMEngineImpl implements NT
                 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) {



Mime
View raw message