hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1787727 - in /httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth: CredSspScheme.java NTLMEngineImpl.java
Date Mon, 20 Mar 2017 11:58:46 GMT
Author: kwright
Date: Mon Mar 20 11:58:46 2017
New Revision: 1787727

URL: http://svn.apache.org/viewvc?rev=1787727&view=rev
Log:
HTTPCLIENT-1834: Fix up the conflicts with patch HTTPCLIENT-1662.

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

Modified: httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/CredSspScheme.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/CredSspScheme.java?rev=1787727&r1=1787726&r2=1787727&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/CredSspScheme.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/CredSspScheme.java
Mon Mar 20 11:58:46 2017
@@ -318,7 +318,7 @@ public class CredSspScheme implements Au
             final int ntlmFlags = getNtlmFlags();
             final ByteBuffer buf = allocateOutBuffer();
             type1Message = new NTLMEngineImpl.Type1Message(
-                ntcredentials.getDomain(), ntcredentials.getWorkstation(), ntlmFlags);
+                ntcredentials.getNetbiosDomain(), ntcredentials.getWorkstation(), ntlmFlags);
             final byte[] ntlmNegoMessageEncoded = type1Message.getBytes();
             final CredSspTsRequest req = CredSspTsRequest.createNegoToken( ntlmNegoMessageEncoded
);
             req.encode( buf );
@@ -336,7 +336,7 @@ public class CredSspScheme implements Au
             final Certificate peerServerCertificate = getPeerServerCertificate();
 
             type3Message = new NTLMEngineImpl.Type3Message(
-                ntcredentials.getDomain(),
+                ntcredentials.getNetbiosDomain(),
                 ntcredentials.getWorkstation(),
                 ntcredentials.getUserName(),
                 ntcredentials.getPassword(),

Modified: httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/NTLMEngineImpl.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/NTLMEngineImpl.java?rev=1787727&r1=1787726&r2=1787727&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/NTLMEngineImpl.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/NTLMEngineImpl.java
Mon Mar 20 11:58:46 2017
@@ -1085,28 +1085,6 @@ final class NTLMEngineImpl implements NT
         }
     }
 
-    /** Strip dot suffix from a name */
-    private static String stripDotSuffix(final String value) {
-        if (value == null) {
-            return null;
-        }
-        final int index = value.indexOf(".");
-        if (index != -1) {
-            return value.substring(0, index);
-        }
-        return value;
-    }
-
-    /** Convert host to standard form */
-    private static String convertHost(final String host) {
-        return stripDotSuffix(host);
-    }
-
-    /** Convert domain to standard form */
-    private static String convertDomain(final String domain) {
-        return stripDotSuffix(domain);
-    }
-
     /** NTLM message generation, base class */
     static class NTLMMessage {
         /** The current response */
@@ -1293,10 +1271,9 @@ final class NTLMEngineImpl implements NT
             super();
             this.flags = ((flags == null)?getDefaultFlags():flags);
 
-            // Strip off domain name from the host!
-            final String unqualifiedHost = convertHost(host);
-            // Use only the base domain name!
-            final String unqualifiedDomain = convertDomain(domain);
+            // See HTTPCLIENT-1662
+            final String unqualifiedHost = host;
+            final String unqualifiedDomain = domain;
 
             hostBytes = unqualifiedHost != null ?
                     unqualifiedHost.getBytes(UNICODE_LITTLE_UNMARKED) : null;



Mime
View raw message