hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1423842 - /httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/auth/NTLMEngineImpl.java
Date Wed, 19 Dec 2012 12:32:27 GMT
Author: kwright
Date: Wed Dec 19 12:32:26 2012
New Revision: 1423842

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

Modified:
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/auth/NTLMEngineImpl.java

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/auth/NTLMEngineImpl.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/auth/NTLMEngineImpl.java?rev=1423842&r1=1423841&r2=1423842&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/auth/NTLMEngineImpl.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/auth/NTLMEngineImpl.java
Wed Dec 19 12:32:26 2012
@@ -573,7 +573,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);
@@ -633,7 +633,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) {
@@ -952,7 +952,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);
             }
@@ -1198,7 +1198,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