Print this page
12513 SMB 3.1.1 support for server

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/smbsrv/libfksmbsrv/common/fksmb_encrypt_pkcs.c
          +++ new/usr/src/lib/smbsrv/libfksmbsrv/common/fksmb_encrypt_pkcs.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 2018 Nexenta Systems, Inc.  All rights reserved.
       14 + * Copyright 2020 RackTop Systems, Inc.
  14   15   */
  15   16  
  16   17  /*
  17   18   * Helper functions for SMB3 encryption using PKCS#11
  18   19   *
  19   20   * There are two implementations of these functions:
  20   21   * This one (for user space) and another for kernel.
  21   22   * See: uts/common/fs/smbsrv/smb3_encrypt_kcf.c
  22   23   *
  23   24   * NOTE: CCM is not implemented in PKCS yet, so these are just stubs.
↓ open down ↓ 2 lines elided ↑ open up ↑
  26   27  #include <smbsrv/smb_kcrypt.h>
  27   28  #include <smbsrv/smb2_kproto.h>
  28   29  
  29   30  /*
  30   31   * SMB3 encryption helpers:
  31   32   * (getmech, init, update, final)
  32   33   */
  33   34  
  34   35  /* ARGSUSED */
  35   36  int
  36      -smb3_encrypt_getmech(smb_crypto_mech_t *mech)
       37 +smb3_aes_ccm_getmech(smb_crypto_mech_t *mech)
       38 +{
       39 +        cmn_err(CE_NOTE, "fksmbsrv does not support SMB3 Encryption");
       40 +        return (-1);
       41 +}
       42 +
       43 +/* ARGSUSED */
       44 +int
       45 +smb3_aes_gcm_getmech(smb_crypto_mech_t *mech)
  37   46  {
  38   47          cmn_err(CE_NOTE, "fksmbsrv does not support SMB3 Encryption");
  39   48          return (-1);
  40   49  }
  41   50  
  42   51  /* ARGSUSED */
  43   52  void
  44      -smb3_crypto_init_param(smb3_crypto_param_t *param,
       53 +smb3_crypto_init_ccm_param(smb3_crypto_param_t *param,
  45   54      uint8_t *nonce, size_t noncesize, uint8_t *auth, size_t authsize,
  46   55      size_t datasize)
       56 +{
       57 +}
       58 +
       59 +/* ARGSUSED */
       60 +void
       61 +smb3_crypto_init_gcm_param(smb3_crypto_param_t *param,
       62 +    uint8_t *nonce, size_t noncesize, uint8_t *auth, size_t authsize)
  47   63  {
  48   64  }
  49   65  
  50   66  /*
  51   67   * Start the KCF session, load the key
  52   68   */
  53   69  
  54   70  /* ARGSUSED */
  55   71  static int
  56   72  smb3_crypto_init(smb3_enc_ctx_t *ctxp, smb_crypto_mech_t *mech,
↓ open down ↓ 59 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX