Lines Matching full:server

58 			  struct TCP_Server_Info *server, char *signature,  in __cifs_calc_signature()  argument
67 if (!is_smb1(server)) { in __cifs_calc_signature()
110 * should be called with the server->srv_mutex held.
113 struct TCP_Server_Info *server, char *signature) in cifs_calc_signature() argument
117 if (!rqst->rq_iov || !signature || !server) in cifs_calc_signature()
120 rc = cifs_alloc_hash("md5", &server->secmech.md5); in cifs_calc_signature()
124 rc = crypto_shash_init(server->secmech.md5); in cifs_calc_signature()
130 rc = crypto_shash_update(server->secmech.md5, in cifs_calc_signature()
131 server->session_key.response, server->session_key.len); in cifs_calc_signature()
137 return __cifs_calc_signature(rqst, server, signature, server->secmech.md5); in cifs_calc_signature()
140 /* must be called with server->srv_mutex held */
141 int cifs_sign_rqst(struct smb_rqst *rqst, struct TCP_Server_Info *server, in cifs_sign_rqst() argument
152 if ((cifs_pdu == NULL) || (server == NULL)) in cifs_sign_rqst()
155 spin_lock(&server->srv_lock); in cifs_sign_rqst()
157 server->tcpStatus == CifsNeedNegotiate) { in cifs_sign_rqst()
158 spin_unlock(&server->srv_lock); in cifs_sign_rqst()
161 spin_unlock(&server->srv_lock); in cifs_sign_rqst()
163 if (!server->session_estab) { in cifs_sign_rqst()
169 cpu_to_le32(server->sequence_number); in cifs_sign_rqst()
172 *pexpected_response_sequence_number = ++server->sequence_number; in cifs_sign_rqst()
173 ++server->sequence_number; in cifs_sign_rqst()
175 rc = cifs_calc_signature(rqst, server, smb_signature); in cifs_sign_rqst()
184 int cifs_sign_smbv(struct kvec *iov, int n_vec, struct TCP_Server_Info *server, in cifs_sign_smbv() argument
190 return cifs_sign_rqst(&rqst, server, pexpected_response_sequence); in cifs_sign_smbv()
193 /* must be called with server->srv_mutex held */
194 int cifs_sign_smb(struct smb_hdr *cifs_pdu, struct TCP_Server_Info *server, in cifs_sign_smb() argument
204 return cifs_sign_smbv(iov, 2, server, in cifs_sign_smb()
209 struct TCP_Server_Info *server, in cifs_verify_signature() argument
221 if (cifs_pdu == NULL || server == NULL) in cifs_verify_signature()
224 if (!server->session_estab) in cifs_verify_signature()
235 server does not send one? BB */ in cifs_verify_signature()
243 its signature against what the server sent */ in cifs_verify_signature()
250 cifs_server_lock(server); in cifs_verify_signature()
251 rc = cifs_calc_signature(rqst, server, what_we_think_sig_should_be); in cifs_verify_signature()
252 cifs_server_unlock(server); in cifs_verify_signature()
352 * Check if server has provided av pair of @type in the NTLMSSP
387 /* Server has provided av pairs/target info in the type 2 challenge
389 * We parse that blob here to find the server given timestamp
415 wchar_t *server; in calc_ntlmv2_hash() local
472 server = kmalloc(2 + (len * 2), GFP_KERNEL); in calc_ntlmv2_hash()
473 if (server == NULL) in calc_ntlmv2_hash()
476 len = cifs_strtoUTF16((__le16 *)server, ses->ip_addr, len, nls_cp); in calc_ntlmv2_hash()
477 rc = crypto_shash_update(hmacmd5, (char *)server, 2 * len); in calc_ntlmv2_hash()
478 kfree(server); in calc_ntlmv2_hash()
480 cifs_dbg(VFS, "%s: Could not update with server, rc=%d\n", __func__, rc); in calc_ntlmv2_hash()
516 if (ses->server->negflavor == CIFS_NEGFLAVOR_EXTENDED) in CalcNTLMv2_response()
519 memcpy(ntlmv2->challenge.key, ses->server->cryptkey, CIFS_SERVER_CHALLENGE_SIZE); in CalcNTLMv2_response()
552 if (ses->server->negflavor == CIFS_NEGFLAVOR_EXTENDED) { in setup_ntlmv2_rsp()
586 /* Must be within 5 minutes of the server (or in range +/-2h in setup_ntlmv2_rsp()
587 * in case of Mac OS X), so simply carry over server timestamp in setup_ntlmv2_rsp()
615 cifs_server_lock(ses->server); in setup_ntlmv2_rsp()
660 cifs_server_unlock(ses->server); in setup_ntlmv2_rsp()
700 cifs_crypto_secmech_release(struct TCP_Server_Info *server) in cifs_crypto_secmech_release() argument
702 cifs_free_hash(&server->secmech.aes_cmac); in cifs_crypto_secmech_release()
703 cifs_free_hash(&server->secmech.hmacsha256); in cifs_crypto_secmech_release()
704 cifs_free_hash(&server->secmech.md5); in cifs_crypto_secmech_release()
705 cifs_free_hash(&server->secmech.sha512); in cifs_crypto_secmech_release()
707 if (server->secmech.enc) { in cifs_crypto_secmech_release()
708 crypto_free_aead(server->secmech.enc); in cifs_crypto_secmech_release()
709 server->secmech.enc = NULL; in cifs_crypto_secmech_release()
711 if (server->secmech.dec) { in cifs_crypto_secmech_release()
712 crypto_free_aead(server->secmech.dec); in cifs_crypto_secmech_release()
713 server->secmech.dec = NULL; in cifs_crypto_secmech_release()