• Home
  • Raw
  • Download

Lines Matching refs:sess_data

843 struct sess_data {  struct
847 void (*func)(struct sess_data *); argument
862 sess_alloc_buffer(struct sess_data *sess_data, int wct) in sess_alloc_buffer() argument
865 struct cifs_ses *ses = sess_data->ses; in sess_alloc_buffer()
874 sess_data->iov[0].iov_base = (char *)smb_buf; in sess_alloc_buffer()
875 sess_data->iov[0].iov_len = be32_to_cpu(smb_buf->smb_buf_length) + 4; in sess_alloc_buffer()
880 sess_data->buf0_type = CIFS_SMALL_BUFFER; in sess_alloc_buffer()
883 sess_data->iov[2].iov_base = kmalloc(2000, GFP_KERNEL); in sess_alloc_buffer()
884 if (!sess_data->iov[2].iov_base) { in sess_alloc_buffer()
893 sess_data->iov[0].iov_base = NULL; in sess_alloc_buffer()
894 sess_data->iov[0].iov_len = 0; in sess_alloc_buffer()
895 sess_data->buf0_type = CIFS_NO_BUFFER; in sess_alloc_buffer()
900 sess_free_buffer(struct sess_data *sess_data) in sess_free_buffer() argument
903 free_rsp_buf(sess_data->buf0_type, sess_data->iov[0].iov_base); in sess_free_buffer()
904 sess_data->buf0_type = CIFS_NO_BUFFER; in sess_free_buffer()
905 kfree(sess_data->iov[2].iov_base); in sess_free_buffer()
909 sess_establish_session(struct sess_data *sess_data) in sess_establish_session() argument
911 struct cifs_ses *ses = sess_data->ses; in sess_establish_session()
941 sess_sendreceive(struct sess_data *sess_data) in sess_sendreceive() argument
944 struct smb_hdr *smb_buf = (struct smb_hdr *) sess_data->iov[0].iov_base; in sess_sendreceive()
948 count = sess_data->iov[1].iov_len + sess_data->iov[2].iov_len; in sess_sendreceive()
952 rc = SendReceive2(sess_data->xid, sess_data->ses, in sess_sendreceive()
953 sess_data->iov, 3 /* num_iovecs */, in sess_sendreceive()
954 &sess_data->buf0_type, in sess_sendreceive()
956 cifs_small_buf_release(sess_data->iov[0].iov_base); in sess_sendreceive()
957 memcpy(&sess_data->iov[0], &rsp_iov, sizeof(struct kvec)); in sess_sendreceive()
971 sess_auth_lanman(struct sess_data *sess_data) in sess_auth_lanman() argument
977 struct cifs_ses *ses = sess_data->ses; in sess_auth_lanman()
983 rc = sess_alloc_buffer(sess_data, 10); in sess_auth_lanman()
987 pSMB = (SESSION_SETUP_ANDX *)sess_data->iov[0].iov_base; in sess_auth_lanman()
988 bcc_ptr = sess_data->iov[2].iov_base; in sess_auth_lanman()
1023 ascii_ssetup_strings(&bcc_ptr, ses, sess_data->nls_cp); in sess_auth_lanman()
1025 sess_data->iov[2].iov_len = (long) bcc_ptr - in sess_auth_lanman()
1026 (long) sess_data->iov[2].iov_base; in sess_auth_lanman()
1028 rc = sess_sendreceive(sess_data); in sess_auth_lanman()
1032 pSMB = (SESSION_SETUP_ANDX *)sess_data->iov[0].iov_base; in sess_auth_lanman()
1033 smb_buf = (struct smb_hdr *)sess_data->iov[0].iov_base; in sess_auth_lanman()
1061 sess_data->nls_cp); in sess_auth_lanman()
1064 sess_data->nls_cp); in sess_auth_lanman()
1067 rc = sess_establish_session(sess_data); in sess_auth_lanman()
1069 sess_data->result = rc; in sess_auth_lanman()
1070 sess_data->func = NULL; in sess_auth_lanman()
1071 sess_free_buffer(sess_data); in sess_auth_lanman()
1077 sess_auth_ntlm(struct sess_data *sess_data) in sess_auth_ntlm() argument
1083 struct cifs_ses *ses = sess_data->ses; in sess_auth_ntlm()
1089 rc = sess_alloc_buffer(sess_data, 13); in sess_auth_ntlm()
1093 pSMB = (SESSION_SETUP_ANDX *)sess_data->iov[0].iov_base; in sess_auth_ntlm()
1094 bcc_ptr = sess_data->iov[2].iov_base; in sess_auth_ntlm()
1105 rc = setup_ntlm_response(ses, sess_data->nls_cp); in sess_auth_ntlm()
1126 if (sess_data->iov[0].iov_len % 2) { in sess_auth_ntlm()
1130 unicode_ssetup_strings(&bcc_ptr, ses, sess_data->nls_cp); in sess_auth_ntlm()
1132 ascii_ssetup_strings(&bcc_ptr, ses, sess_data->nls_cp); in sess_auth_ntlm()
1136 sess_data->iov[2].iov_len = (long) bcc_ptr - in sess_auth_ntlm()
1137 (long) sess_data->iov[2].iov_base; in sess_auth_ntlm()
1139 rc = sess_sendreceive(sess_data); in sess_auth_ntlm()
1143 pSMB = (SESSION_SETUP_ANDX *)sess_data->iov[0].iov_base; in sess_auth_ntlm()
1144 smb_buf = (struct smb_hdr *)sess_data->iov[0].iov_base; in sess_auth_ntlm()
1171 sess_data->nls_cp); in sess_auth_ntlm()
1174 sess_data->nls_cp); in sess_auth_ntlm()
1177 rc = sess_establish_session(sess_data); in sess_auth_ntlm()
1179 sess_data->result = rc; in sess_auth_ntlm()
1180 sess_data->func = NULL; in sess_auth_ntlm()
1181 sess_free_buffer(sess_data); in sess_auth_ntlm()
1187 sess_auth_ntlmv2(struct sess_data *sess_data) in sess_auth_ntlmv2() argument
1193 struct cifs_ses *ses = sess_data->ses; in sess_auth_ntlmv2()
1199 rc = sess_alloc_buffer(sess_data, 13); in sess_auth_ntlmv2()
1203 pSMB = (SESSION_SETUP_ANDX *)sess_data->iov[0].iov_base; in sess_auth_ntlmv2()
1204 bcc_ptr = sess_data->iov[2].iov_base; in sess_auth_ntlmv2()
1214 rc = setup_ntlmv2_rsp(ses, sess_data->nls_cp); in sess_auth_ntlmv2()
1234 if (sess_data->iov[0].iov_len % 2) { in sess_auth_ntlmv2()
1238 unicode_ssetup_strings(&bcc_ptr, ses, sess_data->nls_cp); in sess_auth_ntlmv2()
1240 ascii_ssetup_strings(&bcc_ptr, ses, sess_data->nls_cp); in sess_auth_ntlmv2()
1244 sess_data->iov[2].iov_len = (long) bcc_ptr - in sess_auth_ntlmv2()
1245 (long) sess_data->iov[2].iov_base; in sess_auth_ntlmv2()
1247 rc = sess_sendreceive(sess_data); in sess_auth_ntlmv2()
1251 pSMB = (SESSION_SETUP_ANDX *)sess_data->iov[0].iov_base; in sess_auth_ntlmv2()
1252 smb_buf = (struct smb_hdr *)sess_data->iov[0].iov_base; in sess_auth_ntlmv2()
1279 sess_data->nls_cp); in sess_auth_ntlmv2()
1282 sess_data->nls_cp); in sess_auth_ntlmv2()
1285 rc = sess_establish_session(sess_data); in sess_auth_ntlmv2()
1287 sess_data->result = rc; in sess_auth_ntlmv2()
1288 sess_data->func = NULL; in sess_auth_ntlmv2()
1289 sess_free_buffer(sess_data); in sess_auth_ntlmv2()
1296 sess_auth_kerberos(struct sess_data *sess_data) in sess_auth_kerberos() argument
1302 struct cifs_ses *ses = sess_data->ses; in sess_auth_kerberos()
1311 rc = sess_alloc_buffer(sess_data, 12); in sess_auth_kerberos()
1315 pSMB = (SESSION_SETUP_ANDX *)sess_data->iov[0].iov_base; in sess_auth_kerberos()
1316 bcc_ptr = sess_data->iov[2].iov_base; in sess_auth_kerberos()
1351 sess_data->iov[1].iov_base = msg->data + msg->sesskey_len; in sess_auth_kerberos()
1352 sess_data->iov[1].iov_len = msg->secblob_len; in sess_auth_kerberos()
1353 pSMB->req.SecurityBlobLength = cpu_to_le16(sess_data->iov[1].iov_len); in sess_auth_kerberos()
1357 if ((sess_data->iov[0].iov_len in sess_auth_kerberos()
1358 + sess_data->iov[1].iov_len) % 2) { in sess_auth_kerberos()
1362 unicode_oslm_strings(&bcc_ptr, sess_data->nls_cp); in sess_auth_kerberos()
1363 unicode_domain_string(&bcc_ptr, ses, sess_data->nls_cp); in sess_auth_kerberos()
1366 ascii_ssetup_strings(&bcc_ptr, ses, sess_data->nls_cp); in sess_auth_kerberos()
1369 sess_data->iov[2].iov_len = (long) bcc_ptr - in sess_auth_kerberos()
1370 (long) sess_data->iov[2].iov_base; in sess_auth_kerberos()
1372 rc = sess_sendreceive(sess_data); in sess_auth_kerberos()
1376 pSMB = (SESSION_SETUP_ANDX *)sess_data->iov[0].iov_base; in sess_auth_kerberos()
1377 smb_buf = (struct smb_hdr *)sess_data->iov[0].iov_base; in sess_auth_kerberos()
1414 sess_data->nls_cp); in sess_auth_kerberos()
1417 sess_data->nls_cp); in sess_auth_kerberos()
1420 rc = sess_establish_session(sess_data); in sess_auth_kerberos()
1425 sess_data->result = rc; in sess_auth_kerberos()
1426 sess_data->func = NULL; in sess_auth_kerberos()
1427 sess_free_buffer(sess_data); in sess_auth_kerberos()
1439 _sess_auth_rawntlmssp_assemble_req(struct sess_data *sess_data) in _sess_auth_rawntlmssp_assemble_req() argument
1442 struct cifs_ses *ses = sess_data->ses; in _sess_auth_rawntlmssp_assemble_req()
1446 pSMB = (SESSION_SETUP_ANDX *)sess_data->iov[0].iov_base; in _sess_auth_rawntlmssp_assemble_req()
1458 bcc_ptr = sess_data->iov[2].iov_base; in _sess_auth_rawntlmssp_assemble_req()
1460 if ((sess_data->iov[0].iov_len + sess_data->iov[1].iov_len) % 2) { in _sess_auth_rawntlmssp_assemble_req()
1464 unicode_oslm_strings(&bcc_ptr, sess_data->nls_cp); in _sess_auth_rawntlmssp_assemble_req()
1466 sess_data->iov[2].iov_len = (long) bcc_ptr - in _sess_auth_rawntlmssp_assemble_req()
1467 (long) sess_data->iov[2].iov_base; in _sess_auth_rawntlmssp_assemble_req()
1473 sess_auth_rawntlmssp_authenticate(struct sess_data *sess_data);
1476 sess_auth_rawntlmssp_negotiate(struct sess_data *sess_data) in sess_auth_rawntlmssp_negotiate() argument
1481 struct cifs_ses *ses = sess_data->ses; in sess_auth_rawntlmssp_negotiate()
1500 rc = sess_alloc_buffer(sess_data, 12); in sess_auth_rawntlmssp_negotiate()
1504 pSMB = (SESSION_SETUP_ANDX *)sess_data->iov[0].iov_base; in sess_auth_rawntlmssp_negotiate()
1508 sess_data->iov[1].iov_len = sizeof(NEGOTIATE_MESSAGE); in sess_auth_rawntlmssp_negotiate()
1509 sess_data->iov[1].iov_base = pSMB->req.SecurityBlob; in sess_auth_rawntlmssp_negotiate()
1512 rc = _sess_auth_rawntlmssp_assemble_req(sess_data); in sess_auth_rawntlmssp_negotiate()
1516 rc = sess_sendreceive(sess_data); in sess_auth_rawntlmssp_negotiate()
1518 pSMB = (SESSION_SETUP_ANDX *)sess_data->iov[0].iov_base; in sess_auth_rawntlmssp_negotiate()
1519 smb_buf = (struct smb_hdr *)sess_data->iov[0].iov_base; in sess_auth_rawntlmssp_negotiate()
1522 if (sess_data->buf0_type != CIFS_NO_BUFFER && in sess_auth_rawntlmssp_negotiate()
1554 sess_free_buffer(sess_data); in sess_auth_rawntlmssp_negotiate()
1557 sess_data->func = sess_auth_rawntlmssp_authenticate; in sess_auth_rawntlmssp_negotiate()
1567 sess_data->func = NULL; in sess_auth_rawntlmssp_negotiate()
1568 sess_data->result = rc; in sess_auth_rawntlmssp_negotiate()
1572 sess_auth_rawntlmssp_authenticate(struct sess_data *sess_data) in sess_auth_rawntlmssp_authenticate() argument
1577 struct cifs_ses *ses = sess_data->ses; in sess_auth_rawntlmssp_authenticate()
1586 rc = sess_alloc_buffer(sess_data, 12); in sess_auth_rawntlmssp_authenticate()
1591 pSMB = (SESSION_SETUP_ANDX *)sess_data->iov[0].iov_base; in sess_auth_rawntlmssp_authenticate()
1594 &blob_len, ses, sess_data->nls_cp); in sess_auth_rawntlmssp_authenticate()
1597 sess_data->iov[1].iov_len = blob_len; in sess_auth_rawntlmssp_authenticate()
1598 sess_data->iov[1].iov_base = ntlmsspblob; in sess_auth_rawntlmssp_authenticate()
1607 rc = _sess_auth_rawntlmssp_assemble_req(sess_data); in sess_auth_rawntlmssp_authenticate()
1611 rc = sess_sendreceive(sess_data); in sess_auth_rawntlmssp_authenticate()
1615 pSMB = (SESSION_SETUP_ANDX *)sess_data->iov[0].iov_base; in sess_auth_rawntlmssp_authenticate()
1616 smb_buf = (struct smb_hdr *)sess_data->iov[0].iov_base; in sess_auth_rawntlmssp_authenticate()
1654 sess_data->nls_cp); in sess_auth_rawntlmssp_authenticate()
1657 sess_data->nls_cp); in sess_auth_rawntlmssp_authenticate()
1663 sess_free_buffer(sess_data); in sess_auth_rawntlmssp_authenticate()
1666 rc = sess_establish_session(sess_data); in sess_auth_rawntlmssp_authenticate()
1674 sess_data->func = NULL; in sess_auth_rawntlmssp_authenticate()
1675 sess_data->result = rc; in sess_auth_rawntlmssp_authenticate()
1678 static int select_sec(struct cifs_ses *ses, struct sess_data *sess_data) in select_sec() argument
1697 sess_data->func = sess_auth_lanman; in select_sec()
1703 sess_data->func = sess_auth_ntlm; in select_sec()
1706 sess_data->func = sess_auth_ntlmv2; in select_sec()
1710 sess_data->func = sess_auth_kerberos; in select_sec()
1717 sess_data->func = sess_auth_rawntlmssp_negotiate; in select_sec()
1731 struct sess_data *sess_data; in CIFS_SessSetup() local
1738 sess_data = kzalloc(sizeof(struct sess_data), GFP_KERNEL); in CIFS_SessSetup()
1739 if (!sess_data) in CIFS_SessSetup()
1742 rc = select_sec(ses, sess_data); in CIFS_SessSetup()
1746 sess_data->xid = xid; in CIFS_SessSetup()
1747 sess_data->ses = ses; in CIFS_SessSetup()
1748 sess_data->buf0_type = CIFS_NO_BUFFER; in CIFS_SessSetup()
1749 sess_data->nls_cp = (struct nls_table *) nls_cp; in CIFS_SessSetup()
1751 while (sess_data->func) in CIFS_SessSetup()
1752 sess_data->func(sess_data); in CIFS_SessSetup()
1755 rc = sess_data->result; in CIFS_SessSetup()
1758 kfree(sess_data); in CIFS_SessSetup()