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
1 1 /*
2 2 * This file and its contents are supplied under the terms of the
3 3 * Common Development and Distribution License ("CDDL"), version 1.0.
↓ 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.
24 25 */
25 26
↓ 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,
57 73 uint8_t *key, size_t key_len, smb3_crypto_param_t *param,
58 74 boolean_t is_encrypt)
59 75 {
60 76 return (-1);
61 77 }
62 78
63 79 /* ARGSUSED */
64 80 int
65 81 smb3_encrypt_init(smb3_enc_ctx_t *ctxp, smb_crypto_mech_t *mech,
66 82 smb3_crypto_param_t *param, uint8_t *key, size_t keylen,
67 83 uint8_t *buf, size_t buflen)
68 84 {
69 85 return (smb3_crypto_init(ctxp, mech, key, keylen, param, B_TRUE));
70 86 }
71 87
72 88 int
73 89 smb3_decrypt_init(smb3_enc_ctx_t *ctxp, smb_crypto_mech_t *mech,
74 90 smb3_crypto_param_t *param, uint8_t *key, size_t keylen)
75 91 {
76 92 return (smb3_crypto_init(ctxp, mech, key, keylen, param, B_FALSE));
77 93 }
78 94
79 95 /*
80 96 * Digest one segment
81 97 */
82 98
83 99 /* ARGSUSED */
84 100 int
85 101 smb3_encrypt_update(smb3_enc_ctx_t *ctxp, uint8_t *in, size_t len)
86 102 {
87 103 return (-1);
88 104 }
89 105
90 106 /* ARGSUSED */
91 107 int
92 108 smb3_decrypt_update(smb3_enc_ctx_t *ctxp, uint8_t *in, size_t len)
93 109 {
94 110 return (-1);
95 111 }
96 112
97 113 /* ARGSUSED */
98 114 int
99 115 smb3_encrypt_final(smb3_enc_ctx_t *ctxp, uint8_t *digest16)
100 116 {
101 117 return (-1);
102 118 }
103 119
104 120 /* ARGSUSED */
105 121 int
106 122 smb3_decrypt_final(smb3_enc_ctx_t *ctxp, uint8_t *buf, size_t buflen)
107 123 {
108 124 return (-1);
109 125 }
110 126
111 127 /* ARGSUSED */
112 128 void
113 129 smb3_encrypt_cancel(smb3_enc_ctx_t *ctxp)
114 130 {
115 131 }
↓ open down ↓ |
59 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX