s3:smbd: add support for SMB_EXTENDED_SIGNATURES in SMBtconX
authorStefan Metzmacher <metze@samba.org>
Fri, 3 Aug 2012 06:44:39 +0000 (08:44 +0200)
committerStefan Metzmacher <metze@samba.org>
Sat, 4 Aug 2012 12:28:04 +0000 (14:28 +0200)
metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Sat Aug  4 14:28:04 CEST 2012 on sn-devel-104

source3/smbd/reply.c

index 94c18b0c658a6260e806d3f5cffc07a95f0f4fb5..1b4a1620d6c6bc6240eb8e7e01fe60389cc5acda 100644 (file)
@@ -42,6 +42,7 @@
 #include "smbprofile.h"
 #include "../lib/tsocket/tsocket.h"
 #include "lib/tevent_wait.h"
+#include "libcli/smb/smb_signing.h"
 
 /****************************************************************************
  Ensure we check the path in *exactly* the same way as W2K for a findfirst/findnext
@@ -725,6 +726,7 @@ void reply_tcon_and_X(struct smb_request *req)
        struct smbXsrv_session *session = NULL;
        NTTIME now = timeval_to_nttime(&req->request_time);
        bool session_key_updated = false;
+       uint16_t optional_support = 0;
        struct smbd_server_connection *sconn = req->sconn;
 
        START_PROFILE(SMBtconX);
@@ -874,6 +876,13 @@ void reply_tcon_and_X(struct smb_request *req)
                        return;
                }
 
+               if (tcon_flags & TCONX_FLAG_EXTENDED_SIGNATURES) {
+                       smb_key_derivation(x->global->application_key.data,
+                                          x->global->application_key.length,
+                                          x->global->application_key.data);
+                       optional_support |= SMB_EXTENDED_SIGNATURES;
+               }
+
                /*
                 * Place the application key into the session_info
                 */
@@ -924,7 +933,6 @@ void reply_tcon_and_X(struct smb_request *req)
        } else {
                /* NT sets the fstype of IPC$ to the null string */
                const char *fstype = IS_IPC(conn) ? "" : lp_fstype(ctx, SNUM(conn));
-               uint16_t optional_support = 0;
 
                if (tcon_flags & TCONX_FLAG_EXTENDED_RESPONSE) {
                        /* Return permissions. */