From c482876cb267026ab71f7f57ae7d359e26c61fbb Mon Sep 17 00:00:00 2001 From: Steve French Date: Thu, 12 Mar 2015 00:55:12 -0500 Subject: [PATCH] Newest SMB dialect changed from SMB3.10 to SMB3.11 (0x0310 to 0x0311) for latest Windows Change all references to obsolete 0x0310 dialect to 0x0311. MS-SMB2 has been updated showing that the dialect is no longer 0x0310 but 0x0311. I have also tested against latest Windows 10 beta in MSDN subscriber downloads See Samba bugzilla bug # 11112 for wireshark traces Signed-off-by: Steve French --- docs-xml/manpages/smb.conf.5.xml | 2 +- docs-xml/smbdotconf/protocol/clientmaxprotocol.xml | 2 +- lib/param/param_table.c | 2 +- libcli/smb/smb2_constants.h | 14 +++++++------- libcli/smb/smb2cli_tcon.c | 4 ++-- libcli/smb/smbXcli_base.c | 16 ++++++++-------- libcli/smb/smb_constants.h | 4 ++-- source3/torture/test_smb2.c | 4 ++-- 8 files changed, 24 insertions(+), 24 deletions(-) diff --git a/docs-xml/manpages/smb.conf.5.xml b/docs-xml/manpages/smb.conf.5.xml index e98d183..dab6ad5 100644 --- a/docs-xml/manpages/smb.conf.5.xml +++ b/docs-xml/manpages/smb.conf.5.xml @@ -471,7 +471,7 @@ chmod 1770 /usr/local/samba/lib/usershares %R the selected protocol level after protocol negotiation. It can be one of CORE, COREPLUS, - LANMAN1, LANMAN2, NT1, SMB2_02, SMB2_10, SMB2_22, SMB2_24, SMB3_00, SMB3_02, SMB3_10 or SMB2_FF. + LANMAN1, LANMAN2, NT1, SMB2_02, SMB2_10, SMB2_22, SMB2_24, SMB3_00, SMB3_02, SMB3_11 or SMB2_FF. diff --git a/docs-xml/smbdotconf/protocol/clientmaxprotocol.xml b/docs-xml/smbdotconf/protocol/clientmaxprotocol.xml index 9321d3f..b9ba5ef 100644 --- a/docs-xml/smbdotconf/protocol/clientmaxprotocol.xml +++ b/docs-xml/smbdotconf/protocol/clientmaxprotocol.xml @@ -65,7 +65,7 @@ SMB3_02: Windows 8.1 SMB3 version. - SMB3_10: Windows 10 technical preview SMB3 version. + SMB3_11: Windows 10 technical preview SMB3 version. By default SMB3 selects the SMB3_00 variant. diff --git a/lib/param/param_table.c b/lib/param/param_table.c index 00274ca..f565151 100644 --- a/lib/param/param_table.c +++ b/lib/param/param_table.c @@ -41,7 +41,7 @@ static const struct enum_list enum_protocol[] = { {PROTOCOL_DEFAULT, "default"}, /* the caller decides what this means */ {PROTOCOL_SMB2_10, "SMB2"}, /* for now keep PROTOCOL_SMB2_10 */ {PROTOCOL_SMB3_00, "SMB3"}, /* for now keep PROTOCOL_SMB3_00 */ - {PROTOCOL_SMB3_10, "SMB3_10"}, + {PROTOCOL_SMB3_11, "SMB3_11"}, {PROTOCOL_SMB3_02, "SMB3_02"}, {PROTOCOL_SMB3_00, "SMB3_00"}, {PROTOCOL_SMB2_24, "SMB2_24"}, diff --git a/libcli/smb/smb2_constants.h b/libcli/smb/smb2_constants.h index 1a6c5ad..7afdca3 100644 --- a/libcli/smb/smb2_constants.h +++ b/libcli/smb/smb2_constants.h @@ -97,7 +97,7 @@ #define SMB2_DIALECT_REVISION_224 0x0224 #define SMB3_DIALECT_REVISION_300 0x0300 #define SMB3_DIALECT_REVISION_302 0x0302 -#define SMB3_DIALECT_REVISION_310 0x0310 +#define SMB3_DIALECT_REVISION_311 0x0311 #define SMB2_DIALECT_REVISION_2FF 0x02FF /* SMB2 negotiate security_mode */ @@ -123,20 +123,20 @@ SMB2_CAP_DIRECTORY_LEASING | \ SMB2_CAP_ENCRYPTION) -/* Types of SMB2 Negotiate Contexts - only in dialect >= 0x310 */ +/* Types of SMB2 Negotiate Contexts - only in dialect >= 0x311 */ #define SMB2_PREAUTH_INTEGRITY_CAPABILITIES 0x0001 #define SMB2_ENCRYPTION_CAPABILITIES 0x0002 -/* Values for the SMB2_PREAUTH_INTEGRITY_CAPABILITIES Context (>= 0x310) */ +/* Values for the SMB2_PREAUTH_INTEGRITY_CAPABILITIES Context (>= 0x311) */ #define SMB2_PREAUTH_INTEGRITY_SHA512 0x0001 -/* Values for the SMB2_ENCRYPTION_CAPABILITIES Context (>= 0x310) */ +/* Values for the SMB2_ENCRYPTION_CAPABILITIES Context (>= 0x311) */ #define SMB2_ENCRYPTION_AES128_CCM 0x0001 /* only in dialect >= 0x224 */ -#define SMB2_ENCRYPTION_AES128_GCM 0x0002 /* only in dialect >= 0x310 */ +#define SMB2_ENCRYPTION_AES128_GCM 0x0002 /* only in dialect >= 0x311 */ /* SMB2 session (request) flags */ #define SMB2_SESSION_FLAG_BINDING 0x01 -/* SMB2_SESSION_FLAG_ENCRYPT_DATA 0x04 only in dialect >= 0x310 */ +/* SMB2_SESSION_FLAG_ENCRYPT_DATA 0x04 only in dialect >= 0x311 */ /* SMB2 session (response) flags */ #define SMB2_SESSION_FLAG_IS_GUEST 0x0001 @@ -144,7 +144,7 @@ #define SMB2_SESSION_FLAG_ENCRYPT_DATA 0x0004 /* in dialect >= 0x224 */ /* SMB2 tree connect (request) flags */ -#define SMB2_SHAREFLAG_CLUSTER_RECONNECT 0x0001 /* only in dialect >= 0x310 */ +#define SMB2_SHAREFLAG_CLUSTER_RECONNECT 0x0001 /* only in dialect >= 0x311 */ /* SMB2 sharetype flags */ #define SMB2_SHARE_TYPE_DISK 0x1 diff --git a/libcli/smb/smb2cli_tcon.c b/libcli/smb/smb2cli_tcon.c index 8863bae..03fb604 100644 --- a/libcli/smb/smb2cli_tcon.c +++ b/libcli/smb/smb2cli_tcon.c @@ -76,7 +76,7 @@ struct tevent_req *smb2cli_tcon_send(TALLOC_CTX *mem_ctx, fixed = state->fixed; SSVAL(fixed, 0, 9); - if (smbXcli_conn_protocol(conn) >= PROTOCOL_SMB3_10) { + if (smbXcli_conn_protocol(conn) >= PROTOCOL_SMB3_11) { SSVAL(fixed, 2, flags); } else { SSVAL(fixed, 2, 0); /* Reserved */ @@ -161,7 +161,7 @@ static void smb2cli_tcon_done(struct tevent_req *subreq) return; } - if (smbXcli_conn_protocol(state->conn) >= PROTOCOL_SMB3_10) { + if (smbXcli_conn_protocol(state->conn) >= PROTOCOL_SMB3_11) { tevent_req_done(req); return; } diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c index 5773ab3..af9dcad 100644 --- a/libcli/smb/smbXcli_base.c +++ b/libcli/smb/smbXcli_base.c @@ -3803,7 +3803,7 @@ static const struct { {PROTOCOL_SMB2_24, SMB2_DIALECT_REVISION_224}, {PROTOCOL_SMB3_00, SMB3_DIALECT_REVISION_300}, {PROTOCOL_SMB3_02, SMB3_DIALECT_REVISION_302}, - {PROTOCOL_SMB3_10, SMB3_DIALECT_REVISION_310}, + {PROTOCOL_SMB3_11, SMB3_DIALECT_REVISION_311}, }; struct smbXcli_negprot_state { @@ -4443,7 +4443,7 @@ static struct tevent_req *smbXcli_negprot_smb2_subreq(struct smbXcli_negprot_sta memset(buf+12, 0, 16); /* ClientGuid */ } - if (state->conn->max_protocol >= PROTOCOL_SMB3_10) { + if (state->conn->max_protocol >= PROTOCOL_SMB3_11) { NTSTATUS status; struct smb2_negotiate_contexts c = { .num_contexts = 0, }; uint32_t offset; @@ -4605,7 +4605,7 @@ static void smbXcli_negprot_smb2_done(struct tevent_req *subreq) } conn->smb2.server.security_mode = SVAL(body, 2); - if (conn->protocol >= PROTOCOL_SMB3_10) { + if (conn->protocol >= PROTOCOL_SMB3_11) { negotiate_context_count = SVAL(body, 6); } @@ -4642,7 +4642,7 @@ static void smbXcli_negprot_smb2_done(struct tevent_req *subreq) return; } - if (conn->protocol < PROTOCOL_SMB3_10) { + if (conn->protocol < PROTOCOL_SMB3_11) { TALLOC_FREE(subreq); if (conn->smb2.server.capabilities & SMB2_CAP_ENCRYPTION) { @@ -5368,7 +5368,7 @@ NTSTATUS smb2cli_session_update_preauth(struct smbXcli_session *session, return NT_STATUS_INTERNAL_ERROR; } - if (session->conn->protocol < PROTOCOL_SMB3_10) { + if (session->conn->protocol < PROTOCOL_SMB3_11) { return NT_STATUS_OK; } @@ -5427,7 +5427,7 @@ NTSTATUS smb2cli_session_set_session_key(struct smbXcli_session *session, return NT_STATUS_INVALID_PARAMETER_MIX; } - if (conn->protocol >= PROTOCOL_SMB3_10) { + if (conn->protocol >= PROTOCOL_SMB3_11) { struct _derivation *d; DATA_BLOB p; @@ -5563,7 +5563,7 @@ NTSTATUS smb2cli_session_set_session_key(struct smbXcli_session *session, check_signature = true; } - if (conn->protocol >= PROTOCOL_SMB3_10) { + if (conn->protocol >= PROTOCOL_SMB3_11) { check_signature = true; } @@ -5666,7 +5666,7 @@ NTSTATUS smb2cli_session_set_channel_key(struct smbXcli_session *session, return NT_STATUS_INVALID_PARAMETER_MIX; } - if (conn->protocol >= PROTOCOL_SMB3_10) { + if (conn->protocol >= PROTOCOL_SMB3_11) { struct _derivation *d; DATA_BLOB p; diff --git a/libcli/smb/smb_constants.h b/libcli/smb/smb_constants.h index 5d494f4..6c025eb 100644 --- a/libcli/smb/smb_constants.h +++ b/libcli/smb/smb_constants.h @@ -89,9 +89,9 @@ enum protocol_types { PROTOCOL_SMB2_24, PROTOCOL_SMB3_00, PROTOCOL_SMB3_02, - PROTOCOL_SMB3_10 + PROTOCOL_SMB3_11 }; -#define PROTOCOL_LATEST PROTOCOL_SMB3_10 +#define PROTOCOL_LATEST PROTOCOL_SMB3_11 enum smb_signing_setting { SMB_SIGNING_DEFAULT = -1, diff --git a/source3/torture/test_smb2.c b/source3/torture/test_smb2.c index 301c6e7..e82a10e 100644 --- a/source3/torture/test_smb2.c +++ b/source3/torture/test_smb2.c @@ -265,8 +265,8 @@ bool run_smb2_negprot(int dummy) case PROTOCOL_SMB3_02: name = "SMB3_02"; break; - case PROTOCOL_SMB3_10: - name = "SMB3_10"; + case PROTOCOL_SMB3_11: + name = "SMB3_11"; break; default: break; -- 1.9.1