HTTPCLIENT-1834: Fix up the conflicts with patch HTTPCLIENT-1662.

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1787727 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Karl Wright 2017-03-20 11:58:46 +00:00
parent 248cf5c96d
commit d07ee6fbc7
2 changed files with 5 additions and 28 deletions

View File

@ -318,7 +318,7 @@ public class CredSspScheme implements AuthScheme
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 AuthScheme
final Certificate peerServerCertificate = getPeerServerCertificate();
type3Message = new NTLMEngineImpl.Type3Message(
ntcredentials.getDomain(),
ntcredentials.getNetbiosDomain(),
ntcredentials.getWorkstation(),
ntcredentials.getUserName(),
ntcredentials.getPassword(),

View File

@ -1085,28 +1085,6 @@ final class NTLMEngineImpl implements NTLMEngine {
}
}
/** 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 NTLMEngine {
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;