hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject httpcomponents-client git commit: HTTPCLIENT-1881: Allow truncated NTLM packets to work with this client.
Date Sat, 18 Nov 2017 11:56:06 GMT
Repository: httpcomponents-client
Updated Branches:
  refs/heads/4.5.x d6db9ab3d -> 97eee9e0e


HTTPCLIENT-1881: Allow truncated NTLM packets to work with this client.


Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/commit/97eee9e0
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/tree/97eee9e0
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/diff/97eee9e0

Branch: refs/heads/4.5.x
Commit: 97eee9e0e0adcb917db20550225db717238f6982
Parents: d6db9ab
Author: Karl Wright <DaddyWri@gmail.com>
Authored: Sat Nov 18 06:54:59 2017 -0500
Committer: Karl Wright <DaddyWri@gmail.com>
Committed: Sat Nov 18 06:55:59 2017 -0500

----------------------------------------------------------------------
 .../main/java/org/apache/http/impl/auth/NTLMEngineImpl.java   | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/httpcomponents-client/blob/97eee9e0/httpclient/src/main/java/org/apache/http/impl/auth/NTLMEngineImpl.java
----------------------------------------------------------------------
diff --git a/httpclient/src/main/java/org/apache/http/impl/auth/NTLMEngineImpl.java b/httpclient/src/main/java/org/apache/http/impl/auth/NTLMEngineImpl.java
index a8d1472..6ed5c0e 100644
--- a/httpclient/src/main/java/org/apache/http/impl/auth/NTLMEngineImpl.java
+++ b/httpclient/src/main/java/org/apache/http/impl/auth/NTLMEngineImpl.java
@@ -211,7 +211,7 @@ final class NTLMEngineImpl implements NTLMEngine {
 
     private static int readULong(final byte[] src, final int index) throws NTLMEngineException
{
         if (src.length < index + 4) {
-            throw new NTLMEngineException("NTLM authentication - buffer too small for DWORD");
+            return 0;
         }
         return (src[index] & 0xff) | ((src[index + 1] & 0xff) << 8)
                 | ((src[index + 2] & 0xff) << 16) | ((src[index + 3] & 0xff)
<< 24);
@@ -219,7 +219,7 @@ final class NTLMEngineImpl implements NTLMEngine {
 
     private static int readUShort(final byte[] src, final int index) throws NTLMEngineException
{
         if (src.length < index + 2) {
-            throw new NTLMEngineException("NTLM authentication - buffer too small for WORD");
+            return 0;
         }
         return (src[index] & 0xff) | ((src[index + 1] & 0xff) << 8);
     }
@@ -228,8 +228,7 @@ final class NTLMEngineImpl implements NTLMEngine {
         final int length = readUShort(src, index);
         final int offset = readULong(src, index + 4);
         if (src.length < offset + length) {
-            throw new NTLMEngineException(
-                    "NTLM authentication - buffer too small for data item");
+            return new byte[length];
         }
         final byte[] buffer = new byte[length];
         System.arraycopy(src, offset, buffer, 0, length);


Mime
View raw message