From: Felix Schumacher Date: Mon, 23 Feb 2009 13:50:46 +0000 (+0100) Subject: jcifs-1.3.4b from tgz X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=ef61147b96c86d6f3dcc6eca7e876d1c4ddf5845;p=jcifs_without_docs.git jcifs-1.3.4b from tgz Sun Feb 22 15:14:55 EST 2009 jcifs-1.3.4b SMB parameter words were not decoded correctly (which were ultimately related to the fact that the WordCount of the SMB_COM_NT_CREATE_ANDX response is wrong because an extra 16 bytes for "offline files / client side caching (CSC)". Ultimately this caused an error with the SMB_COM_TREE_CONNECT_ANDX response of certain IBM clusters. This should now be fixed. The error code for 0xC000018B has been updated. Server capabilities in the SMB_COM_NEGOTIATE response were not being read correctly. --- diff --git a/README.txt b/README.txt index 9abd8c1..d971dd5 100644 --- a/README.txt +++ b/README.txt @@ -1,8 +1,17 @@ -Sat Feb 21 13:43:43 EST 2009 -jcifs-1.3.4a +Sun Feb 22 15:14:55 EST 2009 +jcifs-1.3.4b -SMB parameter words were not decoded correctly. This caused an error -with certain IBM clusters. The error code for 0xC000018B has been updated. +SMB parameter words were not decoded correctly (which were ultimately +related to the fact that the WordCount of the SMB_COM_NT_CREATE_ANDX +response is wrong because an extra 16 bytes for "offline files / +client side caching (CSC)". Ultimately this caused an error with the +SMB_COM_TREE_CONNECT_ANDX response of certain IBM clusters. This should +now be fixed. + +The error code for 0xC000018B has been updated. + +Server capabilities in the SMB_COM_NEGOTIATE response were not being +read correctly. Sun Jan 25 14:31:31 EST 2009 jcifs-1.3.3 diff --git a/build.xml b/build.xml index a9124da..ddff5bf 100644 --- a/build.xml +++ b/build.xml @@ -1,7 +1,7 @@ - - + + diff --git a/src/jcifs/smb/AndXServerMessageBlock.java b/src/jcifs/smb/AndXServerMessageBlock.java index f0a2284..4c3d266 100644 --- a/src/jcifs/smb/AndXServerMessageBlock.java +++ b/src/jcifs/smb/AndXServerMessageBlock.java @@ -185,8 +185,6 @@ abstract class AndXServerMessageBlock extends ServerMessageBlock { int start = bufferIndex; wordCount = buffer[bufferIndex++]; -if (command == SMB_COM_NT_CREATE_ANDX) - wordCount = 42; if( wordCount != 0 ) { /* @@ -208,15 +206,18 @@ if (command == SMB_COM_NT_CREATE_ANDX) if( wordCount > 2 ) { readParameterWordsWireFormat( buffer, bufferIndex + 4 ); -/* required for signing verification -if (command == SMB_COM_NT_CREATE_ANDX) { - if (((SmbComNTCreateAndXResponse)this).isExtended) - bufferIndex += 32; -} - */ + + /* The SMB_COM_NT_CREATE_ANDX response wordCount is wrong. There's an + * extra 16 bytes for some "Offline Files (CSC or Client Side Caching)" + * junk. We need to bump up the wordCount here so that this method returns + * the correct number of bytes for signing purposes. Otherwise we get a + * signing verification failure. + */ + if (command == SMB_COM_NT_CREATE_ANDX && ((SmbComNTCreateAndXResponse)this).isExtended) + wordCount += 8; } - bufferIndex += wordCount * 2; + bufferIndex = start + 1 + (wordCount * 2); } byteCount = readInt2( buffer, bufferIndex ); bufferIndex += 2; diff --git a/src/jcifs/smb/SmbComNegotiateResponse.java b/src/jcifs/smb/SmbComNegotiateResponse.java index e2452e9..3f7677e 100644 --- a/src/jcifs/smb/SmbComNegotiateResponse.java +++ b/src/jcifs/smb/SmbComNegotiateResponse.java @@ -66,7 +66,7 @@ class SmbComNegotiateResponse extends ServerMessageBlock { int bufferIndex ) { int start = bufferIndex; - if ((server.capabilities & FLAGS2_EXTENDED_SECURITY_NEGOTIATION) == 0) { + if ((server.capabilities & CAP_EXTENDED_SECURITY) == 0) { server.encryptionKey = new byte[server.encryptionKeyLength]; System.arraycopy( buffer, bufferIndex, server.encryptionKey, 0, server.encryptionKeyLength );