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()
318 /* Server has provided av pairs/target info in the type 2 challenge
324 * domain name, authentication may fail against some server but
374 /* Server has provided av pairs/target info in the type 2 challenge
376 * We parse that blob here to find the server given timestamp
426 wchar_t *server; in calc_ntlmv2_hash() local
483 server = kmalloc(2 + (len * 2), GFP_KERNEL); in calc_ntlmv2_hash()
484 if (server == NULL) in calc_ntlmv2_hash()
487 len = cifs_strtoUTF16((__le16 *)server, ses->ip_addr, len, nls_cp); in calc_ntlmv2_hash()
488 rc = crypto_shash_update(hmacmd5, (char *)server, 2 * len); in calc_ntlmv2_hash()
489 kfree(server); in calc_ntlmv2_hash()
491 cifs_dbg(VFS, "%s: Could not update with server, rc=%d\n", __func__, rc); in calc_ntlmv2_hash()
527 if (ses->server->negflavor == CIFS_NEGFLAVOR_EXTENDED) in CalcNTLMv2_response()
530 memcpy(ntlmv2->challenge.key, ses->server->cryptkey, CIFS_SERVER_CHALLENGE_SIZE); in CalcNTLMv2_response()
563 if (ses->server->negflavor == CIFS_NEGFLAVOR_EXTENDED) { in setup_ntlmv2_rsp()
584 /* Must be within 5 minutes of the server (or in range +/-2h in setup_ntlmv2_rsp()
585 * in case of Mac OS X), so simply carry over server timestamp in setup_ntlmv2_rsp()
613 cifs_server_lock(ses->server); in setup_ntlmv2_rsp()
658 cifs_server_unlock(ses->server); in setup_ntlmv2_rsp()
698 cifs_crypto_secmech_release(struct TCP_Server_Info *server) in cifs_crypto_secmech_release() argument
700 cifs_free_hash(&server->secmech.aes_cmac); in cifs_crypto_secmech_release()
701 cifs_free_hash(&server->secmech.hmacsha256); in cifs_crypto_secmech_release()
702 cifs_free_hash(&server->secmech.md5); in cifs_crypto_secmech_release()
703 cifs_free_hash(&server->secmech.sha512); in cifs_crypto_secmech_release()
705 if (!SERVER_IS_CHAN(server)) { in cifs_crypto_secmech_release()
706 if (server->secmech.enc) { in cifs_crypto_secmech_release()
707 crypto_free_aead(server->secmech.enc); in cifs_crypto_secmech_release()
708 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()
716 server->secmech.enc = NULL; in cifs_crypto_secmech_release()
717 server->secmech.dec = NULL; in cifs_crypto_secmech_release()