smb2: add support for the SMB2_GLOBAL_CAP_ENCRYPTION
authorMichael Adam <obnox@samba.org>
Wed, 29 Feb 2012 02:43:28 +0000 (03:43 +0100)
committerMichael Adam <obnox@samba.org>
Wed, 29 Feb 2012 06:52:45 +0000 (07:52 +0100)
epan/dissectors/packet-smb2.c

index 2637f1a7a5f0e56c0ac9f4c980c51ca3ce84987d..686046041c49f8a906b778fef6866af8f97a2fe3 100644 (file)
@@ -240,6 +240,7 @@ static int hf_smb2_cap_large_mtu = -1;
 static int hf_smb2_cap_multi_channel = -1;
 static int hf_smb2_cap_persistent_handles = -1;
 static int hf_smb2_cap_directory_leasing = -1;
+static int hf_smb2_cap_encryption = -1;
 static int hf_smb2_dialect = -1;
 static int hf_smb2_max_trans_size = -1;
 static int hf_smb2_max_read_size = -1;
@@ -878,6 +879,11 @@ static const true_false_string tfs_cap_directory_leasing = {
        "This host does NOT support DIRECTORY LEASING"
 };
 
+static const true_false_string tfs_cap_encryption = {
+       "This host supports ENCRYPTION",
+       "This host does NOT support ENCRYPTION"
+};
+
 static const true_false_string tfs_smb2_ioctl_network_interface_capability_rss = {
        "This interface supports RSS",
        "This interface does not support RSS"
@@ -1939,6 +1945,7 @@ dissect_smb2_buffercode(proto_tree *tree, tvbuff_t *tvb, int offset, guint16 *le
 #define NEGPROT_CAP_MULTI_CHANNEL      0x00000008
 #define NEGPROT_CAP_PERSISTENT_HANDLES 0x00000010
 #define NEGPROT_CAP_DIRECTORY_LEASING  0x00000020
+#define NEGPROT_CAP_ENCRYPTION         0x00000040
 static int
 dissect_smb2_capabilities(proto_tree *parent_tree, tvbuff_t *tvb, int offset)
 {
@@ -1958,6 +1965,7 @@ dissect_smb2_capabilities(proto_tree *parent_tree, tvbuff_t *tvb, int offset)
        proto_tree_add_boolean(tree, hf_smb2_cap_multi_channel, tvb, offset, 4, cap);
        proto_tree_add_boolean(tree, hf_smb2_cap_persistent_handles, tvb, offset, 4, cap);
        proto_tree_add_boolean(tree, hf_smb2_cap_directory_leasing, tvb, offset, 4, cap);
+       proto_tree_add_boolean(tree, hf_smb2_cap_encryption, tvb, offset, 4, cap);
 
        offset += 4;
 
@@ -7238,6 +7246,11 @@ proto_register_smb2(void)
                TFS(&tfs_cap_directory_leasing), NEGPROT_CAP_DIRECTORY_LEASING,
                "If the host supports DIRECTORY LEASING", HFILL }},
 
+       { &hf_smb2_cap_encryption,
+               { "ENCRYPTION", "smb2.capabilities.encryption", FT_BOOLEAN, 32,
+               TFS(&tfs_cap_encryption), NEGPROT_CAP_ENCRYPTION,
+               "If the host supports ENCRYPTION", HFILL }},
+
        { &hf_smb2_max_trans_size,
                { "Max Transaction Size", "smb2.max_trans_size", FT_UINT32, BASE_DEC,
                NULL, 0, "Maximum size of a transaction", HFILL }},