Print this page
12513 SMB 3.1.1 support for server

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/smbsrv/smb2_session_setup.c
          +++ new/usr/src/uts/common/fs/smbsrv/smb2_session_setup.c
↓ open down ↓ 3 lines elided ↑ open up ↑
   4    4   * You may only use this file in accordance with the terms of version
   5    5   * 1.0 of the CDDL.
   6    6   *
   7    7   * A full copy of the text of the CDDL should have accompanied this
   8    8   * source.  A copy of the CDDL is also available via the Internet at
   9    9   * http://www.illumos.org/license/CDDL.
  10   10   */
  11   11  
  12   12  /*
  13   13   * Copyright 2017 Nexenta Systems, Inc.  All rights reserved.
       14 + * Copyright 2020 RackTop Systems, Inc.
  14   15   */
  15   16  
  16   17  /*
  17   18   * Dispatch function for SMB2_SESSION_SETUP
  18   19   *
  19   20   * Note that the Capabilities supplied in this request are an inferior
  20   21   * subset of those given to us previously in the SMB2 Negotiate request.
  21   22   * We need to remember the full set of capabilities from SMB2 Negotiate,
  22   23   * and therefore ignore the subset of capabilities supplied here.
  23   24   */
  24   25  
  25   26  #include <smbsrv/smb2_kproto.h>
  26   27  
  27   28  static void smb2_ss_adjust_credits(smb_request_t *);
  28   29  
  29   30  smb_sdrc_t
  30   31  smb2_session_setup(smb_request_t *sr)
  31   32  {
  32   33          smb_arg_sessionsetup_t  *sinfo;
       34 +        smb_session_t *s = sr->session;
  33   35          uint16_t StructureSize;
  34   36          uint8_t  Flags;
  35   37          uint8_t  SecurityMode;
  36   38          uint32_t Capabilities;  /* ignored - see above */
  37   39          uint32_t Channel;
  38   40          uint16_t SecBufOffset;
  39   41          uint16_t SecBufLength;
  40   42          uint64_t PrevSsnId;
  41   43          uint16_t SessionFlags;
  42   44          uint32_t status;
↓ open down ↓ 29 lines elided ↑ open up ↑
  72   74  
  73   75          /*
  74   76           * Get the security buffer
  75   77           */
  76   78          sinfo->ssi_iseclen = SecBufLength;
  77   79          sinfo->ssi_isecblob = smb_srm_zalloc(sr, sinfo->ssi_iseclen);
  78   80          rc = smb_mbc_decodef(&sr->smb_data, "#c",
  79   81              sinfo->ssi_iseclen, sinfo->ssi_isecblob);
  80   82          if (rc)
  81   83                  return (SDRC_ERROR);
       84 +
       85 +        if (s->dialect >= SMB_VERS_3_11) {
       86 +                ASSERT3U(s->smb31_preauth_hashid, !=, 0);
       87 +                (void) smb31_preauth_sha512_calc(sr, &sr->command,
       88 +                    s->smb31_preauth_hashval);
       89 +        }
  82   90  
  83   91          /*
  84   92           * Decoded everything.  Dtrace probe,
  85   93           * then no more early returns.
  86   94           */
  87   95          DTRACE_SMB2_START(op__SessionSetup, smb_request_t *, sr);
  88   96  
  89   97          /*
  90   98           * [MS-SMB2] 3.3.5.5 Receiving an SMB2 SESSION_SETUP Request
  91   99           *
↓ open down ↓ 140 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX