Lines Matching refs:ses
27 cifs_ses_add_channel(struct cifs_ses *ses,
30 bool is_ses_using_iface(struct cifs_ses *ses, struct cifs_server_iface *iface) in is_ses_using_iface() argument
34 spin_lock(&ses->chan_lock); in is_ses_using_iface()
35 for (i = 0; i < ses->chan_count; i++) { in is_ses_using_iface()
36 if (ses->chans[i].iface == iface) { in is_ses_using_iface()
37 spin_unlock(&ses->chan_lock); in is_ses_using_iface()
41 spin_unlock(&ses->chan_lock); in is_ses_using_iface()
48 cifs_ses_get_chan_index(struct cifs_ses *ses, in cifs_ses_get_chan_index() argument
57 for (i = 0; i < ses->chan_count; i++) { in cifs_ses_get_chan_index()
58 if (ses->chans[i].server == server) in cifs_ses_get_chan_index()
70 cifs_chan_set_in_reconnect(struct cifs_ses *ses, in cifs_chan_set_in_reconnect() argument
73 int chan_index = cifs_ses_get_chan_index(ses, server); in cifs_chan_set_in_reconnect()
78 ses->chans[chan_index].in_reconnect = true; in cifs_chan_set_in_reconnect()
82 cifs_chan_clear_in_reconnect(struct cifs_ses *ses, in cifs_chan_clear_in_reconnect() argument
85 unsigned int chan_index = cifs_ses_get_chan_index(ses, server); in cifs_chan_clear_in_reconnect()
90 ses->chans[chan_index].in_reconnect = false; in cifs_chan_clear_in_reconnect()
94 cifs_chan_set_need_reconnect(struct cifs_ses *ses, in cifs_chan_set_need_reconnect() argument
97 unsigned int chan_index = cifs_ses_get_chan_index(ses, server); in cifs_chan_set_need_reconnect()
102 set_bit(chan_index, &ses->chans_need_reconnect); in cifs_chan_set_need_reconnect()
104 chan_index, ses->chans_need_reconnect); in cifs_chan_set_need_reconnect()
108 cifs_chan_clear_need_reconnect(struct cifs_ses *ses, in cifs_chan_clear_need_reconnect() argument
111 unsigned int chan_index = cifs_ses_get_chan_index(ses, server); in cifs_chan_clear_need_reconnect()
116 clear_bit(chan_index, &ses->chans_need_reconnect); in cifs_chan_clear_need_reconnect()
118 chan_index, ses->chans_need_reconnect); in cifs_chan_clear_need_reconnect()
122 cifs_chan_needs_reconnect(struct cifs_ses *ses, in cifs_chan_needs_reconnect() argument
125 unsigned int chan_index = cifs_ses_get_chan_index(ses, server); in cifs_chan_needs_reconnect()
130 return CIFS_CHAN_NEEDS_RECONNECT(ses, chan_index); in cifs_chan_needs_reconnect()
134 cifs_chan_is_iface_active(struct cifs_ses *ses, in cifs_chan_is_iface_active() argument
137 unsigned int chan_index = cifs_ses_get_chan_index(ses, server); in cifs_chan_is_iface_active()
142 return ses->chans[chan_index].iface && in cifs_chan_is_iface_active()
143 ses->chans[chan_index].iface->is_active; in cifs_chan_is_iface_active()
147 int cifs_try_adding_channels(struct cifs_ses *ses) in cifs_try_adding_channels() argument
149 struct TCP_Server_Info *server = ses->server; in cifs_try_adding_channels()
158 spin_lock(&ses->chan_lock); in cifs_try_adding_channels()
160 new_chan_count = old_chan_count = ses->chan_count; in cifs_try_adding_channels()
161 left = ses->chan_max - ses->chan_count; in cifs_try_adding_channels()
164 spin_unlock(&ses->chan_lock); in cifs_try_adding_channels()
167 ses->chan_max); in cifs_try_adding_channels()
172 spin_unlock(&ses->chan_lock); in cifs_try_adding_channels()
178 spin_unlock(&ses->chan_lock); in cifs_try_adding_channels()
182 spin_unlock(&ses->chan_lock); in cifs_try_adding_channels()
187 if (tries > 3*ses->chan_max) { in cifs_try_adding_channels()
193 spin_lock(&ses->iface_lock); in cifs_try_adding_channels()
194 if (!ses->iface_count) { in cifs_try_adding_channels()
195 spin_unlock(&ses->iface_lock); in cifs_try_adding_channels()
197 ses->server->hostname); in cifs_try_adding_channels()
202 iface = list_first_entry(&ses->iface_list, struct cifs_server_iface, in cifs_try_adding_channels()
204 last_iface = list_last_entry(&ses->iface_list, struct cifs_server_iface, in cifs_try_adding_channels()
208 list_for_each_entry_safe_from(iface, niface, &ses->iface_list, in cifs_try_adding_channels()
211 if (iface->rdma_capable != ses->server->rdma) in cifs_try_adding_channels()
216 (is_ses_using_iface(ses, iface) && in cifs_try_adding_channels()
229 spin_unlock(&ses->iface_lock); in cifs_try_adding_channels()
230 rc = cifs_ses_add_channel(ses, iface); in cifs_try_adding_channels()
231 spin_lock(&ses->iface_lock); in cifs_try_adding_channels()
251 if (list_entry_is_head(iface, &ses->iface_list, iface_head)) { in cifs_try_adding_channels()
252 list_for_each_entry(iface, &ses->iface_list, iface_head) in cifs_try_adding_channels()
254 spin_unlock(&ses->iface_lock); in cifs_try_adding_channels()
258 spin_unlock(&ses->iface_lock); in cifs_try_adding_channels()
273 cifs_disable_secondary_channels(struct cifs_ses *ses) in cifs_disable_secondary_channels() argument
279 spin_lock(&ses->chan_lock); in cifs_disable_secondary_channels()
280 chan_count = ses->chan_count; in cifs_disable_secondary_channels()
284 ses->chan_count = 1; in cifs_disable_secondary_channels()
287 ses->chans_need_reconnect &= 1; in cifs_disable_secondary_channels()
290 iface = ses->chans[i].iface; in cifs_disable_secondary_channels()
291 server = ses->chans[i].server; in cifs_disable_secondary_channels()
297 ses->chans[i].iface = NULL; in cifs_disable_secondary_channels()
298 ses->chans[i].server = NULL; in cifs_disable_secondary_channels()
299 spin_unlock(&ses->chan_lock); in cifs_disable_secondary_channels()
302 spin_lock(&ses->iface_lock); in cifs_disable_secondary_channels()
307 spin_unlock(&ses->iface_lock); in cifs_disable_secondary_channels()
318 spin_lock(&ses->chan_lock); in cifs_disable_secondary_channels()
322 spin_unlock(&ses->chan_lock); in cifs_disable_secondary_channels()
327 cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server) in cifs_chan_update_iface() argument
337 spin_lock(&ses->chan_lock); in cifs_chan_update_iface()
338 chan_index = cifs_ses_get_chan_index(ses, server); in cifs_chan_update_iface()
340 spin_unlock(&ses->chan_lock); in cifs_chan_update_iface()
344 if (ses->chans[chan_index].iface) { in cifs_chan_update_iface()
345 old_iface = ses->chans[chan_index].iface; in cifs_chan_update_iface()
347 spin_unlock(&ses->chan_lock); in cifs_chan_update_iface()
351 spin_unlock(&ses->chan_lock); in cifs_chan_update_iface()
357 spin_lock(&ses->iface_lock); in cifs_chan_update_iface()
358 if (!ses->iface_count) { in cifs_chan_update_iface()
359 spin_unlock(&ses->iface_lock); in cifs_chan_update_iface()
360 cifs_dbg(ONCE, "server %s does not advertise interfaces\n", ses->server->hostname); in cifs_chan_update_iface()
365 last_iface = list_last_entry(&ses->iface_list, struct cifs_server_iface, in cifs_chan_update_iface()
370 list_for_each_entry(iface, &ses->iface_list, iface_head) { in cifs_chan_update_iface()
386 (is_ses_using_iface(ses, iface) && in cifs_chan_update_iface()
401 if (list_entry_is_head(iface, &ses->iface_list, iface_head)) { in cifs_chan_update_iface()
402 list_for_each_entry(iface, &ses->iface_list, iface_head) in cifs_chan_update_iface()
422 spin_unlock(&ses->iface_lock); in cifs_chan_update_iface()
446 spin_unlock(&ses->iface_lock); in cifs_chan_update_iface()
448 spin_lock(&ses->chan_lock); in cifs_chan_update_iface()
449 chan_index = cifs_ses_get_chan_index(ses, server); in cifs_chan_update_iface()
451 spin_unlock(&ses->chan_lock); in cifs_chan_update_iface()
455 ses->chans[chan_index].iface = iface; in cifs_chan_update_iface()
456 spin_unlock(&ses->chan_lock); in cifs_chan_update_iface()
464 cifs_ses_add_channel(struct cifs_ses *ses, in cifs_ses_add_channel() argument
479 ses, iface->speed, str_yes_no(iface->rdma_capable), in cifs_ses_add_channel()
483 ses, iface->speed, str_yes_no(iface->rdma_capable), in cifs_ses_add_channel()
507 ctx->domainauto = ses->domainAuto; in cifs_ses_add_channel()
508 ctx->domainname = ses->domainName; in cifs_ses_add_channel()
510 ctx->server_hostname = ses->server->hostname; in cifs_ses_add_channel()
512 ctx->username = ses->user_name; in cifs_ses_add_channel()
513 ctx->password = ses->password; in cifs_ses_add_channel()
514 ctx->sectype = ses->sectype; in cifs_ses_add_channel()
515 ctx->sign = ses->sign; in cifs_ses_add_channel()
516 ctx->unicode = ses->unicode; in cifs_ses_add_channel()
526 scnprintf(ctx->UNC, len, unc_fmt, ses->ip_addr); in cifs_ses_add_channel()
530 ctx->vals = ses->server->vals; in cifs_ses_add_channel()
531 ctx->ops = ses->server->ops; in cifs_ses_add_channel()
533 ctx->noblocksnd = ses->server->noblocksnd; in cifs_ses_add_channel()
534 ctx->noautotune = ses->server->noautotune; in cifs_ses_add_channel()
535 ctx->sockopt_tcp_nodelay = ses->server->tcp_nodelay; in cifs_ses_add_channel()
536 ctx->echo_interval = ses->server->echo_interval / HZ; in cifs_ses_add_channel()
537 ctx->max_credits = ses->server->max_credits; in cifs_ses_add_channel()
538 ctx->min_offload = ses->server->min_offload; in cifs_ses_add_channel()
539 ctx->compress = ses->server->compression.requested; in cifs_ses_add_channel()
540 ctx->dfs_conn = ses->server->dfs_conn; in cifs_ses_add_channel()
541 ctx->ignore_signature = ses->server->ignore_signature; in cifs_ses_add_channel()
542 ctx->leaf_fullpath = ses->server->leaf_fullpath; in cifs_ses_add_channel()
543 ctx->rootfs = ses->server->noblockcnt; in cifs_ses_add_channel()
544 ctx->retrans = ses->server->retrans; in cifs_ses_add_channel()
550 ctx->local_nls = ses->local_nls; in cifs_ses_add_channel()
557 memcpy(&ctx->client_guid, ses->server->client_guid, in cifs_ses_add_channel()
561 chan_server = cifs_get_tcp_session(ctx, ses->server); in cifs_ses_add_channel()
563 spin_lock(&ses->chan_lock); in cifs_ses_add_channel()
564 chan = &ses->chans[ses->chan_count]; in cifs_ses_add_channel()
569 spin_unlock(&ses->chan_lock); in cifs_ses_add_channel()
573 ses->chan_count++; in cifs_ses_add_channel()
574 atomic_set(&ses->chan_seq, 0); in cifs_ses_add_channel()
577 cifs_chan_set_need_reconnect(ses, chan->server); in cifs_ses_add_channel()
579 spin_unlock(&ses->chan_lock); in cifs_ses_add_channel()
581 mutex_lock(&ses->session_mutex); in cifs_ses_add_channel()
590 mutex_unlock(&ses->session_mutex); in cifs_ses_add_channel()
594 rc = cifs_negotiate_protocol(xid, ses, chan->server); in cifs_ses_add_channel()
596 rc = cifs_setup_session(xid, ses, chan->server, ses->local_nls); in cifs_ses_add_channel()
598 mutex_unlock(&ses->session_mutex); in cifs_ses_add_channel()
604 spin_lock(&ses->chan_lock); in cifs_ses_add_channel()
607 cifs_chan_clear_need_reconnect(ses, chan->server); in cifs_ses_add_channel()
608 ses->chan_count--; in cifs_ses_add_channel()
613 WARN_ON(ses->chan_count < 1); in cifs_ses_add_channel()
614 spin_unlock(&ses->chan_lock); in cifs_ses_add_channel()
626 static __u32 cifs_ssetup_hdr(struct cifs_ses *ses, in cifs_ssetup_hdr() argument
655 if (ses->capabilities & CAP_UNICODE) { in cifs_ssetup_hdr()
659 if (ses->capabilities & CAP_STATUS32) { in cifs_ssetup_hdr()
663 if (ses->capabilities & CAP_DFS) { in cifs_ssetup_hdr()
667 if (ses->capabilities & CAP_UNIX) in cifs_ssetup_hdr()
712 static void unicode_domain_string(char **pbcc_area, struct cifs_ses *ses, in unicode_domain_string() argument
719 if (ses->domainName == NULL) { in unicode_domain_string()
728 bytes_ret = cifs_strtoUTF16((__le16 *) bcc_ptr, ses->domainName, in unicode_domain_string()
736 static void ascii_domain_string(char **pbcc_area, struct cifs_ses *ses, in ascii_domain_string() argument
743 if (ses->domainName != NULL) { in ascii_domain_string()
744 len = strscpy(bcc_ptr, ses->domainName, CIFS_MAX_DOMAINNAME_LEN); in ascii_domain_string()
755 static void unicode_ssetup_strings(char **pbcc_area, struct cifs_ses *ses, in unicode_ssetup_strings() argument
764 if (ses->user_name == NULL) { in unicode_ssetup_strings()
769 bytes_ret = cifs_strtoUTF16((__le16 *) bcc_ptr, ses->user_name, in unicode_ssetup_strings()
775 unicode_domain_string(&bcc_ptr, ses, nls_cp); in unicode_ssetup_strings()
781 static void ascii_ssetup_strings(char **pbcc_area, struct cifs_ses *ses, in ascii_ssetup_strings() argument
790 if (ses->user_name != NULL) { in ascii_ssetup_strings()
791 len = strscpy(bcc_ptr, ses->user_name, CIFS_MAX_USERNAME_LEN); in ascii_ssetup_strings()
802 ascii_domain_string(&bcc_ptr, ses, nls_cp); in ascii_ssetup_strings()
809 decode_unicode_ssetup(char **pbcc_area, int bleft, struct cifs_ses *ses, in decode_unicode_ssetup() argument
817 kfree(ses->serverOS); in decode_unicode_ssetup()
818 ses->serverOS = cifs_strndup_from_utf16(data, bleft, true, nls_cp); in decode_unicode_ssetup()
819 cifs_dbg(FYI, "serverOS=%s\n", ses->serverOS); in decode_unicode_ssetup()
826 kfree(ses->serverNOS); in decode_unicode_ssetup()
827 ses->serverNOS = cifs_strndup_from_utf16(data, bleft, true, nls_cp); in decode_unicode_ssetup()
828 cifs_dbg(FYI, "serverNOS=%s\n", ses->serverNOS); in decode_unicode_ssetup()
835 kfree(ses->serverDomain); in decode_unicode_ssetup()
836 ses->serverDomain = cifs_strndup_from_utf16(data, bleft, true, nls_cp); in decode_unicode_ssetup()
837 cifs_dbg(FYI, "serverDomain=%s\n", ses->serverDomain); in decode_unicode_ssetup()
843 struct cifs_ses *ses, in decode_ascii_ssetup() argument
855 kfree(ses->serverOS); in decode_ascii_ssetup()
857 ses->serverOS = kmalloc(len + 1, GFP_KERNEL); in decode_ascii_ssetup()
858 if (ses->serverOS) { in decode_ascii_ssetup()
859 memcpy(ses->serverOS, bcc_ptr, len); in decode_ascii_ssetup()
860 ses->serverOS[len] = 0; in decode_ascii_ssetup()
861 if (strncmp(ses->serverOS, "OS/2", 4) == 0) in decode_ascii_ssetup()
872 kfree(ses->serverNOS); in decode_ascii_ssetup()
874 ses->serverNOS = kmalloc(len + 1, GFP_KERNEL); in decode_ascii_ssetup()
875 if (ses->serverNOS) { in decode_ascii_ssetup()
876 memcpy(ses->serverNOS, bcc_ptr, len); in decode_ascii_ssetup()
877 ses->serverNOS[len] = 0; in decode_ascii_ssetup()
900 struct cifs_ses *ses) in decode_ntlmssp_challenge() argument
925 ses->ntlmssp->client_flags, server_flags); in decode_ntlmssp_challenge()
927 if ((ses->ntlmssp->client_flags & (NTLMSSP_NEGOTIATE_SEAL | NTLMSSP_NEGOTIATE_SIGN)) && in decode_ntlmssp_challenge()
937 if (ses->server->sign && !(server_flags & NTLMSSP_NEGOTIATE_SIGN)) { in decode_ntlmssp_challenge()
942 if ((ses->ntlmssp->client_flags & NTLMSSP_NEGOTIATE_KEY_XCH) && in decode_ntlmssp_challenge()
947 ses->ntlmssp->server_flags = server_flags; in decode_ntlmssp_challenge()
949 memcpy(ses->ntlmssp->cryptkey, pblob->Challenge, CIFS_CRYPTO_KEY_SIZE); in decode_ntlmssp_challenge()
965 kfree_sensitive(ses->auth_key.response); in decode_ntlmssp_challenge()
966 ses->auth_key.response = kmemdup(bcc_ptr + tioffset, tilen, in decode_ntlmssp_challenge()
968 if (!ses->auth_key.response) { in decode_ntlmssp_challenge()
972 ses->auth_key.len = tilen; in decode_ntlmssp_challenge()
978 static int size_of_ntlmssp_blob(struct cifs_ses *ses, int base_size) in size_of_ntlmssp_blob() argument
980 int sz = base_size + ses->auth_key.len in size_of_ntlmssp_blob()
983 if (ses->domainName) in size_of_ntlmssp_blob()
984 sz += sizeof(__le16) * strnlen(ses->domainName, CIFS_MAX_DOMAINNAME_LEN); in size_of_ntlmssp_blob()
988 if (ses->user_name) in size_of_ntlmssp_blob()
989 sz += sizeof(__le16) * strnlen(ses->user_name, CIFS_MAX_USERNAME_LEN); in size_of_ntlmssp_blob()
993 if (ses->workstation_name[0]) in size_of_ntlmssp_blob()
994 sz += sizeof(__le16) * strnlen(ses->workstation_name, in size_of_ntlmssp_blob()
995 ntlmssp_workstation_name_size(ses)); in size_of_ntlmssp_blob()
1040 struct cifs_ses *ses, in build_ntlmssp_negotiate_blob() argument
1050 len = size_of_ntlmssp_blob(ses, sizeof(NEGOTIATE_MESSAGE)); in build_ntlmssp_negotiate_blob()
1070 if (!server->session_estab || ses->ntlmssp->sesskey_per_smbsess) in build_ntlmssp_negotiate_blob()
1074 ses->ntlmssp->client_flags = flags; in build_ntlmssp_negotiate_blob()
1102 struct cifs_ses *ses, in build_ntlmssp_smb3_negotiate_blob() argument
1112 len = size_of_ntlmssp_blob(ses, sizeof(struct negotiate_message)); in build_ntlmssp_smb3_negotiate_blob()
1132 if (!server->session_estab || ses->ntlmssp->sesskey_per_smbsess) in build_ntlmssp_smb3_negotiate_blob()
1141 ses->ntlmssp->client_flags = flags; in build_ntlmssp_smb3_negotiate_blob()
1166 struct cifs_ses *ses, in build_ntlmssp_auth_blob() argument
1176 rc = setup_ntlmv2_rsp(ses, nls_cp); in build_ntlmssp_auth_blob()
1183 len = size_of_ntlmssp_blob(ses, sizeof(AUTHENTICATE_MESSAGE)); in build_ntlmssp_auth_blob()
1197 flags = ses->ntlmssp->server_flags | NTLMSSP_REQUEST_TARGET | in build_ntlmssp_auth_blob()
1216 if (ses->user_name != NULL) { in build_ntlmssp_auth_blob()
1217 memcpy(tmp, ses->auth_key.response + CIFS_SESS_KEY_SIZE, in build_ntlmssp_auth_blob()
1218 ses->auth_key.len - CIFS_SESS_KEY_SIZE); in build_ntlmssp_auth_blob()
1219 tmp += ses->auth_key.len - CIFS_SESS_KEY_SIZE; in build_ntlmssp_auth_blob()
1222 cpu_to_le16(ses->auth_key.len - CIFS_SESS_KEY_SIZE); in build_ntlmssp_auth_blob()
1224 cpu_to_le16(ses->auth_key.len - CIFS_SESS_KEY_SIZE); in build_ntlmssp_auth_blob()
1234 ses->domainName, in build_ntlmssp_auth_blob()
1240 ses->user_name, in build_ntlmssp_auth_blob()
1246 ses->workstation_name, in build_ntlmssp_auth_blob()
1247 ntlmssp_workstation_name_size(ses), in build_ntlmssp_auth_blob()
1251 if ((ses->ntlmssp->server_flags & NTLMSSP_NEGOTIATE_KEY_XCH) && in build_ntlmssp_auth_blob()
1252 (!ses->server->session_estab || ses->ntlmssp->sesskey_per_smbsess) && in build_ntlmssp_auth_blob()
1253 !calc_seckey(ses)) { in build_ntlmssp_auth_blob()
1254 memcpy(tmp, ses->ntlmssp->ciphertext, CIFS_CPHTXT_SIZE); in build_ntlmssp_auth_blob()
1311 struct cifs_ses *ses; member
1333 struct cifs_ses *ses = sess_data->ses; in sess_alloc_buffer() local
1336 rc = small_smb_init_no_tc(SMB_COM_SESSION_SETUP_ANDX, wct, ses, in sess_alloc_buffer()
1387 struct cifs_ses *ses = sess_data->ses; in sess_establish_session() local
1394 kmemdup(ses->auth_key.response, in sess_establish_session()
1395 ses->auth_key.len, GFP_KERNEL); in sess_establish_session()
1401 ses->auth_key.len; in sess_establish_session()
1424 rc = SendReceive2(sess_data->xid, sess_data->ses, in sess_sendreceive()
1441 struct cifs_ses *ses = sess_data->ses; in sess_auth_ntlmv2() local
1454 capabilities = cifs_ssetup_hdr(ses, server, pSMB); in sess_auth_ntlmv2()
1461 if (ses->user_name != NULL) { in sess_auth_ntlmv2()
1463 rc = setup_ntlmv2_rsp(ses, sess_data->nls_cp); in sess_auth_ntlmv2()
1469 memcpy(bcc_ptr, ses->auth_key.response + CIFS_SESS_KEY_SIZE, in sess_auth_ntlmv2()
1470 ses->auth_key.len - CIFS_SESS_KEY_SIZE); in sess_auth_ntlmv2()
1471 bcc_ptr += ses->auth_key.len - CIFS_SESS_KEY_SIZE; in sess_auth_ntlmv2()
1477 cpu_to_le16(ses->auth_key.len - CIFS_SESS_KEY_SIZE); in sess_auth_ntlmv2()
1482 if (ses->capabilities & CAP_UNICODE) { in sess_auth_ntlmv2()
1487 unicode_ssetup_strings(&bcc_ptr, ses, sess_data->nls_cp); in sess_auth_ntlmv2()
1489 ascii_ssetup_strings(&bcc_ptr, ses, sess_data->nls_cp); in sess_auth_ntlmv2()
1512 ses->Suid = smb_buf->Uid; /* UID left in wire format (le) */ in sess_auth_ntlmv2()
1513 cifs_dbg(FYI, "UID = %llu\n", ses->Suid); in sess_auth_ntlmv2()
1527 decode_unicode_ssetup(&bcc_ptr, bytes_remaining, ses, in sess_auth_ntlmv2()
1530 decode_ascii_ssetup(&bcc_ptr, bytes_remaining, ses, in sess_auth_ntlmv2()
1539 kfree_sensitive(ses->auth_key.response); in sess_auth_ntlmv2()
1540 ses->auth_key.response = NULL; in sess_auth_ntlmv2()
1551 struct cifs_ses *ses = sess_data->ses; in sess_auth_kerberos() local
1567 capabilities = cifs_ssetup_hdr(ses, server, pSMB); in sess_auth_kerberos()
1569 spnego_key = cifs_get_spnego_key(ses, server); in sess_auth_kerberos()
1588 kfree_sensitive(ses->auth_key.response); in sess_auth_kerberos()
1589 ses->auth_key.response = kmemdup(msg->data, msg->sesskey_len, in sess_auth_kerberos()
1591 if (!ses->auth_key.response) { in sess_auth_kerberos()
1597 ses->auth_key.len = msg->sesskey_len; in sess_auth_kerberos()
1613 unicode_domain_string(&bcc_ptr, ses, sess_data->nls_cp); in sess_auth_kerberos()
1616 ascii_domain_string(&bcc_ptr, ses, sess_data->nls_cp); in sess_auth_kerberos()
1638 ses->Suid = smb_buf->Uid; /* UID left in wire format (le) */ in sess_auth_kerberos()
1639 cifs_dbg(FYI, "UID = %llu\n", ses->Suid); in sess_auth_kerberos()
1663 decode_unicode_ssetup(&bcc_ptr, bytes_remaining, ses, in sess_auth_kerberos()
1666 decode_ascii_ssetup(&bcc_ptr, bytes_remaining, ses, in sess_auth_kerberos()
1678 kfree_sensitive(ses->auth_key.response); in sess_auth_kerberos()
1679 ses->auth_key.response = NULL; in sess_auth_kerberos()
1692 struct cifs_ses *ses = sess_data->ses; in _sess_auth_rawntlmssp_assemble_req() local
1699 capabilities = cifs_ssetup_hdr(ses, server, pSMB); in _sess_auth_rawntlmssp_assemble_req()
1732 struct cifs_ses *ses = sess_data->ses; in sess_auth_rawntlmssp_negotiate() local
1745 ses->ntlmssp = kmalloc(sizeof(struct ntlmssp_auth), GFP_KERNEL); in sess_auth_rawntlmssp_negotiate()
1746 if (!ses->ntlmssp) { in sess_auth_rawntlmssp_negotiate()
1750 ses->ntlmssp->sesskey_per_smbsess = false; in sess_auth_rawntlmssp_negotiate()
1761 &blob_len, ses, server, in sess_auth_rawntlmssp_negotiate()
1796 ses->Suid = smb_buf->Uid; /* UID left in wire format (le) */ in sess_auth_rawntlmssp_negotiate()
1797 cifs_dbg(FYI, "UID = %llu\n", ses->Suid); in sess_auth_rawntlmssp_negotiate()
1810 rc = decode_ntlmssp_challenge(bcc_ptr, blob_len, ses); in sess_auth_rawntlmssp_negotiate()
1823 kfree_sensitive(ses->auth_key.response); in sess_auth_rawntlmssp_negotiate()
1824 ses->auth_key.response = NULL; in sess_auth_rawntlmssp_negotiate()
1825 kfree_sensitive(ses->ntlmssp); in sess_auth_rawntlmssp_negotiate()
1826 ses->ntlmssp = NULL; in sess_auth_rawntlmssp_negotiate()
1838 struct cifs_ses *ses = sess_data->ses; in sess_auth_rawntlmssp_authenticate() local
1856 &blob_len, ses, server, in sess_auth_rawntlmssp_authenticate()
1868 smb_buf->Uid = ses->Suid; in sess_auth_rawntlmssp_authenticate()
1889 if (ses->Suid != smb_buf->Uid) { in sess_auth_rawntlmssp_authenticate()
1890 ses->Suid = smb_buf->Uid; in sess_auth_rawntlmssp_authenticate()
1891 cifs_dbg(FYI, "UID changed! new UID = %llu\n", ses->Suid); in sess_auth_rawntlmssp_authenticate()
1916 decode_unicode_ssetup(&bcc_ptr, bytes_remaining, ses, in sess_auth_rawntlmssp_authenticate()
1919 decode_ascii_ssetup(&bcc_ptr, bytes_remaining, ses, in sess_auth_rawntlmssp_authenticate()
1932 kfree_sensitive(ses->auth_key.response); in sess_auth_rawntlmssp_authenticate()
1933 ses->auth_key.response = NULL; in sess_auth_rawntlmssp_authenticate()
1934 kfree_sensitive(ses->ntlmssp); in sess_auth_rawntlmssp_authenticate()
1935 ses->ntlmssp = NULL; in sess_auth_rawntlmssp_authenticate()
1944 struct cifs_ses *ses = sess_data->ses; in select_sec() local
1947 type = cifs_select_sectype(server, ses->sectype); in select_sec()
1977 int CIFS_SessSetup(const unsigned int xid, struct cifs_ses *ses, in CIFS_SessSetup() argument
1984 if (ses == NULL) { in CIFS_SessSetup()
1994 sess_data->ses = ses; in CIFS_SessSetup()