Lines Matching refs:ses

81 	struct cifs_ses *ses = NULL;
91 list_for_each_entry(ses, &pserver->smb_ses_list, smb_ses_list) {
92 if (ses->Suid == ses_id)
102 spin_lock(&ses->ses_lock);
103 spin_lock(&ses->chan_lock);
105 is_binding = (cifs_chan_needs_reconnect(ses, server) &&
106 ses->ses_status == SES_GOOD);
113 memcpy(key, ses->smb3signingkey, SMB3_SIGN_KEY_SIZE);
114 spin_unlock(&ses->chan_lock);
115 spin_unlock(&ses->ses_lock);
123 for (i = 0; i < ses->chan_count; i++) {
124 chan = ses->chans + i;
127 spin_unlock(&ses->chan_lock);
128 spin_unlock(&ses->ses_lock);
132 spin_unlock(&ses->chan_lock);
133 spin_unlock(&ses->ses_lock);
149 struct cifs_ses *ses;
154 list_for_each_entry(ses, &pserver->smb_ses_list, smb_ses_list) {
155 if (ses->Suid != ses_id)
158 spin_lock(&ses->ses_lock);
159 if (ses->ses_status == SES_EXITING) {
160 spin_unlock(&ses->ses_lock);
163 cifs_smb_ses_inc_refcount(ses);
164 spin_unlock(&ses->ses_lock);
165 return ses;
174 struct cifs_ses *ses;
177 ses = smb2_find_smb_ses_unlocked(server, ses_id);
180 return ses;
184 smb2_find_smb_sess_tcon_unlocked(struct cifs_ses *ses, __u32 tid)
188 list_for_each_entry(tcon, &ses->tcon_list, tcon_list) {
206 struct cifs_ses *ses;
210 ses = smb2_find_smb_ses_unlocked(server, ses_id);
211 if (!ses) {
215 tcon = smb2_find_smb_sess_tcon_unlocked(ses, tid);
217 cifs_put_smb_ses(ses);
222 /* tcon already has a ref to ses, so we don't need ses anymore */
223 cifs_put_smb_ses(ses);
237 struct cifs_ses *ses;
241 ses = smb2_find_smb_ses(server, le64_to_cpu(shdr->SessionId));
242 if (unlikely(!ses)) {
261 rc = crypto_shash_setkey(shash->tfm, ses->auth_key.response,
304 if (ses)
305 cifs_put_smb_ses(ses);
309 static int generate_key(struct cifs_ses *ses, struct kvec label,
319 struct TCP_Server_Info *server = ses->server;
331 ses->auth_key.response, SMB2_NTLMV2_SESSKEY_SIZE);
402 generate_smb3signingkey(struct cifs_ses *ses,
410 spin_lock(&ses->ses_lock);
411 spin_lock(&ses->chan_lock);
412 is_binding = (cifs_chan_needs_reconnect(ses, server) &&
413 ses->ses_status == SES_GOOD);
415 chan_index = cifs_ses_get_chan_index(ses, server);
417 spin_unlock(&ses->chan_lock);
418 spin_unlock(&ses->ses_lock);
423 spin_unlock(&ses->chan_lock);
424 spin_unlock(&ses->ses_lock);
437 rc = generate_key(ses, ptriplet->signing.label,
439 ses->chans[chan_index].signkey,
444 rc = generate_key(ses, ptriplet->signing.label,
446 ses->smb3signingkey,
452 spin_lock(&ses->chan_lock);
453 memcpy(ses->chans[chan_index].signkey, ses->smb3signingkey,
455 spin_unlock(&ses->chan_lock);
457 rc = generate_key(ses, ptriplet->encryption.label,
459 ses->smb3encryptionkey,
463 rc = generate_key(ses, ptriplet->decryption.label,
465 ses->smb3decryptionkey,
477 cifs_dbg(VFS, "Session Id %*ph\n", (int)sizeof(ses->Suid),
478 &ses->Suid);
481 SMB2_NTLMV2_SESSKEY_SIZE, ses->auth_key.response);
483 SMB3_SIGN_KEY_SIZE, ses->smb3signingkey);
487 SMB3_GCM256_CRYPTKEY_SIZE, ses->smb3encryptionkey);
489 SMB3_GCM256_CRYPTKEY_SIZE, ses->smb3decryptionkey);
492 SMB3_GCM128_CRYPTKEY_SIZE, ses->smb3encryptionkey);
494 SMB3_GCM128_CRYPTKEY_SIZE, ses->smb3decryptionkey);
501 generate_smb30signingkey(struct cifs_ses *ses,
526 return generate_smb3signingkey(ses, server, &triplet);
530 generate_smb311signingkey(struct cifs_ses *ses,
540 d->context.iov_base = ses->preauth_sha_hash;
546 d->context.iov_base = ses->preauth_sha_hash;
552 d->context.iov_base = ses->preauth_sha_hash;
555 return generate_smb3signingkey(ses, server, &triplet);
773 smb2_get_mid_entry(struct cifs_ses *ses, struct TCP_Server_Info *server,
795 spin_lock(&ses->ses_lock);
796 if (ses->ses_status == SES_NEW) {
799 spin_unlock(&ses->ses_lock);
805 if (ses->ses_status == SES_EXITING) {
807 spin_unlock(&ses->ses_lock);
812 spin_unlock(&ses->ses_lock);
851 smb2_setup_request(struct cifs_ses *ses, struct TCP_Server_Info *server,
861 rc = smb2_get_mid_entry(ses, server, shdr, &mid);