[SCM] Samba Shared Repository - branch master updated

Stefan Metzmacher metze at samba.org
Tue Sep 17 09:41:02 CEST 2013


The branch, master has been updated
       via  af290a0 libcli/smb: fix non mendatory signing against some vendor SMB2 servers.
       via  1d54d8c libcli/smb: use SMB1 MID=0 for the initial Negprot
      from  6ed5b1c Cleanup map return codes

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit af290a03cef63c3b08446c1980de064a3b1c8804
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Sep 17 04:12:30 2013 +0200

    libcli/smb: fix non mendatory signing against some vendor SMB2 servers.
    
    Windows and Samba always sign the final session setup response
    even if signing is not mendatory, but it ensures that the signing
    key is correctly in place.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=10146
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
    Autobuild-Date(master): Tue Sep 17 09:40:10 CEST 2013 on sn-devel-104

commit 1d54d8c501afa151b6cc07b98a14caae2b31ec65
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Sep 17 04:09:03 2013 +0200

    libcli/smb: use SMB1 MID=0 for the initial Negprot
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=10144
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 libcli/smb/smbXcli_base.c |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c
index 7176e8f..f59f1f7 100644
--- a/libcli/smb/smbXcli_base.c
+++ b/libcli/smb/smbXcli_base.c
@@ -737,6 +737,14 @@ static uint16_t smb1cli_alloc_mid(struct smbXcli_conn *conn)
 	size_t num_pending = talloc_array_length(conn->pending);
 	uint16_t result;
 
+	if (conn->protocol == PROTOCOL_NONE) {
+		/*
+		 * This is what windows sends on the SMB1 Negprot request
+		 * and some vendors reuse the SMB1 MID as SMB2 sequence number.
+		 */
+		return 0;
+	}
+
 	while (true) {
 		size_t i;
 
@@ -4835,7 +4843,16 @@ NTSTATUS smb2cli_session_set_session_key(struct smbXcli_session *session,
 					session->conn->protocol,
 					recv_iov, 3);
 	if (!NT_STATUS_IS_OK(status)) {
-		return status;
+		/*
+		 * Sadly some vendors don't sign the
+		 * final SMB2 session setup response
+		 *
+		 * At least Windows and Samba are always doing this
+		 * if there's a session key available.
+		 */
+		if (conn->mandatory_signing) {
+			return status;
+		}
 	}
 
 	session->smb2->should_sign = false;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list