Lines Matching defs: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) {
208 struct cifs_ses *ses;
212 ses = smb2_find_smb_ses_unlocked(server, ses_id);
213 if (!ses) {
217 tcon = smb2_find_smb_sess_tcon_unlocked(ses, tid);
219 cifs_put_smb_ses(ses);
224 /* tcon already has a ref to ses, so we don't need ses anymore */
225 cifs_put_smb_ses(ses);
239 struct cifs_ses *ses;
243 ses = smb2_find_smb_ses(server, le64_to_cpu(shdr->SessionId));
244 if (unlikely(!ses)) {
263 rc = crypto_shash_setkey(shash->tfm, ses->auth_key.response,
306 if (ses)
307 cifs_put_smb_ses(ses);
311 static int generate_key(struct cifs_ses *ses, struct kvec label,
321 struct TCP_Server_Info *server = ses->server;
333 ses->auth_key.response, SMB2_NTLMV2_SESSKEY_SIZE);
404 generate_smb3signingkey(struct cifs_ses *ses,
412 spin_lock(&ses->ses_lock);
413 spin_lock(&ses->chan_lock);
414 is_binding = (cifs_chan_needs_reconnect(ses, server) &&
415 ses->ses_status == SES_GOOD);
417 chan_index = cifs_ses_get_chan_index(ses, server);
419 spin_unlock(&ses->chan_lock);
420 spin_unlock(&ses->ses_lock);
425 spin_unlock(&ses->chan_lock);
426 spin_unlock(&ses->ses_lock);
439 rc = generate_key(ses, ptriplet->signing.label,
441 ses->chans[chan_index].signkey,
446 rc = generate_key(ses, ptriplet->signing.label,
448 ses->smb3signingkey,
454 spin_lock(&ses->chan_lock);
455 memcpy(ses->chans[chan_index].signkey, ses->smb3signingkey,
457 spin_unlock(&ses->chan_lock);
459 rc = generate_key(ses, ptriplet->encryption.label,
461 ses->smb3encryptionkey,
465 rc = generate_key(ses, ptriplet->decryption.label,
467 ses->smb3decryptionkey,
479 cifs_dbg(VFS, "Session Id %*ph\n", (int)sizeof(ses->Suid),
480 &ses->Suid);
483 SMB2_NTLMV2_SESSKEY_SIZE, ses->auth_key.response);
485 SMB3_SIGN_KEY_SIZE, ses->smb3signingkey);
489 SMB3_GCM256_CRYPTKEY_SIZE, ses->smb3encryptionkey);
491 SMB3_GCM256_CRYPTKEY_SIZE, ses->smb3decryptionkey);
494 SMB3_GCM128_CRYPTKEY_SIZE, ses->smb3encryptionkey);
496 SMB3_GCM128_CRYPTKEY_SIZE, ses->smb3decryptionkey);
503 generate_smb30signingkey(struct cifs_ses *ses,
528 return generate_smb3signingkey(ses, server, &triplet);
532 generate_smb311signingkey(struct cifs_ses *ses,
542 d->context.iov_base = ses->preauth_sha_hash;
548 d->context.iov_base = ses->preauth_sha_hash;
554 d->context.iov_base = ses->preauth_sha_hash;
557 return generate_smb3signingkey(ses, server, &triplet);
775 smb2_get_mid_entry(struct cifs_ses *ses, struct TCP_Server_Info *server,
797 spin_lock(&ses->ses_lock);
798 if (ses->ses_status == SES_NEW) {
801 spin_unlock(&ses->ses_lock);
807 if (ses->ses_status == SES_EXITING) {
809 spin_unlock(&ses->ses_lock);
814 spin_unlock(&ses->ses_lock);
853 smb2_setup_request(struct cifs_ses *ses, struct TCP_Server_Info *server,
863 rc = smb2_get_mid_entry(ses, server, shdr, &mid);