[jira] [Resolved] (HTTPCLIENT-1381) NullPointerException during NTLM authentication using null workstation/domain
[ https://issues.apache.org/jira/browse/HTTPCLIENT-1381?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Oleg Kalnichevski resolved HTTPCLIENT-1381. --- Resolution: Fixed Patch checked in to SVN trunk and 4.2.x. Please review / re-test. Oleg NullPointerException during NTLM authentication using null workstation/domain - Key: HTTPCLIENT-1381 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1381 Project: HttpComponents HttpClient Issue Type: Bug Components: HttpAuth Affects Versions: Snapshot Reporter: Ricardo Pereira Fix For: 4.2.6, 4.3 Beta3 Attachments: ClientNtlmProxyAuthentication.java, HTTPCLIENT-1381_patch_tests, wire.log Using NTCredentials with null workstation or null domain leads to a NullPointerException during the NTLM authentication. The workaround is to use an empty String for both the workstation and domain. Exception stack trace of an attempt to authenticate with null workstation: Exception in thread main java.lang.NullPointerException at org.apache.http.impl.auth.NTLMEngineImpl.stripDotSuffix(NTLMEngineImpl.java:186) at org.apache.http.impl.auth.NTLMEngineImpl.convertHost(NTLMEngineImpl.java:194) at org.apache.http.impl.auth.NTLMEngineImpl.access$14(NTLMEngineImpl.java:193) at org.apache.http.impl.auth.NTLMEngineImpl$Type1Message.init(NTLMEngineImpl.java:970) at org.apache.http.impl.auth.NTLMEngineImpl.getType1Message(NTLMEngineImpl.java:139) at org.apache.http.impl.auth.NTLMEngineImpl.generateType1Msg(NTLMEngineImpl.java:1608) at org.apache.http.impl.auth.NTLMScheme.authenticate(NTLMScheme.java:129) at org.apache.http.impl.auth.AuthSchemeBase.authenticate(AuthSchemeBase.java:136) at org.apache.http.impl.auth.HttpAuthenticator.doAuth(HttpAuthenticator.java:239) at org.apache.http.impl.auth.HttpAuthenticator.generateAuthResponse(HttpAuthenticator.java:202) at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:251) at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:176) at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:77) at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:101) at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:115) at ClientNtlmProxyAuthentication.main(ClientNtlmProxyAuthentication.java:70) -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org
RE: [jira] [Updated] (HTTPCLIENT-1381) NullPointerException during NTLM authentication using null workstation/domain
It is unlikely that messages are improperly encoded in ntlm handling since they were compared directly in wireshark against modern Microsoft products. So I would hesitate to include anything like that in a commit. Karl Sent from my Windows Phone From: Ricardo Pereira (JIRA) Sent: 7/6/2013 9:51 PM To: dev@hc.apache.org Subject: [jira] [Updated] (HTTPCLIENT-1381) NullPointerException during NTLM authentication using null workstation/domain [ https://issues.apache.org/jira/browse/HTTPCLIENT-1381?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ricardo Pereira updated HTTPCLIENT-1381: Attachment: HTTPCLIENT-1381_patch_tests Attached a patch (for trunk) with some changes to the NTLM tests: - Adds a new (failing) test which uses NTLMv2 challenge message; - Minor changes to use the same response handler; - Renames some classes/methods (adds Message to Type2 and adds the version); - Changes the NTLMv1 challenge message since it was not correctly Base64 encoded (didn't affect the tests, though). NullPointerException during NTLM authentication using null workstation/domain - Key: HTTPCLIENT-1381 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1381 Project: HttpComponents HttpClient Issue Type: Bug Components: HttpAuth Affects Versions: Snapshot Reporter: Ricardo Pereira Fix For: 4.2.6, 4.3 Beta3 Attachments: ClientNtlmProxyAuthentication.java, HTTPCLIENT-1381_patch_tests, wire.log Using NTCredentials with null workstation or null domain leads to a NullPointerException during the NTLM authentication. The workaround is to use an empty String for both the workstation and domain. Exception stack trace of an attempt to authenticate with null workstation: Exception in thread main java.lang.NullPointerException at org.apache.http.impl.auth.NTLMEngineImpl.stripDotSuffix(NTLMEngineImpl.java:186) at org.apache.http.impl.auth.NTLMEngineImpl.convertHost(NTLMEngineImpl.java:194) at org.apache.http.impl.auth.NTLMEngineImpl.access$14(NTLMEngineImpl.java:193) at org.apache.http.impl.auth.NTLMEngineImpl$Type1Message.init(NTLMEngineImpl.java:970) at org.apache.http.impl.auth.NTLMEngineImpl.getType1Message(NTLMEngineImpl.java:139) at org.apache.http.impl.auth.NTLMEngineImpl.generateType1Msg(NTLMEngineImpl.java:1608) at org.apache.http.impl.auth.NTLMScheme.authenticate(NTLMScheme.java:129) at org.apache.http.impl.auth.AuthSchemeBase.authenticate(AuthSchemeBase.java:136) at org.apache.http.impl.auth.HttpAuthenticator.doAuth(HttpAuthenticator.java:239) at org.apache.http.impl.auth.HttpAuthenticator.generateAuthResponse(HttpAuthenticator.java:202) at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:251) at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:176) at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:77) at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:101) at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:115) at ClientNtlmProxyAuthentication.main(ClientNtlmProxyAuthentication.java:70) -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org - To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org
[jira] [Commented] (HTTPCLIENT-1381) NullPointerException during NTLM authentication using null workstation/domain
[ https://issues.apache.org/jira/browse/HTTPCLIENT-1381?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13701545#comment-13701545 ] Karl Wright commented on HTTPCLIENT-1381: - It is unlikely that messages are improperly encoded in ntlm handling since they were compared directly in wireshark against modern Microsoft products. So I would hesitate to include anything like that in a commit. Karl Sent from my Windows Phone From: Ricardo Pereira (JIRA) Sent: 7/6/2013 9:51 PM To: dev@hc.apache.org Subject: [jira] [Updated] (HTTPCLIENT-1381) NullPointerException during NTLM authentication using null workstation/domain [ https://issues.apache.org/jira/browse/HTTPCLIENT-1381?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ricardo Pereira updated HTTPCLIENT-1381: Attachment: HTTPCLIENT-1381_patch_tests Attached a patch (for trunk) with some changes to the NTLM tests: - Adds a new (failing) test which uses NTLMv2 challenge message; - Minor changes to use the same response handler; - Renames some classes/methods (adds Message to Type2 and adds the version); - Changes the NTLMv1 challenge message since it was not correctly Base64 encoded (didn't affect the tests, though). -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org NullPointerException during NTLM authentication using null workstation/domain - Key: HTTPCLIENT-1381 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1381 Project: HttpComponents HttpClient Issue Type: Bug Components: HttpAuth Affects Versions: Snapshot Reporter: Ricardo Pereira Fix For: 4.2.6, 4.3 Beta3 Attachments: ClientNtlmProxyAuthentication.java, HTTPCLIENT-1381_patch_tests, wire.log Using NTCredentials with null workstation or null domain leads to a NullPointerException during the NTLM authentication. The workaround is to use an empty String for both the workstation and domain. Exception stack trace of an attempt to authenticate with null workstation: Exception in thread main java.lang.NullPointerException at org.apache.http.impl.auth.NTLMEngineImpl.stripDotSuffix(NTLMEngineImpl.java:186) at org.apache.http.impl.auth.NTLMEngineImpl.convertHost(NTLMEngineImpl.java:194) at org.apache.http.impl.auth.NTLMEngineImpl.access$14(NTLMEngineImpl.java:193) at org.apache.http.impl.auth.NTLMEngineImpl$Type1Message.init(NTLMEngineImpl.java:970) at org.apache.http.impl.auth.NTLMEngineImpl.getType1Message(NTLMEngineImpl.java:139) at org.apache.http.impl.auth.NTLMEngineImpl.generateType1Msg(NTLMEngineImpl.java:1608) at org.apache.http.impl.auth.NTLMScheme.authenticate(NTLMScheme.java:129) at org.apache.http.impl.auth.AuthSchemeBase.authenticate(AuthSchemeBase.java:136) at org.apache.http.impl.auth.HttpAuthenticator.doAuth(HttpAuthenticator.java:239) at org.apache.http.impl.auth.HttpAuthenticator.generateAuthResponse(HttpAuthenticator.java:202) at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:251) at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:176) at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:77) at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:101) at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:115) at ClientNtlmProxyAuthentication.main(ClientNtlmProxyAuthentication.java:70) -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org
Re: [jira] [Updated] (HTTPCLIENT-1381) NullPointerException during NTLM authentication using null workstation/domain
On Sun, 2013-07-07 at 03:42 -0700, Karl Wright wrote: It is unlikely that messages are improperly encoded in ntlm handling since they were compared directly in wireshark against modern Microsoft products. So I would hesitate to include anything like that in a commit. Karl Hi Karl Those messages are used by test cases specifically to test the ability of HttpClient to handle malformed and out of sequence NTLM messages. I see no risk here. This in no way impacts productive code. Oleg Sent from my Windows Phone From: Ricardo Pereira (JIRA) Sent: 7/6/2013 9:51 PM To: dev@hc.apache.org Subject: [jira] [Updated] (HTTPCLIENT-1381) NullPointerException during NTLM authentication using null workstation/domain [ https://issues.apache.org/jira/browse/HTTPCLIENT-1381?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ricardo Pereira updated HTTPCLIENT-1381: Attachment: HTTPCLIENT-1381_patch_tests Attached a patch (for trunk) with some changes to the NTLM tests: - Adds a new (failing) test which uses NTLMv2 challenge message; - Minor changes to use the same response handler; - Renames some classes/methods (adds Message to Type2 and adds the version); - Changes the NTLMv1 challenge message since it was not correctly Base64 encoded (didn't affect the tests, though). NullPointerException during NTLM authentication using null workstation/domain - Key: HTTPCLIENT-1381 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1381 Project: HttpComponents HttpClient Issue Type: Bug Components: HttpAuth Affects Versions: Snapshot Reporter: Ricardo Pereira Fix For: 4.2.6, 4.3 Beta3 Attachments: ClientNtlmProxyAuthentication.java, HTTPCLIENT-1381_patch_tests, wire.log Using NTCredentials with null workstation or null domain leads to a NullPointerException during the NTLM authentication. The workaround is to use an empty String for both the workstation and domain. Exception stack trace of an attempt to authenticate with null workstation: Exception in thread main java.lang.NullPointerException at org.apache.http.impl.auth.NTLMEngineImpl.stripDotSuffix(NTLMEngineImpl.java:186) at org.apache.http.impl.auth.NTLMEngineImpl.convertHost(NTLMEngineImpl.java:194) at org.apache.http.impl.auth.NTLMEngineImpl.access$14(NTLMEngineImpl.java:193) at org.apache.http.impl.auth.NTLMEngineImpl$Type1Message.init(NTLMEngineImpl.java:970) at org.apache.http.impl.auth.NTLMEngineImpl.getType1Message(NTLMEngineImpl.java:139) at org.apache.http.impl.auth.NTLMEngineImpl.generateType1Msg(NTLMEngineImpl.java:1608) at org.apache.http.impl.auth.NTLMScheme.authenticate(NTLMScheme.java:129) at org.apache.http.impl.auth.AuthSchemeBase.authenticate(AuthSchemeBase.java:136) at org.apache.http.impl.auth.HttpAuthenticator.doAuth(HttpAuthenticator.java:239) at org.apache.http.impl.auth.HttpAuthenticator.generateAuthResponse(HttpAuthenticator.java:202) at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:251) at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:176) at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:77) at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:101) at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:115) at ClientNtlmProxyAuthentication.main(ClientNtlmProxyAuthentication.java:70) -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org - To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org - To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org
[jira] [Resolved] (HTTPCLIENT-1383) NTLM authentication can enter in infinite loop
[ https://issues.apache.org/jira/browse/HTTPCLIENT-1383?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Oleg Kalnichevski resolved HTTPCLIENT-1383. --- Resolution: Fixed The patch and a fix committed to SVN trunk and 4.2.x. Please review / re-test Oleg NTLM authentication can enter in infinite loop -- Key: HTTPCLIENT-1383 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1383 Project: HttpComponents HttpClient Issue Type: Bug Components: HttpAuth Affects Versions: Snapshot Reporter: Ricardo Pereira Fix For: 4.2.6, 4.3 Beta3 Attachments: ClientNtlmProxyAuthentication.java, HTTPCLIENT-1383_patch_tests, wire.log If the NTLM proxy sends, always, a challenge message the authentication enters in infinite loop. This happened with an user account that got suspended because of too many failed authentication attempts, after that the server started to send, always, the (same) challenge message causing an infinite loop with the HttpClient. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org
[jira] [Updated] (HTTPCLIENT-1380) NTLMEngineImpl: Change exception message to be informative
[ https://issues.apache.org/jira/browse/HTTPCLIENT-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ricardo Pereira updated HTTPCLIENT-1380: Affects Version/s: (was: 4.3 Beta3) 4.2.5 NTLMEngineImpl: Change exception message to be informative -- Key: HTTPCLIENT-1380 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1380 Project: HttpComponents HttpClient Issue Type: Improvement Components: HttpAuth Affects Versions: 4.2.5, Snapshot Reporter: Ricardo Pereira Priority: Trivial The class NTLMEngineImpl throws an exception when the NTLM server sends the challenge message with the field NTLMSSP_NEGOTIATE_UNICODE set to 0, but the exception message says NTLM type 2 message has flags that make no sense: . The message gives no clue to what the problem is and forces the user to check the source code if (s)he wants to know why the exception was thrown. Consider changing the exception message to report what the problem really is. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org
[jira] [Closed] (HTTPCLIENT-1383) NTLM authentication can enter in infinite loop
[ https://issues.apache.org/jira/browse/HTTPCLIENT-1383?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ricardo Pereira closed HTTPCLIENT-1383. --- Tested with both the latest trunk and branch 4.2.x with no problems. Thank you. NTLM authentication can enter in infinite loop -- Key: HTTPCLIENT-1383 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1383 Project: HttpComponents HttpClient Issue Type: Bug Components: HttpAuth Affects Versions: Snapshot Reporter: Ricardo Pereira Fix For: 4.2.6, 4.3 Beta3 Attachments: ClientNtlmProxyAuthentication.java, HTTPCLIENT-1383_patch_tests, wire.log If the NTLM proxy sends, always, a challenge message the authentication enters in infinite loop. This happened with an user account that got suspended because of too many failed authentication attempts, after that the server started to send, always, the (same) challenge message causing an infinite loop with the HttpClient. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org
[jira] [Closed] (HTTPCLIENT-1381) NullPointerException during NTLM authentication using null workstation/domain
[ https://issues.apache.org/jira/browse/HTTPCLIENT-1381?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ricardo Pereira closed HTTPCLIENT-1381. --- Tested with both the latest trunk and branch 4.2.x with no problems. Thank you. NullPointerException during NTLM authentication using null workstation/domain - Key: HTTPCLIENT-1381 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1381 Project: HttpComponents HttpClient Issue Type: Bug Components: HttpAuth Affects Versions: Snapshot Reporter: Ricardo Pereira Fix For: 4.2.6, 4.3 Beta3 Attachments: ClientNtlmProxyAuthentication.java, HTTPCLIENT-1381_patch_tests, wire.log Using NTCredentials with null workstation or null domain leads to a NullPointerException during the NTLM authentication. The workaround is to use an empty String for both the workstation and domain. Exception stack trace of an attempt to authenticate with null workstation: Exception in thread main java.lang.NullPointerException at org.apache.http.impl.auth.NTLMEngineImpl.stripDotSuffix(NTLMEngineImpl.java:186) at org.apache.http.impl.auth.NTLMEngineImpl.convertHost(NTLMEngineImpl.java:194) at org.apache.http.impl.auth.NTLMEngineImpl.access$14(NTLMEngineImpl.java:193) at org.apache.http.impl.auth.NTLMEngineImpl$Type1Message.init(NTLMEngineImpl.java:970) at org.apache.http.impl.auth.NTLMEngineImpl.getType1Message(NTLMEngineImpl.java:139) at org.apache.http.impl.auth.NTLMEngineImpl.generateType1Msg(NTLMEngineImpl.java:1608) at org.apache.http.impl.auth.NTLMScheme.authenticate(NTLMScheme.java:129) at org.apache.http.impl.auth.AuthSchemeBase.authenticate(AuthSchemeBase.java:136) at org.apache.http.impl.auth.HttpAuthenticator.doAuth(HttpAuthenticator.java:239) at org.apache.http.impl.auth.HttpAuthenticator.generateAuthResponse(HttpAuthenticator.java:202) at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:251) at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:176) at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:77) at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:101) at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:115) at ClientNtlmProxyAuthentication.main(ClientNtlmProxyAuthentication.java:70) -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org
HttpCore 4.3 is GA ready
Folks As far as I am concerned HttpCore 4.3 is GA ready. This is the last chance to request API visible changes or new (minor) features for the 4.3 series. Once 4.3 GA is released all new features and API changes will have to wait until 4.4. The updated tutorial can be found here: http://people.apache.org/~olegk/httpcore-tutorial-4.3/html/ http://people.apache.org/~olegk/httpcore-tutorial-4.3/pdf/httpcore-tutorial.pdf I would be very grateful if someone could proof-read it. I intend to put this release on vote in a week time if no complaints are raised. Oleg - To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org
Re: svn commit: r1500401 - in /httpcomponents/httpclient/trunk/httpclient/src: main/java/org/apache/http/impl/auth/NTLMEngineImpl.java test/java/org/apache/http/impl/client/integration/TestClientAuthe
On 7 July 2013 11:20, ol...@apache.org wrote: Author: olegk Date: Sun Jul 7 10:20:33 2013 New Revision: 1500401 URL: http://svn.apache.org/r1500401 Log: Follow up to HTTPCLIENT-1381: fixes another NPE Contributed by Ricardo Pereira thc202 at gmail.com Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/auth/NTLMEngineImpl.java httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientAuthenticationFakeNTLM.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=1500401r1=1500400r2=1500401view=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 Sun Jul 7 10:20:33 2013 @@ -624,7 +624,7 @@ final class NTLMEngineImpl implements NT final MD4 md4 = new MD4(); md4.update(unicodePassword); return md4.getOutput(); -} catch (java.io.UnsupportedEncodingException e) { +} catch (UnsupportedEncodingException e) { throw new NTLMEngineException(Unicode not supported: + e.getMessage(), e); } } @@ -641,9 +641,11 @@ final class NTLMEngineImpl implements NT final HMACMD5 hmacMD5 = new HMACMD5(ntlmHash); // Upper case username, upper case domain! hmacMD5.update(user.toUpperCase(Locale.US).getBytes(UnicodeLittleUnmarked)); - hmacMD5.update(domain.toUpperCase(Locale.US).getBytes(UnicodeLittleUnmarked)); +if (domain != null) { + hmacMD5.update(domain.toUpperCase(Locale.US).getBytes(UnicodeLittleUnmarked)); Note that getBytes(String) is also Locale-sensitive; should probably use Locale.ENGLISH. (Locale.ROOT is 1.6+) +} return hmacMD5.getOutput(); -} catch (java.io.UnsupportedEncodingException e) { +} catch (UnsupportedEncodingException e) { throw new NTLMEngineException(Unicode not supported! + e.getMessage(), e); } } @@ -660,9 +662,11 @@ final class NTLMEngineImpl implements NT final HMACMD5 hmacMD5 = new HMACMD5(ntlmHash); // Upper case username, mixed case target!! hmacMD5.update(user.toUpperCase(Locale.US).getBytes(UnicodeLittleUnmarked)); -hmacMD5.update(domain.getBytes(UnicodeLittleUnmarked)); +if (domain != null) { +hmacMD5.update(domain.getBytes(UnicodeLittleUnmarked)); +} return hmacMD5.getOutput(); -} catch (java.io.UnsupportedEncodingException e) { +} catch (UnsupportedEncodingException e) { throw new NTLMEngineException(Unicode not supported! + e.getMessage(), e); } } @@ -981,7 +985,7 @@ final class NTLMEngineImpl implements NT hostBytes = unqualifiedHost != null? unqualifiedHost.getBytes(ASCII) : null; domainBytes = unqualifiedDomain != null ? unqualifiedDomain .toUpperCase(Locale.US).getBytes(ASCII) : null; -} catch (java.io.UnsupportedEncodingException e) { +} catch (UnsupportedEncodingException e) { throw new NTLMEngineException(Unicode unsupported: + e.getMessage(), e); } } @@ -1104,7 +1108,7 @@ final class NTLMEngineImpl implements NT if (bytes.length != 0) { try { target = new String(bytes, UnicodeLittleUnmarked); -} catch (java.io.UnsupportedEncodingException e) { +} catch (UnsupportedEncodingException e) { throw new NTLMEngineException(e.getMessage(), e); } } Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientAuthenticationFakeNTLM.java URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientAuthenticationFakeNTLM.java?rev=1500401r1=1500400r2=1500401view=diff == --- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientAuthenticationFakeNTLM.java (original) +++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientAuthenticationFakeNTLM.java Sun Jul 7